|
@@ -0,0 +1,50 @@
|
|
|
|
+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.ClockInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+
|
|
|
|
+@WorkflowTaskListener(name = "考勤管理", group = "请假管理")
|
|
|
|
+public class QingjiaListener extends AbstractWorkflowTaskListener {
|
|
|
|
+
|
|
|
|
+ private static final long serialVersionUID = 4103656734835351132L;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IClockInfoService clockInfoService;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
|
|
+ ClockInfo clockInfo = clockInfoService.selectById(businessKey);
|
|
|
|
+ if (clockInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (processIsEnd) {
|
|
|
|
+ clockInfo.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
|
|
|
|
+ clockInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ clockInfo.setWorkflowId(null);
|
|
|
|
+ clockInfo.setApproveStatus(null);
|
|
|
|
+ } else {
|
|
|
|
+ clockInfo.setApproveStatus(status);
|
|
|
|
+ }
|
|
|
|
+ clockInfoService.updateAllColumnById(clockInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
|
|
|
|
+ ClockInfo clockInfo = clockInfoService.selectById(businessKey);
|
|
|
|
+ if (clockInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ clockInfo.setStatusFlag(StatusEnum.PURCHASE_FAILED.getFlag());
|
|
|
|
+ clockInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
|
+ clockInfo.setApproveStatus(null);
|
|
|
|
+ clockInfoService.updateAllColumnById(clockInfo);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|