Bläddra i källkod

月报数据和项目管理下载数据进行同步

user5 3 år sedan
förälder
incheckning
05e16e46c0
22 ändrade filer med 9133 tillägg och 7319 borttagningar
  1. 9 0
      src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingBatchProInfo.java
  2. 9 0
      src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingbatchRelation.java
  3. 38 21
      src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java
  4. 25 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportDataService.java
  5. 10 10
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java
  6. 110 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  7. 133 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  8. 216 3
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java
  9. 46 0
      src/main/java/com/jeeplus/modules/sys/utils/DictUtils.java
  10. 1 1
      src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java
  11. 455 6
      src/main/java/com/jeeplus/modules/workfullmanage/service/WorkFullManageService.java
  12. 25 9
      src/main/java/com/jeeplus/modules/workfullmanage/web/WorkFullManageController.java
  13. 1633 1677
      src/main/resources/freemarker/current.ftl
  14. 3712 3047
      src/main/resources/freemarker/massControl.ftl
  15. 2633 2473
      src/main/resources/freemarker/projectSignature.ftl
  16. 4 3
      src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchDao.xml
  17. 6 3
      src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchProInfoDao.xml
  18. 2 2
      src/main/resources/mappings/modules/projectGuidang/ProjectFilingbatchRelationDao.xml
  19. 26 55
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml
  20. 6 2
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  21. 32 2
      src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml
  22. 2 1
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

+ 9 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingBatchProInfo.java

@@ -7,6 +7,7 @@ public class ProjectFilingBatchProInfo extends DataEntity<ProjectFilingBatchProI
     private String proId;
     private String proInfoType;
     private String proInfoName;
+    private Integer sort;        //序号
 
     public String getProInfofilingBatch() {
         return proInfofilingBatch;
@@ -39,4 +40,12 @@ public class ProjectFilingBatchProInfo extends DataEntity<ProjectFilingBatchProI
     public void setProInfoName(String proInfoName) {
         this.proInfoName = proInfoName;
     }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingbatchRelation.java

@@ -19,6 +19,7 @@ public class ProjectFilingbatchRelation extends DataEntity<ProjectFilingbatchRel
     private String projectName;//项目名称
     private String createName;//项目创建人
     private String number;//报告号
+    private Integer sort;   //排序
 
     public String getFilingBatch() {
         return filingBatch;
@@ -99,4 +100,12 @@ public class ProjectFilingbatchRelation extends DataEntity<ProjectFilingbatchRel
     public void setNumber(String number) {
         this.number = number;
     }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
 }

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

@@ -427,6 +427,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 ProjectFilingbatchRelation filingbatchRelation=new ProjectFilingbatchRelation();
                 filingbatchRelation.setFilingBatch(projectFilingBatch.getId());
                 filingbatchRelation.setProjectId(id);
+                filingbatchRelation.setSort(i);
                 filingbatchRelation.setStatus(2);
                 filingbatchRelation.preInsert();
                 projectFilingbatchRelationDao.insert(filingbatchRelation);
@@ -1043,28 +1044,44 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 tiao=true;
             }
         }
-        if(!tiao || proInfos[1].length()>50){
-            boolean flag=false;
-            Integer count=0;
-            String prid="";
-            for (int i=0;i<proInfos.length;i++){
-                if (proInfos[i]!=""&& !"".equals(proInfos[i])) {
-                    json = JSONObject.fromObject(proInfos[i]);
-                    ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
-                    info.setId(IdGen.uuid());
-                    info.setProId(json.get("proId").toString());
-                    info.setProInfofilingBatch(filingId);
-                    info.setProInfoName(json.get("names").toString());
-                    info.setProInfoType(json.get("types").toString());
-                    if(count==0 || !prid.equals(json.get("proId").toString())){
-                        DelProInfo(info);count++;
-                    }
-                    prid=json.get("proId").toString();
-                    proInfoDao.proInfoInsert(info);
-                }
+
+        for (int i=0;i<proInfos.length;i++){
+            if (StringUtils.isNotBlank(proInfos[i]) && proInfos[i].length()>50) {
+                json = JSONObject.fromObject(proInfos[i]);
+                ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
+                info.setSort(i);
+                info.setId(IdGen.uuid());
+                info.setProId(json.get("proId").toString());
+                info.setProInfofilingBatch(filingId);
+                info.setProInfoName(json.get("names").toString());
+                info.setProInfoType(json.get("types").toString());
+                DelProInfo(info);
+            }
+        }
+
+
+
+        Integer count=0;
+        for (int i=0;i<proInfos.length;i++){
+            if (StringUtils.isNotBlank(proInfos[i]) && proInfos[i].length()>50) {
+                json = JSONObject.fromObject(proInfos[i]);
+                ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
+                info.setSort(i);
+                info.setId(IdGen.uuid());
+                info.setProId(json.get("proId").toString());
+                info.setProInfofilingBatch(filingId);
+                info.setProInfoName(json.get("names").toString());
+                info.setProInfoType(json.get("types").toString());
+                /*if(count==0){
+                    DelProInfo(info);
+                    count++;
+                }*/
+                proInfoDao.proInfoInsert(info);
             }
-        }else if (flags.length!=0 && proInfos.length==4 && tiao ){
-            int count=0;
+        }
+
+        if (flags.length!=0 && proInfos.length==4 && tiao ){
+            count=0;
             for (int s=0;s< proInfos.length;s++){
                 count++;
                 pro+=proInfos[s];

+ 25 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportDataService.java

@@ -139,6 +139,31 @@ public class ProjectReportDataService extends CrudService<ProjectReportDataDao,
 		return projectReportData;
 	}
 
+	/**
+	 * 根据项目报告好查询报告信息
+	 * @param number
+	 * @return
+	 */
+	public ProjectReportData getByNumber(String number) {
+		ProjectReportData projectReportData = dao.findByNum(number);
+		if (projectReportData!=null && StringUtils.isNotBlank(projectReportData.getId())){
+			Workattachment workattachment = new Workattachment();
+			workattachment.setAttachmentFlag("86");
+			workattachment.setAttachmentId(projectReportData.getId());
+			projectReportData.setWorkAttachments(workattachmentService.findList(workattachment));
+			workattachmentService.attachmentManageOnUrl(projectReportData.getWorkAttachments());
+			projectReportData.setUploadMode(uploadMode);
+			projectReportData.setProjectContentDataList(projectContentDataDao.findReportContent(projectReportData.getId(),"1"));
+			projectReportData.setProjectBasedDataList(projectBasedDataDao.findReportBased(projectReportData.getId(),"3"));
+			WorkReviewAudit workReviewAudit = new WorkReviewAudit();
+			workReviewAudit.setType("1");
+			workReviewAudit.setReportId(projectReportData.getId());
+			workReviewAudit.setCompanyId(projectReportData.getCompanyId());
+			projectReportData.setProjectReviewList(workReviewAuditDao.findList(workReviewAudit));
+		}
+		return projectReportData;
+	}
+
 	public ProjectReportData getOnRural(String id) {
 		ProjectReportData projectReportData = super.get(id);
 		if (projectReportData!=null && StringUtils.isNotBlank(projectReportData.getId())){

+ 10 - 10
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java

@@ -756,7 +756,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                 recordsListOnType.addAll(elseRecordsList);
             }
             //B类紧急项目
-            projectRecords.setEmergencyProject("1");
+            /*projectRecords.setEmergencyProject("1");
             elseRecordsList = dao.getElseRecordList(projectRecords);
             if(elseRecordsList.size()>0){
                 recordsListOnType.addAll(elseRecordsList);
@@ -769,7 +769,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                         }
                     }
                 }
-            }
+            }*/
             recordsList.addAll(recordsListOnType);
         }
         //查询超期的筛选项项目信息
@@ -781,7 +781,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                 recordsListOnType.addAll(exceedRecordsList);
             }
             //B类紧急项目
-            projectRecords.setEmergencyProject("1");
+            /*projectRecords.setEmergencyProject("1");
             exceedRecordsList = dao.getExeedRecordList(projectRecords);
             if(exceedRecordsList.size()>0){
                 recordsListOnType.addAll(exceedRecordsList);
@@ -802,12 +802,12 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                 if(null != info.getProjectReportRecordStatus() && 5 == info.getProjectReportRecordStatus()){
                     info.setProjectReportRecordStatus(7);
                 }
-            }
+            }*/
             recordsList.addAll(recordsListOnType);
         }
 
         //查询资料缺失审批完成信息
-        List projectIdList = Lists.newArrayList();
+        /*List projectIdList = Lists.newArrayList();
         for (DownloadProjectRecords records: recordsList) {
             projectIdList.add(records.getId());
         }
@@ -835,7 +835,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                     }
                 }
             }
-        }
+        }*/
         downloadProjectRecordsListSort(recordsList);
         page.setList(recordsList);
         return page;
@@ -982,7 +982,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
             if(elseRecordsList.size()>0){
                 recordsListOnType.addAll(elseRecordsList);
             }
-            //B类紧急项目
+            /*//B类紧急项目
             projectRecords.setEmergencyProject("1");
             elseRecordsList = dao.getElseReportedList(projectRecords);
             if(elseRecordsList.size()>0){
@@ -996,7 +996,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                         }
                     }
                 }
-            }
+            }*/
             recordsList.addAll(recordsListOnType);
         }
         //查询超期的筛选项项目信息
@@ -1007,7 +1007,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
             if(exceedRecordsList.size()>0){
                 recordsListOnType.addAll(exceedRecordsList);
             }
-            //B类紧急项目
+            /*//B类紧急项目
             projectRecords.setEmergencyProject("1");
             exceedRecordsList = dao.getExeedReportedList(projectRecords);
             if(exceedRecordsList.size()>0){
@@ -1027,7 +1027,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                 if(null != info.getProjectReportRecordStatus() && 5 == info.getProjectReportRecordStatus()){
                     info.setProjectReportRecordStatus(7);
                 }
-            }
+            }*/
             recordsList.addAll(recordsListOnType);
         }
         //查询超期的无需上报项目信息

+ 110 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -6,10 +6,7 @@ import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.common.utils.IdGen;
-import com.jeeplus.common.utils.ImageUtil;
-import com.jeeplus.common.utils.MyBeanUtils;
-import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.common.utils.*;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -19,6 +16,7 @@ import com.jeeplus.modules.ruralprojectrecords.entity.*;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.thread.ApprovalThread;
 import com.jeeplus.modules.ruralprojectrecords.thread.SignatureThread;
+import com.jeeplus.modules.ruralprojectrecords.utils.FileUtil;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -46,7 +44,9 @@ import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 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.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
+import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.apache.commons.lang3.StringEscapeUtils;
@@ -73,9 +73,20 @@ import java.util.regex.Pattern;
 @Transactional(readOnly = true)
 public class RuralProjectMessageElectronicSealService extends CrudService<RuralProjectMessageElectronicSealDao, ProjectReportSignatureInfo> {
 
+    //空白图片的base64参数
+    private final String blankBase64 = "iVBORw0KGgoAAAANSUhEUgAAAIIAAAA/CAYAAAAsVxBWAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\n" +
+            "jwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAACPSURBVHhe7dIBDQAwEMSg+Td9+1QHaOANjghE\n" +
+            "BCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhAR\n" +
+            "iAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQETg\n" +
+            "bB/QoX96EpAulQAAAABJRU5ErkJggg==";
+
     //生产环境域名
     @Value("${serverDomain}")
     private String serverDomain;
+    /**
+     * 阿里云文件服务器前缀
+     */
+    private final static String aliyunUrl = Global.getConfig("aliyunUrl");
 
     @Autowired
     private UserService userService;
@@ -111,6 +122,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     private WorkattachmentService workattachmentService;
     @Autowired
     private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private WorkStaffBasicInfoService workStaffBasicInfoService;
 
     /**
      * 根据项目id查询审定单是否存在送审信息
@@ -1830,6 +1843,31 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         //约定作业期
         data.put("promiseTime",promiseTime);
         data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
+        //如果项目负责人不为空,则对项目负责人(第一个)进行获取签字章并存储
+        if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+            String base64String = base64String(ruralProjectRecords.getProjectMasterId());
+            data.put("handSignature3",base64String);
+        }else{
+            data.put("handSignature3","");
+        }
+
+        //查询杨荣华杨所的用户信息
+        User yrhUser = UserUtils.getByUserName("杨荣华");
+        if(StringUtils.isNotBlank(yrhUser.getId())){
+            String base64String = base64String(yrhUser.getId());
+            data.put("handSignature1",base64String);
+        }else{
+            data.put("handSignature1","");
+        }
+
+        //查询陈红星陈总的用户信息
+        User chxUser = UserUtils.getByUserName("陈红星");
+        if(StringUtils.isNotBlank(chxUser.getId())){
+            String base64String = base64String(chxUser.getId());
+            data.put("handSignature2",base64String);
+        }else{
+            data.put("handSignature2","");
+        }
 
         //咨询员信息
         if(null != consultants && consultants.size()>0){
@@ -1846,6 +1884,17 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
             RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
             User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
             data.put("consultantName1",consultantUser.getName());
+
+            //如果咨询员不为空,则对项咨询员进行获取签字章并存储
+            if(StringUtils.isNotBlank(consultantUser.getId())){
+                String base64String = base64String(consultantUser.getId());
+                data.put("handSignature4",base64String);
+            }else{
+                data.put("handSignature4","");
+            }
+
+
+
             data.put("zixunyuanName",consultantUser.getName());
             data.put("consultantProfession1","");
             data.put("consultantQualification1","");
@@ -2605,4 +2654,61 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         String id = dao.findZXYByName(Name);
         return id;
     }
+
+    /**
+     * 根据用户id获取用户手签章并转换为base64字符串输出
+     * @param userIds
+     * @return
+     */
+    public String base64String(String userIds){
+        String imageStr = "";
+        String path = null;
+        String fileName = null;
+        try {
+            String[] split = userIds.split(",");
+            List<String> userList = Arrays.asList(split);
+            WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(userList.get(0));
+            //判断人员的手签章是否存在
+            if(StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+                String aliyunUrlStr = aliyunUrl + workStaffBasicInfo.getHandSignature();
+                //下载文件
+                if(System.getProperty("os.name").toLowerCase().contains("win")){
+                    path = "D:/attachment-file/handSignature/";
+                }else{
+                    path = "/attachment-file/handSignature/";
+                }
+
+                String file = aliyunUrlStr;
+                file = file.replace("amp;","");
+                fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+                String aliyunUrl = Global.getAliyunUrl();
+                String aliDownloadUrl = Global.getAliDownloadUrl();
+                String cons = "";
+                if (file.contains(aliyunUrl)){
+                    cons = aliyunUrl;
+                }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                    cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+                }else {
+                    cons = aliDownloadUrl;
+                }
+                String ossKey = file.split(cons+"/")[1];
+                File filePath = new File(path);
+                if (!filePath.mkdirs()) {
+                    filePath.mkdirs();
+                }
+                new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                imageStr = ImageUtil.getImageStr(path+fileName);
+            }
+        }catch (Exception e){
+            e.getMessage();
+        }finally {
+            FileUtils.delFile(path+fileName);
+        }
+        if(StringUtils.isBlank(imageStr)){
+            imageStr = blankBase64;
+        }
+
+
+        return imageStr;
+    }
 }

+ 133 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -219,6 +219,14 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		return  DictUtils.getMainDictList("attachment_template_type");
 	}
 
+	/**
+	 * 获取项目附件模板类型
+	 * @return
+	 */
+	public static List<MainDictDetail> attachmentTemplateListByUserId(){
+		return  DictUtils.getMainDictListById("attachment_template_type");
+	}
+
 	private static byte[] SYN_BYTE = new byte[0];
 
 	public RuralProjectRecords get(String id) {
@@ -2125,6 +2133,131 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		return projectcontentinfo;
 	}
 
+	/**
+	 * 项目列表新增文件信息获取
+	 * @param projectRecords  项目信息
+	 * @return
+	 */
+	public RuralProjectcontentinfo formAccessoryByUserId(RuralProjectRecords projectRecords){
+		//查询“配农网”工程类型id
+		String engineeringId = engineeringService.getEngineeringId("202");
+		RuralProjectcontentinfo projectcontentinfo = new RuralProjectcontentinfo();
+		//获取报告信息
+		ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+
+		projectcontentinfo.setProject(projectRecords);
+		projectcontentinfo.setProjectReportData(projectReportData);
+		//声明项目与附件关系表联系
+		ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+		//添加项目类型
+		relateInfo.setAttachmentProjectType(projectRecords.getProjectType());
+		relateInfo.setAttachmentProjectSort(projectRecords.getAttachmentProjectSort());
+//		Integer approvalMoney = 0;
+//		if(null != projectReportData){
+			//查看送审金额是否为500w以上金额
+//			approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
+
+//		}
+		//设置默认值为500w以上的展示数据
+//		approvalMoney = 2;
+		String money=projectcontentinfo.getProject().getSubmitMoney();
+		Integer approvalMoney=null;
+		if(StringUtils.isBlank(money)){
+			approvalMoney=1;
+		}else{
+			approvalMoney=Integer.parseInt(money);
+		}
+		switch (approvalMoney){
+			case 0:
+				//金额为0
+				relateInfo.setAttachmentProjectApprovalMoney(null);
+				break;
+			case 1:
+				//500w以下金额状态
+				relateInfo.setAttachmentProjectApprovalMoney("1");
+				break;
+			case 2:
+				//500w以上金额状态
+				relateInfo.setAttachmentProjectApprovalMoney("2");
+				break;
+		}
+		//创建阶段集合(若为归档阶段则将新增报告和归档阶段信息都添加在内)
+		List<Integer> requiredStageList = Lists.newArrayList();
+		requiredStageList.add(1);
+		//添加报告类型
+		relateInfo.setRequiredStage(1);
+		relateInfo.setId(projectRecords.getId());
+
+		//声明归档状态
+		String reportRecordStatus = null;
+		//判断报告信息是否已存在
+		if(null != projectReportData){
+			//判断是否已经审批完成
+			if ("5".equals(projectReportData.getStatus())){
+				//查询归档状态信息
+				reportRecordStatus = dao.getReportRecordStatus(projectReportData.getId());
+				//如果归档状态不为空,则查询归档展示列
+				if(StringUtils.isNotBlank(reportRecordStatus)){
+					relateInfo.setRequiredStage(2);
+					requiredStageList.add(2);
+				}
+			}
+		}else{
+			//没有提交报告信息
+
+		}
+
+		//查询报告文件、依据性文件、其他文件必填列表以及数据
+		List<MainDictDetail> mainDictDetails = this.attachmentTemplateListByUserId();
+		for (MainDictDetail mainDict : mainDictDetails) {
+			relateInfo.setAttachType(mainDict.getValue());
+			switch (mainDict.getValue()) {
+				case "11":
+					List<ProjectTemplateInfo> fileAttachmentList = this.getProjectTemplate(relateInfo,requiredStageList);
+					for (ProjectTemplateInfo info: fileAttachmentList) {
+						info.setAttachTypes(info.getAttachTypes().toLowerCase());
+						if(engineeringId.equals(projectRecords.getEngineeringType())){
+							if("审定单".equals(info.getAttachName()) || "咨询报告书正文(含附件)  附件一:工程预算或结算汇总表 附件二:编制或审核说明 附件三:工程预算或结算审定单 附件四:工程预算或结算书".equals(info.getAttachName()) ){
+								if(!info.getAttachTypes().contains("zip")){
+									info.setAttachTypes(info.getAttachTypes()+",zip");
+								}
+								if(!info.getAttachTypes().contains("rar")){
+									info.setAttachTypes(info.getAttachTypes()+",rar");
+								}
+							}
+						}
+					}
+					projectcontentinfo.setFileAttachmentList(fileAttachmentList);
+					break;
+				case "12":
+					List<ProjectTemplateInfo> projectTemplateList = this.getProjectTemplate(relateInfo, requiredStageList);
+					for (ProjectTemplateInfo info: projectTemplateList) {
+						info.setAttachTypes(info.getAttachTypes().toLowerCase());
+						if(engineeringId.equals(projectRecords.getEngineeringType())){
+							if("投标文件、中标通知书、工程承包合同(协议书记专用条款部分)、补充协议".equals(info.getAttachName()) || "送审工程预算、结算书".equals(info.getAttachName()) ){
+								if(!info.getAttachTypes().contains("zip")){
+									info.setAttachTypes(info.getAttachTypes()+",zip");
+								}
+								if(!info.getAttachTypes().contains("rar")){
+									info.setAttachTypes(info.getAttachTypes()+",rar");
+								}
+							}
+						}
+					}
+					projectcontentinfo.setFileGistdataList(projectTemplateList);
+					break;
+				case "13":
+					projectcontentinfo.setFileOtherList(this.getProjectTemplate(relateInfo,requiredStageList));
+					break;
+			}
+
+		}
+
+		//添加当前文件服务器类型
+		projectcontentinfo.setUploadMode(uploadMode);
+		return projectcontentinfo;
+	}
+
 
 	/**
 	 *

+ 216 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -4,22 +4,33 @@ import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.utils.FreemarkerUtil;
+import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportRecordDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.ruralprojectrecords.entity.PhysicsSeal;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.entity.SealAuthBean;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectSignatureOldMessageDisposeService;
 import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.tools.utils.SignaturePostUtil;
 import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
 import org.activiti.engine.HistoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -54,6 +65,18 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     @Autowired
     private RuralProjectSignatureOldMessageDisposeService service;
 
+
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Autowired
+    private ProjectTemplateDao projectTemplateDao;
+    @Autowired
+    private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private ProjectReportRecordDao projectReportRecordDao;
+
     @Autowired
     private StatementCompanyComprehensiveService statementCompanyComprehensiveService;
 
@@ -160,7 +183,7 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         Integer month = c.get(Calendar.MONTH)+1; //第一个月从0开始,所以得到月份+1
         //当月最后一天
         logger.info("-----------公司级—月度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementCompany(2022,2,2);
+        //statementCompanyComprehensiveService.disposeStatementCompany(2022,2,2);
         logger.info("------------公司级—月度报表(结束)------------------");
         logger.info("-----------部门级—月度报表(开始)------------------");
         statementCompanyComprehensiveService.disposeStatementOffice(2022,2,2);
@@ -178,12 +201,12 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
 
         map.put("msgQuarter","季度报表处理完成");
 
-        /*logger.info("-----------公司级—年度报表(开始)------------------");
+        logger.info("-----------公司级—年度报表(开始)------------------");
         statementCompanyComprehensiveService.disposeStatementCompany(2022,0,0);
         logger.info("------------公司级—年度报表(结束)------------------");
         logger.info("-----------部门级—年度报表(开始)------------------");
         statementCompanyComprehensiveService.disposeStatementOffice(2022,0,0);
-        logger.info("------------部门级—年度报表(结束)------------------");*/
+        logger.info("------------部门级—年度报表(结束)------------------");
 
         map.put("msgYear","年度报表处理完成");
 
@@ -288,4 +311,194 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         return hashMap;
     }
 
+    /**
+     * 手动生成项目的文件目录
+     * @param reportNumber
+     * @param userName
+     * @return
+     */
+    @RequestMapping(value = "/createFileCatalogue")
+    @ResponseBody
+    @Transactional(readOnly = false)
+    public Map<String,Object> createFileCatalogue (@RequestParam("reportNumber") String reportNumber,@RequestParam("userName") String userName){
+        User user = UserUtils.getByUserName(userName);
+        Map<String,Object> map = new HashMap();
+        //获取项目信息
+        RuralProjectRecords record = ruralProjectRecordsService.getByReportNumber(reportNumber);
+        //获取归档信息
+        ProjectReportRecord projectReportRecord = projectReportRecordService.getprojectReportRecord(record.getPrdId());
+        if(null != projectReportRecord){
+            //查询其他资料对应附件结构信息
+            ProjectTemplateInfo templateInfo = projectTemplateDao.getProjectTemplateInfoByName("其他资料");
+            //生成文件目录
+            //获取上传阿里云盘文件地址
+            String uploadCatalogueFilePath = downloadCatalogue(record.getId());
+
+            if(StringUtils.isNotBlank(uploadCatalogueFilePath)){
+                //将备考表添加到附件中
+                Workattachment workattachment = new Workattachment();
+                workattachment.setAttachmentId(templateInfo.getId());
+                workattachment.setProjectId(record.getId());
+                workattachment.setUrl(uploadCatalogueFilePath);
+                workattachment.setType("doc");
+                workattachment.setAttachmentFlag("100");
+                workattachment.setAttachmentName("文件目录.doc");
+                workattachment.setAttachmentUser(user.getId());
+                workattachment.setCompanyId(user.getCompany().getId());
+                workattachment.setCreateBy(user);
+                workattachment.setCreateDate(new Date());
+                workattachment.setUpdateBy(user);
+                workattachment.setUpdateDate(new Date());
+                workattachmentService.insertOnWorkAttachment(workattachment);
+                if(StringUtils.isNotBlank(projectReportRecord.getCatalogueAttachmentId())){
+                    workattachmentService.deleteById(projectReportRecord.getCatalogueAttachmentId());
+                }
+                //添加目录附件id
+                projectReportRecord.setCatalogueAttachmentId(workattachment.getId());
+
+                projectReportRecordDao.updateRuralProjectReportRecord(projectReportRecord);
+            }
+            map.put("success","true");
+            map.put("msg","成功");
+        }else{
+            map.put("success","false");
+            map.put("msg",",该项目未进行归档,无法生成文件目录");
+        }
+
+        return map;
+    }
+
+    //生成目录
+    public String downloadCatalogue(String projectId)  {
+        Map data = catalogueData(projectId);
+        //模板对象
+        Template template=null;
+        //freemaker模板路径
+        File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
+        Configuration cfg = new Configuration();
+        try {
+            cfg.setDirectoryForTemplateLoading(path);
+            //选择对应的ftl文件
+            template = cfg.getTemplate("catalogue.ftl","UTF-8");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        //获取当前时间戳
+        long time = new Date().getTime();
+        File docFile = new File(time + "文件目录.doc");
+        FreemarkerUtil.generateFile(data,template,docFile);
+        String filePath = ResponseUtil.returnViewResponse(time + "文件目录.doc", docFile);
+
+        //本地备考表信息生成file文件
+        File file = new File(filePath);
+        //File转MultipartFile文件
+        SftpClientUtil sftpClientUtil = new SftpClientUtil();
+        MultipartFile mFile = sftpClientUtil.transformFile(docFile);
+        //文件上传oss
+        String uploadPath = null;
+        try {
+            uploadPath = ResponseUtil.uploadOss(mFile, "reportRecord");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            //删除本地文件
+            if (!file.isDirectory()) {
+                file.delete();
+            }
+
+            //获取tomcat的路径
+            String tomcatFilePath=System.getProperty("catalina.home");
+            //删除tomcat目录下的处理后的文件信息
+            File tomcatFile = new File(tomcatFilePath+"/bin/"+time + "文件目录.doc");
+            if (tomcatFile.isFile()) {
+                tomcatFile.delete();
+            }
+        }
+        return uploadPath;
+    }
+
+
+
+    //获取数据
+    private Map<String,Object> catalogueData(String projectId){
+        //获取数据
+        RuralProjectRecords projectRecords = ruralProjectRecordsService.getQueryProjectUsers(projectId);
+        //文件信息获取
+        RuralProjectcontentinfo ruralProjectcontentinfo = ruralProjectRecordsService.formAccessoryByUserId(projectRecords);
+        //目录
+        List<Map<String,String>> list=new LinkedList<>();
+        //序号
+        int count=1;
+        //成果文件
+        if (ruralProjectcontentinfo.getFileAttachmentList().size()>0){
+            List<ProjectTemplateInfo> infos=ruralProjectcontentinfo.getFileAttachmentList();
+            for (int i=0;i<infos.size();i++){
+                if (infos.get(i).getWorkAttachments().size()>0){
+                    for (WorkClientAttachment attachment:infos.get(i).getWorkAttachments()){
+                        Map<String,String> map=new HashMap<>();
+                        map.put("count",count+"");
+                        map.put("type","成果文件");
+                        map.put("content",infos.get(i).getAttachName());
+                        map.put("fileName",attachment.getAttachmentName());
+                        map.put("remarks","");
+                        count++;
+                        list.add(map);
+                    }
+                }
+            }
+        }
+        //依据性文件
+        if (ruralProjectcontentinfo.getFileGistdataList().size()>0){
+            List<ProjectTemplateInfo> infos=ruralProjectcontentinfo.getFileGistdataList();
+            for (int i=0;i<infos.size();i++){
+                if (infos.get(i).getWorkAttachments().size()>0){
+                    for (WorkClientAttachment attachment:infos.get(i).getWorkAttachments()){
+                        Map<String,String> map=new HashMap<>();
+                        map.put("count",count+"");
+                        map.put("type","依据文件");
+                        map.put("content",infos.get(i).getAttachName());
+                        map.put("fileName",attachment.getAttachmentName());
+                        map.put("remarks","");
+                        count++;
+                        list.add(map);
+                    }
+                }
+            }
+        }
+        //其它文件
+        if (ruralProjectcontentinfo.getFileGistdataList().size()>0){
+            List<ProjectTemplateInfo> infos=ruralProjectcontentinfo.getFileOtherList();
+            for (int i=0;i<infos.size();i++){
+                if (infos.get(i).getWorkAttachments().size()>0){
+                    for (WorkClientAttachment attachment:infos.get(i).getWorkAttachments()){
+                        Map<String,String> map=new HashMap<>();
+                        map.put("count",count+"");
+                        map.put("type","其它文件");
+                        map.put("content",infos.get(i).getAttachName());
+                        map.put("fileName",attachment.getAttachmentName());
+                        map.put("remarks","");
+                        count++;
+                        list.add(map);
+                    }
+                }
+            }
+        }
+        //freemarker参数值准备
+        Map<String,Object> data  = new LinkedHashMap<>();
+        //获取报告
+        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+        if (null!=projectReportData){
+            if(StringUtils.isNotBlank(projectReportData.getNumber())){
+                data.put("number",projectReportData.getNumber());
+            }else{
+                data.put("number","");
+            }
+        }else{
+            //文号
+            data.put("number","");
+        }
+        data.put("list",list);
+        return data;
+    }
+
 }

+ 46 - 0
src/main/java/com/jeeplus/modules/sys/utils/DictUtils.java

@@ -228,6 +228,52 @@ public class DictUtils {
 	 * @param type
 	 * @return
 	 */
+	public static List<MainDictDetail> getMainDictListById(String type){
+		Jedis jedis = null;
+        List<MainDictDetail> dictList=new ArrayList<>();
+
+		String comId=UserUtils.get("1").getCompany().getId();
+		String branchId=UserUtils.get("1").getOffice().getId();
+		MainDict mainDict = mainDictService.getIdByName(type);
+		String key="";
+		if("1".equals(mainDict.getDictType())){
+			key="dictDetail_"+type+"_"+comId;
+		}else{
+			key="dictDetail_"+type+"_"+branchId;
+		}
+		try {
+			jedis = JedisUtils.getResource();
+			String listString=jedis.get(key);
+			if (listString != null && !"".equals(listString)) {
+                dictList= JSON.parseArray(listString, MainDictDetail.class);
+				return dictList;
+			}else{
+				MainDictDetail mainDictDetail = new MainDictDetail();
+				if("1".equals(mainDict.getDictType())){
+				    mainDictDetail.setBranchOffice(comId);
+				}else{
+				    mainDictDetail.setBranchOffice(branchId);
+				}
+					mainDictDetail.setType(type);
+					dictList = mainDictDetailDao.findJedisAllList(mainDictDetail);
+					String str=JSON.toJSONString(dictList);
+					jedis.set(key,str);
+					jedis.expire(key,60*10);
+					return dictList;
+			}
+		} catch (Exception e) {
+			System.out.println("获取业务字典失败!");
+		} finally {
+			JedisUtils.returnResource(jedis);
+		}
+		return dictList;
+	}
+
+	/**
+	 * 公司级业务字典
+	 * @param type
+	 * @return
+	 */
 	public static List<MainDictDetail> getMainDictListOnProjectAdvent(String type){
 		MainDictDetail mainDictDetail = new MainDictDetail();
 		mainDictDetail.setType(type);

+ 1 - 1
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -130,7 +130,7 @@ public class WorkCalendarTaskService  {
     /**
      * 每五分钟对签章文件进行文件位置转移处理
      */
-    @Scheduled(cron= "0 0/50 * * * ?")
+    //@Scheduled(cron= "0 0/50 * * * ?")
     @Transactional(readOnly = false)
     public void getProjectSignatureOldMessageDispose() {
         logger.info("--------------处理审定单签章文件(开始)---------------");

+ 455 - 6
src/main/java/com/jeeplus/modules/workfullmanage/service/WorkFullManageService.java

@@ -6,19 +6,31 @@ package com.jeeplus.modules.workfullmanage.service;
 import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.jeeplus.common.config.Global;
 import com.jeeplus.common.mapper.JsonMapper;
+import com.jeeplus.common.oss.OSSClientUtil;
 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.utils.*;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectReportSignatureInfo;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.dao.AreaDao;
 import com.jeeplus.modules.sys.dao.RoleDao;
 import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.OfficeService;
+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.TwoDimensionCode;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
@@ -28,6 +40,7 @@ import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.workcontractinfo.dao.WorkContractAnnexDao;
 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.workfullexecute.dao.WorkFullExecuteDao;
 import com.jeeplus.modules.workfullexecute.entity.WorkFullExecute;
 import com.jeeplus.modules.workfullmanage.dao.WorkFullConstructDao;
@@ -37,14 +50,20 @@ import com.jeeplus.modules.workfullmanage.dao.WorkFullSurveyDao;
 import com.jeeplus.modules.workfullmanage.entity.WorkFullManage;
 import com.jeeplus.modules.workproject.entity.WorkProject;
 import com.jeeplus.modules.workreimbursement.utils.VarStr;
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
+import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 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.io.File;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 
 /**
@@ -55,7 +74,20 @@ import java.util.Map;
 @Service
 @Transactional(readOnly = true)
 public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFullManage> {
+	//空白图片的base64参数
+	private final String blankBase64 = "iVBORw0KGgoAAAANSUhEUgAAAIIAAAA/CAYAAAAsVxBWAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\n" +
+			"jwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAACPSURBVHhe7dIBDQAwEMSg+Td9+1QHaOANjghE\n" +
+			"BCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhAR\n" +
+			"iAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQEQgIhARiAhEBCICEYGIQETg\n" +
+			"bB/QoX96EpAulQAAAABJRU5ErkJggg==";
 
+	/**
+	 * 阿里云文件服务器前缀
+	 */
+	private final static String aliyunUrl = Global.getConfig("aliyunUrl");
+	//生产环境域名
+	@Value("${serverDomain}")
+	private String serverDomain;
 
 	@Autowired
 	private WorkFullManageDao workFullManageDao;
@@ -86,6 +118,22 @@ public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFu
 	@Autowired
 	private AreaDao areaDao;
 
+	@Autowired
+	private ProjectReportDataService projectReportDataService;
+	@Autowired
+	private RuralProjectRecordsService ruralProjectRecordsService;
+	@Autowired
+	private WorkContractInfoService workContractInfoService;
+	@Autowired
+	private RuralProjectMessageNewService ruralProjectMessageNewService;
+	@Autowired
+	private UserService userService;
+	@Autowired
+	private WorkStaffBasicInfoService workStaffBasicInfoService;
+
+	@Autowired
+	private RuralProjectMessageElectronicSealDao ruralProjectMessageElectronicSealDao;
+
 	public WorkFullManage getSimpleWorkFullManage(String id){
 		return super.get(id);
 	}
@@ -468,4 +516,405 @@ public class WorkFullManageService extends CrudService<WorkFullManageDao, WorkFu
 		String resultJsonStr = JsonMapper.toJsonString(resultList);
 		return resultJsonStr;
     }
+
+
+
+	/**
+	 * 质量流程控制单文件数据处理
+	 * @param projectReportData
+	 * @return
+	 */
+	public Map<String,Object> disposeProjectReportdata(ProjectReportData projectReportData){
+		//freemarker参数值准备
+		Map<String,Object> data  = new LinkedHashMap<>();
+		//获取报告信息
+		projectReportData = projectReportDataService.findByNum(projectReportData.getNumber());
+		//获取项目信息
+		RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
+		ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
+		// 将项目负责人替换为项目中的负责人
+		if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+			User user = UserUtils.get(ruralProjectRecords.getProjectMasterId());
+			projectReportData.setPrincipal(user);
+		}
+
+		//获取合同信息
+		WorkContractInfo workContractInfo = workContractInfoService.get(ruralProjectRecords.getWorkContractInfo().getId());
+		//无合同状态下,获取委托方的名称
+		if (workContractInfo == null) {
+			ruralProjectRecordsService.queryLinkmanInfos(ruralProjectRecords);
+			if (ruralProjectRecords.getWorkClientLinkmanList() != null && ruralProjectRecords.getWorkClientLinkmanList().size() > 0) {
+				WorkClientLinkman linkman = ruralProjectRecords.getWorkClientLinkmanList().get(0);
+				workContractInfo = new WorkContractInfo();
+				workContractInfo.setClient(linkman.getClientId());
+			}
+		}
+		List<RuralReportConsultant> consultants = Lists.newArrayList();
+		//将自己添加到咨询员数据中
+		//根据用户查询技能信息(项目负责人信息)
+		RuralReportConsultant currentConsultant = new RuralReportConsultant();
+		//查询总审人员信息
+		RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+		List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
+		if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+			userCertificateList = ruralProjectMessageNewService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
+		}
+		//获取专业类型
+		List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
+		for (WorkStaffCertificate certificateInfo: userCertificateList) {
+			currentConsultant.setZhucezigezhID(certificateInfo.getNum());
+			currentConsultant.setZhucezigezhKey(certificateInfo.getName());
+			for (MainDictDetail type : certificateMajor) {
+				if(certificateInfo.getMajor().equals(type.getValue())){
+					currentConsultant.setMajor(type.getLabel());
+				}
+			}
+			User currentUser=userService.get(ruralProjectRecords.getProjectMasterId());
+			currentConsultant.setZixunyuanName(currentUser.getName());
+			currentConsultant.setZixunyuan(currentUser.getId());
+			currentConsultant.setRole("负责人");
+			consultants.add(currentConsultant);
+		}
+		//根据项目id查找报告咨询员信息
+		List<RuralReportConsultant> consultantList = ruralProjectMessageNewService.getConsultantsList(ruralProjectRecords.getId());
+		Iterator<RuralReportConsultant> it = consultantList.iterator();
+		while(it.hasNext()){
+			RuralReportConsultant consultant = it.next();
+			String auditOpinion = consultant.getAuditOpinion().replaceAll("&nbsp;","");
+			consultant.setAuditOpinion(auditOpinion);
+			if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())){
+				try {
+					MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				it.remove();
+			}else if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
+				List<WorkStaffCertificate> bzshbCertificateList = ruralProjectMessageNewService.getCertificateByUser(projectReportData.getBzshbUserId());
+				for (WorkStaffCertificate certificateInfo: bzshbCertificateList) {
+					bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
+					bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
+					for (MainDictDetail dictType : certificateMajor) {
+						if(certificateInfo.getMajor().equals(dictType.getValue())){
+							bzshbConsultant.setMajor(dictType.getLabel());
+						}
+					}
+					User bzshbUser=userService.get(projectReportData.getBzshbUserId());
+					bzshbConsultant.setZixunyuanName(bzshbUser.getName());
+					bzshbConsultant.setZixunyuan(bzshbUser.getId());
+					bzshbConsultant.setRole("技术负责人");
+				}
+				try {
+					MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				it.remove();
+			}else{
+				//根据用户查询技能信息
+				List<WorkStaffCertificate> certificateList = ruralProjectMessageNewService.getCertificateByUser(consultant.getZixunyuan());
+				for (WorkStaffCertificate certificateInfo: certificateList) {
+					if(certificateInfo.getName().equals(consultant.getZhucezigezhKey())){
+						consultant.setZhucezigezhID(certificateInfo.getNum());
+					}
+					for (MainDictDetail type : certificateMajor) {
+						if(certificateInfo.getMajor().equals(type.getValue())){
+							consultant.setMajor(type.getLabel());
+						}
+					}
+				}
+				User user=userService.get(consultant.getZixunyuan());
+				consultant.setZixunyuanName(user.getName());
+			}
+		}
+		consultants.addAll(consultantList);
+
+		//如果项目负责人名称为空
+		if(org.apache.commons.lang3.StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
+			User user=userService.get(projectReportData.getBzshbUserId());
+			if(null == user){
+				bzshbConsultant.setZixunyuanName("");
+			}else{
+				bzshbConsultant.setZixunyuanName(user.getName());
+			}
+		}
+
+
+		/*//获取专业类型
+		List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");*/
+		//根据 职业资格名称查询字典表并比对当前人员是否已添加该职业资格信息
+		List<MainDictDetail> certificateType = DictUtils.getMainDictList("certificate_type");
+		for (RuralReportConsultant entity: consultants) {
+			for (MainDictDetail type : certificateType) {
+				if(entity.getZhucezigezhKey().equals(type.getValue())){
+					entity.setZhucezigezh(type.getLabel());
+					break;
+				}
+			}
+			if(org.apache.commons.lang3.StringUtils.isBlank(entity.getZhucezigezh())){
+				entity.setZhucezigezh("");
+			}
+		}
+
+		List<MainDictDetail> mainDictList = Lists.newArrayList();
+		//工程咨询
+		if("1".equals(ruralProjectRecords.getProjectType())){
+			mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+			//造价审核
+		} else if("2".equals(ruralProjectRecords.getProjectType())){
+			mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
+		}
+		data.put("projectType","");
+		if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
+			//处理项目类别
+			for (MainDictDetail info: mainDictList) {
+				if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
+					data.put("projectType",info.getLabel());
+					break;
+				}
+			}
+		}
+
+		String consultType = "";
+		if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
+			//处理项目类别
+			for (MainDictDetail info: mainDictList) {
+				if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
+					consultType = info.getLabel();
+					break;
+				}
+			}
+		}
+
+		if(org.apache.commons.lang3.StringUtils.isBlank(projectReportData.getNumber())){
+			data.put("number","");
+		}else{
+			data.put("number",projectReportData.getNumber()+" 号");
+		}
+		//项目名称含html转义字符的进行处理
+		String newJson = StringEscapeUtils.unescapeHtml4(ruralProjectRecords.getProjectName());
+		data.put("projectName",newJson);
+		//咨询类别
+		data.put("consultType",consultType);
+		//委托单位
+		if(null != workContractInfo){
+			if (null != workContractInfo.getClient()) {
+				if(org.apache.commons.lang3.StringUtils.isNotBlank(workContractInfo.getClient().getName())){
+					data.put("entrustUnit",workContractInfo.getClient().getName());
+					data.put("entrustingParty",workContractInfo.getClient().getName());
+				}else{
+					data.put("entrustUnit","");
+					data.put("entrustingParty","");
+				}
+			}else{
+				data.put("entrustUnit","");
+				data.put("entrustingParty","");
+			}
+			if (org.apache.commons.lang3.StringUtils.isNotBlank(workContractInfo.getContractNum())){
+				data.put("contractNumber",workContractInfo.getContractNum());
+			}else{
+				data.put("contractNumber","");
+			}
+		}else{
+			data.put("entrustUnit","");
+			data.put("contractNumber","");
+		}
+		data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
+		//如果项目负责人不为空,则对项目负责人(第一个)进行获取签字章并存储
+		if(org.apache.commons.lang3.StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+			String base64String = base64String(ruralProjectRecords.getProjectMasterId());
+			data.put("handSignature3",base64String);
+		}else{
+			data.put("handSignature3",blankBase64);
+		}
+
+		//查询杨荣华杨所的用户信息
+		User yrhUser = UserUtils.getByUserName("杨荣华");
+		if(org.apache.commons.lang3.StringUtils.isNotBlank(yrhUser.getId())){
+			String base64String = base64String(yrhUser.getId());
+			data.put("handSignature1",base64String);
+		}else{
+			data.put("handSignature1",blankBase64);
+		}
+
+		//查询陈红星陈总的用户信息
+		User chxUser = UserUtils.getByUserName("陈红星");
+		if(org.apache.commons.lang3.StringUtils.isNotBlank(chxUser.getId())){
+			String base64String = base64String(chxUser.getId());
+			data.put("handSignature2",base64String);
+		}else{
+			data.put("handSignature2",blankBase64);
+		}
+
+		//咨询员信息
+		if(null != consultants && consultants.size()>0){
+			data.put("consultantName0",consultants.get(0).getZixunyuanName());
+			data.put("consultantProfession0",consultants.get(0).getMajor());
+			data.put("consultantQualification0",consultants.get(0).getZhucezigezh());
+		}else{
+			data.put("consultantName0","");
+			data.put("consultantProfession0","");
+			data.put("consultantQualification0","");
+		}
+
+
+		//查询签章数据信息
+		ProjectReportSignatureInfo projectReportSignatureInfo = ruralProjectMessageElectronicSealDao.get(projectReportData.getNumber());
+
+		//根据咨询员id查询咨询员信息以及咨询员的专业和资格
+		if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConsultant())){
+			RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
+			User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
+			data.put("consultantName1",consultantUser.getName());
+
+			//如果咨询员不为空,则对项咨询员进行获取签字章并存储
+			if(org.apache.commons.lang3.StringUtils.isNotBlank(consultantUser.getId())){
+				String base64String = base64String(consultantUser.getId());
+				data.put("handSignature4",base64String);
+			}else{
+				data.put("handSignature4","");
+			}
+
+
+
+			data.put("zixunyuanName",consultantUser.getName());
+			data.put("consultantProfession1","");
+			data.put("consultantQualification1","");
+			List<WorkStaffCertificate> certificateByUser = ruralProjectMessageNewService.getCertificateByUser(consultantUser.getId());
+			for (WorkStaffCertificate certificateInfo: certificateByUser) {
+				consultantUserConsultant.setZhucezigezhID(certificateInfo.getNum());
+				consultantUserConsultant.setZhucezigezhKey(certificateInfo.getName());
+				for (MainDictDetail type : certificateMajor) {
+					if(certificateInfo.getMajor().equals(type.getValue())){
+						data.put("consultantProfession1",type.getLabel());
+						break;
+					}
+				}
+			}
+
+			for (MainDictDetail type : certificateType) {
+				if(consultantUserConsultant.getZhucezigezhKey().equals(type.getValue())){
+					data.put("consultantQualification1",type.getLabel());
+					break;
+				}
+			}
+		}else{
+			data.put("zixunyuanName","");
+			data.put("consultantName1","");
+			data.put("consultantProfession1","");
+			data.put("consultantQualification1","");
+			data.put("handSignature4",blankBase64);
+		}
+
+		//咨询报告日期
+		if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getStampDate()){
+			data.put("projectReportDate",dateStr(projectReportSignatureInfo.getStampDate()));
+		}else{
+			data.put("projectReportDate","");
+		}
+		//咨询作业期处理
+		data.put("consultOperationalPeriod","");
+		if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getAgreedStartDate() && null != projectReportSignatureInfo.getAgreedEndDate()){
+			String startDateStr = dateStr(projectReportSignatureInfo.getAgreedStartDate());
+			String endingDateStr = dateStr(projectReportSignatureInfo.getAgreedEndDate());
+			data.put("consultOperationalPeriod",startDateStr + "至" + endingDateStr);
+		}else{
+			data.put("consultOperationalPeriod","");
+		}
+
+		if(null != currentConsultant && org.apache.commons.lang3.StringUtils.isNotBlank(currentConsultant.getZixunyuanName())){
+			//项目负责人
+			data.put("projectMaster",currentConsultant.getZixunyuanName());
+		}else{
+			//项目负责人
+			data.put("projectMaster","");
+		}
+		//咨询项目委托方全称
+		data.put("querySite","ccpm.xgccpm.com");
+
+		String querySite = serverDomain+"/ruralProject/ruralProjectRecords/getDownloadProjectView?id="+projectReportData.getProject().getId();
+		//生成二维码图片和doc文档 缓存文件的共用名称
+		String commonFileName = UUID.randomUUID().toString();
+		String tempPath = this.getClass().getResource("/").getPath()+"/temp/";
+		File temP = new File(tempPath);
+		if(!temP.exists()){
+			temP.mkdirs();
+		}
+		String qrCodePath = tempPath + commonFileName + ".png";
+		TwoDimensionCode.encoderQRCode(querySite, qrCodePath, "png");//执行生成二维码
+		String imageStr = ImageUtil.getImageStr(qrCodePath);
+		data.put("qrcode",imageStr);
+
+		return data;
+	}
+
+
+
+	/**
+	 * 根据用户id获取用户手签章并转换为base64字符串输出
+	 * @param userIds
+	 * @return
+	 */
+	public String base64String(String userIds){
+		String imageStr = "";
+		String path = null;
+		String fileName = null;
+		try {
+			String[] split = userIds.split(",");
+			List<String> userList = Arrays.asList(split);
+			WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(userList.get(0));
+			//判断人员的手签章是否存在
+			if(org.apache.commons.lang3.StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+				String aliyunUrlStr = aliyunUrl + workStaffBasicInfo.getHandSignature();
+				//下载文件
+				if(System.getProperty("os.name").toLowerCase().contains("win")){
+					path = "D:/attachment-file/handSignature/";
+				}else{
+					path = "/attachment-file/handSignature/";
+				}
+
+				String file = aliyunUrlStr;
+				file = file.replace("amp;","");
+				fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+				String aliyunUrl = Global.getAliyunUrl();
+				String aliDownloadUrl = Global.getAliDownloadUrl();
+				String cons = "";
+				if (file.contains(aliyunUrl)){
+					cons = aliyunUrl;
+				}else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+					cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+				}else {
+					cons = aliDownloadUrl;
+				}
+				String ossKey = file.split(cons+"/")[1];
+				File filePath = new File(path);
+				if (!filePath.mkdirs()) {
+					filePath.mkdirs();
+				}
+				new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
+				imageStr = ImageUtil.getImageStr(path+fileName);
+			}
+		}catch (Exception e){
+			e.getMessage();
+		}finally {
+			FileUtils.delFile(path+fileName);
+		}
+		if(org.apache.commons.lang3.StringUtils.isBlank(imageStr)){
+			imageStr = blankBase64;
+		}
+
+
+		return imageStr;
+	}
+	/**
+	 * date转String
+	 * @param date
+	 * @return
+	 */
+	private String dateStr(Date date){
+		String pattern = "yyyy年MM月dd日";
+		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
+		String format = simpleDateFormat.format(date);
+		return format;
+	}
 }

+ 25 - 9
src/main/java/com/jeeplus/modules/workfullmanage/web/WorkFullManageController.java

@@ -856,11 +856,11 @@ public class WorkFullManageController extends BaseController {
 			e.printStackTrace();
 		}
 		//freemarker参数值准备
-		Map<String,Object> data  = new HashMap<>();
+		/*Map<String,Object> data  = new HashMap<>();
 		data.put("repType",list.get(0));
 		data.put("repYear",list.get(1));
 		data.put("repNum",list.get(2));
-		data.put("querySite","ccpm.xgccpm.com");
+		data.put("querySite","ccpm.xgccpm.com");*/
 
 		//生成二维码图片和doc文档 缓存文件的共用名称
 		String commonFileName = UUID.randomUUID().toString();
@@ -869,22 +869,25 @@ public class WorkFullManageController extends BaseController {
 		if(!temP.exists()){
 			temP.mkdirs();
 		}
-		String qrCodePath = tempPath + commonFileName + ".png";
-		TwoDimensionCode.encoderQRCode(querySite, qrCodePath, "png");//执行生成二维码
-		String imageStr = ImageUtil.getImageStr(qrCodePath);
-		data.put("qrcode",imageStr);
-		String pa = this.getClass().getResource("/").getPath();
+		//String qrCodePath = tempPath + commonFileName + ".png";
+		//TwoDimensionCode.encoderQRCode(querySite, qrCodePath, "png");//执行生成二维码
+		//String imageStr = ImageUtil.getImageStr(qrCodePath);
+		//data.put("qrcode",imageStr);
+		//String pa = this.getClass().getResource("/").getPath();
 
 		File docFile = new File(tempPath+commonFileName+".doc");
+
+		Map<String, Object> data = workFullManageService.disposeProjectReportdata(projectReportData);
+
 		FreemarkerUtil.generateFile(data,template,docFile);
 
 		ResponseUtil.docResponse(FILE_NAME,docFile,response);
 
-		if(docFile != null) docFile.delete(); // 删除doc临时文件
+		/*if(docFile != null) docFile.delete(); // 删除doc临时文件
 		File imageFile = new File(qrCodePath);
 		if(imageFile.exists() && imageFile.isFile()) {
 			imageFile.delete();//删除二维码图片临时文件
-		}
+		}*/
 	}
 
 	/**
@@ -1220,6 +1223,13 @@ public class WorkFullManageController extends BaseController {
 					data.put("consultantProfession"+i,consultants.get(i).getMajor());
 				}
 				data.put("consultantQualification"+i,consultants.get(i).getZhucezigezh());
+				if(i == 0){
+					//项目负责人签字章处理
+					if(StringUtils.isNotBlank(consultants.get(i).getZixunyuan())){
+						String base64String = workFullManageService.base64String(consultants.get(i).getZixunyuan());
+						data.put("handSignature1",base64String);
+					}
+				}
 			}
 			if(consultants.size()<6){
 				for (int i = consultants.size(); i<6; i++){
@@ -1267,6 +1277,12 @@ public class WorkFullManageController extends BaseController {
 		if(null != projectReportData.getPrincipalDate()){
 			//项目负责人
 			data.put("projectMaster",currentConsultant.getZixunyuanName());
+			//项目负责人签字章处理
+			if(org.apache.commons.lang3.StringUtils.isNotBlank(currentConsultant.getZixunyuan())){
+				String base64String = workFullManageService.base64String(currentConsultant.getZixunyuan());
+				data.put("handSignature2",base64String);
+			}
+
 			if(StringUtils.isBlank(currentConsultant.getAuditOpinion())){
 				data.put("projectMasterRemarks","");
 			}else{

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1633 - 1677
src/main/resources/freemarker/current.ftl


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3712 - 3047
src/main/resources/freemarker/massControl.ftl


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2633 - 2473
src/main/resources/freemarker/projectSignature.ftl


+ 4 - 3
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchDao.xml

@@ -182,7 +182,7 @@
 		LEFT JOIN rural_project_records r on(g.project_id=r.id)
 		LEFT JOIN project_report_data d on(d.project_id=r.id)
 		WHERE a.id = #{id} and g.del_flag = 0
-		order by a.create_date desc
+		order by g.sort asc,d.number asc,a.create_date desc
 	</select>
 
 	<select id="getProjectFilingBatchRelationList" resultType="com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch">
@@ -194,7 +194,7 @@
 		LEFT JOIN rural_project_records r on(g.project_id=r.id)
 		LEFT JOIN project_report_data d on(d.project_id=r.id)
 		WHERE a.id = #{id}
-		order by a.create_date desc
+		order by g.sort asc,d.number asc,a.create_date desc
 	</select>
 	<select id="findByFilingBatch"
 			resultType="com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch">
@@ -236,6 +236,7 @@
 		  a.project_id as "projectId",
 		  a.status as "status",
 		  a.box_num as "boxNum",
+		  a.sort as "sort",
 		  a.re_box_num as "reBoxNum",
 		  r.project_name as "projectName",
 		  r.project_id as "projectNum",
@@ -248,6 +249,6 @@
 		LEFT JOIN project_report_data prd on prd.project_id=r.id
 		LEFT JOIN sys_user su on r.create_by=su.id
 		WHERE a.filing_batch = #{id}
-		order by a.create_date desc
+		order by a.sort asc,prd.number asc,a.create_date desc
 	</select>
 </mapper>

+ 6 - 3
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchProInfoDao.xml

@@ -7,13 +7,15 @@
 			 filing_batch,
 			 project_id,
 			 proInfo_type,
-			 proInfo_name)
+			 proInfo_name,
+			 sort)
 			 values
 			(#{id},
 			 #{proInfofilingBatch},
 			 #{proId},
 			 #{proInfoType},
-			 #{proInfoName}
+			 #{proInfoName},
+			 #{sort}
 			 )
 	</insert>
 	<select id="findProInfo" resultType="com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo">
@@ -24,7 +26,7 @@
 			   proInfo_name as "proInfoName"
 		from project_filingbatch_proinfo
 		where filing_batch=#{proInfofilingBatch} and project_id=#{proId}
-		order by proInfo_type asc
+		order by sort asc,proInfo_type asc
 	</select>
 
 	<select id="getListByFilingBatchId" resultType="com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo">
@@ -35,6 +37,7 @@
 			   proInfo_name as "proInfoName"
 		from project_filingbatch_proinfo
 		where filing_batch=#{filingBatchId}
+		order by sort asc,proInfo_type asc
 	</select>
 
 	<delete id="delete">

+ 2 - 2
src/main/resources/mappings/modules/projectGuidang/ProjectFilingbatchRelationDao.xml

@@ -16,9 +16,9 @@
 	</sql>
 	<insert id="insert">
 		insert into project_flingbatch_relation
-			(id,create_by,create_date,update_by,update_date,filing_batch,project_id,status,box_num,re_box_num)
+			(id,create_by,create_date,update_by,update_date,filing_batch,project_id,status,box_num,re_box_num,sort)
 		VALUES
-			(#{id},#{createBy.id},#{createDate},#{updateBy.id},#{updateDate},#{filingBatch},#{projectId},#{status},#{boxNum},#{reBoxNum})
+			(#{id},#{createBy.id},#{createDate},#{updateBy.id},#{updateDate},#{filingBatch},#{projectId},#{status},#{boxNum},#{reBoxNum},#{sort})
 	</insert>
 	<delete id="deleteByprojectId">
 		DELETE FROM project_flingbatch_relation WHERE filing_batch=#{filingBatch} and project_id=#{projectId}

+ 26 - 55
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -947,7 +947,7 @@ END) as projectScale*/
 		,"6" as  "projectReportRecordStatus"
 		,prr.record_date as  "recordStartAuditDate"
 		,prd.ZiXunShouRu as "money"
-		<choose>
+		<!--<choose>
 			<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 				/*B类紧急*/
 				,timestampdiff(day,prd.audit_pass_date,now()) as "elseRecordDay"
@@ -955,23 +955,16 @@ END) as projectScale*/
 			<otherwise>
 				,timestampdiff(day,prdt.audit_pass_date,now()) as "elseRecordDay"
 			</otherwise>
-		</choose>
+		</choose>-->
+		,timestampdiff(day,prd.audit_pass_date,now()) as "elseRecordDay"
 		FROM rural_project_records a
 		<include refid="recordDownloadLeftSql"/>
 		<where>
 			a.status = 5
-			and prd.status = 5
-			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
-			and prr.status is null
-			<choose>
-				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
-				/*B类紧急*/
-					/*and a.emergency_project = 1*/ and timestampdiff(day,prd.audit_pass_date,now())>=#{endingCount} and a.submit_money = 1
-				</when>
-				<otherwise>
-					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,now())>=#{endingCount} and a.submit_money = 2
-				</otherwise>
-			</choose>
+			and a.record_state != 7
+			and a.over_record_status = 1
+			and pmdr.id is null
+
 			<if test="beginDate !=null">
 				AND a.create_date >= #{beginDate}
 			</if>
@@ -988,7 +981,7 @@ END) as projectScale*/
 		,"7" as  "projectReportRecordStatus"
 		,prr.record_date as  "recordStartAuditDate"
 		,prd.ZiXunShouRu as "money"
-		<choose>
+		<!--<choose>
 			<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 				/*B类紧急*/
 				,timestampdiff(day,prd.audit_pass_date,prr.record_date) as "exeedRecordDay"
@@ -996,23 +989,15 @@ END) as projectScale*/
 			<otherwise>
 				,timestampdiff(day,prdt.audit_pass_date,prr.record_date) as "exeedRecordDay"
 			</otherwise>
-		</choose>
+		</choose>-->
+		,timestampdiff(day,prd.audit_pass_date,prr.record_date) as "exeedRecordDay"
 		FROM rural_project_records a
 		<include refid="recordDownloadLeftSql"/>
 		<where>
 			a.status = 5
-			and prd.status = 5
-			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
-			and prr.status = 7
-			<choose>
-				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
-				/*B类紧急*/
-					/*and a.emergency_project = 1*/ and timestampdiff(day,prd.audit_pass_date,prr.record_date)>=#{endingCount} and a.submit_money = 1
-				</when>
-				<otherwise>
-					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,prr.record_date)>=#{endingCount} and a.submit_money = 2
-				</otherwise>
-			</choose>
+			and a.record_state = 7
+			and a.over_record_status = 1
+			and pmdr.id is null
 			<if test="beginDate !=null">
 				AND a.create_date >= #{beginDate}
 			</if>
@@ -1121,7 +1106,7 @@ END) as projectScale*/
 		,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 		order by create_date
 		limit 1) as "recordStartAuditDate"
-		<choose>
+		<!--<choose>
 			<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 				/*B类紧急*/
 				,timestampdiff(day,prd.audit_pass_date,now()) as "elseRecordDay"
@@ -1129,25 +1114,21 @@ END) as projectScale*/
 			<otherwise>
 				,timestampdiff(day,prdt.audit_pass_date,now()) as "elseRecordDay"
 			</otherwise>
-		</choose>
+		</choose>-->
+		,timestampdiff(day,prd.audit_pass_date,now()) as "elseRecordDay"
 		,prd.ZiXunShouRu as "money"
 		FROM rural_project_records a
 		<include refid="recordDownloadLeftSql"/>
 		<where>
 			a.status = 5
-			and prd.status = 5
+			and a.reported_state != 7
 			AND a.reported_state != '10'
-			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
-			and rprr.report_status is null
-			<choose>
-				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
-					/*B类紧急*/
-					/*and a.emergency_project = 1*/ and timestampdiff(day,prd.audit_pass_date,now())>=#{endingCount} and a.submit_money = 1
-				</when>
-				<otherwise>
-					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,now())>=#{endingCount} and a.submit_money = 2
-				</otherwise>
-			</choose>
+			AND a.reported_state != '11'
+			and a.over_due_status = 1
+			and pmdr.id is null
+			AND a.del_flag = #{DEL_FLAG_NORMAL}
+
+
 			<if test="beginDate !=null">
 				AND a.create_date >= #{beginDate}
 			</if>
@@ -1183,23 +1164,13 @@ END) as projectScale*/
 		<include refid="recordDownloadLeftSql"/>
 		<where>
 			a.status = 5
+			and a.reported_state = 7
+			and a.over_due_status = 1
+			and pmdr.id is null
 			and prd.status = 5
 			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 			and rprr.report_status is not null
 			and a.reported_state=7
-			<choose>
-				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
-					/*B类紧急*/
-					/*and a.emergency_project = 1*/ and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
-					order by create_date
-					limit 1))>=#{endingCount} and a.submit_money = 1
-				</when>
-				<otherwise>
-					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
-					order by create_date
-					limit 1))>=#{endingCount} and a.submit_money = 2
-				</otherwise>
-			</choose>
 			<if test="beginDate !=null">
 				AND a.create_date >= #{beginDate}
 			</if>

+ 6 - 2
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -2645,18 +2645,22 @@
 		left join project_report_signature prs on prs.project_id = a.id
 		left join project_report_signature_info prsi on prsi.project_report_id = prd.number
 		<where>
-			sdi.year = #{statementCompanyComprehensiveInfo.year}
+			a.status = 5
+			and a.del_flag = 0
+			and sdi.year = #{statementCompanyComprehensiveInfo.year}
 			and sdi.type = #{statementCompanyComprehensiveInfo.type}
 			and sdi.big_date_type = #{statementCompanyComprehensiveInfo.bigDateType}
 			and sdi.small_date_type = #{statementCompanyComprehensiveInfo.smallDateType}
 			and sdi.office_id = #{statementCompanyComprehensiveInfo.officeId}
 			<if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
-				and a.record_state = 6
+				and a.record_state != 7
+				and pmdr.id is null
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 			</if>
 			<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
 				and a.record_state = 7
+				and pmdr.id is null
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 				and prr.status = 5

+ 32 - 2
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -227,10 +227,14 @@
 	<select id="getOverDueNotRecordProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
 		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
 		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
-			and a.record_state = 6
+			and a.status = 5
+			and a.record_state != 7
 			and a.over_record_status = 1
+			and pmdrd.id is null
 		</where>
 	</select>
 
@@ -255,12 +259,15 @@
 		left join sys_office so on so.id = a.office_id
 		left join project_report_data prd on a.id = prd.project_id
 		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.record_state = 7
 			and a.over_record_status = 1
 			and rprr.status = 5
 			and rprr.del_flag = 0
+			and pmdrd.id is null
 			and rprr.accomplish_date >= #{beginDate}
 			and rprr.accomplish_date &lt;= #{endDate}
 		</where>
@@ -279,10 +286,16 @@
 	<select id="getOverDueNotReportedProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
 		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
 		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.reported_state != 7
+			AND a.reported_state != '10'
+			AND a.reported_state != '11'
 			and a.over_due_status = 1
+			and pmdrd.id is null
 		</where>
 	</select>
 
@@ -307,12 +320,15 @@
 		left join sys_office so on so.id = a.office_id
 		left join project_report_data prd on a.id = prd.project_id
 		left join rural_project_records_reported rprr on prd.id = rprr.id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.reported_state = 7
 			and a.over_due_status = 1
 			and rprr.report_status = 5
 			and rprr.del_flag = 0
+			and pmdrd.id is null
 			and rprr.accomplish_date >= #{beginDate}
 			and rprr.accomplish_date &lt;= #{endDate}
 		</where>
@@ -788,10 +804,14 @@
 		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
 		from rural_project_records a
 		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
-			and a.record_state = 6
+			and a.status = 5
+			and a.record_state != 7
 			and a.over_record_status = 1
+			and pmdrd.id is null
 		</where>
 	</select>
 
@@ -816,13 +836,16 @@
 		from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
 		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		left join sys_office so on so.id = a.office_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.record_state = 7
 			and a.over_record_status = 1
 			and rprr.status = 5
 			and rprr.del_flag = 0
+			and pmdrd.id is null
 			and rprr.accomplish_date >= #{beginDate}
 			and rprr.accomplish_date &lt;= #{endDate}
 		</where>
@@ -842,10 +865,14 @@
 		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
 		from rural_project_records a
 		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.reported_state != 7
 			and a.over_due_status = 1
+			and pmdrd.id is null
 		</where>
 	</select>
 
@@ -869,14 +896,17 @@
 		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
 		from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
+		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id
 		left join rural_project_records_reported rprr on prd.id = rprr.id
 		left join sys_office so on so.id = a.office_id
 		<where>
 			a.del_flag=0
+			and a.status = 5
 			and a.reported_state = 7
 			and a.over_due_status = 1
 			and rprr.report_status = 5
 			and rprr.del_flag = 0
+			and pmdrd.id is null
 			and rprr.accomplish_date >= #{beginDate}
 			and rprr.accomplish_date &lt;= #{endDate}
 		</where>

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

@@ -895,7 +895,8 @@
 					xml+="<a href=\"#\" onclick=\"openDialogre('修改报告签发信息', '${ctx}/ruralProject/electronicSeal/form?id=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height:32px;margin-top: 5px;margin-bottom: 5px;' > 修改报告信息</a>";
 				}
 				if(d.signatureDownloadUrl != null && d.signatureDownloadUrl != undefined && d.signatureDownloadUrl != ""){
-					xml+="<a href=\""+d.signatureDownloadUrl+"\" class=\"layui-btn  layui-btn-xs layui-bg-orange\" style='height:32px;margin-top: 5px;margin-bottom: 5px;'>报告下载</a>"
+					xml+="<a href=\"${ctx}/ruralProject/electronicSeal/downloadMassControl?id="+ d.pidId +"\" class=\"layui-btn  layui-btn-xs layui-bg-orange\" style='height:32px;margin-top: 5px;margin-bottom: 5px;'>报告下载</a>"
+					/*xml+="<a href=\""+d.signatureDownloadUrl+"\" class=\"layui-btn  layui-btn-xs layui-bg-orange\" style='height:32px;margin-top: 5px;margin-bottom: 5px;'>报告下载</a>"*/
 				}else{
 					if(d.prsiId != null && d.prsiId != undefined && d.prsiId != ""){
 						//报告下载