Forráskód Böngészése

打款相关问题处理

yzc 1 éve
szülő
commit
5a9074353d

+ 0 - 2
hx-account/src/main/java/com/fjhx/account/entity/account/enums/PaymentTypeEnum.java

@@ -10,8 +10,6 @@ public enum PaymentTypeEnum {
     UNDER_REVIEW("10", "请款"),
     REJECT("20", "采购付款"),
     RECEIVE("30", "退货到款登记"),
-    COST_CONTROL("40", "费控"),
-
     ;
     private static Map<String, String> map = new LinkedHashMap<>();
 

+ 3 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountPaymentVo.java

@@ -46,4 +46,7 @@ public class AccountPaymentVo extends AccountPayment {
      * 打开记录列表
      */
     private List<AccountPaymentRecordsVo> accountPaymentRecordsList;
+
+
+    private String typeName;
 }

+ 35 - 6
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountPaymentServiceImpl.java

@@ -16,8 +16,13 @@ import com.fjhx.account.entity.account.po.AccountPaymentRecords;
 import com.fjhx.account.entity.account.po.AccountRunningWater;
 import com.fjhx.account.entity.account.vo.AccountPaymentRecordsVo;
 import com.fjhx.account.entity.account.vo.AccountPaymentVo;
+import com.fjhx.account.entity.payment.po.PaymentType;
 import com.fjhx.account.mapper.account.AccountPaymentMapper;
-import com.fjhx.account.service.account.*;
+import com.fjhx.account.service.account.AccountManagementService;
+import com.fjhx.account.service.account.AccountPaymentRecordsService;
+import com.fjhx.account.service.account.AccountPaymentService;
+import com.fjhx.account.service.account.AccountRunningWaterService;
+import com.fjhx.account.service.payment.PaymentTypeService;
 import com.fjhx.common.service.corporation.CorporationService;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.file.utils.ObsFileUtil;
@@ -31,8 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -52,8 +56,6 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
     @Autowired
     private ISysDeptService sysDeptService;
 
-    @Autowired
-    private AccountRemainderService accountRemainderService;
 
     @Autowired
     private AccountRunningWaterService accountRunningWaterService;
@@ -64,6 +66,9 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
     @Autowired
     private AccountPaymentRecordsService accountPaymentRecordsService;
 
+    @Autowired
+    private PaymentTypeService paymentTypeService;
+
     @Override
     public Page<AccountPaymentVo> getPage(AccountRequestFundsSelectDto dto) {
 
@@ -118,9 +123,33 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
         List<SysDept> sysDeptList = sysDeptService.list();
         Map<Long, String> deptMap = sysDeptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
 
+        //付款类型
+        Map<Long, String> paymentTypeMap = paymentTypeService.mapKV(PaymentType::getId, PaymentType::getName, q -> q.orderByAsc(PaymentType::getId));
+
         for (AccountPaymentVo record : records) {
-            record.setCorporationName(deptMap.get(record.getCompanyId()));
+            List<String> nameList = new ArrayList<>();
+
+            String companyIds = record.getCompanyIds();
+            if (ObjectUtil.isNull(companyIds)) {
+                companyIds = "";
+            }
+            List<Long> collect = Arrays.stream(companyIds.split(","))
+                    .filter(item -> ObjectUtil.isNotEmpty(item)).map(Long::valueOf).collect(Collectors.toList());
+            collect.add(record.getCompanyId());
+            collect = collect.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
+            for (Long aLong : collect) {
+                nameList.add(deptMap.getOrDefault(aLong, String.valueOf(aLong)));
+            }
+
+            record.setCorporationName(nameList.stream().collect(Collectors.joining(",")));
             record.setDeptName(deptMap.get(record.getDepartmentId()));
+
+            //赋值付款类型
+            String type = record.getType();
+            if (ObjectUtil.isNotEmpty(type) && type.matches("\\d+")) {
+                record.setTypeName(paymentTypeMap.get(Long.valueOf(type)));
+            }
+
         }
 
         return page;

+ 11 - 3
hx-form/src/main/java/com/fjhx/form/flow/CostControlFlow.java

@@ -3,7 +3,6 @@ package com.fjhx.form.flow;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.fjhx.account.entity.account.enums.PaymentStatusEnum;
-import com.fjhx.account.entity.account.enums.PaymentTypeEnum;
 import com.fjhx.account.entity.account.po.AccountPayment;
 import com.fjhx.account.entity.account.po.AccountRunningWater;
 import com.fjhx.account.service.account.AccountPaymentService;
@@ -122,7 +121,6 @@ public class CostControlFlow extends FlowDelegate {
 
             payment.setAccountManagementId(costControl.getPaymentAccountId());
             payment.setCurrency("CNY");
-            payment.setType(PaymentTypeEnum.COST_CONTROL.getKey());
             payment.setStatus(PaymentStatusEnum.UNDER_REVIEW.getKey());
             payment.setAmount(BigDecimal.ZERO);
             payment.setIncomeAmount(costControl.getAmount());
@@ -132,10 +130,20 @@ public class CostControlFlow extends FlowDelegate {
             payment.setOpeningBank(costControl.getAccountBank());
             payment.setBusinessCurrency("CNY");
             payment.setAccountOpening(costControl.getAccountNumber());
-            payment.setPaymentMethod(costControl.getPaymentMethod());
             payment.setCompanyIds(costControl.getCompanyId());
             payment.setDepartmentId(SecurityUtils.getDeptId());
 
+            //数据类型直接拿费控
+            payment.setType(String.valueOf(costControl.getCostType()));
+
+
+            //赋值付款方式 费控 是否公户转出 是 赋值bank1  否 赋值bank2  没有是否公户转出字段的话 默认bank2
+            payment.setPaymentMethod("bank2");
+            if (ObjectUtil.isNotEmpty(costControl.getIsPublicTransfer()) && costControl.getIsPublicTransfer().equals(1)) {
+                payment.setPaymentMethod("bank1");
+            }
+
+
             accountPaymentService.save(payment);
         } else {
             //添加一条资金流水