|
@@ -10,8 +10,10 @@ import com.fjhx.common.constant.SourceConstant;
|
|
import com.fjhx.common.enums.CodingRuleEnum;
|
|
import com.fjhx.common.enums.CodingRuleEnum;
|
|
import com.fjhx.common.service.coding.CodingRuleService;
|
|
import com.fjhx.common.service.coding.CodingRuleService;
|
|
import com.fjhx.common.utils.Assert;
|
|
import com.fjhx.common.utils.Assert;
|
|
|
|
+import com.fjhx.file.utils.ObsFileUtil;
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
import com.fjhx.flow.core.FlowThreadLocalUtil;
|
|
import com.fjhx.flow.core.FlowThreadLocalUtil;
|
|
|
|
+import com.fjhx.purchase.entity.purchase.dto.PurchaseDto;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDataResourceEnum;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDataResourceEnum;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDetailStatusEnum;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDetailStatusEnum;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
|
|
@@ -77,13 +79,16 @@ public class PurchaseFlowByWdly extends FlowDelegate {
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
DynamicDataSourceContextHolder.push(SourceConstant.PURCHASE);
|
|
DynamicDataSourceContextHolder.push(SourceConstant.PURCHASE);
|
|
try {
|
|
try {
|
|
- Purchase purchase = submitData.toJavaObject(Purchase.class);
|
|
|
|
|
|
+ PurchaseDto purchase = submitData.toJavaObject(PurchaseDto.class);
|
|
// purchase.setCode(CodeEnum.PURCHASE.getCode());
|
|
// purchase.setCode(CodeEnum.PURCHASE.getCode());
|
|
purchase.setCode(codingRuleService.createCode(CodingRuleEnum.PURCHASE.getKey(), null));
|
|
purchase.setCode(codingRuleService.createCode(CodingRuleEnum.PURCHASE.getKey(), null));
|
|
purchase.setPurchaseStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
|
|
purchase.setPurchaseStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
|
|
purchase.setProcessInstanceId("wdly_purchase");
|
|
purchase.setProcessInstanceId("wdly_purchase");
|
|
purchase.setFlowId(flowId);
|
|
purchase.setFlowId(flowId);
|
|
purchaseService.save(purchase);
|
|
purchaseService.save(purchase);
|
|
|
|
+ //处理附件信息
|
|
|
|
+ ObsFileUtil.saveFile(purchase.getFileList(), purchase.getId());
|
|
|
|
+
|
|
List<PurchaseDetail> purchaseDetailList = purchase.getPurchaseDetailList();
|
|
List<PurchaseDetail> purchaseDetailList = purchase.getPurchaseDetailList();
|
|
if (CollectionUtils.isNotEmpty(purchaseDetailList)) {
|
|
if (CollectionUtils.isNotEmpty(purchaseDetailList)) {
|
|
for (PurchaseDetail s : purchaseDetailList) {
|
|
for (PurchaseDetail s : purchaseDetailList) {
|
|
@@ -211,10 +216,13 @@ public class PurchaseFlowByWdly extends FlowDelegate {
|
|
//获取提交的数据
|
|
//获取提交的数据
|
|
JSONObject submitData = FlowThreadLocalUtil.getCurrentData();
|
|
JSONObject submitData = FlowThreadLocalUtil.getCurrentData();
|
|
//修改采购信息
|
|
//修改采购信息
|
|
- Purchase purchase = submitData.toJavaObject(Purchase.class);
|
|
|
|
|
|
+ PurchaseDto purchase = submitData.toJavaObject(PurchaseDto.class);
|
|
Assert.notEmpty(purchase.getId(), "采购id不能为空");
|
|
Assert.notEmpty(purchase.getId(), "采购id不能为空");
|
|
purchase.setPurchaseStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
|
|
purchase.setPurchaseStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
|
|
purchaseService.updateById(purchase);
|
|
purchaseService.updateById(purchase);
|
|
|
|
+ //处理附件信息
|
|
|
|
+ ObsFileUtil.editFile(purchase.getFileList(), purchase.getId());
|
|
|
|
+
|
|
//修改采购明细
|
|
//修改采购明细
|
|
List<PurchaseDetail> purchaseDetailList = purchase.getPurchaseDetailList();
|
|
List<PurchaseDetail> purchaseDetailList = purchase.getPurchaseDetailList();
|
|
if (CollectionUtils.isNotEmpty(purchaseDetailList)) {
|
|
if (CollectionUtils.isNotEmpty(purchaseDetailList)) {
|