Переглянути джерело

报价单 关键字搜索添加单号

yzc 1 рік тому
батько
коміт
4ad54c8dfb

+ 23 - 20
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -101,6 +101,9 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         wrapper.eq(ObjectUtil.isNotEmpty(dto.getStatus()), SaleQuotation::getStatus, dto.getStatus());
         wrapper.orderByDesc(SaleQuotation::getCreateTime);
         wrapper.in(SaleQuotation::getBuyCorporationId, authIdList);
+        if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
+            wrapper.like(SaleQuotation::getCode, dto.getKeyword());
+        }
 
         Page<SaleQuotationVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<SaleQuotationVo> saleQuotationVoList = page.getRecords();
@@ -344,7 +347,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         Map<String, Object> map = new HashMap<>();
 
         //存放来源存量与增量的数据列表
-        List<Map<String,Object>> stockList = new ArrayList<>();
+        List<Map<String, Object>> stockList = new ArrayList<>();
 
 
         //来源存量(在指定时间外的数量)
@@ -388,28 +391,28 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
         Map<String, List<CustomerVo>> sourceStockMap = sourceStockList.stream().collect(Collectors.groupingBy(Customer::getSource));
 
-        if (dictTenantDataVos.size()==0){
+        if (dictTenantDataVos.size() == 0) {
             throw new ServiceException("数据有误:该租户没有配客户来源字典");
         }
 
         //赋值 增量 存量数据
         for (DictTenantDataVo dictTenantDataVo : dictTenantDataVos) {
             //存放来源存量与增量的数据
-            Map<String,Object>  stockMap = new HashMap<>();
+            Map<String, Object> stockMap = new HashMap<>();
             //赋值初使值
-            stockMap.put("source",dictTenantDataVo.getDictValue());
-            stockMap.put("stockAmount",0);
-            stockMap.put("incrementAmount",0);
+            stockMap.put("source", dictTenantDataVo.getDictValue());
+            stockMap.put("stockAmount", 0);
+            stockMap.put("incrementAmount", 0);
 
             //赋值增量数据
             List<CustomerVo> customers = sourceIncrementMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(customers)){
-                stockMap.put("incrementAmount",customers.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(customers)) {
+                stockMap.put("incrementAmount", customers.get(0).getCount());
             }
             //赋值存量数据
             List<CustomerVo> customerVos = sourceStockMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(customerVos)){
-                stockMap.put("stockAmount",customerVos.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(customerVos)) {
+                stockMap.put("stockAmount", customerVos.get(0).getCount());
             }
             stockList.add(stockMap);
         }
@@ -430,7 +433,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         Map<String, Object> map = new HashMap<>();
 
         //存放询盘数据 成交单的列表
-        List<Map<String,Object>> saleList = new ArrayList<>();
+        List<Map<String, Object>> saleList = new ArrayList<>();
 
         QueryWrapper<Object> query = Wrappers.query();
         query.ge("DATE_FORMAT(sq.create_time,'%Y-%m')", dto.getBeginTime());
@@ -463,7 +466,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         DynamicDataSourceContextHolder.push(SourceConstant.BASE);
         List<DictTenantDataVo> dictTenantDataVoList = getDict("customer_status");
 
-        if (dictTenantDataVoList.size()==0){
+        if (dictTenantDataVoList.size() == 0) {
             throw new ServiceException("数据有误:该租户没有配客户类型字典");
         }
 
@@ -472,20 +475,20 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
             //存放询盘数据 成交单的数据
             Map<String, Object> saleMap = new HashMap<>();
             //赋值初使值
-            saleMap.put("status",dictTenantDataVo.getDictValue());
-            saleMap.put("contractAmount",0);
-            saleMap.put("saleAmount",0);
+            saleMap.put("status", dictTenantDataVo.getDictValue());
+            saleMap.put("contractAmount", 0);
+            saleMap.put("saleAmount", 0);
 
             //赋值询盘数据
             List<SaleQuotationVo> saleQuotationVoList = saleStatisticsMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(saleQuotationVoList)){
-                saleMap.put("saleAmount",saleQuotationVoList.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(saleQuotationVoList)) {
+                saleMap.put("saleAmount", saleQuotationVoList.get(0).getCount());
             }
 
             //赋值成交单数据
             List<SaleQuotationVo> saleQuotationList = contractStatisticsMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(saleQuotationList)){
-                saleMap.put("contractAmount",saleQuotationList.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(saleQuotationList)) {
+                saleMap.put("contractAmount", saleQuotationList.get(0).getCount());
             }
             saleList.add(saleMap);
         }
@@ -632,7 +635,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
 
     //根据字典编码获取字典的数据
-    private List<DictTenantDataVo> getDict(String code){
+    private List<DictTenantDataVo> getDict(String code) {
         DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
         dto.setDictCode(code);
         return dictTenantDataService.getList(dto);