Commit 245c9c9d authored by 刘学辉's avatar 刘学辉

品质异常单审批节点的调整

parent 0bd62fdd
...@@ -28,15 +28,7 @@ import com.huigou.topsun.sap.exceptionReport.domain.vo.PurchaseOrderVo; ...@@ -28,15 +28,7 @@ import com.huigou.topsun.sap.exceptionReport.domain.vo.PurchaseOrderVo;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportPayableRepository; import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportPayableRepository;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportRepository; import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportRepository;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportResponsibleRepository; import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReportResponsibleRepository;
import com.huigou.topsun.sap.permit.application.SapPermitApplication;
import com.huigou.topsun.sap.permit.domain.SapPermit;
import com.huigou.topsun.sap.permit.domain.SapPermitItem;
import com.huigou.topsun.sap.permit.vo.SapPermitItemVo;
import com.huigou.topsun.sap.permit.vo.SapPermitVo;
import com.huigou.topsun.sap.processOutsource.domain.ProcessOutsourceMaterial;
import com.huigou.topsun.sap.processOutsource.domain.vo.ProcessOutsourceItemVo;
import com.huigou.topsun.sap.processOutsource.domain.vo.ProcessOutsourceVo;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.fn.CodeGenerator; import com.huigou.uasp.bmp.fn.CodeGenerator;
import com.huigou.uasp.bmp.operator.OperatorApplication; import com.huigou.uasp.bmp.operator.OperatorApplication;
...@@ -49,6 +41,7 @@ import com.huigou.uasp.bpm.engine.application.WorkflowApplication; ...@@ -49,6 +41,7 @@ import com.huigou.uasp.bpm.engine.application.WorkflowApplication;
import com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler; import com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler;
import com.huigou.uasp.bpm.engine.domain.model.RuntimeTaskExtension; import com.huigou.uasp.bpm.engine.domain.model.RuntimeTaskExtension;
import com.huigou.uasp.bpm.engine.domain.model.TaskExtension; import com.huigou.uasp.bpm.engine.domain.model.TaskExtension;
import com.huigou.uasp.bpm.engine.repository.ProcUnitHandlerRepository;
import com.huigou.util.*; import com.huigou.util.*;
import freemarker.template.Template; import freemarker.template.Template;
import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateExecution;
...@@ -88,6 +81,8 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -88,6 +81,8 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
@Autowired @Autowired
private ExceptionReportItemApplication exceptionReportItemApplication; private ExceptionReportItemApplication exceptionReportItemApplication;
@Autowired
private com.huigou.uasp.bpm.engine.repository.ProcUnitHandlerRepository procUnitHandlerRepository;
@Autowired @Autowired
private ExceptionReportDutyPersonApplication exceptionReportDutyPersonApplication; private ExceptionReportDutyPersonApplication exceptionReportDutyPersonApplication;
@Autowired @Autowired
...@@ -276,10 +271,7 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -276,10 +271,7 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
break; break;
} }
} }
//String procUnitId = params.getString("procUnitId");
//if ("responsibleAudit".equals(procUnitId)){ //是责任人审批时 ,才做限制
// }
RuntimeTaskExtension runtimeTaskExtension = actApplication.loadRuntimeTaskExtension(params.getString("taskId")); RuntimeTaskExtension runtimeTaskExtension = actApplication.loadRuntimeTaskExtension(params.getString("taskId"));
ProcUnitHandler procUnitHandler = procUnitHandlerApplication.loadProcUnitHandler(runtimeTaskExtension.getProcUnitHandlerId()); ProcUnitHandler procUnitHandler = procUnitHandlerApplication.loadProcUnitHandler(runtimeTaskExtension.getProcUnitHandlerId());
String nodeCode=procUnitHandler.getSubProcUnitId(); String nodeCode=procUnitHandler.getSubProcUnitId();
...@@ -335,14 +327,17 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -335,14 +327,17 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
//责任人审批 //责任人审批
private void saveResponsibleApprover(SDO params,ExceptionReport exceptionReport){ private void saveResponsibleApprover(SDO params,ExceptionReport exceptionReport){
String bizId = params.getString("bizId"); String bizId = params.getString("bizId");
String procUnitId = params.getString("procUnitId"); String procUnitId = params.getString("procUnitId");// subProcUnitId
String currentProcUnitHandlerId = params.getString("currentHandleId"); String currentProcUnitHandlerId = params.getString("currentHandleId");
Long version = params.getLong("hiProcUnitHandlerInstVersion"); Long version = params.getLong("hiProcUnitHandlerInstVersion");
version=params.getLong("version"); version=params.getLong("version");
List<String> minusSignIds = params.getStringList("deleted"); List<String> minusSignIds = params.getStringList("deleted");
List<ProcUnitHandler> countersigns = params.getList("detailData", ProcUnitHandler.class); List<ProcUnitHandler> countersigns = params.getList("detailData", ProcUnitHandler.class);
//是否存在
long zs=procUnitHandlerRepository.countProcUnitHandlers(bizId,procUnitId,exceptionReport.getCheckOperator());
// if (!operator.getPersonMemberId().equals(exceptionReport.getCheckOperator())) { // if (!operator.getPersonMemberId().equals(exceptionReport.getCheckOperator())) {
if (zs<1) {
ProcUnitHandler procUnitHandler = new ProcUnitHandler(); ProcUnitHandler procUnitHandler = new ProcUnitHandler();
Org org = orgApplication.loadOrg(exceptionReport.getCheckOperator()); Org org = orgApplication.loadOrg(exceptionReport.getCheckOperator());
procUnitHandler.setHandlerId(exceptionReport.getCheckOperator()); procUnitHandler.setHandlerId(exceptionReport.getCheckOperator());
...@@ -361,17 +356,16 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -361,17 +356,16 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
procUnitHandler.setBizId(bizId); procUnitHandler.setBizId(bizId);
procUnitHandler.setStatus(0); procUnitHandler.setStatus(0);
procUnitHandler.setSequence(1); procUnitHandler.setSequence(1);
procUnitHandler.setSubProcUnitId(params.getString("subProcUnitId")); //审批节点固定名称
procUnitHandler.setBizCode(exceptionReport.getBillCode()); procUnitHandler.setBizCode(exceptionReport.getBillCode());
procUnitHandler.setCooperationModelId(params.getProperty("currentHandleCooperationModelId")!=null?params.getProperty("currentHandleCooperationModelId").toString():"chief"); procUnitHandler.setCooperationModelId(params.getProperty("currentHandleCooperationModelId") != null ? params.getProperty("currentHandleCooperationModelId").toString() : "chief");
procUnitHandler.setGroupId(Integer.parseInt(params.getProperty("currentHandleGroupId").toString())+1);
procUnitHandler.setGroupId(Integer.parseInt(params.getProperty("currentHandleGroupId").toString()) + 1);
//System.out.print("isNew=========" + procUnitHandler.isNew()); //System.out.print("isNew=========" + procUnitHandler.isNew());
countersigns.add(procUnitHandler); countersigns.add(procUnitHandler);
workflowApplication.saveCounterSignHandlers(bizId, procUnitId, version, currentProcUnitHandlerId, minusSignIds, countersigns); workflowApplication.saveCounterSignHandlers(bizId, procUnitId, version, currentProcUnitHandlerId, minusSignIds, countersigns);
}
} }
/** /**
* 获取流程参数 * 获取流程参数
...@@ -695,6 +689,11 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -695,6 +689,11 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
} }
} }
} }
//删除异常的待处理记录
// WF_ProcUnitHandler procunitha0_ where `BIZ_CODE`='ER20241023-0001' and
// and `HANDLER_ID`='8b2ff3c3ed0011eea8a50242ac110003@FAD723F9507946628516EFBF316DC59F' and `STATUS`=0
String sql="DELETE FROM WF_ProcUnitHandler where BIZ_ID='"+bizId+"' and SUB_PROC_UNIT_ID='responsibleAudit'";
//sqlExecutorDao.executeUpdate(sql);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment