Преглед на файлове

审定内质量复核流程功能

user5 преди 3 години
родител
ревизия
01f491858b
променени са 20 файла, в които са добавени 7435 реда и са изтрити 26 реда
  1. 7 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportDataDao.java
  2. 9 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportDataService.java
  3. 6 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  4. 64 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  5. 709 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java
  6. 115 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  7. 10 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  8. 106 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewController.java
  9. 31 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureCallBackController.java
  10. 2 1
      src/main/java/com/jeeplus/modules/sys/service/UserService.java
  11. 22 1
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  12. 512 0
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  13. 26 0
      src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml
  14. 17 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml
  15. 32 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  16. 220 14
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm.jsp
  17. 22 3
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp
  18. 2193 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageAudit.jsp
  19. 1939 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify.jsp
  20. 1393 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageView.jsp

+ 7 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportDataDao.java

@@ -164,6 +164,13 @@ public interface ProjectReportDataDao extends CrudDao<ProjectReportData> {
     Integer updateReportSignatureInfo(RuralProjectRecords records);
 
     /**
+     * 修改质量复核签章 项目中的信息
+     * @param records
+     * @return
+     */
+    Integer updateJudgementSignatureInfo(RuralProjectRecords records);
+
+    /**
      * 根据签章的contractId查询报告信息
      * @param contractId
      * @return

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

@@ -1632,6 +1632,15 @@ public class ProjectReportDataService extends CrudService<ProjectReportDataDao,
 	public void updateReportSignatureInfo(RuralProjectRecords records) {
 		dao.updateReportSignatureInfo(records);
 	}
+	/**
+	 * 修改报告签章 项目重的信息
+	 * @param records
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public void updateJudgementSignatureInfo(RuralProjectRecords records) {
+		dao.updateJudgementSignatureInfo(records);
+	}
 
 	/**
 	 * 根据签章contractId查询报告信息

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -252,6 +252,12 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     RuralProjectRecords getProjectRecordsByContractId(String contractId);
+    /**
+     * 根据签章id查询信息
+     * @param contractId
+     * @return
+     */
+    RuralProjectRecords getJudgementProjectRecordsByContractId(String contractId);
 
 
     /**

+ 64 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -280,6 +280,14 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private User reportSignatureUploadFileUser;		//签章文件上传人信息
 	private Date reportSignatureUploadDate;		//签章文件上传时间
 
+	private Integer qualitySignatureFlag;		//是否质量复核签章(1为已签章)
+	private String qualitySignatureDocumentId;		//质量复核签章documentid
+	private String qualitySignatureContractId;		//质量复核签章contractid
+	private String qualitySignatureInvalidDocumentId;		//质量复核无效的签章documentid
+	private String qualitySignatureFileName;		//质量复核签章文件名称
+	private User qualitySignatureUploadFileUser;		//质量复核签章文件上传人信息
+	private Date qualitySignatureUploadDate;		//质量复核签章文件上传时间
+
 	private String belongingDepartment;    //归属部门
 
 
@@ -2036,4 +2044,60 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setBelongingDepartment(String belongingDepartment) {
 		this.belongingDepartment = belongingDepartment;
 	}
+
+	public Integer getQualitySignatureFlag() {
+		return qualitySignatureFlag;
+	}
+
+	public void setQualitySignatureFlag(Integer qualitySignatureFlag) {
+		this.qualitySignatureFlag = qualitySignatureFlag;
+	}
+
+	public String getQualitySignatureDocumentId() {
+		return qualitySignatureDocumentId;
+	}
+
+	public void setQualitySignatureDocumentId(String qualitySignatureDocumentId) {
+		this.qualitySignatureDocumentId = qualitySignatureDocumentId;
+	}
+
+	public String getQualitySignatureContractId() {
+		return qualitySignatureContractId;
+	}
+
+	public void setQualitySignatureContractId(String qualitySignatureContractId) {
+		this.qualitySignatureContractId = qualitySignatureContractId;
+	}
+
+	public String getQualitySignatureInvalidDocumentId() {
+		return qualitySignatureInvalidDocumentId;
+	}
+
+	public void setQualitySignatureInvalidDocumentId(String qualitySignatureInvalidDocumentId) {
+		this.qualitySignatureInvalidDocumentId = qualitySignatureInvalidDocumentId;
+	}
+
+	public String getQualitySignatureFileName() {
+		return qualitySignatureFileName;
+	}
+
+	public void setQualitySignatureFileName(String qualitySignatureFileName) {
+		this.qualitySignatureFileName = qualitySignatureFileName;
+	}
+
+	public User getQualitySignatureUploadFileUser() {
+		return qualitySignatureUploadFileUser;
+	}
+
+	public void setQualitySignatureUploadFileUser(User qualitySignatureUploadFileUser) {
+		this.qualitySignatureUploadFileUser = qualitySignatureUploadFileUser;
+	}
+
+	public Date getQualitySignatureUploadDate() {
+		return qualitySignatureUploadDate;
+	}
+
+	public void setQualitySignatureUploadDate(Date qualitySignatureUploadDate) {
+		this.qualitySignatureUploadDate = qualitySignatureUploadDate;
+	}
 }

+ 709 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java

@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.*;
@@ -49,6 +51,7 @@ import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.tools.utils.HttpPostTool;
+import com.jeeplus.modules.tools.utils.SignaturePostUtil;
 import com.jeeplus.modules.utils.Aestool;
 import com.jeeplus.modules.utils.Rsatool;
 import com.jeeplus.modules.utils.SftpClientUtil;
@@ -194,6 +197,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
     private ProjectTemplateDao projectTemplateDao;
     @Autowired
     private ProjectPlanDao projectPlanDao;
+    @Autowired
+    private RuralProjectMessageService ruralProjectMessageService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -661,7 +666,21 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     //判定如果是B类紧急项目 则不进行流程,直接通过
                     if("1".equals(ruralProjectRecords.getSubmitMoney()) && "1".equals(ruralProjectRecords.getEmergencyProject())){
 //                        saveReviewAudit(projectReportData,projectRecord,infoId);
-                        this.exigenceProjectSave(projectReportData);
+                        //判断,如果项目类别为审定(内)则走审定内的质量复核流程
+                        if(null != ruralProjectRecords.getAttachmentProjectSort() && "8".equals(ruralProjectRecords.getAttachmentProjectSort())){
+                            //启动流程
+                            String str = null;
+                            try {
+                                str = this.startJudgementAudit(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            if (!str.equals("true")){
+                                return str;
+                            }
+                        }else{
+                            this.exigenceProjectSave(projectReportData);
+                        }
                     }else{
                         //启动流程
                         String str="";
@@ -698,12 +717,15 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     workattachment.setDivIdType("_gistdata");
                 }else if ("153".equals(workattachment.getAttachmentFlag())){
                     workattachment.setDivIdType("_other");
+                }else if ("105".equals(workattachment.getAttachmentFlag())){
+                    workattachment.setDivIdType("_judgement");
                 }
                 if (workattachment.getId() == null) {
                     continue;
                 }
-                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                /*if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
                     workattachment.setAttachmentId(infoId);
+                    workattachment.setProjectId(projectcontentinfo.getProject().getId());
                     workattachment.setAttachmentUser(UserUtils.getUser().getId());
                     if (com.jeeplus.common.utils.StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
                         workattachment.preInsert();
@@ -712,24 +734,194 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                         }
 
                         workattachmentDao.insert(workattachment);
-                        if (projectcontentinfo.getProjectReportData()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
+                        *//*if (projectcontentinfo.getProjectReportData()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
                             try {
                                 signatureDocumentService.createIsignature(workattachment.getUrl(), workattachment.getAttachmentName(), workattachment.getId(), projectcontentinfo.getProjectReportData().getName());
                             } catch (Exception e) {
                                 logger.info("PDF转换失败:" + e);
                             }
-                        }
+                        }*//*
                     } else {
                         workattachment.preUpdate();
                         workattachmentDao.update(workattachment);
                     }
                 } else {
                     workattachmentDao.delete(workattachment);
+                }*/
+
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())){
+                    workattachment.setAttachmentId(projectcontentinfo.getProject().getId());
+                    workattachment.setProjectId(projectcontentinfo.getProject().getId());
+                    workattachment.setAttachmentFlag("105");
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (com.jeeplus.common.utils.StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())){
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    }else{
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                }else{
+                    workattachmentDao.delete(workattachment);
+                }
+            }
+        }
+        return "true";
+    }
+
+
+    /**
+     * 审定(内)启动审批流程
+     * @param projectReportData
+     * @param variables
+     * @param processInstanceId
+     * @param masters
+     * @return
+     * @throws Exception
+     */
+    private String startJudgementAudit(ProjectReportData projectReportData,Map<String, Object> variables,String processInstanceId,List<User> masters) throws Exception {
+        User user = UserUtils.get(projectReportData.getCreateBy().getId());
+        Boolean insert = false;
+        if (StringUtils.isBlank(projectReportData.getId())){
+            projectReportData.preInsert();
+            insert = true;
+        }
+        String num = projectReportData.getNumber();
+        if(com.jeeplus.common.utils.StringUtils.isNotBlank(num)){
+            projectReportNumService.updateNum(num);
+        }
+        ProjectRecords projectRecords = dao.getRuralProjectRecords(projectReportData.getProject().getId());
+        Office recordsOffice =officeService.get(projectRecords.getOffice());
+        String title = "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+        String str =  "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+        // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+        identityService.setAuthenticatedUserId(user.getId());
+        // 启动流程
+        String businessKey = projectReportData.getId().toString();
+        WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("9764872f45b84acd893010e66a3db2c8", recordsOffice);
+        // 启动流程
+        String processType = workActivityMenu.getProcessType();
+        StringBuffer buffer = new StringBuffer();
+        Activity activity = new Activity();
+        WorkProjectNotify workProjectNotify = UtilNotify
+                .saveNotify(projectReportData.getId(),
+                        null,
+                        projectReportData.getCompanyId(),
+                        title,
+                        str,
+                        "105",
+                        "0",
+                        "待审批",
+                        ""
+                );
+        List<User> users = new ArrayList<>();
+
+        //部门主任
+        List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,projectReportData.getOfficeId(),"4",projectRecords.getCreateBy());
+
+
+        if (insert) {
+            projectReportDataService.insert(projectReportData);
+        }else {
+            projectReportDataService.save(projectReportData);
+        }
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(workActivityMenu.getId())) {
+            workProjectNotify.setNotifyRole("");
+            workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+            List<Activity> activities = workActivityMenu.getActivities();
+            for (Activity a : activities) {
+                String encount = a.getEncount();
+                String enlist = a.getEnlist();
+                if (a.getRole()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(a.getRole().getEnname())){
+                    List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
+                    if (enusers.size()==0){
+                        projectReportData.setStatus("1");
+                        projectReportDataService.save(projectReportData);
+                        return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+                    }
+                    variables.put(encount, enusers.size());
+                    variables.put(enlist, enusers);
+                }
+                if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                    activity = a;
+                }
+            }
+            buffer.append(activity.getRole().getEnname());
+            if (activity != null && com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getId())) {
+                //人员审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getUser().getId())) {
+                    users.add(activity.getUser());
                 }
+                //角色审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                    users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
+                }
+            }
+            workProjectNotify.setId("");
+        } else {
+            if (bmzrs.size()==0 ){
+                projectReportData.setStatus("1");
+                projectReportDataService.save(projectReportData);
+            }
+            if (bmzrs.size()==0){
+                return "流程审批人不能为空,部门主任下无用户,请联系管理员!";
+            }
+            processType = "judgementReport";
+            users.addAll(bmzrs);
+            variables.put("bmzrList", bmzrs);
+            variables.put("bmzrcount", bmzrs.size());
+        }
+        for (User u : users){
+            workProjectNotify.setUser(u);
+            workProjectNotify.setNotifyRole("部门主任审批");
+            workProjectNotify.setId("");
+            workProjectNotifyService
+                    .save(workProjectNotify);
+            Map<String,Object> extras = new HashMap<>();
+            extras.put("type","7001");
+            extras.put("id",workProjectNotify.getId());
+            extras.put("procDefKey","105");
+            UserUtils.pushInfoToApp(title,str,extras,u.getId());
+            UserUtils.pushIm(u.getId(),str);
+        }
+        variables.put("type", processType);
+        variables.put("busId", businessKey);
+        variables.put("title", "审批单:" + projectReportData.getNumber());//设置标题;
+
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+        projectReportData.setProcessInstance(processInstance);
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(processInstanceId)) {
+            workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+            workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+            workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+        }
+        // 更新流程实例ID
+        projectReportData.setProcessInstanceId(processInstance.getId());
+        projectReportDataDao.updateProcessInstanceId(projectReportData);
+        //通知添加流程实例ID
+        workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotifyService.save(workProjectNotify);
+        List<Activity> list = workActivityMenu.getActivities();
+        if (list != null && list.size() != 0) {
+            workActivityProcessService.saveList(list, processInstance.getId());
+        } else {
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessKey(processType);
+            workActivityProcess.setCount(1);
+            workActivityProcess.setProcessInstanceId(processInstance.getId());
+            workActivityProcess.setIsApproval("0");
+            workActivityProcess.setCreateBy(user);
+            workActivityProcess.setUpdateBy(user);
+            if (StringUtils.isBlank(workActivityProcess.getId())){
+                workActivityProcess.setId(IdGen.uuid());
             }
+            workActivityProcess.setUpdateDate(new Date());
+            workActivityProcess.setCreateDate(new Date());
+            workActivityProcessService.adminInsert(workActivityProcess);
+            workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
         }
         return "true";
     }
+
+
     @Transactional(readOnly = false)
     public Boolean saveReportTree(Projectcontentinfo projectcontentinfo,Boolean save,String infoId,String review,int type) {
         if (!save){
@@ -1315,6 +1507,519 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         return "保存审核意见成功!";
     }
 
+    /**
+     * 审核流程
+     * @param reportData
+     */
+    @Transactional(readOnly = false)
+    public String auditJudgementSave(ProjectReportData reportData,List<User> auditUsers) {
+
+        if(StringUtils.isNotBlank(reportData.getConsultantRemarks())){
+            while (reportData.getConsultantRemarks().endsWith(",")){
+                reportData.setConsultantRemarks(reportData.getConsultantRemarks().substring(0,reportData.getConsultantRemarks().length()-1));
+            }
+        }
+        if(StringUtils.isNotBlank(reportData.getPrincipalRemarks())){
+            while(reportData.getPrincipalRemarks().endsWith(",")){
+                reportData.setPrincipalRemarks(reportData.getPrincipalRemarks().substring(0,reportData.getPrincipalRemarks().length()-1));
+            }
+        }
+        if(StringUtils.isNotBlank(reportData.getTechnicistRemarks())){
+            while(reportData.getTechnicistRemarks().endsWith(",")){
+                reportData.setTechnicistRemarks(reportData.getTechnicistRemarks().substring(0,reportData.getTechnicistRemarks().length()-1));
+            }
+        }
+        String flag = reportData.getAct().getFlag();
+        // 对不同环节的业务逻辑进行操作
+        Act act = reportData.getAct();
+        String taskDefKey = act.getTaskDefKey();
+        ProjectReportData projectReportData = null;
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit")  ) {
+            actTaskService.claim(act.getTaskId(), UserUtils.getUser().getId());
+            projectReportData = projectReportDataDao.get(reportData.getId());
+        }else {
+            projectReportData = reportData;
+            flag = "yes";
+        }
+        User user= UserUtils.get(projectReportData.getCreateBy().getId());
+        ProjectRecords projectRecords = projectRecordsService.getRuralMasters(projectReportData.getProject().getId());
+        //获取项目信息
+        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
+
+        Office recordsOffice =officeService.get(projectRecords.getOffice());
+        String title = "报告名称:"+projectReportData.getName();
+        String str =  "报告名称:"+projectReportData.getName()+",工作内容类型:"+ WorkContentTypeController.getContentTypeName(projectReportData.getType(),"")+",项目所属部门:"+recordsOffice.getName()+",负责人:"+user.getName();
+
+        if (com.jeeplus.common.utils.StringUtils.isBlank(act.getComment())){
+            act.setComment(flag.equals("yes")?"同意":"驳回");
+        }
+        String comment = "";
+        if (projectReportData.getStatus().equals("4")){
+            comment = ("yes".equals(flag)?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(flag)?"[同意] ":"[驳回] ")+act.getComment();
+        }
+        //yes 的时候状态为审核通过 否则为未通过
+        //1 审核中 2 未通过
+        projectReportData.setStatus(("yes".equals(flag) ? "2" : "4"));
+        Map<String, Object> vars = Maps.newHashMap();
+        //业务逻辑对应的条件表达式
+        String exp = "";
+        String taskCount = "";
+        String notifyRole = "";
+        int key = 0;
+        String enname = "";
+        List<Activity> activitieList = activityService.getByProcessInstanceId(projectReportData.getProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            //判断上面act流程的流程图key是不是空  不是空则使用该流程图key信息
+            if(StringUtils.isNotBlank(act.getProcDefKey())){
+                workActivityMenu.setProcessType(act.getProcDefKey());
+            }else{
+                workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            }
+            workActivityMenu.setActivities(activitieList);
+        }
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(projectReportData.getProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("judgementReport")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    exp = "pass";
+                    if (!"yes".equals(flag)) {
+                        workActivityProcess.setIsApproval("2");
+                        projectReportData.setStatus("4");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                notifyRole = activity.getName();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                }else if(taskDefKey.equals("modifyApply")){
+                    notifyRole = "调整报告";
+                    taskCount = "0";
+                    exp = "pass";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(flag)) {
+                        projectReportData.setStatus("3");
+                        workActivityProcess.setIsApproval("2");
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                }
+            }
+        } else {
+            workActivityMenu.setProcessType("judgementReport");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = activityProcess.getCount() + "";
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+                    taskCount = "1";
+                    exp = "pass";
+                    if ("yes".equals(flag)) {
+                        projectReportData.setTechnicistDate(new Date());
+                        notifyRole = "审批通过";
+                        synchronized (SYN_BYTE) {
+                            /*String reportNo = createReportNo(reportData.getConditionType());
+                            projectReportData.setNumber(reportNo);*/
+
+                            //下载审定单文件
+                            String deleteFile = null;
+                            try {
+                                //进行签章处理
+                                //根据项目id查询是否已经提交过了审定单签章
+                                if(null == ruralProjectRecords){
+                                    return "查询不到该项目信息";
+                                }
+                                if(null!= ruralProjectRecords.getQualitySignatureFlag() && 1 == ruralProjectRecords.getQualitySignatureFlag()){
+                                    return "该项目已经报告盖章完成";
+                                }
+                                if(StringUtils.isBlank(ruralProjectRecords.getProjectMasterId())){
+                                    return "项目负责人为空,无法进行签章";
+                                }
+
+                                //根据项目id和附件类型的
+                                Workattachment workClientAttachment = new Workattachment();
+                                workClientAttachment.setAttachmentFlag("105");
+                                workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
+                                workClientAttachment.setProjectId(ruralProjectRecords.getId());
+                                workClientAttachment.setDivIdType("_judgement");
+                                List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+                                if(fileList.size()>0){
+                                    Workattachment workattachment = fileList.get(0);
+                                    if(StringUtils.isBlank(workattachment.getUrl())){
+                                        return "报告签章文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
+                                    }
+                                    //下载审定单文件
+                                    String path = null;
+                                    if(System.getProperty("os.name").toLowerCase().contains("win")){
+                                        path = "D:/attachment-file/";
+                                    }else{
+                                        path = "/attachment-file/";
+                                    }
+                                    String file = workattachment.getUrl();
+                                    file = file.replace("amp;","");
+                                    String 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];
+                                    new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                                    //将下载下来的文件转换为file文件
+                                    File srcFile = new File(path+fileName);
+                                    deleteFile = path+fileName;
+
+                                    //截取文件名称
+                                    String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+                                    //截取文件后缀名
+                                    String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
+                                    if(!"doc".equals(substring.toLowerCase()) && !"docx".equals(substring.toLowerCase()) && !"pdf".equals(substring.toLowerCase()) && !"xls".equals(substring.toLowerCase()) && !"xlsx".equals(substring.toLowerCase())){
+                                        return "请上传doc、docx、xls、xlsx或者pdf文件进行签章操作";
+                                    }
+                                    //获取真签单的documentId
+                                    HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
+                                    String code = hashMap.get("code").toString();
+                                    String documentId = "";
+                                    if("0".equals(code)){
+                                        String result = hashMap.get("result").toString();
+                                        HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                        documentId =  documentIdMap.get("documentId").toString();
+                                        if("".equals(documentId)){
+                                            return "签章文件创建失败";
+                                        }
+                                    }else{
+                                        String message = hashMap.get("message").toString();
+                                        return message;
+                                    }
+                                    List<String> documentList = Lists.newArrayList();
+                                    documentList.add(documentId);
+                                    //根据项目id 和 documentId生成合同id
+                                    long s1 = System.currentTimeMillis();
+                                    HashMap contractIdHashMap = new HashMap();
+                                    if("doc".equals(substring.toLowerCase()) || "docx".equals(substring.toLowerCase()) || "pdf".equals(substring.toLowerCase()) ){
+                                        contractIdHashMap = ruralProjectMessageService.getSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
+                                    }else if("xls".equals(substring.toLowerCase()) || "xlsx".equals(substring.toLowerCase())){
+                                        contractIdHashMap = ruralProjectMessageService.getSignatureExcelContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
+                                    }
+                                    String contractIdCode = contractIdHashMap.get("code").toString();
+                                    String contractId = "";
+                                    if("0".equals(contractIdCode)){
+                                        contractId = contractIdHashMap.get("contractId").toString();
+                                        if("".equals(contractId)){
+                                            return "签章文件创建失败";
+                                        }
+                                    }else{
+                                        return contractIdHashMap.get("message").toString();
+                                    }
+                                    long s2 = System.currentTimeMillis();
+                                    System.out.println("创建签章合同用时:" + (s2-s1));
+
+                                    //进行静默签署
+                                    long s3 = System.currentTimeMillis();
+                                    HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompanyByKeyWord(contractId,documentList);
+                                    if(null != signbyCompanyHashMap){
+                                        String signbyCompanyCode = signbyCompanyHashMap.get("code").toString();
+                                        String signbyCompanyMessage = signbyCompanyHashMap.get("message").toString();
+                                        if(!"0".equals(signbyCompanyCode) && (!"3001009".equals(signbyCompanyCode) || !"文件状态不是“签署中”".equals(signbyCompanyMessage))){
+                                            return signbyCompanyMessage;
+                                        }
+                                    }
+                                    long s4 = System.currentTimeMillis();
+                                    System.out.println("进行静默签署用时:" + (s4-s3));
+                                    //将documentId 和contractId存储到质量复核对应的数据种
+                                    //签章完成则进行数据的保存
+                                    ruralProjectRecords.setQualitySignatureFlag(1);
+                                    ruralProjectRecords.setQualitySignatureDocumentId(documentId);
+                                    ruralProjectRecords.setQualitySignatureContractId(contractId);
+                                    ruralProjectRecords.setQualitySignatureFileName(srcFileName);
+                                    ruralProjectRecords.setQualitySignatureUploadFileUser(UserUtils.getUser());
+                                    ruralProjectRecords.setQualitySignatureUploadDate(new Date());
+                                    //修改签章对应信息文件
+                                    projectReportDataService.updateJudgementSignatureInfo(ruralProjectRecords);
+                                }else{
+                                    return "质量复核审定单文件未找到,无法进行签章操作";
+                                }
+                            }catch (Exception e){
+
+                            }finally {
+                                if(StringUtils.isNotBlank(deleteFile)){
+                                    //根据路径创建文件对象
+                                    File file = new File(deleteFile);
+                                    //路径是个文件且不为空时删除文件
+                                    if(file.isFile()&&file.exists()){
+                                        file.delete();
+                                    }
+                                }
+                            }
+                            //添加审核通过日期
+                            projectReportData.setAuditPassDate(new Date());
+                        }
+                        workActivityProcess.setIsApproval("1");
+                    } else {
+                        notifyRole = "调整报告";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+                    notifyRole = "部门主任审批";
+                    taskCount = "0";
+                    exp = "pass";
+                    workActivityProcess.setCount(0);
+                    enname = "master";
+                    if (!"yes".equals(flag)) {
+                        projectReportData.setStatus("3");
+                    }
+                    break;
+                }
+            }
+        }
+        // 设置意见
+        act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
+        projectReportData.preUpdate();
+        // 提交流程任务
+        vars.put(exp, "yes".equals(flag) ? true : false);
+        vars.put("passs", true);
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectReportData.getProcessInstanceId(),taskDefKey,"modifyApply",flag,comment, activities);
+        // 提交流程任务
+        actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
+        boolean state = actTaskService.isProcessEnd(act.getProcInsId());
+        ProjectReportData projectReportDataInfo = projectReportDataService.get(projectReportData.getId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if (!state) {
+            users.add(projectReportData.getCreateBy());
+            if ("yes".equals(flag)) {
+                String titleStr = "项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
+                String content = "项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
+                if(StringUtils.isNotBlank(projectReportData.getNumber())){
+                    titleStr = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
+                    content = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
+                }
+                str =  "报告名称:"+projectReportData.getName()+",工作内容类型:"+ WorkContentTypeController.getContentTypeName(projectReportData.getType(),"")+",项目所属部门:"+recordsOffice.getName();
+                projectReportData.setStatus("5");
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportData.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectReportData.getId(),
+                                        projectReportData.getCreateBy(),
+                                        projectReportData.getCompanyId(),
+                                        titleStr,
+                                        content,
+                                        "105",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportData.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(projectReportData.getStatus()) && !projectReportData.getStatus().equals("3")){
+                    projectReportData.setStatus("4");
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportData.getId(),
+                                            projectReportData.getCreateBy(),
+                                            projectReportData.getCompanyId(),
+                                            title,
+                                            str,
+                                            "105",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectReportData.getProcessInstanceId());
+        } else {
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("judgementReport")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportData.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectReportData.getId(),
+                                new User(),
+                                projectReportData.getCompanyId(),
+                                title,
+                                str,
+                                "105",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        flag,
+                        taskCount,
+                        projectReportData.getCreateBy(),
+                        user.getOffice().getId(),
+                        "8");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService
+                            .save(workProjectNotify1);
+                    if (!"modifyApply".equals(taskDefKey)){
+                        Map<String,Object> extras = new HashMap<>();
+                        if ("glyda".equals(taskDefKey)){
+                            extras.put("type","7003");
+                        }else if("zlfgld".equals(taskDefKey)  ){
+                            extras.put("type","7002");
+                        }else {
+                            extras.put("type","7001");
+                        }
+                        extras.put("id",workProjectNotify.getId());
+                        extras.put("procDefKey","105");
+                        UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+
+                    }
+                }
+
+            } else {
+                if (!"yes".equals(flag)) {//报告驳回待办提醒
+                    title = "项目【"+ projectRecords.getProjectName()+"】新增报告质量复核被驳回";
+                    str = "项目【"+ projectRecords.getProjectName()+"】新增报告质量复核被驳回,请选择重新申请或删除报告";
+                    if(StringUtils.isNotBlank(projectReportData.getNumber())){
+                        title = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】新增报告质量复核被驳回";
+                        str = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】新增报告质量复核被驳回,请选择重新申请或删除报告";
+                    }
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectReportData.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportData.getId(),
+                                            projectReportData.getCreateBy(),
+                                            projectReportData.getCompanyId(),
+                                            title,
+                                            str,
+                                            "105",
+                                            "0",
+                                            "重新申请",
+                                            notifyRole));
+                    users.add( projectReportData.getCreateBy());
+                } else {
+                    if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
+                        str = "项目【"+ projectRecords.getProjectName()+"】报告质量复核待审批";
+                        title = "项目【"+ projectRecords.getProjectName()+"】报告质量复核待审批";
+                        if(StringUtils.isNotBlank(projectReportData.getNumber())){
+                            title = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+                            str = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+                        }
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectReportData.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectReportData.getId(),
+                                        new User(),
+                                        projectReportData.getCompanyId(),
+                                        title,
+                                        str,
+                                        "105",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        users.addAll(auditUsers);
+                        for (User user1 : users) {
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService
+                                    .save(workProjectNotify);
+                            if (!"modifyApply".equals(taskDefKey)){
+                                Map<String,Object> extras = new HashMap<>();
+                                if ("glyda".equals(taskDefKey)){
+                                    extras.put("type","7003");
+                                }else if("zlfgld".equals(taskDefKey)  ){
+                                    extras.put("type","7002");
+                                }else {
+                                    extras.put("type","7001");
+                                }
+                                extras.put("id",workProjectNotify.getId());
+                                extras.put("procDefKey","105");
+                                UserUtils.pushInfoToApp(title,str,extras,user1.getId());
+
+                            }
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectReportData.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectReportData.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectReportData.getId(),
+                                                projectReportData.getCreateBy(),
+                                                projectReportData.getCompanyId(),
+                                                title,
+                                                str,
+                                                "105",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+        if (users!=null && users.size()!=0) {
+            for (User u : users) {
+                UserUtils.pushIm(u.getId(),title);
+            }
+        }
+        if (users!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+        if (!"yes".equals(flag)){
+            workReviewAuditDao.delReviewAudit(projectReportData.getId());
+        }
+        projectReportData.setTechnicist(reportData.getTechnicist());
+        projectReportData.setTechnicistRemarks(reportData.getTechnicistRemarks());
+        projectReportData.setConsultantRemarks(reportData.getConsultantRemarks());
+        projectReportData.setPrincipalRemarks(reportData.getPrincipalRemarks());
+        projectReportDataDao.update(projectReportData);
+
+        return "保存审核意见成功!";
+    }
+
 
 
     /**

+ 115 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3975,6 +3975,121 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
     }
 
     /**
+     * 根据项目id 和 documentId生成合同id
+     * @param projectId
+     * @param documentList
+     * @return
+     */
+    public HashMap getSignatureExcelContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+        //根据项目id查询项目信息
+        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //公司圆章-竖
+        companyAction.setSealId(COMPANYROUNDSEALIDVERTICAL);
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        Location location = new Location();
+        location.setDocumentId(documentList.get(0));
+        location.setPage("0");
+        location.setRectType("SEAL_CORPORATE");
+        location.setKeyword("咨询企业");
+        location.setKeywordIndex(-1);
+        /*location.setOffsetX("0.5264");
+        location.setOffsetY("0.6787");*/
+        locations.add(location);
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
+        //根据角色信息录入签署方信息
+        //负责人
+        if(StringUtils.isNotBlank(principalUserId)){
+            User user = UserUtils.get(principalUserId);
+            if(null != user){
+                //获取成员印章id信息
+                String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"",user.getName() + "一级注册造价工程师章-竖");
+                if(StringUtils.isNotBlank(userSealId)){
+                    Action actionUser = new Action();
+                    actionUser.setType("CORPORATE");
+                    actionUser.setName(user.getName() + "印章");    //填写人员信息
+                    actionUser.setSerialNo("1");
+                    actionUser.setSealId(userSealId);   //人员印章id
+
+                    //添加盖章位置
+                    List<Location> principalLocations = Lists.newArrayList();
+                    Location principalLocation = new Location();
+                    principalLocation.setDocumentId(documentList.get(0));
+                    principalLocation.setPage("0");
+                    principalLocation.setRectType("SEAL_CORPORATE");
+                    principalLocation.setKeyword("项目负责人(签字盖章)");
+                    principalLocation.setKeywordIndex(-1);
+                    principalLocation.setOffsetX("-0.07");
+                    /*principalLocation.setOffsetX("0.5971");
+                    principalLocation.setOffsetY("0.8176");*/
+                    principalLocations.add(principalLocation);
+                    actionUser.setLocations(principalLocations);
+                    actions.add(actionUser);
+                }
+            }
+        }
+        //总经理
+        User technologyPrincipalUser = UserUtils.getByLoginName("陈红星");
+        if(null != technologyPrincipalUser){
+            //获取成员印章id信息
+            String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星个人签名章-竖");
+            if(StringUtils.isNotBlank(userSealId)){
+                Action actionUser = new Action();
+                actionUser.setType("CORPORATE");
+                actionUser.setName(technologyPrincipalUser.getName() + "印章");    //填写人员信息
+                actionUser.setSerialNo("1");
+                actionUser.setSealId(userSealId);   //人员印章id
+
+                //添加盖章位置
+                List<Location> principalLocations = Lists.newArrayList();
+                Location principalLocation = new Location();
+                principalLocation.setDocumentId(documentList.get(0));
+                principalLocation.setPage("0");
+                principalLocation.setRectType("SEAL_CORPORATE");
+                principalLocation.setKeyword("签发人");
+                principalLocation.setOffsetY("0.1");
+                principalLocation.setKeywordIndex(-1);
+                /*principalLocation.setOffsetX("0.7758");
+                principalLocation.setOffsetY("0.7339");*/
+                principalLocations.add(principalLocation);
+                actionUser.setLocations(principalLocations);
+                actions.add(actionUser);
+            }
+        }
+
+
+        //创建签署方信息表
+        List<SignatorieInfo> signatories = Lists.newArrayList();
+        SignatorieInfo signatorieInfo1 = new SignatorieInfo();
+        signatorieInfo1.setSerialNo("1");
+        signatorieInfo1.setTenantName("江苏兴光项目管理有限公司");
+        signatorieInfo1.setTenantType("COMPANY");
+        signatorieInfo1.setActions(actions);
+        signatories.add(signatorieInfo1);
+        SignatureContract signatureContract = new SignatureContract();
+        signatureContract.setDocuments(documentList);
+        //审定单用印流程id
+        signatureContract.setCategoryId(APPROVALCATEGORYID);
+        signatureContract.setSend(false);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        signatureContract.setSubject(ruralProjectRecords.getProjectName());//添加项目名称
+        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        HashMap hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
      * 根据合同编号查询签章合同对应的url访问界面
      * @param contractId
      * @param contractId

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

@@ -2802,6 +2802,16 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	}
 
 	/**
+	 * 根据签章contractId查询报告信息
+	 * @param contractId
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public RuralProjectRecords getJudgementProjectRecordsByContractId(String contractId) {
+		return dao.getJudgementProjectRecordsByContractId(contractId);
+	}
+
+	/**
 	 * 根据项目id查询造价审核项目的项目类别
 	 * @param projectIdList
 	 * @return

+ 106 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewController.java

@@ -34,7 +34,9 @@ import com.jeeplus.modules.sys.dao.UserDao;
 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.entity.Workattachment;
 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.workcontractinfo.entity.WorkContractInfo;
@@ -101,6 +103,8 @@ public class RuralCostProjectMessageNewController extends BaseController {
     private UserDao userDao;
     @Autowired
     private ProjectPlanService projectPlanService;
+    @Autowired
+    private WorkattachmentService workattachmentService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -346,6 +350,18 @@ public class RuralCostProjectMessageNewController extends BaseController {
 
         //添加当前文件服务器类型
         projectcontentinfo.setUploadMode(uploadMode);
+        if("8".equals(records.getAttachmentProjectSort())){
+            //根据项目id和附件类型的
+            Workattachment workClientAttachment = new Workattachment();
+            workClientAttachment.setAttachmentFlag("105");
+            workClientAttachment.setAttachmentId(records.getId());
+            workClientAttachment.setProjectId(records.getId());
+            workClientAttachment.setDivIdType("_judgement");
+            List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+            workattachmentService.attachmentManageOnUrl(fileList);
+            projectcontentinfo.setWorkAttachments(fileList);
+
+        }
         model.addAttribute("projectRecords", records);
         model.addAttribute("projectcontentinfo", projectcontentinfo);
         model.addAttribute("projectReportData", projectcontentinfo.getProjectReportData());
@@ -403,6 +419,21 @@ public class RuralCostProjectMessageNewController extends BaseController {
         if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
             userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
         }
+
+        if("8".equals(ruralProjectRecords.getAttachmentProjectSort())){
+            //根据项目id和附件类型的
+            Workattachment workClientAttachment = new Workattachment();
+            workClientAttachment.setAttachmentFlag("105");
+            workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
+            workClientAttachment.setProjectId(ruralProjectRecords.getId());
+            workClientAttachment.setDivIdType("_judgement");
+            List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+            workattachmentService.attachmentManageOnUrl(fileList);
+            projectcontent.setWorkAttachments(fileList);
+
+        }
+
+
         //获取专业类型
         List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
         for (WorkStaffCertificate certificateInfo: userCertificateList) {
@@ -566,6 +597,10 @@ public class RuralCostProjectMessageNewController extends BaseController {
                 Act act = getByAct(projectReportData.getProcessInstanceId());
                 projectReportData.setAct(act);
             }
+            if("8".equals(ruralProjectRecords.getAttachmentProjectSort())){
+                model.addAttribute("attachmentProjectSort", ruralProjectRecords.getAttachmentProjectSort());
+                return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify";
+            }
             return "modules/ruralprojectrecords/cost/projectcontentinfo/new/reportModify";
         }
         return "modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm";
@@ -866,6 +901,77 @@ public class RuralCostProjectMessageNewController extends BaseController {
 
     }
 
+    //报告流程审批
+    @RequestMapping(value = {"reportJudgementAudit"})
+    public String reportJudgementAudit(Projectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response, Model model,
+                              RedirectAttributes redirectAttributes,Integer saveAuditFlag) throws Exception {
+        ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
+        if(StringUtils.isNotBlank(projectReportData.getProcessInstanceId())){
+            Act act = getByAct(projectReportData.getProcessInstanceId());
+            projectReportData.setAct(act);
+        }
+        ProjectReportData t = projectReportDataService.getOnRural(projectReportData.getId());//从数据库取出记录的值
+        if(null != saveAuditFlag){
+            if(1 == saveAuditFlag && !t.getStatus().equals("4") && !t.getStatus().equals("5")){
+                addMessage(redirectAttributes, "项目报告已送审,请勿重复送审");
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+            }
+        }
+        if(t.getStatus().equals("5")){
+            addMessage(redirectAttributes, "项目报告已登记完成,无法再次送审");
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+        }
+        try {
+            MyBeanUtils.copyBeanNotNull2Bean(projectReportData, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            if(StringUtils.isNotBlank(t.getProcessInstanceId())){
+                Act act = getByAct(t.getProcessInstanceId());
+                MyBeanUtils.copyBeanNotNull2Bean(projectReportData.getAct(), act);
+                t.setAct(act);
+                projectcontentinfo.setProjectReportData(t);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+        String taskDefKey =  t.getAct().getTaskDefKey();
+        List<User> users = null;
+        User auditUser = null;
+        ProjectRecords projectRecord = projectRecordsServices.getRuralMasters(projectcontentinfo.getProject().getId());
+        projectReportData.setProject(projectRecord);
+        if ("bmzr".equals(taskDefKey)){
+            users = UserUtils.getByProssType(t.getProcessInstanceId(),2);
+            if (users==null )
+                users = UserUtils.getByRoleActivityEnname("bmzr",2,t.getOfficeId(),"4",t.getCreateBy());
+        }else if ("modifyApply".equals(taskDefKey)){
+            users = UserUtils.getByProssType(t.getProcessInstanceId(),1);
+        }
+        String flag = t.getAct().getFlag();
+        if ("yes".equals(flag) && (users==null || users.size()==0)){
+            addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+        }else {
+            if ("modifyApply".equals(taskDefKey)){
+                ruralProjectMessageService.saveData(projectcontentinfo,3);
+            }
+            //添加查询报告号模板的bizCode参数
+            if("1".equals(projectRecord.getProjectType())){
+                t.setConditionType("10");
+            }else if("2".equals(projectRecord.getProjectType())){
+                t.setConditionType("1003");
+            }
+            String str = ruralProjectMessageService.auditJudgementSave(t, users);
+            addMessage(redirectAttributes, str);
+        }
+        if (StringUtils.isNotBlank(projectcontentinfo.getHome()) && projectcontentinfo.getHome().equals("home")){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else {
+            if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("edit")){
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+            }
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+        }
+
+    }
+
     @RequestMapping(value = "revoke")
     public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
         HashMap<String, String> requestMap = findRequestMap(request);

+ 31 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureCallBackController.java

@@ -181,8 +181,19 @@ public class RuralProjectSignatureCallBackController extends BaseController {
             List<Location> locations = coordinateInfo.getLocations();
             //将无效的documentId转换为List
             List<String> invalidDocumentIdList = Arrays.asList(projectReportData.getSignatureInvalidDocumentId().split(","));
+
+            Iterator iterator = locations.iterator();
+            while (iterator.hasNext()) {
+                Location data = (Location) iterator.next();
+                if (null == data.getPage()){
+                    iterator.remove();
+                }else if(!"1".equals(data.getPage())){
+                    iterator.remove();
+                }
+            }
+
             //遍历坐标 将对应的印章和坐标填写在Stamper种
-            for (Location location: locations) {
+            for (Location location : locations) {
                 List<Stamper> stampers = Lists.newArrayList();
                 for (String invalidDocumentId: invalidDocumentIdList) {
                     Stamper stamper = new Stamper();
@@ -321,4 +332,23 @@ public class RuralProjectSignatureCallBackController extends BaseController {
         requestHeaderMap.put("x-qys-timestamp", "0");
         SignaturePostUtil.downloadZipGet(HTTPTOP + "/contract/download?contractId="+contractId,requestHeaderMap,ruralProjectRecords.getReportSignatureFileName()+".zip","",response);
     }
+
+    /**
+     * 下载附件
+     */
+    @RequestMapping(value = "/downLoadJudgementReportAttach", method=RequestMethod.GET)
+    public void downLoadJudgementReportAttach(String contractId,HttpServletResponse response) {
+        //根据contractId查询对应的报告信息
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.getJudgementProjectRecordsByContractId(contractId);
+        if(null == ruralProjectRecords || StringUtils.isBlank(ruralProjectRecords.getQualitySignatureContractId())){
+            return ;
+        }
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        SignaturePostUtil.downloadZipGet(HTTPTOP + "/contract/download?contractId="+contractId,requestHeaderMap,ruralProjectRecords.getQualitySignatureFileName()+".zip","",response);
+    }
 }

+ 2 - 1
src/main/java/com/jeeplus/modules/sys/service/UserService.java

@@ -579,7 +579,8 @@ public class UserService extends BaseController {
             case "2"://真实总审
                 userList = userDao.getAuditUserListByProjectGrade();
                 break;
-            case "1"://真实或虚拟总审
+            case "1"://真实或虚拟总审(改为真实总审)
+                userList = userDao.getAuditUserListByProjectGrade();
                 break;
         }
         return userList;

+ 22 - 1
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -314,6 +314,27 @@ public class WorkInvoiceTwoController extends BaseController {
 				act.setTask(taskInfok);
 				workInvoice.setAct(act);
 				view = "workInvoiceTwoModify";
+
+
+				//获取发票项目信息
+				List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
+				List<String> projectIdList = Lists.newArrayList();
+				//获取项目id并查询所有包含项目id的项目信息
+				for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
+					if(StringUtils.isNotBlank(projectInfo.getProjectId())){
+						projectIdList.add(projectInfo.getProjectId());
+					}
+				}
+
+				if(projectIdList.size()>0){
+					//根据项目id查询项目信息中的项目类别
+					String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
+					//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
+					if(projectSortCostInfo.contains("8")){
+						view = "workInvoiceExamineModify";
+					}
+				}
+
 			}
 		}
 		// 环节编号
@@ -414,7 +435,7 @@ public class WorkInvoiceTwoController extends BaseController {
 			//根据项目id查询项目信息中的项目类别
 				String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
 				//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
-				if(projectSortCostInfo.contains("8")){
+				if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
 					str = workInvoiceService.saveBranchExamine(workInvoice, variables,processInstanceId);
 				}else{
 					str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);

+ 512 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -3743,6 +3743,518 @@ public class WorkProjectNotifyController extends BaseController {
 						projectcontentinfo.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
 						return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/projectRecordsMessageView";
 					}
+				} else if (workProjectNotify.getType().equals("105")) {    //审定(内)质量复核报告
+					//查询“配农网”工程类型id
+					String engineeringId = engineeringService.getEngineeringId("202");
+					ProjectReportData projectReportData = projectReportDataService.getOnRural(workProjectNotify.getNotifyId());
+					RuralProjectRecords ruralProjectRecords=ruralProjectRecordsService.getQueryProjectUsers(projectReportData.getProject().getId());
+
+					if(null != ruralProjectRecords){
+						//获取项目计划信息
+						ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+						//将项目id放入项目计划表中
+						projectPlanInfo.setProjectId(ruralProjectRecords.getId());
+						//获取项目计划信息
+						List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+						if(projectPlanList.size()>0){
+							String startDate = projectPlanList.get(0).getEndDate();
+							String endDate = projectPlanList.get(projectPlanList.size()-1).getBeginDate();
+							model.addAttribute("projectStartDate", startDate);
+							model.addAttribute("projectEndDate", endDate);
+						}else{
+							model.addAttribute("projectStartDate", "");
+							model.addAttribute("projectEndDate", "");
+						}
+					}else{
+						model.addAttribute("projectStartDate", "");
+						model.addAttribute("projectEndDate", "");
+					}
+
+					if(StringUtils.isBlank(ruralProjectRecords.getProjectMasterId())){
+						ruralProjectRecords.setProjectMasterId(projectReportData.getPrincipal().getId());
+						ruralProjectRecords.setProjectMasterName(projectReportData.getPrincipal().getName());
+					}
+					Act act = getByAct(projectReportData.getProcessInstanceId());
+					projectReportData.setAct(act);
+					Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
+					projectcontentinfo.setProjectReportData(projectReportData);
+
+					if(null != ruralProjectRecords && null != ruralProjectRecords.getAttachmentProjectSort() && StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
+						if("8".equals(ruralProjectRecords.getAttachmentProjectSort())){
+							//根据项目id和附件类型的
+							Workattachment workClientAttachment = new Workattachment();
+							workClientAttachment.setAttachmentFlag("105");
+							workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
+							workClientAttachment.setProjectId(ruralProjectRecords.getId());
+							workClientAttachment.setDivIdType("_judgement");
+							List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+							workattachmentService.attachmentManageOnUrl(fileList);
+							projectcontentinfo.setWorkAttachments(fileList);
+
+						}
+						model.addAttribute("attachmentProjectSort", ruralProjectRecords.getAttachmentProjectSort());
+					}else{
+						model.addAttribute("attachmentProjectSort", "");
+					}
+
+					//添加当前文件服务器类型
+					projectcontentinfo.setUploadMode(uploadMode);
+					List<MainDictDetail> achievementTypes = DictUtils.getMainDictList("achievement_type");
+					if(null != achievementTypes){
+						for (MainDictDetail achievementType:achievementTypes) {
+							if(achievementType.getValue().equals(projectReportData.getAchievementType())){
+								projectReportData.setAchievementType(achievementType.getLabel());
+								break;
+							}
+						}
+					}
+					//根据项目id查找咨询员信息
+					List<RuralReportConsultant> consultants = Lists.newArrayList();
+					//将自己添加到咨询员数据中
+					//根据用户查询技能信息
+					RuralReportConsultant currentConsultant = new RuralReportConsultant();
+					List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
+					if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+						userCertificateList = ruralProjectMessageService.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 = ruralProjectMessageService.getConsultantsList(projectReportData.getProject().getId());
+					//使用迭代器去除重复信息
+					//排除 重新申请|撤销
+					Iterator<RuralReportConsultant> it = consultantList.iterator();
+					while(it.hasNext()){
+						RuralReportConsultant consultant = it.next();
+						if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())){
+							try {
+								MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
+							} catch (Exception e) {
+								e.printStackTrace();
+							}
+							it.remove();
+						}else{
+							//根据用户查询技能信息
+							List<WorkStaffCertificate> certificateList = ruralProjectMessageService.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());
+							consultant.setRole("咨询员");
+						}
+					}
+					consultants.addAll(consultantList);
+
+					//根据条件查询附件必填项
+					//判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
+					ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+					//添加项目类型
+					relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
+					relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+					String money=ruralProjectRecords.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;
+					}
+
+					//添加报告类型
+					relateInfo.setRequiredStage(1);
+					relateInfo.setId(ruralProjectRecords.getId());
+					//查询报告文件、依据性文件、其他文件必填列表以及数据
+					List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+					for (MainDictDetail mainDict : mainDictDetails) {
+						relateInfo.setAttachType(mainDict.getValue());
+						switch (mainDict.getValue()) {
+							case "11":
+								List<ProjectTemplateInfo> fileAttachmentList = projectTemplateService.getProjectTemplateList(relateInfo);
+								for (ProjectTemplateInfo info: fileAttachmentList) {
+									info.setAttachTypes(info.getAttachTypes().toLowerCase());
+									if(engineeringId.equals(ruralProjectRecords.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 = projectTemplateService.getProjectTemplateList(relateInfo);
+								for (ProjectTemplateInfo info: projectTemplateList) {
+									info.setAttachTypes(info.getAttachTypes().toLowerCase());
+									if(engineeringId.equals(ruralProjectRecords.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(projectTemplateService.getProjectTemplateList(relateInfo));
+								break;
+						}
+
+					}
+					if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+						projectcontentinfo.setHome(workProjectNotify.getHome());
+					}else{
+						projectcontentinfo.setHome("home");
+					}
+					//获取子项目列表信息
+					List<SubProjectInfo> subProjectInfos=this.queryReportDetails(projectcontentinfo.getProject().getId());
+					//获取合同信息
+					WorkContractInfo workContractInfo=this.queryWorkContract(projectcontentinfo.getProject().getId());
+					//收费标准
+					//查询合同对应委托方客户信息
+					if(null != workContractInfo){
+						WorkClientInfo clientInfo = workClientInfoService.get(workContractInfo.getClient().getId());
+						model.addAttribute("workClientInfo", clientInfo);
+						if(StringUtils.isNotBlank(workContractInfo.getChargeCriterion())){
+							//收费标准
+							String [] biao=workContractInfo.getChargeCriterion().split(",");
+							List<String> chargeCriterionList=new ArrayList<>();
+							for (int i=0;i<biao.length;i++){
+								chargeCriterionList.add(biao[i]);
+							}
+							projectcontentinfo.setChargeCriterionList(chargeCriterionList);
+						}
+					}
+					ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
+					//工程咨询
+					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");
+					}
+					if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
+						//处理项目类别
+						for (MainDictDetail info: mainDictList) {
+							if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
+								ruralProjectRecords.setAttachmentProjectSort(info.getLabel());
+								break;
+							}
+						}
+					}
+					model.addAttribute("processInstanceId",projectReportData.getProcessInstanceId());
+					model.addAttribute("projectId", projectcontentinfo.getProject().getId());
+					model.addAttribute("id", projectcontentinfo.getId());
+					model.addAttribute("projectcontentinfo", projectcontentinfo);
+					model.addAttribute("projectRecords", ruralProjectRecords);
+					model.addAttribute("consultantinfo", consultants);
+					model.addAttribute("consultantCount", consultants.size());
+					model.addAttribute("subProjectInfos", subProjectInfos);
+					model.addAttribute("workContractInfo", workContractInfo);
+					//tap页
+					//查询所有的工程类型
+					List<ProjectEngineeringInfo> projectEngineeringInfo=engineeringService.findList(new ProjectEngineeringInfo());
+					model.addAttribute("projectEngineeringInfo",projectEngineeringInfo);
+					//项目计划
+					RuralProjectRecords projectRecordPlans=this.planView(projectcontentinfo.getProject().getId());
+					model.addAttribute("projectRecordPlans", projectRecordPlans);
+
+
+					//获取评分标准
+					//获取自检的质量复核标准
+					String reviewId="";
+					if ("2".equals(ruralProjectRecords.getSubmitMoney())){
+						reviewId="1";
+					}else{
+						if(StringUtils.isBlank(ruralProjectRecords.getEmergencyProject()) ||"0".equals(ruralProjectRecords.getEmergencyProject())){
+							reviewId="2";
+						}else{
+							reviewId="3";
+						}
+					}
+					List<WorkReviewAudit> workReviewAudits = projectContentDataService.findListReview(reviewId,"质量复核");
+					model.addAttribute("list", workReviewAudits);
+					if (null!=workReviewAudits){
+						projectReportData.setProjectReviewList(workReviewAudits);
+					}
+					model.addAttribute("projectReportData", projectReportData);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						//展示
+						WorkReviewAudit workReviewAudit = new WorkReviewAudit();
+						String type = "4";
+						workReviewAudit.setCompanyId(UserUtils.getSelectCompany().getId());
+						workReviewAudit.setType(type);
+						workReviewAudit.setReportId(workProjectNotify.getNotifyId());
+						List<WorkReviewAudit> audits = workReviewStandardService.findAuditList(workReviewAudit);
+						for(WorkReviewAudit reviewAudit:workReviewAudits){
+							for (WorkReviewAudit audit:audits){
+								if (reviewAudit.getId().equals(audit.getStandardId())){
+									reviewAudit.setDeductOption(audit.getDeductOption());
+									break;
+								}
+							}
+						}
+						model.addAttribute("lists", workReviewAudits);
+						//查询总审人员信息
+						RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+						List<WorkStaffCertificate> bzshbCertificateList = Lists.newArrayList();
+						if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+							bzshbCertificateList = ruralProjectMessageService.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());
+						}
+
+						Iterator<RuralReportConsultant> itView = consultants.iterator();
+						while(itView.hasNext()){
+							RuralReportConsultant consultant = itView.next();
+							if(bzshbCertificateList.size()>0){
+								if(consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}else{
+								if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}
+						}
+
+						if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
+							consultants.add(bzshbConsultant);
+						}else{
+							User user=userService.get(projectReportData.getBzshbUserId());
+							bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
+							bzshbConsultant.setZixunyuan(user.getId());
+							bzshbConsultant.setRole("技术负责人");
+							consultants.add(bzshbConsultant);
+						}
+						model.addAttribute("consultantinfo", consultants);
+						model.addAttribute("consultantCount", consultants.size());
+						projectcontentinfo.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
+						projectcontentinfo.setFileGistdataList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
+						projectcontentinfo.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
+						return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						//查询总审人员信息
+						RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+						List<WorkStaffCertificate> bzshbCertificateList = Lists.newArrayList();
+						if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+							bzshbCertificateList = ruralProjectMessageService.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());
+							consultants.add(bzshbConsultant);
+						}
+						Iterator<RuralReportConsultant> itView = consultants.iterator();
+						while(itView.hasNext()){
+							RuralReportConsultant consultant = itView.next();
+							if(bzshbCertificateList.size()>0){
+								if(consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}else{
+								if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}
+						}
+
+						if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
+							consultants.add(bzshbConsultant);
+						}else{
+							User user=userService.get(projectReportData.getBzshbUserId());
+							bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
+							bzshbConsultant.setZixunyuan(user.getId());
+							bzshbConsultant.setRole("技术负责人");
+							consultants.add(bzshbConsultant);
+						}
+						model.addAttribute("consultantinfo", consultants);
+						model.addAttribute("consultantCount", consultants.size());
+						projectcontentinfo.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
+						projectcontentinfo.setFileGistdataList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
+						projectcontentinfo.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
+						model.addAttribute("identification", "projectReportData");
+						model.addAttribute("identificationName","报告审核意见");
+						return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						Iterator<RuralReportConsultant> itView = consultants.iterator();
+						while(itView.hasNext()){
+							RuralReportConsultant consultant = itView.next();
+							if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
+								itView.remove();
+							}
+						}
+						model.addAttribute("info", consultants);
+						model.addAttribute("consultantCount", consultants.size());
+
+						return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify";
+					} else {
+						WorkReviewAudit workReviewAudit = new WorkReviewAudit();
+						String type = "4";
+						workReviewAudit.setCompanyId(UserUtils.getSelectCompany().getId());
+						workReviewAudit.setType(type);
+						workReviewAudit.setReportId(workProjectNotify.getNotifyId());
+						List<WorkReviewAudit> audits = workReviewStandardService.findAuditList(workReviewAudit);
+						for(WorkReviewAudit reviewAudit:workReviewAudits){
+							for (WorkReviewAudit audit:audits){
+								if (reviewAudit.getId().equals(audit.getStandardId())){
+									reviewAudit.setDeductOption(audit.getDeductOption());
+								}
+							}
+						}
+						model.addAttribute("lists", workReviewAudits);
+						//查询总审人员信息
+						RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+						List<WorkStaffCertificate> bzshbCertificateList = Lists.newArrayList();
+						if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+							bzshbCertificateList = ruralProjectMessageService.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());
+							consultants.add(bzshbConsultant);
+						}
+						Iterator<RuralReportConsultant> itView = consultants.iterator();
+						while(itView.hasNext()){
+							RuralReportConsultant consultant = itView.next();
+							if(bzshbCertificateList.size()>0){
+								if(consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}else{
+								if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
+									try {
+										MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+										bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
+										bzshbConsultant.setRole("技术负责人");
+									} catch (Exception e) {
+										e.printStackTrace();
+									}
+									itView.remove();
+								}
+							}
+						}
+
+						if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
+							consultants.add(bzshbConsultant);
+						}else{
+							User user=userService.get(projectReportData.getBzshbUserId());
+							bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
+							bzshbConsultant.setZixunyuan(user.getId());
+							bzshbConsultant.setRole("技术负责人");
+							consultants.add(bzshbConsultant);
+						}
+						model.addAttribute("consultantinfo", consultants);
+						model.addAttribute("consultantCount", consultants.size());
+						projectcontentinfo.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
+						projectcontentinfo.setFileGistdataList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
+						projectcontentinfo.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
+						return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageView";
+					}
 				}else if (workProjectNotify.getType().equals("97")) {    //工作内容报告new流程2
 					//查询“配农网”工程类型id
 					String engineeringId = engineeringService.getEngineeringId("202");

+ 26 - 0
src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml

@@ -1152,6 +1152,32 @@
 		WHERE id = #{id}
 	</update>
 
+	<update id="updateJudgementSignatureInfo">
+		UPDATE rural_project_records SET
+			<if test="qualitySignatureDocumentId != null and qualitySignatureDocumentId != ''">
+				quality_signature_document_id = #{qualitySignatureDocumentId}
+			</if>
+			<if test="qualitySignatureInvalidDocumentId != null and qualitySignatureInvalidDocumentId != ''">
+				,quality_signature_invalid_document_id = #{qualitySignatureInvalidDocumentId}
+			</if>
+			<if test="qualitySignatureContractId != null and qualitySignatureContractId != ''">
+				,quality_signature_contract_id = #{qualitySignatureContractId}
+			</if>
+			<if test="qualitySignatureFlag != null and qualitySignatureFlag != ''">
+				,quality_signature_flag = #{qualitySignatureFlag}
+			</if>
+			<if test="qualitySignatureFileName != null and qualitySignatureFileName != ''">
+				,quality_signature_file_name = #{qualitySignatureFileName}
+			</if>
+			<if test="qualitySignatureUploadFileUser != null and qualitySignatureUploadFileUser.id != null and qualitySignatureUploadFileUser.id != ''">
+				,quality_signature_upload_file_user = #{qualitySignatureUploadFileUser.id}
+			</if>
+			<if test="qualitySignatureUploadDate != null and qualitySignatureUploadDate != ''">
+				,quality_signature_upload_date = #{qualitySignatureUploadDate}
+			</if>
+		WHERE id = #{id}
+	</update>
+
 	<select id="getProjectReportDataByContractId" resultType="ProjectReportData" >
 		SELECT
 		<include refid="projectReportDataColumns"/>

+ 17 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -47,7 +47,23 @@
 		a.over_due_status as "overDueStatus",
 		ifnull(a.record_state,0) as "projectRecordStatus",
 		a.over_record_status as "overRecordStatus",
-		a.emergency_project as "emergencyProject"
+		a.emergency_project as "emergencyProject",
+		a.attachment_project_sort as "attachmentProjectSort",
+		a.report_signature_flag as "reportSignatureFlag",
+		a.report_signature_document_id as "reportSignatureDocumentId",
+		a.report_signature_contract_id as "reportSignatureContractId",
+		a.report_signature_invalid_document_id as "reportSignatureInvalidDocumentId",
+		a.report_signature_file_name as "reportSignatureFileName",
+		a.report_signature_upload_file_user as "reportSignatureUploadFileUser.id",
+		a.report_signature_upload_date as "reportSignatureUploadDate",
+		a.quality_signature_flag as "qualitySignatureFlag",
+		a.quality_signature_document_id as "qualitySignatureDocumentId",
+		a.quality_signature_contract_id as "qualitySignatureContractId",
+		a.quality_signature_invalid_document_id as "qualitySignatureInvalidDocumentId",
+		a.quality_signature_file_name as "qualitySignatureFileName",
+		a.quality_signature_upload_file_user as "qualitySignatureUploadFileUser.id",
+		a.quality_signature_upload_date as "qualitySignatureUploadDate",
+		a.belonging_department as "belongingDepartment"
 	</sql>
 
 	<sql id="projectReportDataColumns">

+ 32 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -63,6 +63,13 @@
 		a.report_signature_file_name as "reportSignatureFileName",
 		a.report_signature_upload_file_user as "reportSignatureUploadFileUser.id",
 		a.report_signature_upload_date as "reportSignatureUploadDate",
+		a.quality_signature_flag as "qualitySignatureFlag",
+		a.quality_signature_document_id as "qualitySignatureDocumentId",
+		a.quality_signature_contract_id as "qualitySignatureContractId",
+		a.quality_signature_invalid_document_id as "qualitySignatureInvalidDocumentId",
+		a.quality_signature_file_name as "qualitySignatureFileName",
+		a.quality_signature_upload_file_user as "qualitySignatureUploadFileUser.id",
+		a.quality_signature_upload_date as "qualitySignatureUploadDate",
 		a.belonging_department as "belongingDepartment"
 	</sql>
 
@@ -119,6 +126,30 @@
 		WHERE a.report_signature_contract_id = #{contractId}
 	</select>
 
+	<select id="getJudgementProjectRecordsByContractId" resultType="RuralProjectRecords" >
+		SELECT
+			<include refid="projectRecordsColumns"/>
+		,a.file_num AS "fileNum"
+	    ,a.check_process_instance_id AS "checkProcessInstanceId"
+        ,su.name AS "createBy.name"
+        ,o.top_company AS "office.name"
+		,prd.number AS "projectReportNumber"
+		,prd.id AS "prdId"
+		,prr.id As "prrid"
+		,a.project_master_id as "projectMasterId"
+		,a.submit_money as "submitMoney"
+		,a.engineering_type as "engineeringType"
+		,supmi.name as "projectMasterName"
+        FROM rural_project_records a
+        <include refid="projectRecordsJoins"/>
+        LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+		left join project_report_data prd on prd.project_id = a.id
+		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		WHERE a.quality_signature_contract_id = #{contractId}
+	</select>
+
 
 	<select id="getById" resultType="RuralProjectRecords" >
 		SELECT
@@ -1902,7 +1933,7 @@
 			</if>
 		</where>
 	</select>
-	
+
 	<select id="getBelongingDepartmentByBelongingDepartmentName" parameterType="java.lang.String" resultType="java.lang.String">
 		select id from sys_office where name = #{belongingDepartmentName}
 	</select>

+ 220 - 14
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm.jsp

@@ -172,6 +172,17 @@
 								}
 							}
 						}
+
+						var attachmentProjectSort = ${projectRecords.attachmentProjectSort};
+						if(8 == attachmentProjectSort){
+							var length = $("#file_attachment_judgement").find("tr").length ;
+							if(length<1){
+								parent.layer.msg("审定(内)项目请上传审定单文件!", {icon: 2});
+								return false;
+							}
+						}
+
+
 						var info = false;
 						if(dataList == undefined){
 							dataList = ${fns:toJson(workReviewAudits)}
@@ -307,20 +318,47 @@
         }
         function insertTitle(tValue){
             var files = $("#attachment_file")[0].files;
-            for(var i=0;i<files.length;i++) {
-                var file = files[i];
-                var attachmentId = "";
-                var attachmentFlag = "86";
-                console.log(file);
-                var timestamp = new Date().getTime();
+			var length = $("#file_attachment_judgement").find("tr").length ;
+			if(length>0){
+				top.layer.msg("已上传审定单签章文件,审定单签章文件有且只能存在一条", {icon: 0});
+				return;
+			}
+			if(files.length>1){
+				top.layer.msg("只能够上传一个审定单签章文件", {icon: 0});
+				return;
+			}
+			for(var i = 0;i<files.length;i++) {
+				var file = files[i];
+				var attachTypes = "doc,docx,pdf,xls,xlsx";
+				var suffixResult = 0;
+				var fileName = file.name.lastIndexOf(".");//获取到文件名开始到最后一个“.”的长度。
+				var fileNameLength = file.name.length;//获取到文件名长度
+				var suffix = file.name.substring(fileName + 1, fileNameLength);//截取后缀名
+				suffix = suffix.toLowerCase();//后缀名转换小写
+				attachTypes = attachTypes.toLowerCase();
+				var attachTypeList = attachTypes.split(",");
+				for (var x in attachTypeList) {
+					if(attachTypeList[x] == suffix){
+						suffixResult = 1;
+						break;
+					}
+				}
+				if(suffixResult == 0 ){
+					top.layer.msg("上传附件只能为:"+attachTypes+" 类型文件", {icon: 0});
+					return false;
+				}
+
+				var attachmentId = $("#id").val();
+				var attachmentFlag = "105";
+				/*console.log(file);*/
+				var timestamp=new Date().getTime();
 
 				var storeAs = "projectRecords";
-                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
-                /*将这段字符串存到数据库即可*/
-                var divId = "_attachment";
-                $("#addFile" + divId).show();
-                multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, "0");
-            }
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment_judgement";
+				$("#addFile"+divId).show();
+				multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);
+			}
         }
 
         function gistdataInsertTitle(tValue){
@@ -1301,13 +1339,181 @@
 				</div>
 			</div>
 
+			<c:if test="${projectRecords.attachmentProjectSort == 8}">
+				<div class="form-group layui-row">
+					<div class="form-group-label"><h2>审定单签章附件信息</h2></div>
+					<div class="layui-item nav-btns">
+						<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+					</div>
+					<div id="addFile_attachment_judgement" style="display: none" class="upload-progress">
+						<span id="fileName_attachment_judgement" ></span>
+						<b><span id="baifenbi_attachment_judgement" ></span></b>
+						<div class="progress">
+							<div id="jindutiao_attachment_judgement" class="progress-bar" style="width: 0%" aria-valuenow="0">
+							</div>
+						</div>
+					</div>
+					<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+					<span id="attachment_title"></span>
+					<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+						<table id="listAttachment" class="table table-bordered table-condensed details">
+							<thead>
+							<tr>
+									<%-- <th>序号</th>--%>
+								<th>文件预览</th>
+								<th>上传人</th>
+								<th>上传时间</th>
+								<th width="180px">操作</th>
+							</tr>
+							</thead>
+							<tbody id="file_attachment_judgement">
+							<c:forEach items="${projectcontentinfo.workAttachments}" var = "workClientAttachment" varStatus="status">
+								<tr>
+										<%-- <td>${status.index + 1}</td>--%>
+									<c:choose>
+										<c:when test="${projectcontentinfo.uploadMode == 2}">
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+													<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																	<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+																</c:when>
+																<c:otherwise>
+																	<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+													<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<c:choose>
+																<c:when test="${workReimbursement.uploadMode == 2}">
+																	<c:choose>
+																		<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+																			<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+																		</c:when>
+																		<c:otherwise>
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+																					<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																							<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+																						</c:when>
+																						<c:otherwise>
+																							<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:otherwise>
+																	</c:choose>
+																</c:when>
+																<c:otherwise>
+																	<c:choose>
+																		<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+																			<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+																		</c:when>
+																		<c:otherwise>
+																			<c:choose>
+																				<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+																					<td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+																				</c:when>
+																				<c:otherwise>
+																					<c:choose>
+																						<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																							<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+																						</c:when>
+																						<c:otherwise>
+																							<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+																						</c:otherwise>
+																					</c:choose>
+																				</c:otherwise>
+																			</c:choose>
+																		</c:otherwise>
+																	</c:choose>
+																</c:otherwise>
+															</c:choose>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+
+									<td>${workClientAttachment.createBy.name}</td>
+									<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+									<td class="op-td">
+										<div class="op-btn-box" >
+											<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												<%--													<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">--%>
+												<%--														<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>--%>
+												<%--													</c:if>--%>
+											<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+										</div>
+									</td>
+								</tr>
+							</c:forEach>
+							</tbody>
+						</table>
+					</div>
+				</div>
+			</c:if>
+
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>成果文件</h2></div>
 <%--				<div class="layui-item nav-btns">--%>
 					<%--<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>--%>
 <%--					<a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${ctx}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=11&projectType=2&projectId=${projectRecords.id}&reviewFee='+$('#reviewFee').val(),'500px','350px',false,'inputForm','file_attachment')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>--%>
 <%--				</div>--%>
-				<div id="addFile_attachment" style="display: none" class="upload-progress">
+				<%--<div id="addFile_attachment" style="display: none" class="upload-progress">
 					<span id="fileName_attachment" ></span>
 					<span id="_attachment" ></span>
 					<b><span id="baifenbi_attachment" ></span></b>
@@ -1317,7 +1523,7 @@
 					</div>
 				</div>
 				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-				<span id="attachment_title"></span>
+				<span id="attachment_title"></span>--%>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
 					<table id="upTable" class="table table-bordered table-condensed tree_table">
 						<thead>

+ 22 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp

@@ -503,6 +503,13 @@
 
 					<%--xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectMessage/deleteReport?projectId=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目报告质量复核吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 删除报告</a>";--%>
 				}
+				if(d.projectReportStatus == 5){
+					if(undefined != d.qualitySignatureFlag && null != d.qualitySignatureFlag && "" != d.qualitySignatureFlag){
+						if(undefined != d.qualitySignatureContractId && null != d.qualitySignatureContractId && "" != d.qualitySignatureContractId){
+							xml+="<a href=\"${ctx}/ruralProject/signatureCallBack/downLoadJudgementReportAttach?contractId="+ d.qualitySignatureContractId +"\" class=\"layui-btn  layui-btn-xs layui-bg-orange\" style='height:32px;margin-top: 5px;margin-bottom: 5px;'>审定单签章下载</a>"
+						}
+					}
+				}
 
 				//报告签发操作
 				if(d.projectReportStatus == 5 && d.emergencyProject != 1){
@@ -535,18 +542,27 @@
 						if(d.emergencyProject == 1){
 							/*xml+="<a href=\"#\" style='background-color: #FFB800' onclick=\"openDialogre('下载模板', '${ctx}/ruralProject/ruralCostProjectMessage/skipDownloadFtl?id=" + d.id +"','35%', '35%','','下载,关闭')\" class=\"op-btn\" > 下载模板</a>";*/
 							if(d.projectReportRecordStatus == 0 || d.projectReportRecordStatus == 6){
-								xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								if(8 != d.attachmentProjectSort){
+									xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								}
+
 								xml+="<a href=\"#\" onclick=\"openDialogre('新增归档信息', '${ctx}/ruralProject/ruralCostProjectMessageNewTwo/formRecord?reportId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 线上归档</a>";
 							}
 							if(d.projectReportRecordStatus == 1){
-								xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								if(8 != d.attachmentProjectSort){
+									xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								}
+
 								xml+="<a href=\"#\" onclick=\"openDialogre('修改归档信息', '${ctx}/ruralProject/ruralCostProjectMessageNewTwo/formRecordModify?id=" + d.prrId +"','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg- layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 线上重新归档</a>";
 							}
 							if(d.projectReportRecordStatus == 2){
 								xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectMessage/cancelInvalidate?id=" + d.prrId + "&processInstanceId=" + d.prrProcessInstanceId + "\" onclick=\"return confirmx('确认要撤回该报告线上归档审批吗?', this.href)\" class=\"layui-btn layui-btn-xs  layui-bg-red\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 撤回线上归档</a>";
 							}
 							if(d.projectReportRecordStatus == 3){
-								xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								if(8 != d.attachmentProjectSort){
+									xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改质量复核</a>";
+								}
+
 								xml+="<a href=\"#\" onclick=\"openDialogre('撤回调整归档信息', '${ctx}/ruralProject/ruralCostProjectMessageNewTwo/formRecordModify?id=" + d.prrId + " ','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 线上重新归档</a>";
 							}
 							if(d.projectReportRecordStatus == 4){
@@ -1156,6 +1172,9 @@
                     ,"createName":"${projectRecords.createBy.name}"
                     ,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
                     ,"projectReportStatus":"${projectRecords.projectReportStatus}"
+                    ,"attachmentProjectSort":"${projectRecords.attachmentProjectSort}"
+                    ,"qualitySignatureFlag":"${projectRecords.qualitySignatureFlag}"
+                    ,"qualitySignatureContractId":"${projectRecords.qualitySignatureContractId}"
                     ,"projectReportStatusTwo":"${projectRecords.projectReportStatusTwo}"
                     ,"defectRecordStatus":"${projectRecords.defectRecordStatus}"
                     ,"projectReportRecordStatus":"${projectRecords.projectReportRecordStatus}"

Файловите разлики са ограничени, защото са твърде много
+ 2193 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageAudit.jsp


Файловите разлики са ограничени, защото са твърде много
+ 1939 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify.jsp


Файловите разлики са ограничени, защото са твърде много
+ 1393 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageView.jsp