Просмотр исходного кода

项目管理页面查询优化

user5 3 лет назад
Родитель
Сommit
e7829e6ded

+ 66 - 82
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -263,12 +263,24 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
         workProjectNotify.setRemarks("待审批");
         //添加发票对应编号
-        workProjectNotify.setType("92");
+        List<String> typeList= jersey.repackaged.com.google.common.collect.Lists.newArrayList();
+        typeList.add("92");
+        typeList.add("51");
+        typeList.add("95");
+        typeList.add("96");
+        typeList.add("97");
+        typeList.add("99");
+        typeList.add("101");
+        typeList.add("98");
+        typeList.add("110");
+        String types = StringUtils.join(typeList,',');
+        workProjectNotify.setTypes(types);
+        //workProjectNotify.setType("92");
         //查询所有需要当前登录人进行处理的项目信息
         List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
 
         //添加发票对应编号
-        workProjectNotify.setType("51");
+        /*workProjectNotify.setType("51");
         //查询所有需要当前登录人进行处理的项目信息
         List<WorkProjectNotify> recordNotifyList = workProjectNotifyService.findList(workProjectNotify);
 
@@ -297,54 +309,28 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         workProjectNotify.setType("98");
         //查询所有需要当前登录人进行处理的项目信息
         List<WorkProjectNotify> newReportedNotifyList = workProjectNotifyService.findList(workProjectNotify);
-        //查询新的归档流程信息代办
-        workProjectNotify.setType("103");
-        //查询所有需要当前登录人进行处理的项目信息
-        List<WorkProjectNotify> newRecordTwoNotifyList = workProjectNotifyService.findList(workProjectNotify);
+        //添加上报对应编号
+        workProjectNotify.setType("110");
+        //查询所有需要当前登录人进行处理的纸质归档信息
+        List<WorkProjectNotify> paperProjectNotifyList = workProjectNotifyService.findList(workProjectNotify);*/
 
 
 
         //查询负责人信息
         for (RuralProjectRecords records : recordsList) {
-            this.queryContractInfos(records);
+            if(null != records.getRecordState() && 0 == records.getProjectReportRecordStatus()){
+                records.setProjectReportRecordStatus(records.getRecordState());
+            }
+            /*this.queryContractInfos(records);*/
             //获取项目负责人
-            List<User> users = workProjectUserDao.getProjectprincipalList(records.getId());
+            /*List<User> users = workProjectUserDao.getProjectprincipalList(records.getId());
             records.setProjectLeaders(users);
             records.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
-            records.setLeaderIds(Collections3.extractToString(users, "id", ","));
-
-            //获取归档批次信息
-            //项目归档批次
-            ProjectFilingbatchRelation relation=filingbatchRelationDao.getProjectId(records.getId());
-            if(null != relation && StringUtils.isNotBlank(relation.getId())){
-                records.setFilingBatch(relation.getFilingBatch());
-                records.setFilingProjectStatus(relation.getStatus());
-                records.setBoxNum(relation.getBoxNum());
-                records.setReBoxNum(relation.getReBoxNum());
-                //查询批次流程状态
-                ProjectFilingBatch filingBatch=projectFilingBatchDao.findByFilingBatch(relation.getFilingBatch());
-                if(null != filingBatch){
-                    records.setFilingBatchId(filingBatch.getId());
-                    records.setFilingProcessinstanceId(filingBatch.getProcessinstanceId());
-                    records.setFilingStatus(filingBatch.getFilingStatus());
-                }
-            }
-            //判定 如果项目上报信息超期 并且没有上报则江状态改为超期未上报
-            /*if(records.getReportedType().equals("1") && !records.getReportedState().equals("5") && !records.getReportedState().equals("7") && null != records.getAuditPassDate()){
-                records.setReportedState("6");
-            }else
-                //判定 如果项目上报信息超期 并且已经上报则将状态改为超期上报
-            if(records.getReportedType().equals("1") && records.getReportedState().equals("5") && null != records.getAuditPassDate()){
-                records.setReportedState("7");
-            }*/
-
-            if(0 != records.getProjectRecordStatus() && 0 == records.getProjectReportRecordStatus()){
-                records.setProjectReportRecordStatus(records.getProjectRecordStatus());
-            }
+            records.setLeaderIds(Collections3.extractToString(users, "id", ","));*/
 
             //新增报告展示
             for (WorkProjectNotify notify: notifyList) {
-                if(notify.getNotifyId().equals(records.getPrdId())){
+                if(notify.getNotifyId().equals(records.getPrdId()) && "92".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setReportNotifyFlag(1);
@@ -354,10 +340,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
-            //线上归档展示
-            for (WorkProjectNotify notify: recordNotifyList) {
-                if(notify.getNotifyId().equals(records.getPrrId())){
+                //线上归档展示
+                if(notify.getNotifyId().equals(records.getPrrId()) && "51".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setRecordNotifyFlag(1);
@@ -367,10 +351,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
-            //上报展示
-            for (WorkProjectNotify notify: reportedNotifyList) {
-                if(notify.getNotifyId().equals(records.getId())){
+                //上报展示
+                if(notify.getNotifyId().equals(records.getPrrId()) && "95".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setReportedNotifyFlag(1);
@@ -380,10 +362,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
-            //新代办修改权限处理
-            for (WorkProjectNotify notify: newReportNotifyList) {
-                if(notify.getNotifyId().equals(records.getPrdId())){
+                //新代办修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "96".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setNewReportNotifyFlag(1);
@@ -393,50 +373,41 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
-            //新代办流程2修改权限处理
-            for (WorkProjectNotify notify: newReportNotifyListTwo) {
-                if(notify.getNotifyId().equals(records.getPrdtId())){
+                //新代办流程2修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "97".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewReportNotifyFlag(1);
+                        records.setNewReportTwoNotifyFlag(1);
                     }
                     if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewReportAuditNotifyFlag(1);
+                        records.setNewReportTwoAuditNotifyFlag(1);
                     }
                     break;
                 }
-            }
-            //报告归档资料缺失说明修改权限处理
-            for (WorkProjectNotify notify: materialDefectRecord) {
-                if(notify.getNotifyId().equals(records.getPrdtId())){
+                //报告归档资料缺失说明修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "99".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewReportNotifyFlag(1);
+                        records.setNewReportMaterialNotifyFlag(1);
                     }
                     if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewReportAuditNotifyFlag(1);
+                        records.setNewReportMaterialAuditNotifyFlag(1);
                     }
                     break;
                 }
-            }
-            //新代办修改权限处理
-            for (WorkProjectNotify notify: newRecordNotifyList) {
-                if(notify.getNotifyId().equals(records.getPrrId())){
-                    records.setNewRecordNotifyId(notify.getId());
+                //新代办修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "101".equals(notify.getType())){
+                    records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setNewRecordNotifyFlag(1);
                     }
                     if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewRecordNotifyFlag(1);
+                        records.setNewRecordAuditNotifyFlag(1);
                     }
                     break;
                 }
-            }
-
-            //新代办修改权限处理
-            for (WorkProjectNotify notify: newReportedNotifyList) {
-                if(notify.getNotifyId().equals(records.getId())){
+                //新代办修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "98".equals(notify.getType())){
                     records.setNewRecordNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
                         records.setNewReportedNotifyFlag(1);
@@ -446,22 +417,35 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
-
-            //新代办修改权限处理
-            for (WorkProjectNotify notify: newRecordTwoNotifyList) {
-                if(notify.getNotifyId().equals(records.getPrrId())){
-                    records.setNewRecordNotifyId(notify.getId());
+                //新代办修改权限处理
+                if(notify.getNotifyId().equals(records.getPrrId()) && "110".equals(notify.getType())){
+                    records.setPaperProjectNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewRecordTwoNotifyFlag(1);
+                        records.setPaperProjectNotifyFlag(1);
                     }
                     if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
-                        records.setNewRecordTwoAuditNotifyFlag(1);
+                        records.setPaperProjectAuditNotifyFlag(1);
                     }
                     break;
                 }
             }
 
+            //获取归档批次信息
+            //项目归档批次
+            /*ProjectFilingbatchRelation relation=filingbatchRelationDao.getProjectId(records.getId());
+            if(null != relation && StringUtils.isNotBlank(relation.getId())){
+                records.setFilingBatch(relation.getFilingBatch());
+                records.setFilingProjectStatus(relation.getStatus());
+                records.setBoxNum(relation.getBoxNum());
+                records.setReBoxNum(relation.getReBoxNum());
+                //查询批次流程状态
+                ProjectFilingBatch filingBatch=projectFilingBatchDao.findByFilingBatch(relation.getFilingBatch());
+                if(null != filingBatch){
+                    records.setFilingBatchId(filingBatch.getId());
+                    records.setFilingProcessinstanceId(filingBatch.getProcessinstanceId());
+                    records.setFilingStatus(filingBatch.getFilingStatus());
+                }
+            }*/
 
         }
         page.setList(recordsList);