|
@@ -0,0 +1,48 @@
|
|
|
+package com.yh.saas.plugin.yiliangyiyun.workflow;
|
|
|
+
|
|
|
+import com.yh.saas.common.support.workflow.AbstractWorkflowTaskListener;
|
|
|
+import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+
|
|
|
+@WorkflowTaskListener(name = "合同管理", group = "收购合同")
|
|
|
+public class ShouContractListener extends AbstractWorkflowTaskListener {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = 4103656734835351132L;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IContractManagementInfoService contractManagementInfoService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
|
|
|
+ if (contractManagementInfo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (processIsEnd) {
|
|
|
+ contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_WAIT.getFlag());
|
|
|
+ contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
|
|
|
+ contractManagementInfo.setWorkflowId(null);
|
|
|
+ contractManagementInfo.setApproveStatus(null);
|
|
|
+ } else {
|
|
|
+ contractManagementInfo.setApproveStatus(status);
|
|
|
+ }
|
|
|
+ contractManagementInfoService.updateAllColumnById(contractManagementInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
|
|
|
+ if (contractManagementInfo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ contractManagementInfo.setStatusFlag(StatusEnum.TASK_RETURN.getFlag());
|
|
|
+ contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
|
|
|
+ contractManagementInfo.setApproveStatus(null);
|
|
|
+ contractManagementInfoService.updateAllColumnById(contractManagementInfo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|