Quellcode durchsuchen

流程功能修改,待办和已办添加开始时间和完成时间筛选项等功能

user5 vor 3 Jahren
Ursprung
Commit
d13690b211
37 geänderte Dateien mit 1042 neuen und 391 gelöschten Zeilen
  1. 28 17
      src/main/java/com/jeeplus/modules/businessQuestions/service/BusinessQuestionsService.java
  2. 27 14
      src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java
  3. 29 29
      src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java
  4. 28 19
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectMaterialDefectRecordService.java
  5. 78 42
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportRecordService.java
  6. 31 14
      src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java
  7. 28 17
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/ProjectPaperFilingService.java
  8. 89 44
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java
  9. 27 15
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewTwoService.java
  10. 2 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  11. 1 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordTwoService.java
  12. 16 14
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  13. 1 8
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/ProjectPaperFilingController.java
  14. 2 0
      src/main/java/com/jeeplus/modules/workactivity/dao/WorkActivityProcessDao.java
  15. 12 7
      src/main/java/com/jeeplus/modules/workactivity/service/WorkActivityProcessService.java
  16. 18 10
      src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractBorrowService.java
  17. 1 0
      src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoService.java
  18. 27 12
      src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoTookDisposeService.java
  19. 33 30
      src/main/java/com/jeeplus/modules/workcontractrecord/service/WorkContractRecordService.java
  20. 52 29
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java
  21. 52 31
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  22. 10 0
      src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java
  23. 55 3
      src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java
  24. 66 1
      src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java
  25. 36 0
      src/main/java/com/jeeplus/modules/workprojectnotify/util/UtilNotify.java
  26. 27 22
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java
  27. 2 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml
  28. 29 0
      src/main/resources/mappings/modules/workactivity/WorkActivityProcessDao.xml
  29. 120 5
      src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml
  30. 8 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/newReportedForm.jsp
  31. 7 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/reportedAudit.jsp
  32. 6 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/reportedModify.jsp
  33. 2 1
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp
  34. 8 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/reportedModify.jsp
  35. 2 1
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp
  36. 29 2
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp
  37. 53 0
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyReadBacklogList.jsp

+ 28 - 17
src/main/java/com/jeeplus/modules/businessQuestions/service/BusinessQuestionsService.java

@@ -7,16 +7,12 @@ import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
-import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.businessQuestions.dao.BusinessQuestionsDao;
 import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
 import com.jeeplus.modules.businessQuestions.entity.BusinessQuestionsAttentionUser;
 import com.jeeplus.modules.businessQuestions.entity.BusinessQuestionsContentsUser;
 import com.jeeplus.modules.businessQuestions.entity.BusinessQuestionsUser;
-import com.jeeplus.modules.oa.entity.OaNotify;
-import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.entity.Workattachment;
@@ -40,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import javax.management.StringValueExp;
 import java.util.*;
 
 /**
@@ -312,6 +307,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
        dao.updateProcessInstanceId(businessQuestions);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -588,6 +584,10 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
             order = 2;
         }
 
+
+        //查询当前流程信息
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(businessQuestions.getProcessInstanceId());
+
         workActivityProcessService.updateProcessNew(workActivityProcess,workActivityMenu,key,taskCount,businessQuestions.getProcessInstanceId(),taskDefKey,"modifyApply",businessQuestions.getAct().getFlag(),comment, activities,order);
         // 设置意见
         businessQuestions.getAct().setComment(comment);
@@ -636,7 +636,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                 for (User userInfo : informUsers) {
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(businessQuestions.getId(),
+                                    .saveNewNotify(businessQuestions.getId(),
                                             userInfo,
                                             UserUtils.getSelectCompany().getId(),
                                             title,
@@ -644,7 +644,8 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                             "182",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            businessQuestions.getProcessInstanceId(),new Date()));
                 }
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -655,7 +656,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                     businessQuestions.setStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(businessQuestions.getId(),
+                                    .saveNewNotify(businessQuestions.getId(),
                                             businessQuestions.getCreateBy(),
                                             UserUtils.getSelectCompany().getId(),
                                             titleStr,
@@ -663,7 +664,8 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                             "182",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            businessQuestions.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(businessQuestions.getProcessInstanceId());
@@ -674,7 +676,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                 notify.setNotifyId(businessQuestions.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(businessQuestions.getId(),
+                        .saveNewNotify(businessQuestions.getId(),
                                 new User(),
                                 UserUtils.getSelectCompany().getId(),
                                 titleStr,
@@ -682,7 +684,8 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                 "182",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                businessQuestions.getProcessInstanceId(),new Date());
                 String count = taskDefKey.replace("audit","").replace("task","");
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
@@ -729,7 +732,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
 
                     for (User userInfo: informUserList) {
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(businessQuestions.getId(),
+                                .saveNewNotify(businessQuestions.getId(),
                                         userInfo,
                                         UserUtils.getSelectCompany().getId(),
                                         titleStr,
@@ -737,7 +740,8 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                         "182",
                                         "0",
                                         remarks,
-                                        notifyRole);
+                                        notifyRole,
+                                        businessQuestions.getProcessInstanceId(),new Date());
                         workProjectNotifyService.save(workProjectNotify);
                     }
                 } else {
@@ -749,7 +753,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                         notify.setNotifyId(businessQuestions.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(businessQuestions.getId(),
+                                .saveNewNotify(businessQuestions.getId(),
                                         new User(),
                                         UserUtils.getSelectCompany().getId(),
                                         titleStr,
@@ -757,7 +761,8 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                         "182",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        businessQuestions.getProcessInstanceId(),new Date());
                         for (User user1:auditUsers){
                             users.add(user1);
                             workProjectNotify.setUser(user1);
@@ -777,7 +782,7 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                         users.add(businessQuestions.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(businessQuestions.getId(),
+                                        .saveNewNotify(businessQuestions.getId(),
                                                 businessQuestions.getCreateBy(),
                                                 UserUtils.getSelectCompany().getId(),
                                                 titleStr,
@@ -785,12 +790,18 @@ public class BusinessQuestionsService extends CrudService<BusinessQuestionsDao,
                                                 "182",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                businessQuestions.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
 
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
+
         if (users!=null && users.size()!=0) {
             List<String> userIds = new ArrayList<>(users.size());
             for (User u : users) {

+ 27 - 14
src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java

@@ -12,7 +12,6 @@ import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.JPushClientUtil;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
-import com.jeeplus.common.websocket.onchat.ChatServerPool;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.oa.dao.OaNotifyDao;
 import com.jeeplus.modules.oa.dao.OaNotifyDetailDao;
@@ -55,7 +54,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -544,6 +542,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         dao.updateProcessIdAndStatus(oaNotify);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         return "";
     }
@@ -1023,6 +1022,10 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
             // 设置意见
             oaNotify.getAct().setComment(("yes".equals(oaNotify.getAct().getFlag()) ? "[同意] " : "[驳回] ") + oaNotify.getAct().getComment());
             oaNotify.preUpdate();
+
+            //查询当前流程信息
+            WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(oaNotify.getProcessInstanceId());
+
             // 提交流程任务
             vars.put(exp, "yes".equals(oaNotify.getAct().getFlag()) ? true : false);
             vars.put("passs",true);
@@ -1048,7 +1051,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(oaNotify.getId(),
+                                    .saveNewNotify(oaNotify.getId(),
                                             oaNotify.getCreateBy(),
                                             oaNotify.getCompany().getId(),
                                             title,
@@ -1056,7 +1059,8 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                             "89",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            oaNotify.getProcessInstanceId(),new Date()));
 
                 } else {
                     WorkProjectNotify notify = new WorkProjectNotify();
@@ -1066,7 +1070,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                         oaNotify.setStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(oaNotify.getId(),
+                                        .saveNewNotify(oaNotify.getId(),
                                                 oaNotify.getCreateBy(),
                                                 oaNotify.getCompany().getId(),
                                                 title,
@@ -1074,7 +1078,8 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                                 "89",
                                                 "0",
                                                 "待通知",
-                                                notifyRole));
+                                                notifyRole,
+                                                oaNotify.getProcessInstanceId(),new Date()));
                     }
                 }
                 workActivityProcessService.deleteProcessIdAuditUsers(oaNotify.getProcessInstanceId());
@@ -1085,7 +1090,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     //users.addAll(userList);
                     WorkProjectNotify workProjectNotify = UtilNotify
-                            .saveNotify(oaNotify.getId(),
+                            .saveNewNotify(oaNotify.getId(),
                                     new User(),
                                     oaNotify.getCompany().getId(),
                                     title,
@@ -1093,7 +1098,8 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                     "89",
                                     "0",
                                     "待审批",
-                                    notifyRole);
+                                    notifyRole,
+                                    oaNotify.getProcessInstanceId(),new Date());
                     List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                             activities,
                             workProjectNotify,
@@ -1121,7 +1127,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                         //users.addAll(userList);
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(oaNotify.getId(),
+                                        .saveNewNotify(oaNotify.getId(),
                                                 oaNotify.getCreateBy(),
                                                 oaNotify.getCompany().getId(),
                                                 title,
@@ -1129,7 +1135,8 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                                 "89",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                oaNotify.getProcessInstanceId(),new Date()));
                         users.add( oaNotify.getCreateBy());
                     } else {
                         if (StringUtils.isNotBlank(enname)) {//驳回重新申请
@@ -1144,7 +1151,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                             userList = workProjectNotifyService.readByNotifyId(notify);
                             //users.addAll(userList1);
                             WorkProjectNotify workProjectNotify = UtilNotify
-                                    .saveNotify(oaNotify.getId(),
+                                    .saveNewNotify(oaNotify.getId(),
                                             new User(),
                                             oaNotify.getCompany().getId(),
                                             title,
@@ -1152,7 +1159,8 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                             "89",
                                             "0",
                                             "待审批",
-                                            notifyRole);
+                                            notifyRole,
+                                            oaNotify.getProcessInstanceId(),new Date());
                             users.addAll(auditUsers);
                             for (User user1:auditUsers){
                                 workProjectNotify.setUser(user1);
@@ -1172,7 +1180,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                             users.add(oaNotify.getCreateBy());
                             workProjectNotifyService
                                     .save(UtilNotify
-                                            .saveNotify(oaNotify.getId(),
+                                            .saveNewNotify(oaNotify.getId(),
                                                     oaNotify.getCreateBy(),
                                                     oaNotify.getCompany().getId(),
                                                     title,
@@ -1180,11 +1188,16 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
                                                     "89",
                                                     "0",
                                                     "重新申请",
-                                                    notifyRole));
+                                                    notifyRole,
+                                                    oaNotify.getProcessInstanceId(),new Date()));
                         }
                     }
                 }
             }
+            //对数据进行处理
+            if(null != nowWorkProjectNotify){
+                workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+            }
             if (StringUtils.isNotBlank(title) && users!=null && users.size()!=0) {
                 for (User u : users) {
                     UserUtils.pushIm(u.getId(),title);

+ 29 - 29
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -1,7 +1,6 @@
 package com.jeeplus.modules.projectFilingBatch.service;
 
 import com.google.common.collect.Maps;
-import com.google.gson.JsonObject;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.IdGen;
@@ -15,13 +14,9 @@ import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchTree;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
-import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
-import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
-import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -36,31 +31,21 @@ import com.jeeplus.modules.workactivity.service.ActivityService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
-import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import org.activiti.engine.IdentityService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.method.P;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 @Transactional(readOnly = true)
@@ -561,6 +546,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
             dao.updateProcessIdAndStatus(projectFilingBatch);
             //通知添加流程实例ID
             workProjectNotify.setProcessInstanceId(processInstance.getId());
+            workProjectNotify.setWapBeginDate(new Date());
             workProjectNotifyService.save(workProjectNotify);
         }catch (Exception e){
             logger.error("启动审批流程异常:",e);
@@ -812,6 +798,11 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 }
             }
         }
+
+
+        //查询当前流程信息
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(projectFilingBatch.getProcessinstanceId());
+
         workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectFilingBatch.getProcessinstanceId(),taskDefKey,"modifyApply",projectFilingBatch.getAct().getFlag(),comment, activities);
         // 设置意见
         projectFilingBatch.getAct().setComment(comment);
@@ -857,7 +848,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 users.add(projectFilingBatch.getCreateBy());
                 workProjectNotifyService
                         .save(UtilNotify
-                                .saveNotify(projectFilingBatch.getId(),
+                                .saveNewNotify(projectFilingBatch.getId(),
                                         projectFilingBatch.getCreateBy(),
                                         UserUtils.getSelectCompany().getId(),
                                         title,
@@ -865,7 +856,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                         "100",
                                         "0",
                                         "待通知",
-                                        notifyRole));
+                                        notifyRole,
+                                        projectFilingBatch.getProcessinstanceId(),new Date()));
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
                 notify.setNotifyId(projectFilingBatch.getId());
@@ -875,7 +867,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                     projectFilingBatch.setFilingStatus(ProjectStatusEnum.REJECTED.getValue());
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectFilingBatch.getId(),
+                                    .saveNewNotify(projectFilingBatch.getId(),
                                             projectFilingBatch.getCreateBy(),
                                             UserUtils.getSelectCompany().getId(),
                                             titleStr,
@@ -883,7 +875,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                             "100",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            projectFilingBatch.getProcessinstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectFilingBatch.getProcessinstanceId());
@@ -893,7 +886,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 notify.setNotifyId(projectFilingBatch.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(projectFilingBatch.getId(),
+                        .saveNewNotify(projectFilingBatch.getId(),
                                 new User(),
                                 UserUtils.getSelectCompany().getId(),
                                 titleStr,
@@ -901,7 +894,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                 "100",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                projectFilingBatch.getProcessinstanceId(),new Date());
                 String count = taskDefKey.replace("audit","").replace("task","");
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
@@ -927,7 +921,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     users.add(user);
                     WorkProjectNotify workProjectNotify = UtilNotify
-                            .saveNotify(projectFilingBatch.getId(),
+                            .saveNewNotify(projectFilingBatch.getId(),
                                     user,
                                     UserUtils.getSelectCompany().getId(),
                                     titleStr,
@@ -935,7 +929,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                     "100",
                                     "0",
                                     "重新申请",
-                                    notifyRole);
+                                    notifyRole,
+                                    projectFilingBatch.getProcessinstanceId(),new Date());
                     workProjectNotifyService.save(workProjectNotify);
                 } else {
                     if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
@@ -945,7 +940,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                         notify.setNotifyId(projectFilingBatch.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(projectFilingBatch.getId(),
+                                .saveNewNotify(projectFilingBatch.getId(),
                                         new User(),
                                         UserUtils.getSelectCompany().getId(),
                                         titleStr,
@@ -953,7 +948,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                         "100",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        projectFilingBatch.getProcessinstanceId(),new Date());
                         for (User user1:auditUsers){
                             users.add(user1);
                             workProjectNotify.setUser(user1);
@@ -973,7 +969,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                         users.add(projectFilingBatch.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(projectFilingBatch.getId(),
+                                        .saveNewNotify(projectFilingBatch.getId(),
                                                 projectFilingBatch.getCreateBy(),
                                                 UserUtils.getSelectCompany().getId(),
                                                 titleStr,
@@ -981,12 +977,16 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                                                 "100",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                projectFilingBatch.getProcessinstanceId(),new Date()));
                     }
                 }
             }
         }
-
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             List<String> userIds = new ArrayList<>(users.size());
             for (User u : users) {

+ 28 - 19
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectMaterialDefectRecordService.java

@@ -1,9 +1,7 @@
 package com.jeeplus.modules.projectcontentinfo.service;
 
 import com.google.common.collect.Maps;
-import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
@@ -16,7 +14,6 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.dao.WorkattachmentDao;
-import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
@@ -28,18 +25,18 @@ import com.jeeplus.modules.workactivity.service.ActivityService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
 import org.activiti.engine.*;
-import org.activiti.engine.runtime.ProcessInstance;
-import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 @Service
 @Transactional(readOnly = true)
 public class ProjectMaterialDefectRecordService extends CrudService<ProjectReportRecordDao, ProjectReportRecord> {
@@ -267,6 +264,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
         // 设置意见
         act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
         projectReportRecord.preUpdate();
+        //查询当前流程信息
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(materialDefectRecord.getProcessInstanceId());
         // 提交流程任务
         vars.put(exp, "yes".equals(flag) ? true : false);
         vars.put("passs", true);
@@ -293,7 +292,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 workProjectNotifyService
                         .save(UtilNotify
-                                .saveNotify(projectReportRecord.getId(),
+                                .saveNewNotify(projectReportRecord.getId(),
                                         projectReportRecord.getCreateBy(),
                                         projectReportRecord.getCompanyId(),
                                         titleStr,
@@ -301,7 +300,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                         "99",
                                         "0",
                                         "待通知",
-                                        notifyRole));
+                                        notifyRole,
+                                        materialDefectRecord.getProcessInstanceId(),new Date()));
 
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -311,7 +311,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                     projectReportRecord.setStatus("4");
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportRecord.getId(),
+                                    .saveNewNotify(projectReportRecord.getId(),
                                             projectReportRecord.getCreateBy(),
                                             projectReportRecord.getCompanyId(),
                                             title,
@@ -319,7 +319,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                             "99",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            materialDefectRecord.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectReportRecord.getProcessInstanceId());
@@ -329,7 +330,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                 notify.setNotifyId(projectReportRecord.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(projectReportRecord.getId(),
+                        .saveNewNotify(projectReportRecord.getId(),
                                 new User(),
                                 projectReportRecord.getCompanyId(),
                                 title,
@@ -337,7 +338,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                 "99",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                materialDefectRecord.getProcessInstanceId(),new Date());
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
                         workProjectNotify,
@@ -364,7 +366,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportRecord.getId(),
+                                    .saveNewNotify(projectReportRecord.getId(),
                                             projectReportRecord.getCreateBy(),
                                             projectReportRecord.getCompanyId(),
                                             title,
@@ -372,7 +374,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                             "99",
                                             "0",
                                             "重新申请",
-                                            notifyRole));
+                                            notifyRole,
+                                            materialDefectRecord.getProcessInstanceId(),new Date()));
                     users.add( projectReportRecord.getCreateBy());
                 } else {
                     if (StringUtils.isNotBlank(enname)) {//驳回重新归档
@@ -382,7 +385,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                         notify.setNotifyId(projectReportRecord.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(projectReportRecord.getId(),
+                                .saveNewNotify(projectReportRecord.getId(),
                                         new User(),
                                         projectReportRecord.getCompanyId(),
                                         title,
@@ -390,7 +393,8 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                         "99",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        materialDefectRecord.getProcessInstanceId(),new Date());
                         users.addAll(auditUsers);
                         for (User user1 : users) {
                             workProjectNotify.setUser(user1);
@@ -406,7 +410,7 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                         users.add(projectReportRecord.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(projectReportRecord.getId(),
+                                        .saveNewNotify(projectReportRecord.getId(),
                                                 projectReportRecord.getCreateBy(),
                                                 projectReportRecord.getCompanyId(),
                                                 title,
@@ -414,11 +418,16 @@ public class ProjectMaterialDefectRecordService extends CrudService<ProjectRepor
                                                 "99",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                materialDefectRecord.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             for (User u : users) {
                 UserUtils.pushIm(u.getId(),title);

+ 78 - 42
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportRecordService.java

@@ -4,8 +4,6 @@
 package com.jeeplus.modules.projectcontentinfo.service;
 
 import com.google.common.collect.Maps;
-import com.jeeplus.common.bos.BosController;
-import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.FreemarkerUtil;
@@ -50,16 +48,12 @@ import freemarker.template.Template;
 import org.activiti.engine.*;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
-import org.apache.http.entity.ContentType;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -604,6 +598,10 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 		// 设置意见
 		act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
 		projectReportRecord.preUpdate();
+
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(reportRecord.getProcessInstanceId());
+
 		// 提交流程任务
 		vars.put(exp, "yes".equals(flag) ? true : false);
 		vars.put("passs", true);
@@ -688,7 +686,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				String str2 = "归档申请编号:"+projectReportRecord.getRecordNum()+ ",主委托方:"+projectReportRecord.getClientName();
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										projectReportRecord.getCreateBy(),
 										projectReportRecord.getCompanyId(),
 										titleStr,
@@ -696,7 +694,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"51",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										reportRecord.getProcessInstanceId(),new Date()));
 
 			} else {
 				WorkProjectNotify notify = new WorkProjectNotify();
@@ -706,7 +705,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					projectReportRecord.setStatus("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -714,7 +713,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"51",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											reportRecord.getProcessInstanceId(),new Date()));
 				}
 			}
 			workActivityProcessService.deleteProcessIdAuditUsers(projectReportRecord.getProcessInstanceId());
@@ -724,7 +724,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				notify.setNotifyId(projectReportRecord.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(projectReportRecord.getId(),
+						.saveNewNotify(projectReportRecord.getId(),
 								new User(),
 								projectReportRecord.getCompanyId(),
 								title,
@@ -732,7 +732,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 								"51",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								reportRecord.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -763,7 +764,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -771,7 +772,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"51",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											reportRecord.getProcessInstanceId(),new Date()));
 					users.add( projectReportRecord.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {//驳回重新归档
@@ -785,7 +787,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						notify.setNotifyId(projectReportRecord.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										new User(),
 										projectReportRecord.getCompanyId(),
 										title,
@@ -793,7 +795,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"51",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										reportRecord.getProcessInstanceId(),new Date());
 						users.addAll(auditUsers);
 						for (User user1 : users) {
 							workProjectNotify.setUser(user1);
@@ -809,7 +812,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						users.add(projectReportRecord.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(projectReportRecord.getId(),
+										.saveNewNotify(projectReportRecord.getId(),
 												projectReportRecord.getCreateBy(),
 												projectReportRecord.getCompanyId(),
 												title,
@@ -817,11 +820,16 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 												"51",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												reportRecord.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),title);
@@ -1150,6 +1158,10 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 		// 设置意见
 		act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
 		projectReportRecord.preUpdate();
+
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(projectReportRecord.getProcessInstanceId());
+
 		// 提交流程任务
 		vars.put(exp, "yes".equals(flag) ? true : false);
 		vars.put("passs", true);
@@ -1196,7 +1208,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										projectReportRecord.getCreateBy(),
 										projectReportRecord.getCompanyId(),
 										titleStr,
@@ -1204,7 +1216,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"101",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										projectReportRecord.getProcessInstanceId(),new Date()));
 
 			} else {
 				WorkProjectNotify notify = new WorkProjectNotify();
@@ -1214,7 +1227,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					projectReportRecord.setStatus("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -1222,7 +1235,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"101",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											projectReportRecord.getProcessInstanceId(),new Date()));
 				}
 			}
 			workActivityProcessService.deleteProcessIdAuditUsers(projectReportRecord.getProcessInstanceId());
@@ -1232,7 +1246,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				notify.setNotifyId(projectReportRecord.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(projectReportRecord.getId(),
+						.saveNewNotify(projectReportRecord.getId(),
 								new User(),
 								projectReportRecord.getCompanyId(),
 								title,
@@ -1240,7 +1254,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 								"101",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								projectReportRecord.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -1271,7 +1286,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -1279,7 +1294,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"101",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											projectReportRecord.getProcessInstanceId(),new Date()));
 					users.add( projectReportRecord.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {//驳回重新归档
@@ -1293,7 +1309,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						notify.setNotifyId(projectReportRecord.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										new User(),
 										projectReportRecord.getCompanyId(),
 										title,
@@ -1301,7 +1317,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"101",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										projectReportRecord.getProcessInstanceId(),new Date());
 						users.addAll(auditUsers);
 						for (User user1 : users) {
 							workProjectNotify.setUser(user1);
@@ -1317,7 +1334,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						users.add(projectReportRecord.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(projectReportRecord.getId(),
+										.saveNewNotify(projectReportRecord.getId(),
 												projectReportRecord.getCreateBy(),
 												projectReportRecord.getCompanyId(),
 												title,
@@ -1325,11 +1342,16 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 												"101",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												projectReportRecord.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),title);
@@ -1858,6 +1880,9 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 		// 提交流程任务
 		vars.put(exp, "yes".equals(flag) ? true : false);
 		vars.put("passs", true);
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(reportRecord.getProcessInstanceId());
+
 		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectReportRecord.getProcessInstanceId(),taskDefKey,"modifyApply",flag,comment, activities);
 		// 提交流程任务
 		actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
@@ -1901,7 +1926,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										projectReportRecord.getCreateBy(),
 										projectReportRecord.getCompanyId(),
 										titleStr,
@@ -1909,7 +1934,9 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"103",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										reportRecord.getProcessInstanceId(),
+										new Date()));
 
 			} else {
 				WorkProjectNotify notify = new WorkProjectNotify();
@@ -1919,7 +1946,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					projectReportRecord.setStatus("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -1927,7 +1954,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"103",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											reportRecord.getProcessInstanceId(),new Date()));
 				}
 			}
 			workActivityProcessService.deleteProcessIdAuditUsers(projectReportRecord.getProcessInstanceId());
@@ -1937,7 +1965,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 				notify.setNotifyId(projectReportRecord.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(projectReportRecord.getId(),
+						.saveNewNotify(projectReportRecord.getId(),
 								new User(),
 								projectReportRecord.getCompanyId(),
 								title,
@@ -1945,7 +1973,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 								"103",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								reportRecord.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -1976,7 +2005,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(projectReportRecord.getId(),
+									.saveNewNotify(projectReportRecord.getId(),
 											projectReportRecord.getCreateBy(),
 											projectReportRecord.getCompanyId(),
 											title,
@@ -1984,7 +2013,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 											"103",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											reportRecord.getProcessInstanceId(),new Date()));
 					users.add( projectReportRecord.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {//驳回重新归档
@@ -1998,7 +2028,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						notify.setNotifyId(projectReportRecord.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(projectReportRecord.getId(),
+								.saveNewNotify(projectReportRecord.getId(),
 										new User(),
 										projectReportRecord.getCompanyId(),
 										title,
@@ -2006,7 +2036,8 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 										"103",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										reportRecord.getProcessInstanceId(),new Date());
 						users.addAll(auditUsers);
 						for (User user1 : users) {
 							workProjectNotify.setUser(user1);
@@ -2022,7 +2053,7 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 						users.add(projectReportRecord.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(projectReportRecord.getId(),
+										.saveNewNotify(projectReportRecord.getId(),
 												projectReportRecord.getCreateBy(),
 												projectReportRecord.getCompanyId(),
 												title,
@@ -2030,11 +2061,16 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 												"103",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												reportRecord.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),title);

+ 31 - 14
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java

@@ -22,7 +22,6 @@ import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
 import com.jeeplus.modules.projectreportnum.entity.ReportNum;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -856,6 +855,10 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
             projectRecords.setProcessInstanceId(processInstance.getId());
             projectRecords.setProjectStatus(ProjectStatusEnum.IN_APRL.getValue());
             dao.updateProcessIdAndStatus(projectRecords);
+			//通知添加流程实例ID
+			workProjectNotify.setProcessInstanceId(processInstance.getId());
+			workProjectNotify.setWapBeginDate(new Date());
+			workProjectNotifyService.save(workProjectNotify);
         }catch (Exception e){
             logger.error("启动审批流程异常:",e);
             throw e;
@@ -1048,6 +1051,11 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 				}
 			}
 		}
+
+
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(projectRecords.getProcessInstanceId());
+
 		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectRecords.getProcessInstanceId(),taskDefKey,"modifyApply",projectRecords.getAct().getFlag(),comment, activities);
 		// 设置意见
 		projectRecords.getAct().setComment(comment);
@@ -1072,7 +1080,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 						user2.setId(lds.get(i).getId());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(projectRecords.getId(),
+										.saveNewNotify(projectRecords.getId(),
 												/*projectRecords.getCreateBy(),*/
 												user2,
 												projectRecords.getCompany().getId(),
@@ -1081,7 +1089,8 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 												"39",
 												"0",
 												"待通知",
-												notifyRole));
+												notifyRole,
+												projectRecords.getProcessInstanceId(),new Date()));
 					}
 
 				}
@@ -1111,7 +1120,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 							user2.setId(lds.get(i).getId());
 							workProjectNotifyService
 									.save(UtilNotify
-											.saveNotify(projectRecords.getId(),
+											.saveNewNotify(projectRecords.getId(),
 													/*projectRecords.getCreateBy(),*/
 													user2,
 													projectRecords.getCompany().getId(),
@@ -1120,7 +1129,8 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 													"39",
 													"0",
 													"待通知",
-													notifyRole));
+													notifyRole,
+													projectRecords.getProcessInstanceId(),new Date()));
 						}
 
 					}
@@ -1134,7 +1144,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 				notify.setNotifyId(projectRecords.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(projectRecords.getId(),
+						.saveNewNotify(projectRecords.getId(),
 								new User(),
 								projectRecords.getCompany().getId(),
 								titleStr,
@@ -1142,7 +1152,8 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 								"39",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								projectRecords.getProcessInstanceId(),new Date());
 				String count = taskDefKey.replace("audit","").replace("task","");
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
@@ -1166,7 +1177,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					users.add(user);
 					WorkProjectNotify workProjectNotify = UtilNotify
-							.saveNotify(projectRecords.getId(),
+							.saveNewNotify(projectRecords.getId(),
 									user,
 									projectRecords.getCompany().getId(),
 									titleStr,
@@ -1174,7 +1185,8 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 									"39",
 									"0",
 									"重新申请",
-									notifyRole);
+									notifyRole,
+									projectRecords.getProcessInstanceId(),new Date());
 					workProjectNotifyService.save(workProjectNotify);
 				} else {
 					if (StringUtils.isNotBlank(enname)) {
@@ -1182,7 +1194,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 						notify.setNotifyId(projectRecords.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(projectRecords.getId(),
+								.saveNewNotify(projectRecords.getId(),
 										new User(),
 										projectRecords.getCompany().getId(),
 										titleStr,
@@ -1190,7 +1202,8 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 										"39",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										projectRecords.getProcessInstanceId(),new Date());
 						for (User user1:auditUsers){
 							users.add(user1);
 							workProjectNotify.setUser(user1);
@@ -1210,7 +1223,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 						users.add(projectRecords.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(projectRecords.getId(),
+										.saveNewNotify(projectRecords.getId(),
 												projectRecords.getCreateBy(),
 												projectRecords.getCompany().getId(),
 												titleStr,
@@ -1218,12 +1231,16 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 												"39",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												projectRecords.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
-
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			List<String> userIds = new ArrayList<>(users.size());
 			for (User u : users) {

+ 28 - 17
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/ProjectPaperFilingService.java

@@ -1,16 +1,12 @@
 package com.jeeplus.modules.ruralprojectrecords.service;
 
-import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.ruralprojectrecords.dao.ProjectPaperFilingDao;
-import com.jeeplus.modules.ruralprojectrecords.dao.RuralPeojectRecordChooseCheckDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.ProjectPaperFiling;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
@@ -25,7 +21,6 @@ import com.jeeplus.modules.workactivity.service.ActivityService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
-import com.jeeplus.modules.workcontent.web.WorkContentTypeController;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
@@ -185,6 +180,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
         dao.updateProcessIdAndStatus(paperFiling);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -400,6 +396,11 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
         // 设置意见
         act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
         paperFiling.preUpdate();
+
+        //查询当前流程信息
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(paperFiling.getProcessInstanceId());
+
+
         // 提交流程任务
         vars.put(exp, "yes".equals(flag) ? true : false);
         vars.put("passs", true);
@@ -422,7 +423,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 workProjectNotifyService
                         .save(UtilNotify
-                                .saveNotify(paperFiling.getId(),
+                                .saveNewNotify(paperFiling.getId(),
                                         paperFiling.getCreateBy(),
                                         paperFiling.getCompanyId(),
                                         title,
@@ -430,7 +431,8 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                         "110",
                                         "0",
                                         "待通知",
-                                        notifyRole));
+                                        notifyRole,
+                                        paperFiling.getProcessInstanceId(),new Date()));
 
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -440,7 +442,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                     paperFiling.setStatus(4);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(paperFiling.getId(),
+                                    .saveNewNotify(paperFiling.getId(),
                                             paperFiling.getCreateBy(),
                                             paperFiling.getCompanyId(),
                                             titleStr,
@@ -448,7 +450,8 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                             "110",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            paperFiling.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(paperFiling.getProcessInstanceId());
@@ -458,7 +461,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                 notify.setNotifyId(paperFiling.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(paperFiling.getId(),
+                        .saveNewNotify(paperFiling.getId(),
                                 new User(),
                                 paperFiling.getCompanyId(),
                                 titleStr,
@@ -466,7 +469,8 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                 "110",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                paperFiling.getProcessInstanceId(),new Date());
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
                         workProjectNotify,
@@ -500,7 +504,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(paperFiling.getId(),
+                                    .saveNewNotify(paperFiling.getId(),
                                             paperFiling.getCreateBy(),
                                             paperFiling.getCompanyId(),
                                             titleStr,
@@ -508,7 +512,8 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                             "110",
                                             "0",
                                             "重新申请",
-                                            notifyRole));
+                                            notifyRole,
+                                            paperFiling.getProcessInstanceId(),new Date()));
                     users.add( paperFiling.getCreateBy());
                 } else {
                     if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
@@ -518,7 +523,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                         notify.setNotifyId(paperFiling.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(paperFiling.getId(),
+                                .saveNewNotify(paperFiling.getId(),
                                         new User(),
                                         paperFiling.getCompanyId(),
                                         titleStr,
@@ -526,7 +531,8 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                         "110",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        paperFiling.getProcessInstanceId(),new Date());
                         users.addAll(auditUsers);
                         for (User user1 : users) {
                             workProjectNotify.setUser(user1);
@@ -550,7 +556,7 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                         users.add(paperFiling.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(paperFiling.getId(),
+                                        .saveNewNotify(paperFiling.getId(),
                                                 paperFiling.getCreateBy(),
                                                 paperFiling.getCompanyId(),
                                                 titleStr,
@@ -558,11 +564,16 @@ public class ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao
                                                 "110",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                paperFiling.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             for (User u : users) {
                 UserUtils.pushIm(u.getId(),titleStr);

+ 89 - 44
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java

@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
-import com.jeeplus.common.config.Global;
-import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.*;
@@ -26,7 +24,10 @@ import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectContentChangeDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
-import com.jeeplus.modules.projectcontentinfo.entity.*;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectMaterialDefectRecord;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
@@ -34,7 +35,6 @@ import com.jeeplus.modules.projectrecord.dao.ProjectPlanDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
-import com.jeeplus.modules.projectrecord.entity.ProjectReportedImport;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
@@ -42,7 +42,6 @@ import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsReportedDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.*;
-import com.jeeplus.modules.ruralprojectrecords.thread.ApprovalThread;
 import com.jeeplus.modules.ruralprojectrecords.thread.JudgementThread;
 import com.jeeplus.modules.ruralprojectrecords.utils.RuralProjectReportedInfoUtil;
 import com.jeeplus.modules.sys.dao.UserDao;
@@ -54,7 +53,6 @@ import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.tools.utils.HttpPostTool;
-import com.jeeplus.modules.tools.utils.SignaturePostUtil;
 import com.jeeplus.modules.utils.Aestool;
 import com.jeeplus.modules.utils.Rsatool;
 import com.jeeplus.modules.utils.SftpClientUtil;
@@ -84,7 +82,6 @@ import com.jeeplus.modules.workreview.service.WorkReviewStandardService;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import org.activiti.engine.ActivitiObjectNotFoundException;
@@ -919,6 +916,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         projectReportDataDao.updateProcessInstanceId(projectReportData);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -1324,6 +1322,9 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         // 设置意见
         act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
         projectReportData.preUpdate();
+
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(reportData.getProcessInstanceId());
+
         // 提交流程任务
         vars.put(exp, "yes".equals(flag) ? true : false);
         vars.put("passs", true);
@@ -1350,7 +1351,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 workProjectNotifyService
                         .save(UtilNotify
-                                .saveNotify(projectReportData.getId(),
+                                .saveNewNotify(projectReportData.getId(),
                                         projectReportData.getCreateBy(),
                                         projectReportData.getCompanyId(),
                                         titleStr,
@@ -1358,7 +1359,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                         "96",
                                         "0",
                                         "待通知",
-                                        notifyRole));
+                                        notifyRole,
+                                        reportData.getProcessInstanceId(),new Date()));
 
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -1368,7 +1370,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     projectReportData.setStatus("4");
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportData.getId(),
+                                    .saveNewNotify(projectReportData.getId(),
                                             projectReportData.getCreateBy(),
                                             projectReportData.getCompanyId(),
                                             title,
@@ -1376,7 +1378,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "96",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            reportData.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectReportData.getProcessInstanceId());
@@ -1386,7 +1389,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                 notify.setNotifyId(projectReportData.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(projectReportData.getId(),
+                        .saveNewNotify(projectReportData.getId(),
                                 new User(),
                                 projectReportData.getCompanyId(),
                                 title,
@@ -1394,7 +1397,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                 "96",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                reportData.getProcessInstanceId(),new Date());
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
                         workProjectNotify,
@@ -1439,7 +1443,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportData.getId(),
+                                    .saveNewNotify(projectReportData.getId(),
                                             projectReportData.getCreateBy(),
                                             projectReportData.getCompanyId(),
                                             title,
@@ -1447,7 +1451,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "96",
                                             "0",
                                             "重新申请",
-                                            notifyRole));
+                                            notifyRole,
+                                            reportData.getProcessInstanceId(),new Date()));
                     users.add( projectReportData.getCreateBy());
                 } else {
                     if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
@@ -1461,7 +1466,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         notify.setNotifyId(projectReportData.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(projectReportData.getId(),
+                                .saveNewNotify(projectReportData.getId(),
                                         new User(),
                                         projectReportData.getCompanyId(),
                                         title,
@@ -1469,7 +1474,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                         "96",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        reportData.getProcessInstanceId(),new Date());
                         users.addAll(auditUsers);
                         for (User user1 : users) {
                             workProjectNotify.setUser(user1);
@@ -1499,7 +1505,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         users.add(projectReportData.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(projectReportData.getId(),
+                                        .saveNewNotify(projectReportData.getId(),
                                                 projectReportData.getCreateBy(),
                                                 projectReportData.getCompanyId(),
                                                 title,
@@ -1507,11 +1513,16 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                 "96",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                reportData.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             for (User u : users) {
                 UserUtils.pushIm(u.getId(),title);
@@ -2322,6 +2333,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         projectReportDataDao.updateProcessInstanceId(projectReportData);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -2470,6 +2482,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         projectReportDataDao.updateProcessInstanceId(projectReportData);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -2995,7 +3008,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
 
     /**
      * 根据用户查询技能信息
-     * @param projectId
+     * @param userId
      * @return
      */
     public List<WorkStaffCertificate> getCertificateByUser(String userId){
@@ -3340,6 +3353,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         dao.updateDefectRecordProcessInstanceId(materialDefectRecord);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -3605,6 +3619,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         ruralProjectRecordsReportedDao.updateProcessIdAndStatus(reported);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
 
 
@@ -3854,6 +3869,9 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
             // 设置意见
             reported.getAct().setComment(("yes".equals(reported.getAct().getFlag()) ? "[同意] " : "[驳回] ") + reported.getAct().getComment());
             reported.preUpdate();
+
+            WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(reported.getProcessInstanceId());
+
             // 提交流程任务
             vars.put(exp, "yes".equals(reported.getAct().getFlag()) ? true : false);
             vars.put("passLv",true);
@@ -3876,7 +3894,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(reported.getId(),
+                                    .saveNewNotify(reported.getId(),
                                             reported.getCreateBy(),
                                             reported.getCompany().getId(),
                                             titleStr,
@@ -3884,7 +3902,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "98",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            reported.getProcessInstanceId(),new Date()));
 
                 } else {
                     WorkProjectNotify notify = new WorkProjectNotify();
@@ -3894,7 +3913,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         reported.setReportStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(reported.getId(),
+                                        .saveNewNotify(reported.getId(),
                                                 reported.getCreateBy(),
                                                 reported.getCompany().getId(),
                                                 title,
@@ -3902,7 +3921,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                 "98",
                                                 "0",
                                                 "待通知",
-                                                notifyRole));
+                                                notifyRole,
+                                                reported.getProcessInstanceId(),new Date()));
                     }
                 }
                 workActivityProcessService.deleteProcessIdAuditUsers(reported.getProcessInstanceId());
@@ -3913,7 +3933,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     //users.addAll(userList);
                     WorkProjectNotify workProjectNotify = UtilNotify
-                            .saveNotify(reported.getId(),
+                            .saveNewNotify(reported.getId(),
                                     new User(),
                                     reported.getCompany().getId(),
                                     title,
@@ -3921,7 +3941,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                     "98",
                                     "0",
                                     "待审批",
-                                    notifyRole);
+                                    notifyRole,
+                                    reported.getProcessInstanceId(),new Date());
                     List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                             activities,
                             workProjectNotify,
@@ -3949,7 +3970,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         //users.addAll(userList);
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(reported.getId(),
+                                        .saveNewNotify(reported.getId(),
                                                 reported.getCreateBy(),
                                                 reported.getCompany().getId(),
                                                 title,
@@ -3957,7 +3978,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                 "98",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                reported.getProcessInstanceId(),new Date()));
                         users.add( reported.getCreateBy());
                     } else {
                         if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
@@ -3968,7 +3990,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                             userList = workProjectNotifyService.readByNotifyId(notify);
                             //users.addAll(userList1);
                             WorkProjectNotify workProjectNotify = UtilNotify
-                                    .saveNotify(reported.getId(),
+                                    .saveNewNotify(reported.getId(),
                                             new User(),
                                             reported.getCompany().getId(),
                                             title,
@@ -3976,7 +3998,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "98",
                                             "0",
                                             "待审批",
-                                            notifyRole);
+                                            notifyRole,
+                                            reported.getProcessInstanceId(),new Date());
                             users.addAll(auditUsers);
                             for (User user1:auditUsers){
                                 workProjectNotify.setUser(user1);
@@ -3996,7 +4019,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                             users.add(reported.getCreateBy());
                             workProjectNotifyService
                                     .save(UtilNotify
-                                            .saveNotify(reported.getId(),
+                                            .saveNewNotify(reported.getId(),
                                                     reported.getCreateBy(),
                                                     reported.getCompany().getId(),
                                                     title,
@@ -4004,11 +4027,16 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                     "98",
                                                     "0",
                                                     "重新申请",
-                                                    notifyRole));
+                                                    notifyRole,
+                                                    reported.getProcessInstanceId(),new Date()));
                         }
                     }
                 }
             }
+            //对数据进行处理
+            if(null != nowWorkProjectNotify){
+                workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+            }
             if (StringUtils.isNotBlank(title) && users!=null && users.size()!=0) {
                 for (User u : users) {
                     UserUtils.pushIm(u.getId(),title);
@@ -4474,6 +4502,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         ruralProjectRecordsReportedDao.updateProcessIdAndStatus(reported);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
 
         return "";
@@ -4688,6 +4717,10 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
             // 设置意见
             reported.getAct().setComment(("yes".equals(reported.getAct().getFlag()) ? "[同意] " : "[驳回] ") + reported.getAct().getComment());
             reported.preUpdate();
+
+            //查询当前流程信息
+            WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(reported.getProcessInstanceId());
+
             // 提交流程任务
             vars.put(exp, "yes".equals(reported.getAct().getFlag()) ? true : false);
             vars.put("passLv",true);
@@ -4710,7 +4743,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(reported.getId(),
+                                    .saveNewNotify(reported.getId(),
                                             reported.getCreateBy(),
                                             reported.getCompany().getId(),
                                             titleStr,
@@ -4718,7 +4751,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "218",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            reported.getProcessInstanceId(),new Date()));
 
                 } else {
                     WorkProjectNotify notify = new WorkProjectNotify();
@@ -4728,7 +4762,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         reported.setReportStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(reported.getId(),
+                                        .saveNewNotify(reported.getId(),
                                                 reported.getCreateBy(),
                                                 reported.getCompany().getId(),
                                                 title,
@@ -4736,7 +4770,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                 "218",
                                                 "0",
                                                 "待通知",
-                                                notifyRole));
+                                                notifyRole,
+                                                reported.getProcessInstanceId(),new Date()));
                     }
                 }
                 workActivityProcessService.deleteProcessIdAuditUsers(reported.getProcessInstanceId());
@@ -4747,7 +4782,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     //users.addAll(userList);
                     WorkProjectNotify workProjectNotify = UtilNotify
-                            .saveNotify(reported.getId(),
+                            .saveNewNotify(reported.getId(),
                                     new User(),
                                     reported.getCompany().getId(),
                                     title,
@@ -4755,7 +4790,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                     "218",
                                     "0",
                                     "待审批",
-                                    notifyRole);
+                                    notifyRole,
+                                    reported.getProcessInstanceId(),new Date());
                     List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                             activities,
                             workProjectNotify,
@@ -4783,7 +4819,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         //users.addAll(userList);
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(reported.getId(),
+                                        .saveNewNotify(reported.getId(),
                                                 reported.getCreateBy(),
                                                 reported.getCompany().getId(),
                                                 title,
@@ -4791,7 +4827,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                 "218",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                reported.getProcessInstanceId(),new Date()));
                         users.add( reported.getCreateBy());
                     } else {
                         if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
@@ -4802,7 +4839,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                             userList = workProjectNotifyService.readByNotifyId(notify);
                             //users.addAll(userList1);
                             WorkProjectNotify workProjectNotify = UtilNotify
-                                    .saveNotify(reported.getId(),
+                                    .saveNewNotify(reported.getId(),
                                             new User(),
                                             reported.getCompany().getId(),
                                             title,
@@ -4810,7 +4847,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                             "218",
                                             "0",
                                             "待审批",
-                                            notifyRole);
+                                            notifyRole,
+                                            reported.getProcessInstanceId(),new Date());
                             users.addAll(auditUsers);
                             for (User user1:auditUsers){
                                 workProjectNotify.setUser(user1);
@@ -4830,7 +4868,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                             users.add(reported.getCreateBy());
                             workProjectNotifyService
                                     .save(UtilNotify
-                                            .saveNotify(reported.getId(),
+                                            .saveNewNotify(reported.getId(),
                                                     reported.getCreateBy(),
                                                     reported.getCompany().getId(),
                                                     title,
@@ -4838,11 +4876,18 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                                     "218",
                                                     "0",
                                                     "重新申请",
-                                                    notifyRole));
+                                                    notifyRole,
+                                                    reported.getProcessInstanceId(),new Date()));
                         }
                     }
                 }
             }
+
+            //对数据进行处理
+            if(null != nowWorkProjectNotify){
+                workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+            }
+
             if (StringUtils.isNotBlank(title) && users!=null && users.size()!=0) {
                 for (User u : users) {
                     UserUtils.pushIm(u.getId(),title);

+ 27 - 15
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewTwoService.java

@@ -14,7 +14,6 @@ import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchDao;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingbatchRelationDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectContentChangeDao;
-import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataTwoDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -50,7 +49,6 @@ import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.workcontent.web.WorkContentTypeController;
@@ -571,6 +569,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
         projectReportDataDao.updateProcessInstanceId(projectReportData);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -597,7 +596,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
     }
     /**
      * 根据用户查询技能信息
-     * @param projectId
+     * @param userId
      * @return
      */
     public List<WorkStaffCertificate> getCertificateByUser(String userId){
@@ -769,6 +768,9 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
         // 设置意见
         act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
         projectReportData.preUpdate();
+
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(projectReportData.getProcessInstanceId());
+
         // 提交流程任务
         vars.put(exp, "yes".equals(flag) ? true : false);
         vars.put("passs", true);
@@ -794,7 +796,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 workProjectNotifyService
                         .save(UtilNotify
-                                .saveNotify(projectReportData.getId(),
+                                .saveNewNotify(projectReportData.getId(),
                                         projectReportData.getCreateBy(),
                                         projectReportData.getCompanyId(),
                                         titleStr,
@@ -802,7 +804,8 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                         "97",
                                         "0",
                                         "待通知",
-                                        notifyRole));
+                                        notifyRole,
+                                        projectReportData.getProcessInstanceId(),new Date()));
 
             } else {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -812,7 +815,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                     projectReportData.setStatus("4");
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportData.getId(),
+                                    .saveNewNotify(projectReportData.getId(),
                                             projectReportData.getCreateBy(),
                                             projectReportData.getCompanyId(),
                                             title,
@@ -820,7 +823,8 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                             "97",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            projectReportData.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectReportData.getProcessInstanceId());
@@ -830,7 +834,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                 notify.setNotifyId(projectReportData.getId());
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(projectReportData.getId(),
+                        .saveNewNotify(projectReportData.getId(),
                                 new User(),
                                 projectReportData.getCompanyId(),
                                 title,
@@ -838,7 +842,8 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                 "97",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                projectReportData.getProcessInstanceId(),new Date());
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
                         workProjectNotify,
@@ -883,7 +888,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                     userList = workProjectNotifyService.readByNotifyId(notify);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(projectReportData.getId(),
+                                    .saveNewNotify(projectReportData.getId(),
                                             projectReportData.getCreateBy(),
                                             projectReportData.getCompanyId(),
                                             title,
@@ -891,7 +896,8 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                             "97",
                                             "0",
                                             "重新申请",
-                                            notifyRole));
+                                            notifyRole,
+                                            projectReportData.getProcessInstanceId(),new Date()));
                     users.add( projectReportData.getCreateBy());
                 } else {
                     if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
@@ -905,7 +911,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                         notify.setNotifyId(projectReportData.getId());
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(projectReportData.getId(),
+                                .saveNewNotify(projectReportData.getId(),
                                         new User(),
                                         projectReportData.getCompanyId(),
                                         title,
@@ -913,7 +919,8 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                         "97",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        projectReportData.getProcessInstanceId(),new Date());
                         users.addAll(auditUsers);
                         for (User user1 : users) {
                             workProjectNotify.setUser(user1);
@@ -943,7 +950,7 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                         users.add(projectReportData.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(projectReportData.getId(),
+                                        .saveNewNotify(projectReportData.getId(),
                                                 projectReportData.getCreateBy(),
                                                 projectReportData.getCompanyId(),
                                                 title,
@@ -951,11 +958,16 @@ public class RuralProjectMessageNewTwoService extends CrudService<RuralProjectMe
                                                 "97",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                projectReportData.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             for (User u : users) {
                 UserUtils.pushIm(u.getId(),title);

+ 2 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -51,7 +51,6 @@ import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
-import com.jeeplus.modules.tools.utils.HttpPostTest;
 import com.jeeplus.modules.tools.utils.HttpPostTool;
 import com.jeeplus.modules.tools.utils.SignaturePostUtil;
 import com.jeeplus.modules.utils.Aestool;
@@ -86,6 +85,7 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.IdentityService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -94,10 +94,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.text.SimpleDateFormat;
-import org.apache.commons.codec.binary.Base64;
 import java.util.*;
 
 /**
@@ -1856,6 +1853,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         dao.updateProcessInstanceId(projectReportRecord);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {

+ 1 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordTwoService.java

@@ -367,6 +367,7 @@ public class RuralProjectRecordTwoService  extends CrudService<RuralProjectMessa
         dao.updateProcessInstanceId(projectReportRecord);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {

+ 16 - 14
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -3,9 +3,6 @@
  */
 package com.jeeplus.modules.ruralprojectrecords.service;
 
-import com.alibaba.fastjson.JSON;
-import com.github.junrar.Archive;
-import com.github.junrar.rarfile.FileHeader;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.bos.BOSClientUtil;
@@ -13,7 +10,10 @@ import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.common.utils.*;
+import com.jeeplus.common.utils.Collections3;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ProcessDefCache;
@@ -23,9 +23,7 @@ import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchImportInfo;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataTwoDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
@@ -33,21 +31,18 @@ import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
-import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
 import com.jeeplus.modules.projectrecord.dao.ProjectPlanDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
-import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
-import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
-import com.jeeplus.modules.ruralprojectrecords.entity.*;
+import com.jeeplus.modules.ruralprojectrecords.entity.ImportBRuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
-import com.jeeplus.modules.ruralprojectrecords.utils.ImportExcelUtil;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
-import com.jeeplus.modules.statement.entity.ReportDataEntity;
 import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
 import com.jeeplus.modules.sys.dao.UserDao;
@@ -98,14 +93,12 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.math.BigDecimal;
 import java.net.URI;
 import java.net.URLEncoder;
 import java.nio.charset.Charset;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
@@ -4137,6 +4130,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		dao.updateProcessInstanceId(records);  //根据项目id去更新实例id
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 
 		List<Activity> list = workActivityMenu.getActivities();
@@ -4345,6 +4339,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				}
 			}
 		}
+
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(records.getProcessInstanceId());
+
 		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,records.getProcessInstanceId(),taskDefKey,"modifyApply",records.getAct().getFlag(),comment, activities);
 		// 设置意见  comment上已配置
 		records.getAct().setComment(comment);
@@ -4513,6 +4511,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			}
 		}
 
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			List<String> userIds = new ArrayList<>(users.size());
 			for (User u : users) {

+ 1 - 8
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/ProjectPaperFilingController.java

@@ -1,6 +1,5 @@
 package com.jeeplus.modules.ruralprojectrecords.web;
 
-import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
@@ -9,8 +8,6 @@ import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
-import com.jeeplus.modules.projectcontentinfo.entity.ProjectMaterialDefectRecord;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
@@ -19,9 +16,7 @@ import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.ruralprojectrecords.entity.ProjectPaperFiling;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.ProjectPaperFilingService;
-import com.jeeplus.modules.ruralprojectrecords.service.RuralPeojectRecordChooseCheckAllService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
@@ -34,8 +29,6 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
-import org.apache.shiro.authz.annotation.Logical;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -229,7 +222,7 @@ public class ProjectPaperFilingController extends BaseController {
                 addMessage(redirectAttributes, str);
             }
         }catch (Exception e){
-            addMessage(redirectAttributes, "选查项目流程审批失败");
+            addMessage(redirectAttributes, "线下归档流程审批失败");
             logger.error("Exception e:"+e);
         }
 

+ 2 - 0
src/main/java/com/jeeplus/modules/workactivity/dao/WorkActivityProcessDao.java

@@ -22,6 +22,8 @@ public interface WorkActivityProcessDao extends CrudDao<WorkActivityProcess> {
     List<WorkActivityProcess> findByProcInsId(WorkActivityProcess workActivityProcess);
     List<WorkActivityProcess> findByProcInsIdAudit(WorkActivityProcess workActivityProcess);
     List<WorkActivityProcess> findByProcInsIdAndIsApproval(WorkActivityProcess workActivityProcess);
+    List<WorkActivityProcess> findByProcInsIdAndIsApprovalOnList(WorkActivityProcess workActivityProcess);
+    List<WorkActivityProcess> getByProcessInstanceId(@Param("processInstanceId")String processInstanceId);
     int delFlag(WorkActivityProcess workActivityProcess);
     int deleteByAudit(WorkActivityProcess workActivityProcess);
     int deleteProcessIdAuditUsers(@Param("processInstanceId")String processInstanceId);

+ 12 - 7
src/main/java/com/jeeplus/modules/workactivity/service/WorkActivityProcessService.java

@@ -3,21 +3,20 @@
  */
 package com.jeeplus.modules.workactivity.service;
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcessUser;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.service.CrudService;
-import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
-import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 工作流审批信息Service
@@ -47,6 +46,12 @@ public class WorkActivityProcessService extends CrudService<WorkActivityProcessD
 	public List<WorkActivityProcess> findByProcInsIdAndIsApproval(WorkActivityProcess workActivityProcess) {
 		return dao.findByProcInsIdAndIsApproval(workActivityProcess);
 	}
+	public List<WorkActivityProcess> findByProcInsIdAndIsApprovalOnList(WorkActivityProcess workActivityProcess) {
+		return dao.findByProcInsIdAndIsApprovalOnList(workActivityProcess);
+	}
+	public List<WorkActivityProcess> getByProcessInstanceId(String processInstanceId) {
+		return dao.getByProcessInstanceId(processInstanceId);
+	}
 
 	public Page<WorkActivityProcess> findPage(Page<WorkActivityProcess> page, WorkActivityProcess workActivityProcess) {
 		return super.findPage(page, workActivityProcess);

+ 18 - 10
src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractBorrowService.java

@@ -21,13 +21,9 @@ import com.jeeplus.modules.workactivity.service.ActivityService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
-import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workcontractinfo.dao.WorkContractBorrowDao;
 import com.jeeplus.modules.workcontractinfo.entity.WorkCntractBorrow;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
-import com.jeeplus.modules.workcontractrecord.dao.WorkContractRecordDao;
-import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
@@ -212,6 +208,7 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 		dao.updateProcessInstanceId(workCntractBorrow);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 			List<Activity> list = workActivityMenu.getActivities();
 			if (list != null && list.size() != 0) {
@@ -377,10 +374,14 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 				}
 			}
 		Boolean state = null;
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workCntractBorrow.getProcessInstanceId());
+
 		if("yes".equals(workCntractBorrow.getAct().getFlag())){
 				// 设置意见
 				workCntractBorrow.getAct().setComment(("yes".equals(workCntractBorrow.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workCntractBorrow.getAct().getComment());
 				workCntractBorrow.preUpdate();
+
 				// 提交流程任务
 				vars.put(exp, "yes".equals(workCntractBorrow.getAct().getFlag()) ? true : false);
 				vars.put("passs", true);
@@ -450,7 +451,7 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workCntractBorrow.getId(),
+									.saveNewNotify(workCntractBorrow.getId(),
 											workCntractBorrow.getCreateBy(),
 											workCntractBorrow.getCompanyId(),
 											title,
@@ -458,7 +459,8 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 											"93",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workCntractBorrow.getProcessInstanceId(),new Date()));
 
 				} else {
 					WorkProjectNotify notify = new WorkProjectNotify();
@@ -468,7 +470,7 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 						workCntractBorrow.setStatus("4");
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workCntractBorrow.getId(),
+										.saveNewNotify(workCntractBorrow.getId(),
 												workCntractBorrow.getCreateBy(),
 												workCntractBorrow.getCompanyId(),
 												title,
@@ -476,7 +478,8 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 												"93",
 												"0",
 												"待通知",
-												notifyRole));
+												notifyRole,
+												workCntractBorrow.getProcessInstanceId(),new Date()));
 					}
 				}
 				workActivityProcessService.deleteProcessIdAuditUsers(workCntractBorrow.getProcessInstanceId());
@@ -496,7 +499,7 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(workCntractBorrow.getId(),
+								.saveNewNotify(workCntractBorrow.getId(),
 										workCntractBorrow.getCreateBy(),
 										workCntractBorrow.getCompanyId(),
 										title,
@@ -504,8 +507,13 @@ public class WorkContractBorrowService extends CrudService<WorkContractBorrowDao
 										"93",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										workCntractBorrow.getProcessInstanceId(),new Date()));
 			}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 			if (users!=null && users.size()!=0) {
 				for (User u : users) {
 					UserUtils.pushIm(u.getId(),str);

+ 1 - 0
src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoService.java

@@ -994,6 +994,7 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
 		workContractInfoDao.updateProcessInstanceId(workContractInfo);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 
 		List<Activity> list = workActivityMenu.getActivities();

+ 27 - 12
src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoTookDisposeService.java

@@ -351,6 +351,11 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 		// 设置意见
 		workContractInfo.getAct().setComment(("yes".equals(workContractInfo.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workContractInfo.getAct().getComment());
 		workContractInfo.preUpdate();
+
+
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workContractInfo.getProcessInstanceId());
+
 		// 提交流程任务
 		vars.put(exp, "yes".equals(workContractInfo.getAct().getFlag())? true : false);
 		vars.put("passs", true);
@@ -376,7 +381,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(workContractInfo.getId(),
+								.saveNewNotify(workContractInfo.getId(),
 										workContractInfo.getCreateBy(),
 										workContractInfo.getCompanyId(),
 										titleStr,
@@ -384,7 +389,8 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 										"143",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										workContractInfo.getProcessInstanceId(),new Date()));
 				/*for (User user : zjlList) {
 					workProjectNotifyService
 							.save(UtilNotify
@@ -418,7 +424,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 					workContractInfo.setContractState("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workContractInfo.getId(),
+									.saveNewNotify(workContractInfo.getId(),
 											workContractInfo.getCreateBy(),
 											workContractInfo.getCompanyId(),
 											title,
@@ -426,7 +432,8 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 											"143",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workContractInfo.getProcessInstanceId(),new Date()));
 					/*for (User user : zjlList) {
 						workProjectNotifyService
 								.save(UtilNotify
@@ -450,7 +457,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				//users.addAll(userList);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(workContractInfo.getId(),
+						.saveNewNotify(workContractInfo.getId(),
 								new User(),
 								workContractInfo.getCompanyId(),
 								title,
@@ -458,7 +465,8 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 								"143",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								workContractInfo.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -498,7 +506,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 					//users.addAll(userList);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workContractInfo.getId(),
+									.saveNewNotify(workContractInfo.getId(),
 											workContractInfo.getCreateBy(),
 											workContractInfo.getCompanyId(),
 											title,
@@ -506,7 +514,8 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 											"143",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											workContractInfo.getProcessInstanceId(),new Date()));
 					users.add( workContractInfo.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办展示
@@ -517,7 +526,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						//users.addAll(userList1);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(workContractInfo.getId(),
+								.saveNewNotify(workContractInfo.getId(),
 										new User(),
 										workContractInfo.getCompanyId(),
 										title,
@@ -525,7 +534,8 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 										"143",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										workContractInfo.getProcessInstanceId(),new Date());
 						users.addAll(auditUsers);
 						for (User user1:auditUsers){
 							workProjectNotify.setUser(user1);
@@ -554,7 +564,7 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 						users.add(workContractInfo.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workContractInfo.getId(),
+										.saveNewNotify(workContractInfo.getId(),
 												workContractInfo.getCreateBy(),
 												workContractInfo.getCompanyId(),
 												title,
@@ -562,11 +572,16 @@ public class WorkContractInfoTookDisposeService extends CrudService<WorkContract
 												"143",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workContractInfo.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),str);

+ 33 - 30
src/main/java/com/jeeplus/modules/workcontractrecord/service/WorkContractRecordService.java

@@ -3,24 +3,17 @@
  */
 package com.jeeplus.modules.workcontractrecord.service;
 
-import java.util.*;
-
-import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.jeeplus.common.config.Global;
-import com.jeeplus.common.oss.OSSClientUtil;
-import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
-import com.jeeplus.common.websocket.onchat.ChatServerPool;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
-import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -34,8 +27,10 @@ import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
-import com.jeeplus.modules.workcontractinfo.dao.WorkContractInfoDao;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import com.jeeplus.modules.workcontractrecord.dao.WorkContractRecordDao;
+import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
@@ -43,16 +38,11 @@ import org.activiti.engine.ActivitiObjectNotFoundException;
 import org.activiti.engine.IdentityService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
-import org.java_websocket.WebSocket;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
-import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.service.CrudService;
-import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
-import com.jeeplus.modules.workcontractrecord.dao.WorkContractRecordDao;
+import java.util.*;
 
 /**
  * 合同归档Service
@@ -417,8 +407,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 		workProjectNotify.preInsert();
 		workProjectNotify.setCreateBy(user);
 		workProjectNotify.setUpdateBy(user);
-
-		workProjectNotifyService.insert(workProjectNotify);
+		workProjectNotify.setWapBeginDate(new Date());
+		workProjectNotifyService.save(workProjectNotify);
 			List<Activity> list = workActivityMenu.getActivities();
 			if (list != null && list.size() != 0) {
 				workActivityProcessService.saveList(list, processInstance.getId());
@@ -610,6 +600,9 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 			// 设置意见
 			workContractRecord.getAct().setComment(("yes".equals(workContractRecord.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workContractRecord.getAct().getComment());
 			workContractRecord.preUpdate();
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workContractRecord.getProcessInstanceId());
+
 			// 提交流程任务
 			vars.put(exp, "yes".equals(workContractRecord.getAct().getFlag()) ? true : false);
 		    vars.put("passs", true);
@@ -631,7 +624,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workContractRecord.getId(),
+									.saveNewNotify(workContractRecord.getId(),
 											workContractRecord.getCreateBy(),
 											workContractRecord.getCompanyId(),
 											title,
@@ -639,7 +632,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 											"42",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workContractRecord.getProcessInstanceId(),new Date()));
 					//归档中状态
 					if(workContractRecord.getWorkContractInfo()!=null){
 						if(StringUtils.isNotBlank(workContractRecord.getWorkContractInfo().getId())){
@@ -662,7 +656,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 						workContractRecord.setStatus("4");
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workContractRecord.getId(),
+										.saveNewNotify(workContractRecord.getId(),
 												workContractRecord.getCreateBy(),
 												workContractRecord.getCompanyId(),
 												title,
@@ -670,7 +664,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 												"42",
 												"0",
 												"待通知",
-												notifyRole));
+												notifyRole,
+												workContractRecord.getProcessInstanceId(),new Date()));
 					}
 				}
 				workActivityProcessService.deleteProcessIdAuditUsers(workContractRecord.getProcessInstanceId());
@@ -680,7 +675,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 					notify.setNotifyId(workContractRecord.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					WorkProjectNotify workProjectNotify = UtilNotify
-							.saveNotify(workContractRecord.getId(),
+							.saveNewNotify(workContractRecord.getId(),
 									new User(),
 									workContractRecord.getCompanyId(),
 									title,
@@ -688,7 +683,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 									"42",
 									"0",
 									"待审批",
-									notifyRole);
+									notifyRole,
+									workContractRecord.getProcessInstanceId(),new Date());
 					List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 							activities,
 							workProjectNotify,
@@ -723,7 +719,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workContractRecord.getId(),
+										.saveNewNotify(workContractRecord.getId(),
 												workContractRecord.getCreateBy(),
 												workContractRecord.getCompanyId(),
 												title,
@@ -731,7 +727,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 												"42",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workContractRecord.getProcessInstanceId(),new Date()));
 						users.add( workContractRecord.getCreateBy());
 						//归档中状态
 						if(workContractRecord.getWorkContractInfo()!=null){
@@ -749,7 +746,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 							notify.setNotifyId(workContractRecord.getId());
 							userList = workProjectNotifyService.readByNotifyId(notify);
 							WorkProjectNotify workProjectNotify = UtilNotify
-									.saveNotify(workContractRecord.getId(),
+									.saveNewNotify(workContractRecord.getId(),
 											new User(),
 											workContractRecord.getCompanyId(),
 											title,
@@ -757,7 +754,8 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 											"42",
 											"0",
 											"待审批",
-											notifyRole);
+											notifyRole,
+											workContractRecord.getProcessInstanceId(),new Date());
 							for (User user1:auditUsers){
 								users.add(user1);
 								workProjectNotify.setUser(user1);
@@ -782,7 +780,7 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 							users.add(workContractRecord.getCreateBy());
 							workProjectNotifyService
 									.save(UtilNotify
-											.saveNotify(workContractRecord.getId(),
+											.saveNewNotify(workContractRecord.getId(),
 													workContractRecord.getCreateBy(),
 													workContractRecord.getCompanyId(),
 													title,
@@ -790,11 +788,16 @@ public class WorkContractRecordService extends CrudService<WorkContractRecordDao
 													"42",
 													"0",
 													"重新申请",
-													notifyRole));
+													notifyRole,
+													workContractRecord.getProcessInstanceId(),new Date()));
 						}
 					}
 				}
 			}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 			if (users!=null && users.size()!=0) {
 				for (User u : users) {
 					UserUtils.pushIm(u.getId(),str);

+ 52 - 29
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java

@@ -36,7 +36,6 @@ import com.jeeplus.modules.workbidproject.entity.WorkBidProject;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workinvoice.dao.WorkInvoiceDao;
 import com.jeeplus.modules.workinvoice.dao.WorkInvoiceReceiptDao;
@@ -58,10 +57,7 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 开票管理Service
@@ -653,6 +649,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 		workInvoiceDao.updateProcessInstanceId(workInvoice);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 		List<Activity> list = workActivityMenu.getActivities();
 		long s11=System.currentTimeMillis();
@@ -934,6 +931,9 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 		// 设置意见
 		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
 		workInvoice.preUpdate();
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workInvoice.getProcessInstanceId());
+
 		// 提交流程任务
 		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
 		vars.put("passs", true);
@@ -954,7 +954,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(workInvoice.getId(),
+								.saveNewNotify(workInvoice.getId(),
 										workInvoice.getCreateBy(),
 										workInvoice.getCompanyId(),
 										title,
@@ -962,7 +962,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 										"21",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										workInvoice.getProcessInstanceId(),new Date()));
 
 			} else {
 				WorkProjectNotify notify = new WorkProjectNotify();
@@ -972,7 +973,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 					workInvoice.setInvoiceState("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -980,7 +981,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 											"21",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date()));
 				}
 			}
 			workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
@@ -990,7 +992,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(workInvoice.getId(),
+						.saveNewNotify(workInvoice.getId(),
 								new User(),
 								workInvoice.getCompanyId(),
 								title,
@@ -998,7 +1000,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 								"21",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								workInvoice.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -1034,7 +1037,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1042,7 +1045,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 											"21",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date()));
 					users.add( workInvoice.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {
@@ -1050,7 +1054,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 						notify.setNotifyId(workInvoice.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(workInvoice.getId(),
+								.saveNewNotify(workInvoice.getId(),
 										new User(),
 										workInvoice.getCompanyId(),
 										title,
@@ -1058,7 +1062,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 										"21",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										workInvoice.getProcessInstanceId(),new Date());
 
 						for (User user1:auditUsers){
 							users.add(user1);
@@ -1087,7 +1092,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 						users.add(workInvoice.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1095,11 +1100,16 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 												"21",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),str);
@@ -1302,6 +1312,9 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 			// 设置意见
 			workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
 			workInvoice.preUpdate();
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workInvoice.getProcessInstanceId());
+
 			// 提交流程任务
 			vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
 		    vars.put("passs", true);
@@ -1323,7 +1336,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1331,7 +1344,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 											"21",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(), new Date()));
 
 				} else {
 					WorkProjectNotify notify = new WorkProjectNotify();
@@ -1341,7 +1355,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 						workInvoice.setInvoiceState("4");
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1349,7 +1363,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 												"21",
 												"0",
 												"待通知",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(), new Date()));
 					}
 				}
 				workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
@@ -1359,7 +1374,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 					notify.setNotifyId(workInvoice.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					WorkProjectNotify workProjectNotify = UtilNotify
-							.saveNotify(workInvoice.getId(),
+							.saveNewNotify(workInvoice.getId(),
 									new User(),
 									workInvoice.getCompanyId(),
 									title,
@@ -1367,7 +1382,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 									"21",
 									"0",
 									"待审批",
-									notifyRole);
+									notifyRole,
+									workInvoice.getProcessInstanceId(), new Date());
 					List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 							activities,
 							workProjectNotify,
@@ -1406,7 +1422,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1414,7 +1430,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 												"21",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(), new Date()));
 						users.add( workInvoice.getCreateBy());
 					} else {
 						if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
@@ -1424,7 +1441,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 							notify.setNotifyId(workInvoice.getId());
 							userList = workProjectNotifyService.readByNotifyId(notify);
 							WorkProjectNotify workProjectNotify = UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											new User(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1432,7 +1449,8 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 											"21",
 											"0",
 											"待审批",
-											notifyRole);
+											notifyRole,
+											workInvoice.getProcessInstanceId(), new Date());
 							for (User user1:auditUsers){
 								users.add(user1);
 								workProjectNotify.setUser(user1);
@@ -1461,7 +1479,7 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 							users.add(workInvoice.getCreateBy());
 							workProjectNotifyService
 									.save(UtilNotify
-											.saveNotify(workInvoice.getId(),
+											.saveNewNotify(workInvoice.getId(),
 													workInvoice.getCreateBy(),
 													workInvoice.getCompanyId(),
 													title,
@@ -1469,11 +1487,16 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 													"21",
 													"0",
 													"重新申请",
-													notifyRole));
+													notifyRole,
+													workInvoice.getProcessInstanceId(), new Date()));
 						}
 					}
 				}
 			}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 			if (users!=null && users.size()!=0) {
 				for (User u : users) {
 					UserUtils.pushIm(u.getId(),str);

+ 52 - 31
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -10,11 +10,8 @@ import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
-import com.jeeplus.common.websocket.onchat.ChatServerPool;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
-import com.jeeplus.modules.oa.entity.OaNotify;
-import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
@@ -29,7 +26,6 @@ import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.AreaService;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
-import com.jeeplus.modules.sys.utils.RoleActivityEnname;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
@@ -42,7 +38,6 @@ import com.jeeplus.modules.workbidproject.entity.WorkBidProject;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workinvoice.dao.WorkInvoiceDao;
 import com.jeeplus.modules.workinvoice.dao.WorkInvoiceReceiptDao;
@@ -59,13 +54,11 @@ import org.activiti.engine.*;
 import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
-import org.java_websocket.WebSocket;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.text.DecimalFormat;
 import java.util.*;
 
 /**
@@ -755,6 +748,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			workInvoiceDao.updateProcessInstanceId(workInvoice);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 			List<Activity> list = workActivityMenu.getActivities();
 		long s11=System.currentTimeMillis();
@@ -926,6 +920,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		workInvoiceDao.updateProcessInstanceId(workInvoice);
 		//通知添加流程实例ID
 		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
 		workProjectNotifyService.save(workProjectNotify);
 		List<Activity> list = workActivityMenu.getActivities();
 		long s11=System.currentTimeMillis();
@@ -1151,6 +1146,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		// 设置意见
 		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
 		workInvoice.preUpdate();
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workInvoice.getProcessInstanceId());
+
 		// 提交流程任务
 		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
 		vars.put("passs", true);
@@ -1171,7 +1169,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				workProjectNotifyService
 						.save(UtilNotify
-								.saveNotify(workInvoice.getId(),
+								.saveNewNotify(workInvoice.getId(),
 										workInvoice.getCreateBy(),
 										workInvoice.getCompanyId(),
 										title,
@@ -1179,7 +1177,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 										"21",
 										"0",
 										"待通知",
-										notifyRole));
+										notifyRole,
+										workInvoice.getProcessInstanceId(),new Date()));
 
 			} else {
 				WorkProjectNotify notify = new WorkProjectNotify();
@@ -1189,7 +1188,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					workInvoice.setInvoiceState("4");
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1197,7 +1196,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 											"21",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date()));
 				}
 			}
 			workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
@@ -1207,7 +1207,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
 				WorkProjectNotify workProjectNotify = UtilNotify
-						.saveNotify(workInvoice.getId(),
+						.saveNewNotify(workInvoice.getId(),
 								new User(),
 								workInvoice.getCompanyId(),
 								title,
@@ -1215,7 +1215,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 								"21",
 								"0",
 								"待审批",
-								notifyRole);
+								notifyRole,
+								workInvoice.getProcessInstanceId(),new Date());
 				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 						activities,
 						workProjectNotify,
@@ -1251,7 +1252,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1259,7 +1260,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 											"21",
 											"0",
 											"重新申请",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date()));
 					users.add( workInvoice.getCreateBy());
 				} else {
 					if (StringUtils.isNotBlank(enname)) {
@@ -1267,7 +1269,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 						notify.setNotifyId(workInvoice.getId());
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						WorkProjectNotify workProjectNotify = UtilNotify
-								.saveNotify(workInvoice.getId(),
+								.saveNewNotify(workInvoice.getId(),
 										new User(),
 										workInvoice.getCompanyId(),
 										title,
@@ -1275,7 +1277,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 										"21",
 										"0",
 										"待审批",
-										notifyRole);
+										notifyRole,
+										workInvoice.getProcessInstanceId(),new Date());
 
 						for (User user1:auditUsers){
 							users.add(user1);
@@ -1304,7 +1307,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 						users.add(workInvoice.getCreateBy());
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1312,11 +1315,16 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 												"21",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(),new Date()));
 					}
 				}
 			}
 		}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 		if (users!=null && users.size()!=0) {
 			for (User u : users) {
 				UserUtils.pushIm(u.getId(),str);
@@ -1491,6 +1499,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			// 设置意见
 			workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
 			workInvoice.preUpdate();
+
+		WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workInvoice.getProcessInstanceId());
+
 			// 提交流程任务
 			vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
 		    vars.put("passs", true);
@@ -1512,7 +1523,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					workProjectNotifyService
 							.save(UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											workInvoice.getCreateBy(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1520,7 +1531,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 											"21",
 											"0",
 											"待通知",
-											notifyRole));
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date()));
 
 				} else {
 					WorkProjectNotify notify = new WorkProjectNotify();
@@ -1530,7 +1542,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 						workInvoice.setInvoiceState("4");
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1538,7 +1550,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 												"21",
 												"0",
 												"待通知",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(),new Date()));
 					}
 				}
 				workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
@@ -1548,7 +1561,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					notify.setNotifyId(workInvoice.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
 					WorkProjectNotify workProjectNotify = UtilNotify
-							.saveNotify(workInvoice.getId(),
+							.saveNewNotify(workInvoice.getId(),
 									new User(),
 									workInvoice.getCompanyId(),
 									title,
@@ -1556,7 +1569,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 									"21",
 									"0",
 									"待审批",
-									notifyRole);
+									notifyRole,
+									workInvoice.getProcessInstanceId(),new Date());
 					List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
 							activities,
 							workProjectNotify,
@@ -1595,7 +1609,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 						userList = workProjectNotifyService.readByNotifyId(notify);
 						workProjectNotifyService
 								.save(UtilNotify
-										.saveNotify(workInvoice.getId(),
+										.saveNewNotify(workInvoice.getId(),
 												workInvoice.getCreateBy(),
 												workInvoice.getCompanyId(),
 												title,
@@ -1603,7 +1617,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 												"21",
 												"0",
 												"重新申请",
-												notifyRole));
+												notifyRole,
+												workInvoice.getProcessInstanceId(),new Date()));
 						users.add( workInvoice.getCreateBy());
 					} else {
 						if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
@@ -1613,7 +1628,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 							notify.setNotifyId(workInvoice.getId());
 							userList = workProjectNotifyService.readByNotifyId(notify);
 							WorkProjectNotify workProjectNotify = UtilNotify
-									.saveNotify(workInvoice.getId(),
+									.saveNewNotify(workInvoice.getId(),
 											new User(),
 											workInvoice.getCompanyId(),
 											title,
@@ -1621,7 +1636,8 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 											"21",
 											"0",
 											"待审批",
-											notifyRole);
+											notifyRole,
+											workInvoice.getProcessInstanceId(),new Date());
 							for (User user1:auditUsers){
 								users.add(user1);
 								workProjectNotify.setUser(user1);
@@ -1650,7 +1666,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 							users.add(workInvoice.getCreateBy());
 							workProjectNotifyService
 									.save(UtilNotify
-											.saveNotify(workInvoice.getId(),
+											.saveNewNotify(workInvoice.getId(),
 													workInvoice.getCreateBy(),
 													workInvoice.getCompanyId(),
 													title,
@@ -1658,11 +1674,16 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 													"21",
 													"0",
 													"重新申请",
-													notifyRole));
+													notifyRole,
+													workInvoice.getProcessInstanceId(),new Date()));
 						}
 					}
 				}
 			}
+		//对数据进行处理
+		if(null != nowWorkProjectNotify){
+			workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+		}
 			if (users!=null && users.size()!=0) {
 				for (User u : users) {
 					UserUtils.pushIm(u.getId(),str);

+ 10 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java

@@ -24,6 +24,13 @@ public interface WorkProjectNotifyDao extends CrudDao<WorkProjectNotify> {
     WorkProjectNotify getByNotifyId(@Param("notifyId") String notifyId);
 
     /**
+     * 根据参数查询具体信息
+     * @param info
+     * @return
+     */
+    WorkProjectNotify getByInfo(WorkProjectNotify info);
+
+    /**
      * 根据title查询通知信息
      * @param title
      * @return
@@ -107,4 +114,7 @@ public interface WorkProjectNotifyDao extends CrudDao<WorkProjectNotify> {
      * @param workProjectNotify
      */
     void deleteByNotifyId(WorkProjectNotify workProjectNotify);
+
+
+    int updateWpaData(WorkProjectNotify notify);
 }

+ 55 - 3
src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java

@@ -4,12 +4,10 @@
 package com.jeeplus.modules.workprojectnotify.entity;
 
 import com.google.common.collect.Lists;
-import com.jeeplus.modules.sys.entity.User;
-
 import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.sys.entity.User;
 
-import javax.xml.crypto.Data;
 import java.util.Date;
 import java.util.List;
 
@@ -58,6 +56,12 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	private Date wapCreateDate;//节点创建时间
 	private Date wapEndDate;//节点结束时间
 	private List<String> statusList = Lists.newArrayList();
+	private Date wapBeginDate;	//开始审核时间
+	private Date wapOverDate;	//结束审核时间
+	private Date startBeginDate;//开始审核时间(开始)
+	private Date endBeginDate;	//开始审核时间(结束)
+	private Date startOverDate;	//结束审核时间(开始)
+	private Date endOverDate;	//结束审核时间(结束)
 
 	public WorkProjectNotify() {
 		super();
@@ -281,4 +285,52 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setWapEndDate(Date wapEndDate) {
 		this.wapEndDate = wapEndDate;
 	}
+
+	public Date getWapBeginDate() {
+		return wapBeginDate;
+	}
+
+	public void setWapBeginDate(Date wapBeginDate) {
+		this.wapBeginDate = wapBeginDate;
+	}
+
+	public Date getWapOverDate() {
+		return wapOverDate;
+	}
+
+	public void setWapOverDate(Date wapOverDate) {
+		this.wapOverDate = wapOverDate;
+	}
+
+	public Date getStartBeginDate() {
+		return startBeginDate;
+	}
+
+	public void setStartBeginDate(Date startBeginDate) {
+		this.startBeginDate = startBeginDate;
+	}
+
+	public Date getEndBeginDate() {
+		return endBeginDate;
+	}
+
+	public void setEndBeginDate(Date endBeginDate) {
+		this.endBeginDate = endBeginDate;
+	}
+
+	public Date getStartOverDate() {
+		return startOverDate;
+	}
+
+	public void setStartOverDate(Date startOverDate) {
+		this.startOverDate = startOverDate;
+	}
+
+	public Date getEndOverDate() {
+		return endOverDate;
+	}
+
+	public void setEndOverDate(Date endOverDate) {
+		this.endOverDate = endOverDate;
+	}
 }

+ 66 - 1
src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java

@@ -12,6 +12,8 @@ import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workprojectnotify.dao.WorkProjectNotifyDao;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workreimbursement.utils.HistoicFlowUtil;
@@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -38,6 +41,8 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 	private UserDao userDao;
 	@Autowired
 	private HistoicFlowUtil histoicFlowUtil;
+	@Autowired
+	private WorkActivityProcessService workActivityProcessService;
 
 	public WorkProjectNotify get(String id) {
 		return super.get(id);
@@ -46,6 +51,10 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		return dao.getByNotifyId(id);
 	}
 
+	public WorkProjectNotify getByInfo(WorkProjectNotify workProjectNotify) {
+		return dao.getByInfo(workProjectNotify);
+	}
+
 	/**
 	 * 根据title查询通知信息
 	 * @param title
@@ -107,7 +116,22 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		page.setCount(count);
 		page.setCountFlag(false);
 		workProjectNotify.setPage(page);
-		page.setList(findList(workProjectNotify));
+		List<WorkProjectNotify> list = findList(workProjectNotify);
+		/*for (WorkProjectNotify info: list) {
+			//如果记录中流程开始时间为空,则通过流程id查询该流程的开始时间
+			if(null == info.getWapCreateDate() && StringUtils.isNotBlank(info.getProcessInstanceId())){
+				WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+				workActivityProcess.setIsApproval("0");
+				workActivityProcess.setProcessInstanceId(info.getProcessInstanceId());
+				List<WorkActivityProcess> beginList = workActivityProcessService.findByProcInsIdAndIsApprovalOnList(workActivityProcess);
+				if(beginList.size()>0){
+					info.setWapCreateDate(beginList.get(0).getCreateDate());
+				}else{
+					info.setWapCreateDate(new Date());
+				}
+			}
+		}*/
+		page.setList(list);
 		return page;
 	}
 
@@ -132,6 +156,18 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 					info.setNotifyRole("已结束");
 				}
 			}
+			//如果记录中流程开始时间为空,则通过流程id查询该流程的开始时间
+			/*if(null == info.getWapCreateDate() && StringUtils.isNotBlank(info.getProcessInstanceId())){
+				WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+				workActivityProcess.setIsApproval("0");
+				workActivityProcess.setProcessInstanceId(info.getProcessInstanceId());
+				List<WorkActivityProcess> beginList = workActivityProcessService.findByProcInsIdAndIsApprovalOnList(workActivityProcess);
+				if(beginList.size()>0){
+					info.setWapCreateDate(beginList.get(0).getCreateDate());
+				}else{
+					info.setWapCreateDate(new Date());
+				}
+			}*/
 		}
 		page.setList(listByMine);
 		return page;
@@ -304,4 +340,33 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		dao.deleteByNotifyId(workProjectNotify);
 	}
 
+	@Transactional(readOnly = false)
+	public void updateWpaData(WorkProjectNotify workProjectNotify) {
+		workProjectNotify.preUpdate();
+		dao.updateWpaData(workProjectNotify);
+	}
+
+	/**
+	 * 数据处理
+	 * @param processInstanceId
+	 * @return
+	 */
+	public WorkProjectNotify processingInfo(String processInstanceId){
+		WorkProjectNotify selectNotifyInfo = new WorkProjectNotify();
+		selectNotifyInfo.setUser(UserUtils.getUser());
+		selectNotifyInfo.setProcessInstanceId(processInstanceId);
+		//查询当前流程信息
+		WorkProjectNotify nowWorkProjectNotify = this.getByInfo(selectNotifyInfo);
+		if(null != nowWorkProjectNotify){
+			nowWorkProjectNotify.setWapOverDate(new Date());
+			//查询所有通知信息数据
+			if(null == nowWorkProjectNotify.getWapBeginDate()){
+				List<WorkActivityProcess> oldWorkActivityProcessList = workActivityProcessService.getByProcessInstanceId(processInstanceId);
+				if(oldWorkActivityProcessList.size()>0){
+					nowWorkProjectNotify.setWapBeginDate(oldWorkActivityProcessList.get(0).getCreateDate());
+				}
+			}
+		}
+		return nowWorkProjectNotify;
+	}
 }

+ 36 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/util/UtilNotify.java

@@ -1,8 +1,13 @@
 package com.jeeplus.modules.workprojectnotify.util;
 
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 
+import java.util.Date;
+import java.util.List;
+
 public class UtilNotify {
 
     /**
@@ -53,4 +58,35 @@ public class UtilNotify {
         }
         return workProjectNotify;
     }
+
+
+
+    /**
+     * 处理提醒的数据
+     * @return
+     */
+    public static WorkProjectNotify saveNewNotify(String notifyId, User user,
+                                               String company_id,String title,
+                                               String content,String type,
+                                               String status,String remarks,String notifyRole,
+                                               String processInstanceId,
+                                               Date wapBeginDate){
+        WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+        workProjectNotify.setNotifyId(notifyId);
+        workProjectNotify.setUser(user);
+        workProjectNotify.setCompanyId(company_id);
+        workProjectNotify.setTitle(title);
+        workProjectNotify.setContent(content);
+        workProjectNotify.setType(type);
+        workProjectNotify.setStatus(status);
+        workProjectNotify.setNotifyRole(notifyRole);
+        workProjectNotify.setRemarks(remarks);
+        workProjectNotify.setProcessInstanceId(processInstanceId);
+        workProjectNotify.setWapBeginDate(wapBeginDate);
+        if("94".equals(type)){
+            workProjectNotify.setExigency("1");
+            workProjectNotify.setRepetitionCount(1);
+        }
+        return workProjectNotify;
+    }
 }

+ 27 - 22
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java

@@ -5,20 +5,17 @@ package com.jeeplus.modules.workreimbursement.service;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
-import com.jeeplus.common.websocket.onchat.ChatServerPool;
-import com.jeeplus.common.websocket.utils.Constant;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.act.utils.ProcessDefCache;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
@@ -32,7 +29,6 @@ import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
-import com.jeeplus.modules.workactivity.entity.WorkActivityProcessUser;
 import com.jeeplus.modules.workactivity.service.ActivityService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
@@ -42,12 +38,9 @@ import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workloan.dao.WorkLoanDao;
 import com.jeeplus.modules.workloan.entity.WorkLoan;
 import com.jeeplus.modules.workloan.service.WorkLoanService;
-import com.jeeplus.modules.workofficechange.entity.WorkOfficeChange;
-import com.jeeplus.modules.workofficechange.entity.WorkOfficeChangeUser;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
-import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.workreimbursement.dao.ReimbursementVATTaxDao;
 import com.jeeplus.modules.workreimbursement.dao.WorkAccountDao;
 import com.jeeplus.modules.workreimbursement.dao.WorkReimbursementDao;
@@ -65,9 +58,7 @@ import org.activiti.engine.history.HistoricTaskInstanceQuery;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.activiti.engine.task.TaskQuery;
-import org.java_websocket.WebSocket;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.method.P;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -532,6 +523,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
         workReimbursementDao.updateProcessInstanceId(workReimbursement);
         //通知添加流程实例ID
         workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotify.setWapBeginDate(new Date());
         workProjectNotifyService.save(workProjectNotify);
         List<Activity> list = workActivityMenu.getActivities();
         if (list != null && list.size() != 0) {
@@ -978,6 +970,9 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
         // 设置意见
         workReimbursement.getAct().setComment(("yes".equals(workReimbursement.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workReimbursement.getAct().getComment());
         workReimbursement.preUpdate();
+
+        WorkProjectNotify nowWorkProjectNotify = workProjectNotifyService.processingInfo(workReimbursement.getProcessInstanceId());
+
         // 提交流程任务
         vars.put(exp, "yes".equals(workReimbursement.getAct().getFlag()) ? true : false);
         vars.put("passs", true);
@@ -1025,7 +1020,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                 for (User user: informUser) {
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(workReimbursement.getId(),
+                                    .saveNewNotify(workReimbursement.getId(),
                                             user,
                                             workReimbursement.getCompanyId(),
                                             title,
@@ -1033,7 +1028,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                             "13",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            workReimbursement.getProcessInstanceId(),new Date()));
                 }
 
                 //修改还款
@@ -1076,7 +1072,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     workReimbursement.setStatus("4");
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(workReimbursement.getId(),
+                                    .saveNewNotify(workReimbursement.getId(),
                                             workReimbursement.getCreateBy(),
                                             workReimbursement.getCompanyId(),
                                             title,
@@ -1084,7 +1080,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                             "13",
                                             "0",
                                             "待通知",
-                                            notifyRole));
+                                            notifyRole,
+                                            workReimbursement.getProcessInstanceId(),new Date()));
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(workReimbursement.getProcessInstanceId());
@@ -1096,7 +1093,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                 userList = workProjectNotifyService.readByNotifyId(notify);
                 //users.addAll(userList);
                 WorkProjectNotify workProjectNotify = UtilNotify
-                        .saveNotify(workReimbursement.getId(),
+                        .saveNewNotify(workReimbursement.getId(),
                                 new User(),
                                 workReimbursement.getCompanyId(),
                                 title,
@@ -1104,7 +1101,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                 "13",
                                 "0",
                                 "待审批",
-                                notifyRole);
+                                notifyRole,
+                                workReimbursement.getProcessInstanceId(),new Date());
                 List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
                         activities,
                         workProjectNotify,
@@ -1144,7 +1142,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     //users.addAll(userList);
                     workProjectNotifyService
                             .save(UtilNotify
-                                    .saveNotify(workReimbursement.getId(),
+                                    .saveNewNotify(workReimbursement.getId(),
                                             workReimbursement.getCreateBy(),
                                             workReimbursement.getCompanyId(),
                                             title,
@@ -1152,7 +1150,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                             "13",
                                             "0",
                                             "重新申请",
-                                            notifyRole));
+                                            notifyRole,
+                                            workReimbursement.getProcessInstanceId(),new Date()));
                     users.add( workReimbursement.getCreateBy());
                 } else {
                     if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
@@ -1163,7 +1162,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                         userList = workProjectNotifyService.readByNotifyId(notify);
                         //users.addAll(userList1);
                         WorkProjectNotify workProjectNotify = UtilNotify
-                                .saveNotify(workReimbursement.getId(),
+                                .saveNewNotify(workReimbursement.getId(),
                                         new User(),
                                         workReimbursement.getCompanyId(),
                                         title,
@@ -1171,7 +1170,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                         "13",
                                         "0",
                                         "待审批",
-                                        notifyRole);
+                                        notifyRole,
+                                        workReimbursement.getProcessInstanceId(),new Date());
                         users.addAll(auditUsers);
                         for (User user1:auditUsers){
                             workProjectNotify.setId("");
@@ -1200,7 +1200,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                         users.add(workReimbursement.getCreateBy());
                         workProjectNotifyService
                                 .save(UtilNotify
-                                        .saveNotify(workReimbursement.getId(),
+                                        .saveNewNotify(workReimbursement.getId(),
                                                 workReimbursement.getCreateBy(),
                                                 workReimbursement.getCompanyId(),
                                                 title,
@@ -1208,11 +1208,16 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                                                 "13",
                                                 "0",
                                                 "重新申请",
-                                                notifyRole));
+                                                notifyRole,
+                                                workReimbursement.getProcessInstanceId(),new Date()));
                     }
                 }
             }
         }
+        //对数据进行处理
+        if(null != nowWorkProjectNotify){
+            workProjectNotifyService.updateWpaData(nowWorkProjectNotify);
+        }
         if (users!=null && users.size()!=0) {
             for (User u : users) {
                 UserUtils.pushIm(u.getId(),str);

+ 2 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -342,6 +342,8 @@
 	<select id="findList" resultType="RuralProjectRecords" >
 		SELECT
 			<include refid="projectRecordsColumns"/>
+		,(select group_concat(su.name) from work_project_user wpu left join sys_user su on su.id = wpu.user_id where wpu.project_id = a.id) as "leaderNameStr"
+		,(select group_concat(su.id) from work_project_user wpu left join sys_user su on su.id = wpu.user_id where wpu.project_id = a.id) as "leaderNameIds"
 		,a.submit_money as "submitMoney"
 		,a.project_type as projectType,
 		wci.name AS "workContractInfo.name",

+ 29 - 0
src/main/resources/mappings/modules/workactivity/WorkActivityProcessDao.xml

@@ -78,6 +78,35 @@
 		</where>
 	</select>
 
+	<select id="findByProcInsIdAndIsApprovalOnList" resultType="WorkActivityProcess" >
+		SELECT
+		<include refid="workActivityProcessColumns"/>
+		FROM work_activity_process a
+		<where>
+			a.count != 0
+			<if test="processInstanceId != null and processInstanceId != ''">
+				and a.process_instance_id = #{processInstanceId}
+			</if>
+			<if test="isApproval != null and isApproval != ''">
+				AND a.is_approval = #{isApproval}
+			</if>
+		</where>
+	</select>
+
+	<select id="getByProcessInstanceId" resultType="WorkActivityProcess" >
+		SELECT
+		<include refid="workActivityProcessColumns"/>
+		FROM work_activity_process a
+		<include refid="workActivityProcessJoins"/>
+		<where>
+			a.count != 0
+			<if test="processInstanceId != null and processInstanceId != ''">
+				and a.process_instance_id = #{processInstanceId}
+			</if>
+		</where>
+		order by a.update_date desc
+	</select>
+
 	<select id="findByKeyAndCount" resultType="WorkActivityProcess" >
 		SELECT
 		<include refid="workActivityProcessColumns"/>

+ 120 - 5
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -21,7 +21,9 @@
 		a.kind AS "kind",
 		a.officeId AS "officeId",
 		a.exigency as "exigency",
-		a.repetition_count as "repetitionCount"
+		a.repetition_count as "repetitionCount",
+		a.wap_begin_date as "wapBeginDate",
+		a.wap_over_date as "wapOverDate"
 	</sql>
 
 
@@ -85,6 +87,7 @@
 	<select id="findList" resultType="WorkProjectNotify" >
 		SELECT
 		<include refid="workProjectNotifyColumns"/>
+		,a.wap_begin_date AS "wapCreateDate"
 		FROM work_project_notify a
 		left join sys_user su on a.create_by = su.id
 		LEFT JOIN sys_user u ON u.id = a.create_by
@@ -128,6 +131,14 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.create_date &lt;= #{endDate}
 			</if>
+
+			<if test="startBeginDate != null and startBeginDate != ''">
+				AND a.wap_begin_date &gt;= #{startBeginDate}
+			</if>
+			<if test="endBeginDate != null and endBeginDate != ''">
+				AND a.wap_begin_date &lt;= #{endBeginDate}
+			</if>
+
 			<if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
 				AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
 			</if>
@@ -168,6 +179,23 @@
 		</choose>
 	</select>
 
+	<select id="getByInfo" resultType="WorkProjectNotify" >
+		SELECT
+		<include refid="workProjectNotifyColumns"/>
+		FROM work_project_notify a
+		<include refid="workProjectNotifyJoins"/>
+		<where>
+			a.del_flag = 0
+			<if test="user != null and user.id != null and user.id != ''">
+				AND a.notify_user = #{user.id}
+			</if>
+			AND a.status != '1'
+			AND a.remarks != '待通知'
+			and a.process_instance_id = #{processInstanceId}
+		</where>
+		limit 1
+	</select>
+
 	<select id="queryCount" resultType="Integer">
 		SELECT count(1)
 		FROM work_project_notify a
@@ -212,6 +240,14 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.create_date &lt;= #{endDate}
 			</if>
+
+			<if test="startBeginDate != null and startBeginDate != ''">
+				AND a.wap_begin_date &gt;= #{startBeginDate}
+			</if>
+			<if test="endBeginDate != null and endBeginDate != ''">
+				AND a.wap_begin_date &lt;= #{endBeginDate}
+			</if>
+
 			<if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
 				AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
 			</if>
@@ -366,12 +402,21 @@
 			status,
 			kind,
 			officeId
+			<if test="processInstanceId != null and processInstanceId != ''">
+				,process_instance_id
+			</if>
 			<if test="exigency != null and exigency != ''">
 				,exigency
 			</if>
 			<if test="repetitionCount != null and repetitionCount != ''">
 				,repetition_count
 			</if>
+			<if test="wapBeginDate != null and wapBeginDate != ''">
+				,wap_begin_date
+			</if>
+			<if test="wapOverDate != null and wapOverDate != ''">
+				,wap_over_date
+			</if>
 		) VALUES (
 					 #{id},
 					 #{createBy.id},
@@ -390,12 +435,21 @@
 					 #{status},
 					 #{kind},
 					 #{officeId}
+					<if test="processInstanceId != null and processInstanceId != ''">
+						,#{processInstanceId}
+					</if>
 					<if test="exigency != null and exigency != ''">
 						,#{exigency}
 					</if>
 					<if test="repetitionCount != null and repetitionCount != ''">
 						,#{repetitionCount}
 					</if>
+					<if test="wapBeginDate != null and wapBeginDate != ''">
+						,#{wapBeginDate}
+					</if>
+					<if test="wapOverDate != null and wapOverDate != ''">
+						,#{wapOverDate}
+					</if>
 				 )
 	</insert>
 
@@ -425,6 +479,12 @@
 		<if test="repetitionCount != null and repetitionCount != ''">
 			,repetition_count = #{repetitionCount}
 		</if>
+		<if test="wapBeginDate != null and wapBeginDate != ''">
+			,wap_begin_date = #{wapBeginDate}
+		</if>
+		<if test="wapOverDate != null and wapOverDate != ''">
+			,wap_over_date = #{wapOverDate}
+		</if>
 		WHERE id = #{id}
 	</update>
 	<update id="updateReadStateByNotifyIdAndNotifyUser">
@@ -508,6 +568,8 @@
 	<select id="findReadList" resultType="WorkProjectNotify" >
 		SELECT
 		<include refid="workProjectNotifyColumns"/>
+		,a.wap_begin_date AS "wapCreateDate"
+		,a.wap_over_date AS "wapEndDate"
 		FROM work_project_notify a
 		<include refid="workProjectNotifyJoins"/>
 		<where>
@@ -549,9 +611,29 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.create_date &lt;= #{endDate}
 			</if>
-			and a.create_by =#{createBy.id}
-			and a.remarks != '[强制撤销]' and a.remarks != '待通知'
 
+			<if test="startBeginDate != null and startBeginDate != ''">
+				AND a.wap_begin_date &gt;= #{startBeginDate}
+			</if>
+			<if test="endBeginDate != null and endBeginDate != ''">
+				AND a.wap_begin_date &lt;= #{endBeginDate}
+			</if>
+
+			<if test="startOverDate != null and startOverDate != ''">
+				AND a.wap_over_date &gt;= #{startOverDate}
+			</if>
+			<if test="endOverDate != null and endOverDate != ''">
+				AND a.wap_over_date &lt;= #{endOverDate}
+			</if>
+
+			and a.create_by is not null
+
+			and a.process_instance_id in( select process_instance_id from work_activity_process
+			where process_instance_id in(select process_id from work_activity_process_user where user_id = #{user.id} and type=1)
+			and del_flag = 0 and (remarks !='[强制撤销]' or remarks is null) and is_approval != 0
+			)
+			and remarks != '待通知'
+			and a.notify_user = #{user.id}
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -609,8 +691,28 @@
 				AND a.create_date &lt;= #{endDate}
 			</if>
 
-			and a.create_by =#{createBy.id}
-			and a.remarks != '[强制撤销]' and a.remarks != '待通知'
+			<if test="startBeginDate != null and startBeginDate != ''">
+				AND a.wap_begin_date &gt;= #{startBeginDate}
+			</if>
+			<if test="endBeginDate != null and endBeginDate != ''">
+				AND a.wap_begin_date &lt;= #{endBeginDate}
+			</if>
+
+			<if test="startOverDate != null and startOverDate != ''">
+				AND a.wap_over_date &gt;= #{startOverDate}
+			</if>
+			<if test="endOverDate != null and endOverDate != ''">
+				AND a.wap_over_date &lt;= #{endOverDate}
+			</if>
+
+			and a.create_by is not null
+
+			and a.process_instance_id in( select process_instance_id from work_activity_process
+			where process_instance_id in(select process_id from work_activity_process_user where user_id = #{user.id} and type=1)
+			and del_flag = 0 and (remarks !='[强制撤销]' or remarks is null) and is_approval != 0
+			)
+			and remarks != '待通知'
+			and a.notify_user = #{user.id}
 		</where>
 	</select>
 
@@ -741,4 +843,17 @@
 		where id = #{id}
 	</update>
 
+
+	<update id="updateWpaData">
+		UPDATE work_project_notify SET
+			update_date = #{updateDate}
+			<if test="wapBeginDate != null and wapBeginDate != ''">
+				,wap_begin_date = #{wapBeginDate}
+			</if>
+			<if test="wapOverDate != null and wapOverDate != ''">
+				,wap_over_date = #{wapOverDate}
+			</if>
+		WHERE id = #{id}
+	</update>
+
 </mapper>

+ 8 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/newReportedForm.jsp

@@ -166,6 +166,14 @@
                             return false;
                         }
                     }
+
+                    var ziXunBDE = $("#ZiXunBDE").val();
+                    var ShenDingJia = $("#ShenDingJia").val();
+                    if(ziXunBDE != ShenDingJia){
+                        parent.layer.msg("咨询标的额和审定价不同,请调整!", {icon: 5});
+                        return ;
+                    }
+
                     var projectRecordId = $("#projectRecordId").val();
                     if("0" != projectRecordId && projectRecordId.length != 16){
                         parent.layer.msg("项目编号填写错误!", {icon: 5});

+ 7 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/reportedAudit.jsp

@@ -149,6 +149,13 @@
                             return false;
                         }
                     }
+
+                    var ziXunBDE = $("#ZiXunBDE").val();
+                    var ShenDingJia = $("#ShenDingJia").val();
+                    if(ziXunBDE != ShenDingJia){
+                        parent.layer.msg("咨询标的额和审定价不同,请调整!", {icon: 5});
+                        return ;
+                    }
                     var projectType = $("#ProjectType").val();
                     if(projectType == 19){
                         var advisoryIncome = $("#advisoryIncome").val();

+ 6 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/newReported/reportedModify.jsp

@@ -150,6 +150,12 @@
                         return false;
                     }
                 }
+                var ziXunBDE = $("#ZiXunBDE").val();
+                var ShenDingJia = $("#ShenDingJia").val();
+                if(ziXunBDE != ShenDingJia){
+                    parent.layer.msg("咨询标的额和审定价不同,请调整!", {icon: 5});
+                    return ;
+                }
                 var projectType = $("#ProjectType").val();
                 if(projectType == 19){
                     var advisoryIncome = $("#advisoryIncome").val();

+ 2 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp

@@ -1359,7 +1359,8 @@
                     ,"recodeNum":"${projectRecords.recodeNum}"
 					,"projectReportNumber":"${projectRecords.projectReportNumber}"
                     ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
-                    ,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"
+					<%--,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"--%>
+					,"projMaster":"${projectRecords.leaderNameStr}"
                     ,"contract":"${projectRecords.workContractInfo.name}"
 					,"contractId":"${projectRecords.workContractInfo.id}"
                     ,"client":"${projectRecords.workContractInfo.client.name}"

+ 8 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/reportedModify.jsp

@@ -150,6 +150,14 @@
                         return false;
                     }
                 }
+
+                var ziXunBDE = $("#ZiXunBDE").val();
+                var ShenDingJia = $("#ShenDingJia").val();
+                if(ziXunBDE != ShenDingJia){
+                    parent.layer.msg("咨询标的额和审定价不同,请调整!", {icon: 5});
+                    return ;
+                }
+
                 var projectType = $("#ProjectType").val();
                 if(projectType == 19){
                     var advisoryIncome = $("#advisoryIncome").val();

+ 2 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

@@ -1237,7 +1237,8 @@
                     ,"projectReportNumber":"${projectRecords.projectReportNumber}"
                     ,"recodeNum":"${projectRecords.recodeNum}"
                     ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
-                    ,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"
+					<%--,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"--%>
+					,"projMaster":"${projectRecords.leaderNameStr}"
                     ,"contract":"${projectRecords.workContractInfo.name}"
                     ,"contractId":"${projectRecords.workContractInfo.id}"
                     ,"client":"${projectRecords.workContractInfo.client.name}"

+ 29 - 2
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp

@@ -28,6 +28,16 @@
 				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
 				type : 'date'
 			});
+			laydate.render({
+				elem: '#startBeginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+			laydate.render({
+				elem: '#endBeginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
 		});
         function openDialogre(title,url,width,height,target){
             if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
@@ -564,7 +574,7 @@
 						</div>
 					</div>
 					<div class="layui-item query athird">
-						<label class="layui-form-label">开始时间:</label>
+						<label class="layui-form-label">创建时间:</label>
 						<div class="layui-input-block">
 							<input id="startDate" name="startDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
 								   value="<fmt:formatDate value="${workProjectNotify.startDate}" pattern="yyyy-MM-dd"/>"/>
@@ -575,6 +585,18 @@
 							</input>
 						</div>
 					</div>
+					<div class="layui-item query athird">
+						<label class="layui-form-label">开始时间:</label>
+						<div class="layui-input-block">
+							<input id="startBeginDate" name="startBeginDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.startBeginDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+							<span class="group-sep">-</span>
+							<input id="endBeginDate" name="endBeginDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.endBeginDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+						</div>
+					</div>
 				</div>
 			</form:form>
 			</div>
@@ -815,9 +837,12 @@
                         return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
                     }}
                 ,{field:'status1', align:'center',title: '审批状态',width:100}
-                ,{field:'op',align:'center', title: '开始时间', width:140,templet:function(d){
+                ,{field:'op',align:'center', title: '创建时间', width:140,templet:function(d){
                         return "<span title='"+ d.date +"'>" + d.ymddate + "</span>";
                     }}
+                ,{field:'wapCreateDate',align:'center', title: '开始时间', width:180,templet:function(d){
+                        return "<span title='"+ d.wapCreateDate +"'>" + d.wapCreateDate + "</span>";
+                    }}
             ]]
             ,data: [
                 <c:if test="${ not empty page.list}">
@@ -836,6 +861,8 @@
                     ,"status1":"${fns:getDictLabel(workProjectNotify.status, 'project_notify_class', '')}"
                     ,"date":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                     ,"ymddate":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"wapCreateDate":"<fmt:formatDate value="${workProjectNotify.wapCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+                    ,"wapEndDate":"<fmt:formatDate value="${workProjectNotify.wapEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
 					,"remarks":"${workProjectNotify.remarks}"
 					,"projectType":"${workProjectNotify.projectType}"
                 }

+ 53 - 0
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyReadBacklogList.jsp

@@ -27,6 +27,27 @@
 				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
 				type : 'date'
 			});
+			laydate.render({
+				elem: '#startBeginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+			laydate.render({
+				elem: '#endBeginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+
+			laydate.render({
+				elem: '#startOverDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+			laydate.render({
+				elem: '#endOverDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
 		});
         function openDialogre(title,url,width,height,target){
             if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
@@ -431,6 +452,30 @@
 							</input>
 						</div>
 					</div>
+					<div class="layui-item query athird">
+						<label class="layui-form-label">开始日期:</label>
+						<div class="layui-input-block">
+							<input id="startBeginDate" name="startBeginDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.startBeginDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+							<span class="group-sep">-</span>
+							<input id="endBeginDate" name="endBeginDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.endBeginDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+						</div>
+					</div>
+					<div class="layui-item query athird">
+						<label class="layui-form-label">结束日期:</label>
+						<div class="layui-input-block">
+							<input id="startOverDate" name="startOverDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.startOverDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+							<span class="group-sep">-</span>
+							<input id="endOverDate" name="endOverDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+								   value="<fmt:formatDate value="${workProjectNotify.endOverDate}" pattern="yyyy-MM-dd"/>"/>
+							</input>
+						</div>
+					</div>
 				</div>
 			</form:form>
 			</div>
@@ -484,6 +529,12 @@
                 ,{field:'op',align:'center', title: '创建时间', width:140,templet:function(d){
                         return "<span title='"+ d.date +"'>" + d.ymddate + "</span>";
                     }}
+                ,{field:'wapCreateDate',align:'center', title: '开始时间', width:180,templet:function(d){
+                        return "<span title='"+ d.wapCreateDate +"'>" + d.wapCreateDate + "</span>";
+                    }}
+                ,{field:'wapEndDate',align:'center', title: '结束时间', width:180,templet:function(d){
+                        return "<span title='"+ d.wapEndDate +"'>" + d.wapEndDate + "</span>";
+                    }}
             ]]
             ,data: [
                 <c:if test="${ not empty page.list}">
@@ -503,6 +554,8 @@
                     ,"date":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
 					,"remarks":"${workProjectNotify.remarks}"
 					,"ymddate":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd"/>"
+					,"wapCreateDate":"<fmt:formatDate value="${workProjectNotify.wapCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					,"wapEndDate":"<fmt:formatDate value="${workProjectNotify.wapEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                 }
                 </c:forEach>
                 </c:if>