From fde4edce8e5428b81971ecbf82a366c05089aae0 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Tue, 14 May 2024 10:31:00 +0800 Subject: [PATCH] '123' --- .../controller/redBook/RedBookController.java | 27 ++++ .../java/com/ruoyi/redBook/domain/OAQuot.java | 6 + .../ruoyi/redBook/domain/OAQuotProduct.java | 5 + .../ruoyi/redBook/mapper/OARedBookMapper.java | 21 +++ .../redBook/service/IRedBookService.java | 20 +++ .../service/impl/RedBookServiceImpl.java | 30 ++++ .../mapper/redBook/OARedBookMapper.xml | 69 ++++++++- ruoyi-ui/src/api/redBook/redBook.js | 15 +- ruoyi-ui/src/settings.js | 2 +- ruoyi-ui/src/views/redBook/productSelect.vue | 53 +++---- ruoyi-ui/src/views/redBook/quots.vue | 133 +++++++++++++++++- 11 files changed, 339 insertions(+), 42 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index 02bed16..fc2918b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -255,6 +255,14 @@ public class RedBookController extends BaseController if(CollectionUtils.isEmpty(resCache)){ resCache = redBookService.versionList(); redisCache.setCacheObject(getCacheKey("versionList"),resCache); + }else{ + // 判断是否有最新调价 + String maxUid = resCache.get(0).getValue();//获取缓存里最新调价版本 + String rb_price_version = redBookService.rb_price_version();//获取电子红本最新的调价版本 + if(!rb_price_version.equals(maxUid)){ + resCache = redBookService.versionList(); + redisCache.setCacheObject(getCacheKey("versionList"),resCache); + } } ajax.put("versionList", resCache); return ajax; @@ -296,4 +304,23 @@ public class RedBookController extends BaseController List list = redBookService.listQuots(oaQuot); return getDataTable(list); } + + /** + * 获取报价详细信息 + */ + @GetMapping(value = "/{quotId}") + public AjaxResult getInfo(@PathVariable("quotId") String quotId) + { + return success(redBookService.selectQuotByQuotId(quotId)); + } + + /** + * 删除报价单 + */ + @Log(title = "OA报价单删除", businessType = BusinessType.DELETE) + @DeleteMapping("/deleteQuots/{quotId}") + public AjaxResult remove(@PathVariable String quotId) + { + return toAjax(redBookService.deleteQuotsByQuotId(quotId)); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java index f6a623a..587a72f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java @@ -13,6 +13,8 @@ public class OAQuot extends BaseEntity { private String quotLxrdh;//联系人电话 private String totalPrice;//总金额 + private String rbDateUid;//调价版本 + private List selectedResultData; public String getQuot_id() { return quot_id; } @@ -59,6 +61,10 @@ public class OAQuot extends BaseEntity { public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; } + public String getRbDateUid() { return rbDateUid; } + + public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; } + public List getSelectedResultData() { return selectedResultData; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java index be3a753..0e69557 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuotProduct.java @@ -9,6 +9,7 @@ public class OAQuotProduct { private String spec;//规格 private String voltage;//电压 private String stu;//单位 + private String price;//红本价 private BigDecimal setPrice;//单价 private BigDecimal count;//数量 private BigDecimal allPrice;//金额 @@ -58,6 +59,10 @@ public class OAQuotProduct { this.stu = stu; } + public String getPrice() { return price; } + + public void setPrice(String price) { this.price = price; } + public BigDecimal getSetPrice() { return setPrice; } public void setSetPrice(BigDecimal setPrice) { this.setPrice = setPrice; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java index 3bdfc69..2376520 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java @@ -108,4 +108,25 @@ public interface OARedBookMapper * @return */ List listQuots(OAQuot oaQuot); + + /** + * 获取报价详细信息 + * @param quotId + * @return + */ + OAQuot selectQuotByQuotId(String quotId); + + /** + * 删除报价单 + * @param quotId + * @return + */ + int deleteQuotsByQuotId(String quotId); + void deleteQuotProductsByCusId(String quotId); + + /** + * 获取本地记录的调价版本 + * @return + */ + String rb_price_version(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java index 3c3eae5..ca83359 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java @@ -101,4 +101,24 @@ public interface IRedBookService * @return */ List listQuots(OAQuot oaQuot); + + /** + * 获取报价详细信息 + * @param quotId + * @return + */ + OAQuot selectQuotByQuotId(String quotId); + + /** + * 删除报价单 + * @param quotId + * @return + */ + int deleteQuotsByQuotId(String quotId); + + /** + * 获取本地记录的调价版本 + * @return + */ + String rb_price_version(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java index d3e66dc..637f6ee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java @@ -178,4 +178,34 @@ public class RedBookServiceImpl implements IRedBookService public List listQuots(OAQuot oaQuot) { return oaRedBookMapper.listQuots(oaQuot); } + + /** + * 获取报价详细信息 + * @param quotId + * @return + */ + @Override + public OAQuot selectQuotByQuotId(String quotId) { + return oaRedBookMapper.selectQuotByQuotId(quotId); + } + + /** + * 删除报价单 + * @param quotId + * @return + */ + @Override + public int deleteQuotsByQuotId(String quotId) { + oaRedBookMapper.deleteQuotProductsByCusId(quotId); + return oaRedBookMapper.deleteQuotsByQuotId(quotId); + } + + /** + * 获取本地记录的调价版本 + * @return + */ + @Override + public String rb_price_version() { + return oaRedBookMapper.rb_price_version(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml index 9a6e65a..6b2746f 100644 --- a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml @@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quotLxr, quotLxrdh, totalPrice, + rbDateUid, create_by, create_time @@ -101,15 +102,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{quotLxr}, #{quotLxrdh}, #{totalPrice}, + #{rbDateUid}, #{createBy}, getdate() - insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,setPrice,count,allPrice,per,per2,quot_id) values + insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id) values - ( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id}) + ( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.price,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id}) @@ -146,9 +148,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from OAQuot a + + and datediff(d, a.create_time, #{params.beginTime}) 0 + + + and datediff(d, a.create_time, #{params.endTime}) =]]> 0 + ${params.dataScope} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from OAQuot where quot_id = #{quotId} + + + delete from OAQuotProduct where quot_id = #{quotId} + + + + diff --git a/ruoyi-ui/src/api/redBook/redBook.js b/ruoyi-ui/src/api/redBook/redBook.js index 702396f..a76bc7a 100644 --- a/ruoyi-ui/src/api/redBook/redBook.js +++ b/ruoyi-ui/src/api/redBook/redBook.js @@ -146,7 +146,20 @@ export function listQuots(query) { params: query }) } - +// 查询报价单详细 +export function getQuotDetail(quotId) { + return request({ + url: '/redBook/redBook/' + quotId, + method: 'get' + }) +} +// 删除报价单 +export function deleteQuots(quotId) { + return request({ + url: '/redBook/redBook/deleteQuots/' + quotId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/settings.js b/ruoyi-ui/src/settings.js index ad78801..c367d6d 100644 --- a/ruoyi-ui/src/settings.js +++ b/ruoyi-ui/src/settings.js @@ -12,7 +12,7 @@ module.exports = { /** * 是否显示顶部导航 */ - topNav: false, + topNav: true, /** * 是否显示 tagsView diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue index d5a6cdc..31c838b 100644 --- a/ruoyi-ui/src/views/redBook/productSelect.vue +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -8,11 +8,11 @@ 搜索 - 生成报价单 - 保存 + 生成报价单 + 保存 - + @@ -65,7 +65,7 @@ :limit.sync="searchResultPageSize" @size-change="handleSearchResultSizeChange" @current-change="handleSearchResultCurrentChange" - :layout="'total, sizes, prev, pager, next'" + :layout="'total, prev, pager, next'" /> @@ -100,18 +100,17 @@ - - - - 总价:{{sumSelectedResultData}} 元 - + + + + 总价:{{sumSelectedResultData}} 元 + + @click.native="selectRbDate(item.value)"/> @@ -128,8 +127,8 @@ - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 总价:{{sumSelectedResultData}} 元 + + + + + + + + + + + + + + + + + + + + + + + + +