|
@@ -0,0 +1,49 @@
|
|
|
|
+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.GeneralAuditInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+
|
|
|
|
+@WorkflowTaskListener(name = "通用审核", group = "通用审核")
|
|
|
|
+public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
|
|
|
|
+
|
|
|
|
+ private static final long serialVersionUID = 4103656734835351132L;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IGeneralAuditInfoService generalAuditInfoService;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
|
|
+ GeneralAuditInfo generalAuditInfo = generalAuditInfoService.selectById(businessKey);
|
|
|
|
+ if (generalAuditInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (processIsEnd) {
|
|
|
|
+ generalAuditInfo.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
|
|
|
|
+ generalAuditInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ generalAuditInfo.setWorkflowId(null);
|
|
|
|
+ generalAuditInfo.setApproveStatus(null);
|
|
|
|
+ } else {
|
|
|
|
+ generalAuditInfo.setApproveStatus(status);
|
|
|
|
+ }
|
|
|
|
+ generalAuditInfoService.updateAllColumnById(generalAuditInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
|
|
|
|
+ GeneralAuditInfo generalAuditInfo = generalAuditInfoService.selectById(businessKey);
|
|
|
|
+ if (generalAuditInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ generalAuditInfo.setStatusFlag(StatusEnum.PURCHASE_FAILED.getFlag());
|
|
|
|
+ generalAuditInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
|
+ generalAuditInfo.setApproveStatus(null);
|
|
|
|
+ generalAuditInfoService.updateAllColumnById(generalAuditInfo);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|