zxz 1 年之前
父節點
當前提交
2886b10f8e

+ 13 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ExpenseInfoServiceImpl.java

@@ -1132,6 +1132,19 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
                 }
             }
         }
+        //查询任务表,删除任务
+        List<NoticeTaskInfo> noticeTaskInfoList = noticeTaskService.selectList(new EntityWrapper<NoticeTaskInfo>()
+                .eq("business_id",expenseInfo.getId())
+                .eq("vessel_id","点击切换任务状态")
+                .eq("business_code","FEIYONGGUANLI-APPROVE")
+                .eq("delete_flag","0"));
+        if(!CollectionUtils.isEmpty(noticeTaskInfoList)){
+            for(int i = 0;i<noticeTaskInfoList.size();i++){
+                noticeTaskInfoList.get(i).setDeleteFlag("1");
+            }
+        }
+        noticeTaskService.updateBatchById(noticeTaskInfoList);
+        expenseInfo.setNoticeTaskInfoList(noticeTaskInfoList);
         this.updateById(expenseInfo);
         ExpenseInfo expenseInfo1 = this.selectById(expenseInfo.getId());
         //合同费用

+ 28 - 20
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseInfoListener.java

@@ -19,6 +19,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
@@ -42,6 +43,8 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
     private INoticeTaskService noticeTaskService;
     @Autowired
     private ICommonStaffService staffService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
@@ -67,26 +70,31 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
                 statusRecordMapper.insert(statusRecord);
             }
 
-//            // 先删除任务
-//            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
-//                    expenseInfo.getId(), null);
-//            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
-//            String taskContent = "有新的待付款操作需要你处理";
-//            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
-//            taskInfo.setCompId(commitUserInfo.getCompId());
-//            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
-//            taskInfo.setBusinessId(expenseInfo.getId());
-//            taskInfo.setBusinessType("FEIYONGGUANLI");
-//            taskInfo.setMessageTitle("费用管理");
-//            taskInfo.setMessageContent(taskContent);
-//            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
-//            //查询出纳
-//            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
-//                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
-//                    .eq("delete_flag", "0"));
-//            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
-//            noticeTaskService.createNoticeTask(staffIds,
-//                    "点击切换任务状态", taskInfo);
+            // 先删除任务
+            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
+                    expenseInfo.getId(), null);
+            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+            String taskContent = "有新的待付款操作需要你处理";
+            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
+            taskInfo.setCompId(commitUserInfo.getCompId());
+            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
+            taskInfo.setBusinessId(expenseInfo.getId());
+            taskInfo.setBusinessType("FEIYONGGUANLI");
+            taskInfo.setMessageTitle("费用管理");
+            taskInfo.setMessageContent(taskContent);
+            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
+            //查询出纳
+            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
+                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
+                    .eq("delete_flag", "0"));
+            for (CommonStaff c :
+                    commonStaffList) {
+                geTuiUtils.pushByCidPhone("工作事项提醒","您有新的易粮易运流程,请及时审批",c.getStaffId());
+
+            }
+            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
+            noticeTaskService.createNoticeTask(staffIds,
+                    "点击切换任务状态", taskInfo);
         } else {
             expenseInfo.setApproveStatus(status);
 

+ 28 - 20
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseListener.java

@@ -18,6 +18,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
@@ -41,6 +42,8 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
     private INoticeTaskService noticeTaskService;
     @Autowired
     private ICommonStaffService staffService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
@@ -66,26 +69,31 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
                 statusRecordMapper.insert(statusRecord);
             }
 
-//            // 先删除任务
-//            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
-//                    expenseInfo.getId(), null);
-//            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
-//            String taskContent = "有新的待付款操作需要你处理";
-//            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
-//            taskInfo.setCompId(commitUserInfo.getCompId());
-//            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
-//            taskInfo.setBusinessId(expenseInfo.getId());
-//            taskInfo.setBusinessType("FEIYONGGUANLI");
-//            taskInfo.setMessageTitle("费用管理");
-//            taskInfo.setMessageContent(taskContent);
-//            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
-//            //查询出纳
-//            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
-//                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
-//                    .eq("delete_flag", "0"));
-//            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
-//            noticeTaskService.createNoticeTask(staffIds,
-//                    "点击切换任务状态", taskInfo);
+            // 先删除任务
+            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
+                    expenseInfo.getId(), null);
+            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+            String taskContent = "有新的待付款操作需要你处理";
+            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
+            taskInfo.setCompId(commitUserInfo.getCompId());
+            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
+            taskInfo.setBusinessId(expenseInfo.getId());
+            taskInfo.setBusinessType("FEIYONGGUANLI");
+            taskInfo.setMessageTitle("费用管理");
+            taskInfo.setMessageContent(taskContent);
+            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
+            //查询出纳
+            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
+                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
+                    .eq("delete_flag", "0"));
+            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
+            for (CommonStaff c :
+                    commonStaffList) {
+                geTuiUtils.pushByCidPhone("工作事项提醒","您有新的易粮易运流程,请及时审批",c.getStaffId());
+
+            }
+            noticeTaskService.createNoticeTask(staffIds,
+                    "点击切换任务状态", taskInfo);
         } else {
             expenseInfo.setApproveStatus(status);
 

+ 28 - 20
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseYunListener.java

@@ -20,6 +20,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 
@@ -46,6 +47,8 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
     private INoticeTaskService noticeTaskService;
     @Autowired
     private ICommonStaffService staffService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
@@ -80,26 +83,31 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
                 statusRecordMapper.insert(statusRecord);
             }
 
-//            // 先删除任务
-//            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
-//                    expenseInfo.getId(), null);
-//            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
-//            String taskContent = "有新的待付款操作需要你处理";
-//            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
-//            taskInfo.setCompId(commitUserInfo.getCompId());
-//            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
-//            taskInfo.setBusinessId(expenseInfo.getId());
-//            taskInfo.setBusinessType("FEIYONGGUANLI");
-//            taskInfo.setMessageTitle("费用管理");
-//            taskInfo.setMessageContent(taskContent);
-//            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
-//            //查询出纳
-//            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
-//                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
-//                    .eq("delete_flag", "0"));
-//            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
-//            noticeTaskService.createNoticeTask(staffIds,
-//                    "点击切换任务状态", taskInfo);
+            // 先删除任务
+            noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
+                    expenseInfo.getId(), null);
+            CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+            String taskContent = "有新的待付款操作需要你处理";
+            NoticeTaskInfo taskInfo = new NoticeTaskInfo();
+            taskInfo.setCompId(commitUserInfo.getCompId());
+            taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
+            taskInfo.setBusinessId(expenseInfo.getId());
+            taskInfo.setBusinessType("FEIYONGGUANLI");
+            taskInfo.setMessageTitle("费用管理");
+            taskInfo.setMessageContent(taskContent);
+            taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
+            //查询出纳
+            List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
+                    .eq("major_role_id", "04e3ec4d03c7499fafa690572fdb4c1c")
+                    .eq("delete_flag", "0"));
+            for (CommonStaff c :
+                    commonStaffList) {
+                geTuiUtils.pushByCidPhone("工作事项提醒","您有新的易粮易运流程,请及时审批",c.getStaffId());
+
+            }
+            List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
+            noticeTaskService.createNoticeTask(staffIds,
+                    "点击切换任务状态", taskInfo);
         } else {
             expenseInfo.setApproveStatus(status);
 

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ShouContractProvider.java

@@ -23,7 +23,7 @@ public class ShouContractProvider implements BeanWorkFlowProvider {
     @Autowired
     private IContractGoodsInfoService contractGoodsInfoService;
     // 工作通知信息
-    static final String MESSAGE_CONTENT = "{0}发起的{1}合同等待您的审核,合同编号:{2},{3}{4}吨";
+    static final String MESSAGE_CONTENT = "{0}发起的{1}等待您的审核,合同编号:{2},{3}{4}吨";
 
     @Override
     public String getDeptId(String businessId) {