Parcourir la source

三梵 回款登记 付款信息 来自客户

yzc il y a 1 an
Parent
commit
9fddf99d96

+ 15 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractVo.java

@@ -241,5 +241,20 @@ public class ContractVo extends Contract {
      */
     private BigDecimal notDeliverQuantity;
 
+
+    /**
+     * 付款账户名称
+     */
+    private String paymentAccountName;
+    /**
+     * 付款账户开户行
+     */
+    private String paymentAccountBank;
+
+    /**
+     * 付款账户账号
+     */
+    private String paymentAccountNumber;
+
 }
 

+ 24 - 8
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -453,10 +453,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         Map<String, String> contractTypeStatusDic = dictTenantDataVoList.stream().collect(Collectors.toMap(DictTenantDataVo::getDictKey, DictTenantDataVo::getDictValue));
         DynamicDataSourceContextHolder.poll();
 
-        List<Long> customerIds = list.stream().map(Contract::getBuyCorporationId).collect(Collectors.toList());
-        List<Customer> customerList = customerService.list(Wrappers.<Customer>query().lambda().in(Customer::getId, customerIds));
-        Map<Long, List<Customer>> cusMap = customerList.stream().distinct().collect(Collectors.groupingBy(Customer::getId));
-
         List<Long> ids = list.stream().map(ContractVo::getId).collect(Collectors.toList());
         // 获取交接单附件
         Map<Long, List<FileInfoVo>> fileMap = ObsFileUtil.getFileMap(ids, 1);
@@ -495,6 +491,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         }
 
 
+        List<Long> customerIds = list.stream().map(Contract::getBuyCorporationId).collect(Collectors.toList());
+        Map<Long, Customer> cusMap = customerService.mapKEntity(Customer::getId, q -> q.in(Customer::getId, customerIds));
+
+
         Map<Long, List<ContractProductVo>> cpMap = contractProductVos.stream().collect(Collectors.groupingBy(ContractProduct::getContractId));
 
 
@@ -504,12 +504,23 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
 
             // 客户
             if (MapUtils.isNotEmpty(cusMap)) {
-                List<Customer> customers = cusMap.getOrDefault(p.getBuyCorporationId(), null);
-                p.setBuyCorporationName(customers == null ? null : customers.get(0).getName());
-                // 赋值客户标签
-                p.setTag(customers == null ? null : customers.get(0).getTag());
+                Customer customer = cusMap.get(p.getBuyCorporationId());
+                if (ObjectUtil.isNotEmpty(customer)) {
+
+                    p.setBuyCorporationName(customer.getName());
+                    // 赋值客户标签
+                    p.setTag(customer.getTag());
+
+                    //买方付款信息
+                    p.setPaymentAccountName(customer.getAccountName());
+                    p.setPaymentAccountBank(customer.getAccountBank());
+                    p.setPaymentAccountNumber(customer.getAccountNumber());
+                }
+
                 //赋值业务员
                 p.setUserName(p.getSalesmanName());
+
+
             }
 
             // 赋值交接单附件
@@ -1210,6 +1221,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         if (ObjectUtil.isNotEmpty(corporation)) {
             result.setSellCorporationName(corporation.getName());
             result.setBuyCorporationName(customer.getName());
+
+            //买方付款信息
+            result.setPaymentAccountName(customer.getAccountName());
+            result.setPaymentAccountBank(customer.getAccountBank());
+            result.setPaymentAccountNumber(customer.getAccountNumber());
         }
         //赋值收款账号
         AccountManagement accountManagement = accountManagementService.getById(result.getShroffAccountId());