|
@@ -75,6 +75,8 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
private IContractManagementInfoService contractManagementInfoService;
|
|
|
@Autowired
|
|
|
private ICommonStaffRoleService commonStaffRoleService;
|
|
|
+ @Autowired
|
|
|
+ private IBatchReviewInfoService batchReviewInfoService;
|
|
|
/**
|
|
|
* 汽运调度分页列表查询
|
|
|
*
|
|
@@ -205,6 +207,9 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
public String insertTranCar(TranProcessInfo tranProcessInfo) {
|
|
|
this.updateById(tranProcessInfo);
|
|
|
List<TranCarInfo> tranCarInfoList = tranProcessInfo.getTranCarInfoList();
|
|
|
+ BatchReviewInfo batchReviewInfo = new BatchReviewInfo();
|
|
|
+ batchReviewInfo.setId(IdGenerator.generateUUID());
|
|
|
+ String flagBatch = "0";
|
|
|
if (!CollectionUtils.isEmpty(tranCarInfoList)) {
|
|
|
for (TranCarInfo tranCarInfo : tranCarInfoList) {
|
|
|
if (tranCarInfo.getLoadNetWeight() == null) {
|
|
@@ -319,31 +324,29 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
|
|
|
tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
|
|
|
tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
|
|
|
+ tranSettlementReport.setBatchId(batchReviewInfo.getId());
|
|
|
tranSettlementReportService.insert(tranSettlementReport);
|
|
|
- boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
- // 不是退回的单子
|
|
|
- if (isStartWorkflow) {
|
|
|
- Workflow workflow = workflowService
|
|
|
- .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
- // 没配置审核流程,直接结束并处理信息
|
|
|
- if (workflow == null) {
|
|
|
- throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
- }
|
|
|
- // 开启审核流
|
|
|
- else {
|
|
|
|
|
|
- // 设置状态 已提交审核
|
|
|
- tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- // 退回的单子 再启用
|
|
|
- else {
|
|
|
+ flagBatch = "1";
|
|
|
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
+// boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
+// // 不是退回的单子
|
|
|
+// if (isStartWorkflow) {
|
|
|
+// Workflow workflow = workflowService
|
|
|
+// .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
+// // 没配置审核流程,直接结束并处理信息
|
|
|
+// if (workflow == null) {
|
|
|
+// throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+// }
|
|
|
+// // 开启审核流
|
|
|
+// else {
|
|
|
+//
|
|
|
+// // 设置状态 已提交审核
|
|
|
+// tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
+// tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
+// workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
//火运类型
|
|
@@ -381,31 +384,33 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
tranSettlementReport.setAmountNotPayable(tranProcessInfo1.getTranPrice());
|
|
|
tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
|
|
|
tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
|
|
|
+ tranSettlementReport.setBatchId(batchReviewInfo.getId());
|
|
|
tranSettlementReportService.insert(tranSettlementReport);
|
|
|
- boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
- // 不是退回的单子
|
|
|
- if (isStartWorkflow) {
|
|
|
- Workflow workflow = workflowService
|
|
|
- .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
- // 没配置审核流程,直接结束并处理信息
|
|
|
- if (workflow == null) {
|
|
|
- throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
- }
|
|
|
- // 开启审核流
|
|
|
- else {
|
|
|
-
|
|
|
- // 设置状态 已提交审核
|
|
|
- tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- // 退回的单子 再启用
|
|
|
- else {
|
|
|
-
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
+ flagBatch = "1";
|
|
|
+// boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
+// // 不是退回的单子
|
|
|
+// if (isStartWorkflow) {
|
|
|
+// Workflow workflow = workflowService
|
|
|
+// .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
+// // 没配置审核流程,直接结束并处理信息
|
|
|
+// if (workflow == null) {
|
|
|
+// throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+// }
|
|
|
+// // 开启审核流
|
|
|
+// else {
|
|
|
+//
|
|
|
+// // 设置状态 已提交审核
|
|
|
+// tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
+// tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
+// workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 退回的单子 再启用
|
|
|
+// else {
|
|
|
+//
|
|
|
+// tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
+// workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
//船运类型
|
|
@@ -451,31 +456,33 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
|
|
|
tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
|
|
|
tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
|
|
|
+ tranSettlementReport.setBatchId(batchReviewInfo.getId());
|
|
|
tranSettlementReportService.insert(tranSettlementReport);
|
|
|
- boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
- // 不是退回的单子
|
|
|
- if (isStartWorkflow) {
|
|
|
- Workflow workflow = workflowService
|
|
|
- .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
- // 没配置审核流程,直接结束并处理信息
|
|
|
- if (workflow == null) {
|
|
|
- throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
- }
|
|
|
- // 开启审核流
|
|
|
- else {
|
|
|
-
|
|
|
- // 设置状态 已提交审核
|
|
|
- tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- // 退回的单子 再启用
|
|
|
- else {
|
|
|
-
|
|
|
- tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
- workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
|
|
|
- }
|
|
|
+ flagBatch = "1";
|
|
|
+// boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
|
|
|
+// // 不是退回的单子
|
|
|
+// if (isStartWorkflow) {
|
|
|
+// Workflow workflow = workflowService
|
|
|
+// .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
+// // 没配置审核流程,直接结束并处理信息
|
|
|
+// if (workflow == null) {
|
|
|
+// throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+// }
|
|
|
+// // 开启审核流
|
|
|
+// else {
|
|
|
+//
|
|
|
+// // 设置状态 已提交审核
|
|
|
+// tranSettlementReport.setWorkflowId(workflow.getId());
|
|
|
+// tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
+// workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 退回的单子 再启用
|
|
|
+// else {
|
|
|
+//
|
|
|
+// tranSettlementReportService.updateById(tranSettlementReport);
|
|
|
+// workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -683,6 +690,45 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
tranCarInfoService.updateById(tranCarInfo);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 批次开启审核流
|
|
|
+ if("1".equals(flagBatch)){
|
|
|
+ batchReviewInfoService.insert(batchReviewInfo);
|
|
|
+ boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(batchReviewInfo.getWorkflowId());
|
|
|
+ // 不是退回的单子
|
|
|
+ if (isStartWorkflow) {
|
|
|
+ Workflow workflow = workflowService
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(batchReviewInfo.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
+ if (workflow == null) {
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+ }
|
|
|
+ // 开启审核流
|
|
|
+ else {
|
|
|
+
|
|
|
+ // 设置状态 已提交审核
|
|
|
+ batchReviewInfo.setWorkflowId(workflow.getId());
|
|
|
+ batchReviewInfoService.updateById(batchReviewInfo);
|
|
|
+ workflowService.startInstance(workflow.getId(), batchReviewInfo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 更新详细状态
|
|
|
+ batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
|
|
|
+ List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
|
|
|
+ .eq("batch_id",batchReviewInfo.getId()));
|
|
|
+ if(!CollectionUtils.isEmpty(tranSettlementReports)){
|
|
|
+ for(int i=0;i<tranSettlementReports.size();i++){
|
|
|
+ TranSettlementReport settlementReport = tranSettlementReports.get(i);
|
|
|
+ settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
|
|
|
+ settlementReport.setStatus(batchReviewInfo.getStatus());
|
|
|
+ settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
|
|
|
+
|
|
|
+ }
|
|
|
+ tranSettlementReportService.insertBatch(tranSettlementReports);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
return tranProcessInfo.getId();
|
|
|
}
|