Bladeren bron

柴沟申购 维多利亚流程key错误问题修改

yzc 2 jaren geleden
bovenliggende
commit
e6bc5ae60b

+ 10 - 8
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -81,10 +81,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
             Map<Long, List<CustomerFollowRecords>> longListMap = customerFollowRecordsService.mapKGroup(CustomerFollowRecords::getCustomerId,
                     q -> q.in(CustomerFollowRecords::getCustomerId, customerIds).orderByDesc(CustomerFollowRecords::getDate));
             for (CustomerVo record : records) {
-                List<CustomerFollowRecords> customerFollowRecords = longListMap.get(record.getId());
-                if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
-                    record.setCustomerFollowRecordsList(customerFollowRecords.subList(0, 2));
-                }
+//                List<CustomerFollowRecords> customerFollowRecords = longListMap.get(record.getId());
+//                if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
+//                    record.setCustomerFollowRecordsList(customerFollowRecords.subList(0, 2));
+//                }
+                record.setCustomerFollowRecordsList(longListMap.get(record.getId()));
             }
         }
         return page;
@@ -181,10 +182,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
             Map<Long, List<CustomerFollowRecords>> longListMap = customerFollowRecordsService.mapKGroup(CustomerFollowRecords::getCustomerId,
                     q -> q.in(CustomerFollowRecords::getCustomerId, customerIds));
             for (CustomerVo record : records) {
-                List<CustomerFollowRecords> customerFollowRecords = longListMap.get(record.getId());
-                if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
-                    record.setCustomerFollowRecordsList(customerFollowRecords.subList(0, 2));
-                }
+//                List<CustomerFollowRecords> customerFollowRecords = longListMap.get(record.getId());
+//                if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
+//                    record.setCustomerFollowRecordsList(customerFollowRecords.subList(0, 2));
+//                }
+                record.setCustomerFollowRecordsList(longListMap.get(record.getId()));
             }
         }
         return page;

+ 15 - 1
hx-purchase/src/main/java/com/fjhx/purchase/flow/SubscribeFlowByWdly.java

@@ -47,7 +47,21 @@ public class SubscribeFlowByWdly extends FlowDelegate {
      */
     @Override
     public Long start(Long flowId, JSONObject submitData) {
-        return subscribeFlow.start(flowId,submitData);
+        SubscribeService subscribeService = SpringUtil.getBean(SubscribeService.class);
+        SubscribeDetailService subscribeDetailService = SpringUtil.getBean(SubscribeDetailService.class);
+        Subscribe subscribe = submitData.toJavaObject(Subscribe.class);
+        subscribe.setCode(CodeEnum.SUBSCRIBE.getCode());
+        subscribe.setProcessInstanceId("wdly_apply_purchase");
+        subscribe.setSubcribeStatus(SubscribeStatusEnum.UNDER_REVIEW.getKey());
+        subscribeService.save(subscribe);
+        List<SubscribeDetail> SubscribeDetails = subscribe.getSubscribeDetailList();
+        if(CollectionUtils.isNotEmpty(SubscribeDetails)){
+            for(SubscribeDetail s : SubscribeDetails){
+                s.setSubscribeId(subscribe.getId());
+            }
+            subscribeDetailService.saveBatch(SubscribeDetails);
+        }
+        return subscribe.getId();
     }
 
     /**

+ 29 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java

@@ -130,9 +130,37 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 
     @Override
     public Page<PurchaseVo> getPageByWdly(PurchaseSelectDto dto) {
-        Page<PurchaseVo> page = getPage(dto);
+        IWrapper<Purchase> wrapper = getWrapper();
+
+        //过滤维多利亚数据
+        wrapper.isNotNull("p.victoriatourist_json");
+
+        wrapper.orderByDesc("p", Purchase::getCreateTime);
+        if (ObjectUtils.isNotEmpty(dto.getPurchaseStatus())) {
+            wrapper.eq("p", Purchase::getPurchaseStatus, dto.getPurchaseStatus());
+        }
+        if (ObjectUtils.isNotEmpty(dto.getArrivalStatus())) {
+            wrapper.eq("p", Purchase::getArrivalStatus, dto.getArrivalStatus());
+        }
+        if (ObjectUtils.isNotEmpty(dto.getPayStatus())) {
+            wrapper.eq("p", Purchase::getPayStatus, dto.getPayStatus());
+        }
+        wrapper.eq("p", Purchase::getCode, dto.getKeyword());//根据采购单号关键字搜索
+        Page<PurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<PurchaseVo> list = page.getRecords();
         if (CollectionUtils.isNotEmpty(list)) {
+            List<Long> supplyIds = list.stream().map(PurchaseVo::getSupplyId).collect(Collectors.toList());
+            List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
+            Map<Long, List<SupplierInfo>> supplyMap = supplierInfoList.stream().distinct().collect(Collectors.groupingBy(SupplierInfo::getId));
+            if (MapUtils.isNotEmpty(supplyMap)) {
+                for (PurchaseVo p : list) {
+                    List<SupplierInfo> supplys = supplyMap.getOrDefault(p.getSupplyId(), null);
+                    p.setSupplyName(supplys == null ? null : supplys.get(0).getName());
+                }
+            }
+        }
+        //-------------------------------------------------
+        if (CollectionUtils.isNotEmpty(list)) {
             //维多利亚 赋值收货仓库名称
             List<Long> wids = new ArrayList<>();
             for (PurchaseVo purchaseVo : list) {

+ 1 - 0
hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseFlowByWdly.java

@@ -74,6 +74,7 @@ public class PurchaseFlowByWdly extends FlowDelegate {
             Purchase purchase = submitData.toJavaObject(Purchase.class);
             purchase.setCode(CodeEnum.PURCHASE.getCode());
             purchase.setPurchaseStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
+            purchase.setProcessInstanceId("wdly_purchase");
             purchase.setFlowId(flowId);
             purchaseService.save(purchase);
             List<PurchaseDetail> purchaseDetailList = purchase.getPurchaseDetailList();