|
@@ -2,6 +2,10 @@ 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.service.account.AccountPaymentService;
|
|
|
import com.fjhx.common.enums.CodingRuleEnum;
|
|
|
import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
import com.fjhx.common.service.coding.CodingRuleService;
|
|
@@ -20,6 +24,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -40,6 +45,8 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
private CostControlDetailService costControlDetailService;
|
|
|
@Autowired
|
|
|
private StockJournalDetailsService stockJournalDetailsService;
|
|
|
+ @Autowired
|
|
|
+ private AccountPaymentService accountPaymentService;
|
|
|
|
|
|
@Override
|
|
|
public String getFlowKey() {
|
|
@@ -72,6 +79,8 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
*/
|
|
|
@Override
|
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
|
+ CostControl costControl = costControlService.getById(businessId);
|
|
|
+
|
|
|
costControlService.update(q -> q
|
|
|
.eq(CostControl::getId, businessId)
|
|
|
.set(CostControl::getStatus, FlowStatusEnum1.PASS.getKey())
|
|
@@ -90,6 +99,33 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
.set(StockJournalDetails::getSettleStatus, 2));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if (ObjectUtil.equals(costControl.getTradeType(), 20)) {
|
|
|
+
|
|
|
+ AccountPayment payment = new AccountPayment();
|
|
|
+ payment.setBusinessId(businessId);
|
|
|
+ payment.setCostControlId(businessId);
|
|
|
+
|
|
|
+ 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());
|
|
|
+ payment.setName(costControl.getAccountName());
|
|
|
+ payment.setDataUser(costControl.getApplyUserId());
|
|
|
+ payment.setBusinessManagementId(costControl.getPaymentAccountId());
|
|
|
+ payment.setOpeningBank(costControl.getAccountBank());
|
|
|
+ payment.setBusinessCurrency("CNY");
|
|
|
+ payment.setAccountOpening(costControl.getAccountNumber());
|
|
|
+ payment.setPaymentMethod(costControl.getPaymentMethod());
|
|
|
+ payment.setCompanyId(costControl.getCompanyId());
|
|
|
+ payment.setCorporationId(costControl.getCompanyId());
|
|
|
+ payment.setDepartmentId(SecurityUtils.getDeptId());
|
|
|
+
|
|
|
+ accountPaymentService.save(payment);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -124,12 +160,13 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
|
|
|
@Override
|
|
|
public void defaultMethod(Long flowId, Long businessId, NodeTypeEnum handleNodeType, FlowStatusEnum flowStatus, JSONObject submitData) {
|
|
|
- super.defaultMethod(flowId, businessId, handleNodeType, flowStatus, submitData);
|
|
|
-
|
|
|
|
|
|
CostControlDto costControlDto = submitData.toJavaObject(CostControlDto.class);
|
|
|
if (ObjectUtil.isNotEmpty(costControlDto) && ObjectUtil.isNotEmpty(costControlDto.getId())) {
|
|
|
costControlService.addOrEdit(costControlDto);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ super.defaultMethod(flowId, businessId, handleNodeType, flowStatus, submitData);
|
|
|
}
|
|
|
}
|