|
@@ -1,9 +1,11 @@
|
|
|
package com.fjhx.sale.flow;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.fjhx.area.utils.CustomizeAreaUtil;
|
|
|
+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;
|
|
@@ -87,7 +89,8 @@ public class ContractFlow extends FlowDelegate {
|
|
|
contractProductList.forEach(item -> item.setExpendQuantity(item.getQuantity()));
|
|
|
}
|
|
|
|
|
|
- return start(contract);
|
|
|
+ contract = commStart(contract, 0);
|
|
|
+ return contract.getId();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -126,18 +129,13 @@ public class ContractFlow extends FlowDelegate {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public Long start(ContractDto contract) {
|
|
|
- ContractDto contractDto = commStart(contract, 0);
|
|
|
-
|
|
|
- return contractDto.getId();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 开始公共代码抽取
|
|
|
*
|
|
|
* @param opType 操作类型 0直接发起 1重新发起
|
|
|
*/
|
|
|
- private ContractDto commStart(ContractDto contract, Integer opType) {
|
|
|
+ public ContractDto commStart(ContractDto contract, Integer opType) {
|
|
|
+ DynamicDataSourceContextHolder.push(SourceConstant.SALE);
|
|
|
|
|
|
// long contractId = IdWorker.getId();
|
|
|
|
|
@@ -220,6 +218,8 @@ public class ContractFlow extends FlowDelegate {
|
|
|
// 包装指示附件列表
|
|
|
ObsFileUtil.saveFile(contract.getPackageFileList(), contract.getId(), 2);
|
|
|
}
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
+
|
|
|
|
|
|
return contract;
|
|
|
}
|