|
@@ -1,5 +1,6 @@
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
@@ -162,6 +163,13 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
public TranProcessInfo getTranProcess(String id) {
|
|
public TranProcessInfo getTranProcess(String id) {
|
|
//查看运输信息
|
|
//查看运输信息
|
|
TranProcessInfo tranProcessInfo = this.selectById(id);
|
|
TranProcessInfo tranProcessInfo = this.selectById(id);
|
|
|
|
+ String taskId = "";
|
|
|
|
+ // 只有待审核状态才有taskId
|
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(tranProcessInfo.getWorkflowId())) {
|
|
|
|
+ JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranProcessInfo.getWorkflowId()), tranProcessInfo.getId());
|
|
|
|
+ taskId = jsonObject.getString("taskId");
|
|
|
|
+ tranProcessInfo.setTaskId(taskId);
|
|
|
|
+ }
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranProcessInfo.getInfoId());
|
|
TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranProcessInfo.getInfoId());
|
|
ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
.eq("contract_no",tranProcessInfo.getContractNo())
|
|
.eq("contract_no",tranProcessInfo.getContractNo())
|
|
@@ -909,44 +917,28 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
//物流部提交
|
|
//物流部提交
|
|
if ("1".equals(tranProcessInfo.getFlag())) {
|
|
if ("1".equals(tranProcessInfo.getFlag())) {
|
|
tranProcessInfo.setPriceStatus("审核中");
|
|
tranProcessInfo.setPriceStatus("审核中");
|
|
- List<String> roleIdList = Lists.newArrayList();
|
|
|
|
- if("1".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Exe"));
|
|
|
|
- tesk(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
- else if("2".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Trian"));
|
|
|
|
- tesk(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Ship"));
|
|
|
|
- tesk(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
|
|
+ tranProcessInfo.setPriceStatusCar("审核中");
|
|
|
|
+ tranProcessInfo.setTranPriceCar(0.0f);
|
|
|
|
+ TranProcessInfo tranProcessInfo1=this.selectById(tranProcessInfo.getId());
|
|
|
|
+ TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranProcessInfo1.getInfoId());
|
|
|
|
+ boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranProcessInfo1.getWorkflowId());
|
|
|
|
+ // 不是退回的单子
|
|
|
|
+ if (isStartWorkflow) {
|
|
|
|
+ Workflow workflow = workflowService
|
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(tranTaskInfo.getCompId(), "YUNJIA-TRAN-APPROVE");
|
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
|
+ if (workflow == null) {
|
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ // 开启审核流
|
|
|
|
+ else {
|
|
|
|
|
|
- }
|
|
|
|
- //决策人审核
|
|
|
|
- else if ("2".equals(tranProcessInfo.getFlag())) {
|
|
|
|
- tranProcessInfo.setTranPrice(tranProcessInfo.getTranPriceIng());
|
|
|
|
- tranProcessInfo.setTranPriceIng(0.0f);
|
|
|
|
- tranProcessInfo.setPriceStatus("已通过");
|
|
|
|
- //汽运生成审核记录
|
|
|
|
- if(tranProcessInfo.getTranTypeKey()!=null&&"1".equals(tranProcessInfo.getTranTypeKey())) {
|
|
|
|
- //生成审核记录
|
|
|
|
- TranPriceApprove tranPriceApprove = new TranPriceApprove();
|
|
|
|
- tranPriceApprove.setProcessId(tranProcessInfo.getId());
|
|
|
|
- tranPriceApprove.setId(IdGenerator.generateUUID());
|
|
|
|
- tranPriceApprove.setReviewer(tranProcessInfo.getReviewer());
|
|
|
|
- tranPriceApprove.setResult("通过");
|
|
|
|
- tranPriceApprove.setRecordType("1");
|
|
|
|
- tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice());
|
|
|
|
- tranPriceApproveService.insert(tranPriceApprove);
|
|
|
|
|
|
+ // 设置状态 已提交审核
|
|
|
|
+ tranProcessInfo1.setWorkflowId(workflow.getId());
|
|
|
|
+ this.updateById(tranProcessInfo1);
|
|
|
|
+ workflowService.startInstance(workflow.getId(), tranProcessInfo1.getId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- // 先删除任务
|
|
|
|
- noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "TRAN-TASK-APPROVE",
|
|
|
|
- tranProcessInfo.getId(), null);
|
|
|
|
}
|
|
}
|
|
this.updateById(tranProcessInfo);
|
|
this.updateById(tranProcessInfo);
|
|
return "ok";
|
|
return "ok";
|
|
@@ -957,44 +949,28 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
//物流部提交
|
|
//物流部提交
|
|
if ("1".equals(tranProcessInfo.getFlag())) {
|
|
if ("1".equals(tranProcessInfo.getFlag())) {
|
|
tranProcessInfo.setPriceStatusCar("审核中");
|
|
tranProcessInfo.setPriceStatusCar("审核中");
|
|
- List<String> roleIdList = Lists.newArrayList();
|
|
|
|
- if("1".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Execar"));
|
|
|
|
- teskCar(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
- else if("2".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Triancar"));
|
|
|
|
- teskCar(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
|
- Lists.newArrayList("transportationInfo-Shipcar"));
|
|
|
|
- teskCar(tranProcessInfo,roleIdList);
|
|
|
|
- }
|
|
|
|
|
|
+ tranProcessInfo.setPriceStatus("审核中");
|
|
|
|
+ tranProcessInfo.setTranPrice(0.0f);
|
|
|
|
+ TranProcessInfo tranProcessInfo1=this.selectById(tranProcessInfo.getId());
|
|
|
|
+ TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranProcessInfo1.getInfoId());
|
|
|
|
+ boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranProcessInfo1.getWorkflowId());
|
|
|
|
+ // 不是退回的单子
|
|
|
|
+ if (isStartWorkflow) {
|
|
|
|
+ Workflow workflow = workflowService
|
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(tranTaskInfo.getCompId(), "YUNJIA-TRAN-APPROVE");
|
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
|
+ if (workflow == null) {
|
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ // 开启审核流
|
|
|
|
+ else {
|
|
|
|
|
|
- }
|
|
|
|
- //决策人审核
|
|
|
|
- else if ("2".equals(tranProcessInfo.getFlag())) {
|
|
|
|
- tranProcessInfo.setTranPriceCar(tranProcessInfo.getTranPriceIngCar());
|
|
|
|
- tranProcessInfo.setTranPriceIngCar(0.0f);
|
|
|
|
- tranProcessInfo.setPriceStatusCar("已通过");
|
|
|
|
- //汽运生成审核记录
|
|
|
|
- if(tranProcessInfo.getTranTypeKey()!=null&&"1".equals(tranProcessInfo.getTranTypeKey())) {
|
|
|
|
- //生成审核记录
|
|
|
|
- TranPriceApprove tranPriceApprove = new TranPriceApprove();
|
|
|
|
- tranPriceApprove.setProcessId(tranProcessInfo.getId());
|
|
|
|
- tranPriceApprove.setId(IdGenerator.generateUUID());
|
|
|
|
- tranPriceApprove.setReviewer(tranProcessInfo.getReviewer());
|
|
|
|
- tranPriceApprove.setResult("通过");
|
|
|
|
- tranPriceApprove.setRecordType("1");
|
|
|
|
- tranPriceApprove.setTranPrice(tranProcessInfo.getTranPriceCar());
|
|
|
|
- tranPriceApproveService.insert(tranPriceApprove);
|
|
|
|
|
|
+ // 设置状态 已提交审核
|
|
|
|
+ tranProcessInfo1.setWorkflowId(workflow.getId());
|
|
|
|
+ this.updateById(tranProcessInfo1);
|
|
|
|
+ workflowService.startInstance(workflow.getId(), tranProcessInfo1.getId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- // 先删除任务
|
|
|
|
- noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "TRAN-TEAM-APPROVE",
|
|
|
|
- tranProcessInfo.getId(), null);
|
|
|
|
}
|
|
}
|
|
this.updateById(tranProcessInfo);
|
|
this.updateById(tranProcessInfo);
|
|
return "ok";
|
|
return "ok";
|