|
@@ -1,5 +1,6 @@
|
|
|
package com.fjhx.sale.flow;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
@@ -9,6 +10,8 @@ import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.enums.CodingRuleEnum;
|
|
|
import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
import com.fjhx.common.service.coding.CodingRuleService;
|
|
|
+import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
+import com.fjhx.customer.service.customer.CustomerService;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
|
import com.fjhx.flow.enums.FlowStatusEnum;
|
|
@@ -58,6 +61,8 @@ public class ContractFlow extends FlowDelegate {
|
|
|
|
|
|
@Autowired
|
|
|
private ContractShipmentService contractShipmentService;
|
|
|
+ @Autowired
|
|
|
+ private CustomerService customerService;
|
|
|
|
|
|
@Override
|
|
|
public String getFlowKey() {
|
|
@@ -75,9 +80,15 @@ public class ContractFlow extends FlowDelegate {
|
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
|
ContractDto contract = submitData.toJavaObject(ContractDto.class);
|
|
|
|
|
|
+ //赋值买方公司名称
|
|
|
+ Customer customer = customerService.getById(contract.getBuyCorporationId());
|
|
|
+ if (ObjectUtil.isNotEmpty(customer)) {
|
|
|
+ submitData.put("buyCorporationName", customer.getName());
|
|
|
+ }
|
|
|
+
|
|
|
contract.setFlowId(flowId);
|
|
|
|
|
|
- if(StringUtils.isEmpty(contract.getCurrency())){
|
|
|
+ if (StringUtils.isEmpty(contract.getCurrency())) {
|
|
|
throw new ServiceException("币种不能为空");
|
|
|
}
|
|
|
contract.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract.getBuyCorporationId()));
|