Ver código fonte

签章流程加入线程,提高运行速度

user5 3 anos atrás
pai
commit
ff89e307af

+ 21 - 16
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -12,15 +12,13 @@ import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
-import com.jeeplus.modules.oa.entity.OaNotify;
-import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
-import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
-import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.*;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.thread.ApprovalThread;
+import com.jeeplus.modules.ruralprojectrecords.thread.SignatureThread;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -42,7 +40,6 @@ import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
 import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
@@ -54,7 +51,6 @@ import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -469,7 +465,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                         vars.put("passs", true);
                         notifyRole = "审批通过";
 
-                        //下载审定单文件
+                        new ApprovalThread(ruralProjectRecords,projectApprovalSignature,projectReportData,office).start();
+                        /*//下载审定单文件
                         String deleteFile = null;
                         try {
                             //进行签章调用
@@ -570,13 +567,13 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                     return contractIdHashMap.get("message").toString();
                                 }
                                 //进行静默签署
-                                HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompany(contractId, documentList);
+                                *//*HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompany(contractId, documentList);
                                 if(null != signbyCompanyHashMap){
                                     String signbyCompany = signbyCompanyHashMap.get("code").toString();
                                     if(!"0".equals(signbyCompany)){
                                         return signbyCompanyHashMap.get("message").toString();
                                     }
-                                }
+                                }*//*
                                 //将documentId 和contractId存储到质量复核对应的数据种
                                 //签章完成则进行数据的保存
                                 projectReportData.setSignatureFlag(1);
@@ -601,7 +598,7 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                     file.delete();
                                 }
                             }
-                        }
+                        }*/
 
                     } else {
                         workActivityProcess.setIsApproval("2");
@@ -652,7 +649,11 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         List<User> userList = new ArrayList<>();
         if(!state) {
             users.add(projectApprovalSignature.getCreateBy());
-            //审核完成提示框
+            projectApprovalSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
+            WorkProjectNotify notify = new WorkProjectNotify();
+            notify.setNotifyId(projectApprovalSignature.getId());
+            userList = workProjectNotifyService.readByNotifyId(notify);
+            /*//审核完成提示框
             String title = "报告号【"+projectReportData.getNumber()+"】审定单审批登记完成";
             String content = "报告号【"+projectReportData.getNumber()+"】审定单审批登记完成,项目编号:"+ruralProjectRecords.getProjectId();
             if ("yes".equals(projectApprovalSignature.getAct().getFlag())) {
@@ -711,7 +712,7 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectApprovalSignature.getProcessInstanceId());
-
+*/
         }else{
             if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("approvalSignature")) {
                 WorkProjectNotify notify = new WorkProjectNotify();
@@ -1199,7 +1200,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                         vars.put("passs", true);
                         notifyRole = "审批通过";
 
-                        //下载审定单文件
+                        new SignatureThread(ruralProjectRecords,projectApprovalSignature,projectReportData,office).start();
+                        /*//下载审定单文件
                         String deleteFile = null;
                         try {
                             //进行签章调用
@@ -1326,7 +1328,7 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                     file.delete();
                                 }
                             }
-                        }
+                        }*/
 
                     } else {
                         workActivityProcess.setIsApproval("2");
@@ -1377,8 +1379,11 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         List<User> userList = new ArrayList<>();
         if(!state) {
             users.add(projectApprovalSignature.getCreateBy());
+            WorkProjectNotify notify = new WorkProjectNotify();
+            notify.setNotifyId(projectApprovalSignature.getId());
+            userList = workProjectNotifyService.readByNotifyId(notify);
             //审核完成提示框
-            String title = "报告号【"+projectReportData.getNumber()+"】报告签章审批登记完成";
+           /* String title = "报告号【"+projectReportData.getNumber()+"】报告签章审批登记完成";
             String content = "报告号【"+projectReportData.getNumber()+"】报告签章审批登记完成,项目编号:"+ruralProjectRecords.getProjectId();
             if ("yes".equals(projectApprovalSignature.getAct().getFlag())) {
                 projectApprovalSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
@@ -1436,7 +1441,7 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                 }
             }
             workActivityProcessService.deleteProcessIdAuditUsers(projectApprovalSignature.getProcessInstanceId());
-
+*/
         }else{
             if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("reportSignature")) {
                 WorkProjectNotify notify = new WorkProjectNotify();

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

@@ -1765,7 +1765,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                     System.out.println("创建签章合同用时:" + (s2-s1));
 
                                     //进行静默签署
-                                    long s3 = System.currentTimeMillis();
+                                    /*long s3 = System.currentTimeMillis();
                                     HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompanyByKeyWord(contractId,documentList);
                                     if(null != signbyCompanyHashMap){
                                         String signbyCompanyCode = signbyCompanyHashMap.get("code").toString();
@@ -1775,7 +1775,7 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                         }
                                     }
                                     long s4 = System.currentTimeMillis();
-                                    System.out.println("进行静默签署用时:" + (s4-s3));
+                                    System.out.println("进行静默签署用时:" + (s4-s3));*/
                                     //将documentId 和contractId存储到质量复核对应的数据种
                                     //签章完成则进行数据的保存
                                     ruralProjectRecords.setQualitySignatureFlag(1);
@@ -1786,9 +1786,9 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                                     ruralProjectRecords.setQualitySignatureUploadDate(new Date());
                                     //修改签章对应信息文件
                                     projectReportDataService.updateJudgementSignatureInfo(ruralProjectRecords);
-                                }else{
+                                }/*else{
                                     return "质量复核审定单文件未找到,无法进行签章操作";
-                                }
+                                }*/
                             }catch (Exception e){
 
                             }finally {

+ 200 - 96
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3868,6 +3868,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @return
      */
     public HashMap getSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+        HashMap hashMap = new HashMap();
+        Set<String> serialIdSet = new HashSet<>();
         //根据项目id查询项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
         //创建签署方信息
@@ -3877,20 +3879,20 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         companyAction.setName("公司印章");
         companyAction.setSerialNo("1");
         //公司圆章-竖
-        companyAction.setSealId(COMPANYROUNDSEALIDVERTICAL);
+        serialIdSet.add(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);
+        for (String documentId: documentList) {
+            Location location = new Location();
+            location.setSealId(COMPANYROUNDSEALIDVERTICAL);
+            location.setDocumentId(documentId);
+            location.setPage("0");
+            location.setRectType("SEAL_CORPORATE");
+            location.setKeywordIndex(-1);
+            location.setOffsetX("0.5264");
+            location.setOffsetY("0.6787");
+            locations.add(location);
+        }
 
         //根据角色信息录入签署方信息
         //负责人
@@ -3900,27 +3902,29 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 //获取成员印章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.5971");
-                    principalLocation.setOffsetY("0.8176");
-                    principalLocations.add(principalLocation);
-                    actionUser.setLocations(principalLocations);
-                    actions.add(actionUser);
+                    for (String documentId: documentList) {
+                        //添加盖章位置
+                        Location principalLocation = new Location();
+                        serialIdSet.add(userSealId);
+                        principalLocation.setSealId(userSealId);
+                        principalLocation.setDocumentId(documentId);
+                        principalLocation.setPage("0");
+                        principalLocation.setRectType("SEAL_CORPORATE");
+                        principalLocation.setKeywordIndex(-1);
+                        principalLocation.setOffsetX("0.5971");
+                        principalLocation.setOffsetY("0.8176");
+                        locations.add(principalLocation);
+                    }
+                }else{
+                    hashMap.put("code","2");
+                    hashMap.put("message","查询不到项目负责人 "+ user.getName() + " 的印章信息!请联系管理员");
+                    return hashMap;
                 }
             }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到项目负责人信息!请联系管理员");
+            return hashMap;
         }
         //总经理
         User technologyPrincipalUser = UserUtils.getByLoginName("陈红星");
@@ -3928,27 +3932,35 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             //获取成员印章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
+                for (String documentId: documentList) {
+                    //添加盖章位置
+                    Location principalLocation = new Location();
+                    serialIdSet.add(userSealId);
+                    principalLocation.setSealId(userSealId);
+                    principalLocation.setDocumentId(documentId);
+                    principalLocation.setPage("0");
+                    principalLocation.setRectType("SEAL_CORPORATE");
+                    principalLocation.setKeywordIndex(-1);
+                    principalLocation.setOffsetX("0.7758");
+                    principalLocation.setOffsetY("0.7339");
+                    locations.add(principalLocation);
+                }
 
-                //添加盖章位置
-                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.7758");
-                principalLocation.setOffsetY("0.7339");
-                principalLocations.add(principalLocation);
-                actionUser.setLocations(principalLocations);
-                actions.add(actionUser);
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到技术负责人 陈红星 的印章信息!请联系管理员");
+                return hashMap;
             }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到技术负责人信息!请联系管理员");
+            return hashMap;
         }
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("true");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
 
 
         //创建签署方信息表
@@ -3963,13 +3975,13 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         signatureContract.setDocuments(documentList);
         //审定单用印流程id
         signatureContract.setCategoryId(APPROVALCATEGORYID);
-        signatureContract.setSend(false);
+        signatureContract.setSend(true);
         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);
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
 
         return hashMap;
     }
@@ -3981,6 +3993,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @return
      */
     public HashMap getSignatureExcelContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+        HashMap hashMap = new HashMap();
+        Set<String> serialIdSet = new HashSet<>();
         //根据项目id查询项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
         //创建签署方信息
@@ -3990,7 +4004,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         companyAction.setName("公司印章");
         companyAction.setSerialNo("1");
         //公司圆章
-        companyAction.setSealId(COMPANYROUNDSEALID);
+        //companyAction.setSealId(COMPANYROUNDSEALID);
+        serialIdSet.add(COMPANYROUNDSEALID);
         //添加盖章位置
         List<Location> locations = Lists.newArrayList();
         Location location = new Location();
@@ -4002,8 +4017,6 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         /*location.setOffsetX("0.5264");
         location.setOffsetY("0.6787");*/
         locations.add(location);
-        companyAction.setLocations(locations);
-        actions.add(companyAction);
 
         //根据角色信息录入签署方信息
         //负责人
@@ -4013,14 +4026,16 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 //获取成员印章id信息
                 String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"",user.getName() + "一级注册造价工程师章");
                 if(StringUtils.isNotBlank(userSealId)){
-                    Action actionUser = new Action();
+                    /*Action actionUser = new Action();
                     actionUser.setType("CORPORATE");
                     actionUser.setName(user.getName() + "印章");    //填写人员信息
                     actionUser.setSerialNo("1");
-                    actionUser.setSealId(userSealId);   //人员印章id
+                    actionUser.setSealId(userSealId);   //人员印章id*/
+
+                    serialIdSet.add(userSealId);
 
                     //添加盖章位置
-                    List<Location> principalLocations = Lists.newArrayList();
+                    //List<Location> principalLocations = Lists.newArrayList();
                     Location principalLocation = new Location();
                     principalLocation.setDocumentId(documentList.get(0));
                     principalLocation.setPage("0");
@@ -4028,11 +4043,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     principalLocation.setKeyword("项目负责人(签字盖章)");
                     principalLocation.setKeywordIndex(-1);
                     principalLocation.setOffsetX("-0.07");
+                    locations.add(principalLocation);
                     /*principalLocation.setOffsetX("0.5971");
                     principalLocation.setOffsetY("0.8176");*/
-                    principalLocations.add(principalLocation);
+                    /*principalLocations.add(principalLocation);
                     actionUser.setLocations(principalLocations);
-                    actions.add(actionUser);
+                    actions.add(actionUser);*/
                 }
             }
         }
@@ -4042,14 +4058,16 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             //获取成员印章id信息
             String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星个人签名章");
             if(StringUtils.isNotBlank(userSealId)){
-                Action actionUser = new Action();
+                /*Action actionUser = new Action();
                 actionUser.setType("CORPORATE");
                 actionUser.setName(technologyPrincipalUser.getName() + "印章");    //填写人员信息
                 actionUser.setSerialNo("1");
-                actionUser.setSealId(userSealId);   //人员印章id
+                actionUser.setSealId(userSealId);   //人员印章id*/
+
+                serialIdSet.add(userSealId);
 
                 //添加盖章位置
-                List<Location> principalLocations = Lists.newArrayList();
+                //List<Location> principalLocations = Lists.newArrayList();
                 Location principalLocation = new Location();
                 principalLocation.setDocumentId(documentList.get(0));
                 principalLocation.setPage("0");
@@ -4057,13 +4075,19 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 principalLocation.setKeyword("签发人");
                 principalLocation.setOffsetY("0.1");
                 principalLocation.setKeywordIndex(-1);
+                locations.add(principalLocation);
                 /*principalLocation.setOffsetX("0.7758");
                 principalLocation.setOffsetY("0.7339");*/
-                principalLocations.add(principalLocation);
+                /*principalLocations.add(principalLocation);
                 actionUser.setLocations(principalLocations);
-                actions.add(actionUser);
+                actions.add(actionUser);*/
             }
         }
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("true");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
 
 
         //创建签署方信息表
@@ -4078,13 +4102,13 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         signatureContract.setDocuments(documentList);
         //审定单用印流程id
         signatureContract.setCategoryId(APPROVALCATEGORYID);
-        signatureContract.setSend(false);
+        signatureContract.setSend(true);
         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);
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
 
         return hashMap;
     }
@@ -4269,6 +4293,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @return
      */
     public HashMap getReportSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+        HashMap hashMap = new HashMap();
+        List<String> serialIdList = Lists.newArrayList();
         //根据项目id查询项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
         //查询到显示信息
@@ -4281,11 +4307,13 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         companyAction.setName("公司执业印章");
         companyAction.setSerialNo("1");
         //公司方章编号
-        companyAction.setSealId(COMPANYPARTIESSEALID);
+        //companyAction.setSealId(COMPANYPARTIESSEALID);
+        serialIdList.add(COMPANYPARTIESSEALID);
         //添加盖章位置
         List<Location> locations = Lists.newArrayList();
         Location location = new Location();
         location.setDocumentId(documentList.get(0));
+        location.setSealId(COMPANYPARTIESSEALID);
         //location.setPage(0);
         location.setRectType("SEAL_CORPORATE");
         location.setKeyword("咨询企业执业印章");
@@ -4293,28 +4321,29 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         /*location.setOffsetX(0.7749);
         location.setOffsetY(0.2725);*/
         locations.add(location);
-        companyAction.setLocations(locations);
-        actions.add(companyAction);
 
-        Action companyActionCircle = new Action();
+        /*Action companyActionCircle = new Action();
         companyActionCircle.setType("CORPORATE");
         companyActionCircle.setName("公司印章");
-        companyActionCircle.setSerialNo("1");
+        companyActionCircle.setSerialNo("1");*/
         //公司圆章编号
-        companyActionCircle.setSealId(COMPANYROUNDSEALID);
+        //companyActionCircle.setSealId(COMPANYROUNDSEALID);
+        serialIdList.add(COMPANYROUNDSEALID);
         //添加盖章位置
-        List<Location> locationCircles = Lists.newArrayList();
+        //List<Location> locationCircles = Lists.newArrayList();
         Location locationCircle = new Location();
         locationCircle.setDocumentId(documentList.get(0));
+        locationCircle.setSealId(COMPANYROUNDSEALID);
         //location.setPage(0);
         locationCircle.setRectType("SEAL_CORPORATE");
         locationCircle.setKeyword("江苏兴光项目管理有限公司(印章)");
         locationCircle.setKeywordIndex(1);
         locationCircle.setOffsetX("-0.2");
         //locationCircle.setOffsetY("0.2725");
-        locationCircles.add(locationCircle);
+        locations.add(locationCircle);
+        /*locationCircles.add(locationCircle);
         companyActionCircle.setLocations(locationCircles);
-        actions.add(companyActionCircle);
+        actions.add(companyActionCircle);*/
 
         //根据角色信息录入签署方信息
         //负责人
@@ -4324,49 +4353,64 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 //获取成员印章id信息
                 String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"",user.getName() + "一级注册造价工程师章");
                 if(StringUtils.isNotBlank(userSealId)){
-                    Action actionUser = new Action();
+                    /*Action actionUser = new Action();
                     actionUser.setType("CORPORATE");
                     actionUser.setName(user.getName() + "印章");    //填写人员信息
                     actionUser.setSerialNo("1");
-                    actionUser.setSealId(userSealId);   //人员印章id
+                    actionUser.setSealId(userSealId);   //人员印章id*/
 
+                    serialIdList.add(userSealId);
                     //添加盖章位置
-                    List<Location> principalLocations = Lists.newArrayList();
+                    //List<Location> principalLocations = Lists.newArrayList();
                     Location principalLocation = new Location();
                     principalLocation.setDocumentId(documentList.get(0));
+                    principalLocation.setSealId(userSealId);
                     //principalLocation.setPage(0);
                     principalLocation.setRectType("SEAL_CORPORATE");
                     principalLocation.setKeyword("项目负责人:");
                     principalLocation.setKeywordIndex(1);
+                    locations.add(principalLocation);
                     /*principalLocation.setOffsetX(0.7759);
-                    principalLocation.setOffsetY(0.1934);*/
-                    principalLocations.add(principalLocation);
+                    principalLocation.setOffsetY(0.1934);
+                    principalLocations.add(principalLocation);*/
 
                     //添加盖章位置
                     Location principalLocationSign = new Location();
                     principalLocationSign.setDocumentId(documentList.get(0));
+                    principalLocationSign.setSealId(userSealId);
                     //principalLocation.setPage(0);
                     principalLocationSign.setRectType("SEAL_CORPORATE");
                     principalLocationSign.setKeyword("项目负责人署名(");
                     principalLocationSign.setKeywordIndex(1);
+                    locations.add(principalLocationSign);
                     /*principalLocation.setOffsetX(0.7759);
-                    principalLocation.setOffsetY(0.1934);*/
-                    principalLocations.add(principalLocationSign);
+                    principalLocation.setOffsetY(0.1934);
+                    principalLocations.add(principalLocationSign);*/
 
                     //添加盖章位置
                     Location principalLocationSignFirst = new Location();
                     principalLocationSignFirst.setDocumentId(documentList.get(0));
+                    principalLocationSignFirst.setSealId(userSealId);
                     //principalLocation.setPage(0);
                     principalLocationSignFirst.setRectType("SEAL_CORPORATE");
                     principalLocationSignFirst.setKeyword("造价工程师:");
                     principalLocationSignFirst.setKeywordIndex(1);
+                    locations.add(principalLocationSignFirst);
                     /*principalLocation.setOffsetX(0.7759);
-                    principalLocation.setOffsetY(0.1934);*/
+                    principalLocation.setOffsetY(0.1934);
                     principalLocations.add(principalLocationSignFirst);
 
                     actionUser.setLocations(principalLocations);
-                    actions.add(actionUser);
+                    actions.add(actionUser);*/
+                }else{
+                    hashMap.put("code","2");
+                    hashMap.put("message","查询不到项目负责人 " + user.getName() + " 的印章信息!请联系管理员");
+                    return hashMap;
                 }
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到项目负责人的信息!请联系管理员");
+                return hashMap;
             }
         }
 
@@ -4406,26 +4450,70 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             //获取成员印章id信息
             String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星一级注册造价工程师章");
             if(StringUtils.isNotBlank(userSealId)){
-                Action actionUser = new Action();
+                /*Action actionUser = new Action();
                 actionUser.setType("CORPORATE");
                 actionUser.setName(technologyPrincipalUser.getName() + "印章");    //填写人员信息
                 actionUser.setSerialNo("1");
-                actionUser.setSealId(userSealId);   //人员印章id
+                actionUser.setSealId(userSealId);   //人员印章id*/
 
+                serialIdList.add(userSealId);
                 //添加盖章位置
-                List<Location> principalLocations = Lists.newArrayList();
+                //List<Location> principalLocations = Lists.newArrayList();
                 Location principalLocation = new Location();
                 principalLocation.setDocumentId(documentList.get(0));
+                principalLocation.setSealId(userSealId);
                 //principalLocation.setPage(0);
                 principalLocation.setRectType("SEAL_CORPORATE");
                 principalLocation.setKeyword("技术负责人:");
                 principalLocation.setKeywordIndex(1);
+                principalLocation.setOffsetY("-0.07");
+                locations.add(principalLocation);
                 /*principalLocation.setOffsetX(0.7518);
-                principalLocation.setOffsetY(0.1642);*/
+                principalLocation.setOffsetY(0.1642);
+                principalLocations.add(principalLocation);
+                actionUser.setLocations(principalLocations);
+                actions.add(actionUser);*/
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到技术负责人 陈红星 的造价师印章信息!请联系管理员");
+                return hashMap;
+            }
+
+            //获取成员印章id信息
+            String signatureUserSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星个人签名章");
+            if(StringUtils.isNotBlank(signatureUserSealId)){
+                /*Action actionUser = new Action();
+                actionUser.setType("CORPORATE");
+                actionUser.setName(technologyPrincipalUser.getName() + "印章");    //填写人员信息
+                actionUser.setSerialNo("1");
+                actionUser.setSealId(signatureUserSealId);   //人员印章id*/
+
+                serialIdList.add(signatureUserSealId);
+                //添加盖章位置
+                //List<Location> principalLocations = Lists.newArrayList();
+                Location principalLocation = new Location();
+                principalLocation.setDocumentId(documentList.get(0));
+                principalLocation.setSealId(signatureUserSealId);
+                //principalLocation.setPage(0);
+                principalLocation.setRectType("SEAL_CORPORATE");
+                principalLocation.setKeyword("技术负责人:");
+                principalLocation.setKeywordIndex(1);
+                principalLocation.setOffsetX("0.07");
+                principalLocation.setOffsetY("0.03");
+                locations.add(principalLocation);
+                /*principalLocation.setOffsetY(0.1642);
                 principalLocations.add(principalLocation);
                 actionUser.setLocations(principalLocations);
-                actions.add(actionUser);
+                actions.add(actionUser);*/
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到技术负责人 陈红星 的印章信息!请联系管理员");
+                return hashMap;
             }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到技术负责人 陈红星 的信息!请联系管理员");
+            return hashMap;
         }
 
 
@@ -4435,28 +4523,44 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             //获取成员印章id信息
             String userSealId = SignaturePostUtil.getUserSealByMobile(representativeUser.getMobile(),"","杨荣华个人签名章");
             if(StringUtils.isNotBlank(userSealId)){
-                Action actionUser = new Action();
+                /*Action actionUser = new Action();
                 actionUser.setType("CORPORATE");
                 actionUser.setName(representativeUser.getName() + "个人签名章");    //填写人员信息
                 actionUser.setSerialNo("1");
-                actionUser.setSealId(userSealId);   //人员印章id
+                actionUser.setSealId(userSealId);   //人员印章id*/
 
+                serialIdList.add(userSealId);
                 //添加盖章位置
-                List<Location> principalLocations = Lists.newArrayList();
+                //List<Location> principalLocations = Lists.newArrayList();
                 Location principalLocation = new Location();
                 principalLocation.setDocumentId(documentList.get(0));
+                principalLocation.setSealId(userSealId);
                 //principalLocation.setPage(0);
                 principalLocation.setRectType("SEAL_CORPORATE");
                 principalLocation.setKeyword("法定代表人:");
                 principalLocation.setKeywordIndex(1);
                 /*principalLocation.setOffsetX(0.7518);*/
                 principalLocation.setOffsetY("0.03");
-                principalLocations.add(principalLocation);
+                locations.add(principalLocation);
+                /*principalLocations.add(principalLocation);
                 actionUser.setLocations(principalLocations);
-                actions.add(actionUser);
+                actions.add(actionUser);*/
+            }else{
+                hashMap.put("code","2");
+                hashMap.put("message","查询不到技术负责人 杨荣华 的印章信息!请联系管理员");
+                return hashMap;
             }
+        }else{
+            hashMap.put("code","2");
+            hashMap.put("message","查询不到技术负责人 杨荣华 的信息!请联系管理员");
+            return hashMap;
         }
 
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("true");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
 
         //创建签署方信息表
         List<SignatorieInfo> signatories = Lists.newArrayList();
@@ -4470,13 +4574,13 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         signatureContract.setDocuments(documentList);
         //报告用印流程id
         signatureContract.setCategoryId(REPORTCATEGORYID);
-        signatureContract.setSend(false);
+        signatureContract.setSend(true);
         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);
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
 
         return hashMap;
     }

+ 345 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/thread/ApprovalThread.java

@@ -0,0 +1,345 @@
+package com.jeeplus.modules.ruralprojectrecords.thread;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.utils.SpringContextHolder;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectApprovalSignature;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectReportSignature;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.tools.utils.SignaturePostUtil;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-12-07 16:36
+ **/
+public class ApprovalThread extends Thread {
+
+    private ProjectReportDataService projectReportDataService = SpringContextHolder.getBean(ProjectReportDataService.class);
+    private WorkattachmentService workattachmentService = SpringContextHolder.getBean(WorkattachmentService.class);
+    private RuralProjectMessageService ruralProjectMessageService = SpringContextHolder.getBean(RuralProjectMessageService.class);
+    private WorkActivityProcessService workActivityProcessService = SpringContextHolder.getBean(WorkActivityProcessService.class);
+    private WorkProjectNotifyService workProjectNotifyService = SpringContextHolder.getBean(WorkProjectNotifyService.class);
+    private RuralProjectMessageElectronicSealDao dao = SpringContextHolder.getBean(RuralProjectMessageElectronicSealDao.class);
+
+    private RuralProjectRecords ruralProjectRecords;
+    private ProjectApprovalSignature projectReportSignature;
+    private ProjectReportData projectReportData;
+    private Office office;
+
+
+    public ApprovalThread(RuralProjectRecords ruralProjectRecords, ProjectApprovalSignature projectReportSignature, ProjectReportData projectReportData, Office office)
+    {
+        this.ruralProjectRecords = ruralProjectRecords;
+        this.projectReportSignature = projectReportSignature;
+        this.projectReportData = projectReportData;
+        this.office = office;
+    }
+
+    public void run(){
+        Boolean bool = true;
+        String disposeResult = "";
+        //下载审定单文件
+        String deleteFile = null;
+        try {
+            //进行签章调用
+            //根据项目id查询是否已经提交过了审定单签章
+            if(null == projectReportData){
+                disposeResult = "查询不到该项目的质量复核信息";
+                bool = false;
+            }
+            if(null!= projectReportData.getSignatureFlag() && 1 == projectReportData.getSignatureFlag()){
+                disposeResult = "该质量复核已经审定单盖章完成";
+                bool = false;
+            }
+            if(StringUtils.isBlank(ruralProjectRecords.getProjectMasterId())){
+                disposeResult = "项目负责人为空,无法进行签章";
+                bool = false;
+            }
+
+            //根据项目id和附件类型的
+            Workattachment workClientAttachment = new Workattachment();
+            workClientAttachment.setAttachmentFlag("144");
+            workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
+            List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+            if(fileList.size()>0){
+                Workattachment workattachment = fileList.get(0);
+                if(StringUtils.isBlank(workattachment.getUrl())){
+                    disposeResult = "审定单文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
+                    bool = false;
+                }
+                //下载审定单文件
+                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);
+                File verticalInvalidFile = 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())){
+                    disposeResult = "请上传doc、docx或者pdf的文件进行签章操作";
+                    bool = false;
+                }
+                //获取真签单的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)){
+                        bool = false;
+                        disposeResult = "签章文件创建失败";
+                    }
+                }else{
+                    String message = hashMap.get("message").toString();
+                    bool = false;
+                    disposeResult = message;
+                }
+                //获取竖版假(空白)签单的documentId
+                String verticalInvalidDocumentId = SignaturePostUtil.getVerticalInvalidDocument(verticalInvalidFile.getName(),verticalInvalidFile);
+                if("".equals(verticalInvalidDocumentId)){
+                    bool = false;
+                    disposeResult = "竖版模板文件创建失败";
+                }
+                List<String> documentList = Lists.newArrayList();
+                List<String> invalidDocumentList = Lists.newArrayList();
+                documentList.add(documentId);
+                documentList.add(verticalInvalidDocumentId);
+                //documentList.add(acrossInvalidDocumentId);
+                invalidDocumentList.add(verticalInvalidDocumentId);
+                //invalidDocumentList.add(acrossInvalidDocumentId);
+                //将空白单的documentId存入数据库种
+                projectReportData.setSignatureInvalidDocumentId(String.join(",", invalidDocumentList));
+                //根据项目id 和 documentId生成合同id
+                HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractId(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)){
+                        disposeResult = "签章文件创建失败";
+                        bool = false;
+                    }
+                }else{
+                    bool = false;
+                    disposeResult = contractIdHashMap.get("message").toString();
+                }
+                //进行静默签署
+                                /*HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompany(contractId, documentList);
+                                if(null != signbyCompanyHashMap){
+                                    String signbyCompany = signbyCompanyHashMap.get("code").toString();
+                                    if(!"0".equals(signbyCompany)){
+                                        disposeResult = signbyCompanyHashMap.get("message").toString();
+                                    }
+                                }*/
+                //将documentId 和contractId存储到质量复核对应的数据种
+                //签章完成则进行数据的保存
+                notification(bool,disposeResult,documentId,contractId,srcFileName);
+            }else{
+                disposeResult = "审定单文件未找到,无法进行签章操作";
+                bool = false;
+                notification(bool,disposeResult,"","","");
+            }
+        }catch (Exception e){
+
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+    }
+
+    private void notification(Boolean bool,String disposeResult,String documentId,String contractId,String srcFileName){
+        if(bool){
+            //users.add(projectReportSignature.getCreateBy());
+            //审核完成提示框
+            String title = "报告号【"+projectReportData.getNumber()+"】审定单签章审批登记完成";
+            String content = "报告号【"+projectReportData.getNumber()+"】审定单签章审批登记完成,项目编号:"+ruralProjectRecords.getProjectId();
+            if ("yes".equals(projectReportSignature.getAct().getFlag())) {
+                projectReportSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectReportSignature.getId(),
+                                        projectReportSignature.getCreateBy(),
+                                        projectReportSignature.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "144",
+                                        "0",
+                                        "待通知",
+                                        "审批通过"));
+                //给苏州质控中的人员发送通知
+                List<User> szzks = UserUtils.getByRoleActivityEnname("szzk",3,office.getId(),"4",projectReportSignature.getCreateBy());
+                for (User szzk: szzks) {
+                    if(StringUtils.isNotBlank(szzk.getId())){
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectReportSignature.getId(),
+                                                szzk,
+                                                projectReportSignature.getCompany().getId(),
+                                                title,
+                                                content,
+                                                "144",
+                                                "0",
+                                                "待通知",
+                                                "审批通过"));
+                    }
+                }
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                if (projectReportSignature.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectReportSignature.setStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportSignature.getId(),
+                                            projectReportSignature.getCreateBy(),
+                                            projectReportSignature.getCompany().getId(),
+                                            title,
+                                            content,
+                                            "144",
+                                            "0",
+                                            "待通知",
+                                            "审批通过"));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectReportSignature.getProcessInstanceId());
+
+            //签章完成则进行数据的保存
+            projectReportData.setSignatureFlag(1);
+            projectReportData.setSignatureDocumentId(documentId);
+            projectReportData.setSignatureContractId(contractId);
+            projectReportData.setSignatureFileName(srcFileName);
+            projectReportData.setSignatureUploadFileUser(UserUtils.getUser());
+            projectReportData.setSignatureUploadDate(new Date());
+            //修改签章对应信息文件
+            projectReportDataService.updateSignatureInfo(projectReportData);
+
+        }else{
+            //users.add(projectReportSignature.getCreateBy());
+            //审核完成提示框
+            String title = "报告号【"+projectReportData.getNumber()+"】审定单签章失败。原因:"+ disposeResult;
+            String content = "报告号【"+projectReportData.getNumber()+"】审定单签章失败。原因:"+ disposeResult;
+            if ("yes".equals(projectReportSignature.getAct().getFlag())) {
+                projectReportSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectReportSignature.getId(),
+                                        projectReportSignature.getCreateBy(),
+                                        projectReportSignature.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "144",
+                                        "0",
+                                        "待通知",
+                                        "审批通过"));
+                //给苏州质控中的人员发送通知
+                List<User> szzks = UserUtils.getByRoleActivityEnname("szzk",3,office.getId(),"4",projectReportSignature.getCreateBy());
+                for (User szzk: szzks) {
+                    if(StringUtils.isNotBlank(szzk.getId())){
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectReportSignature.getId(),
+                                                szzk,
+                                                projectReportSignature.getCompany().getId(),
+                                                title,
+                                                content,
+                                                "144",
+                                                "0",
+                                                "待通知",
+                                                "审批通过"));
+                    }
+                }
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                if (projectReportSignature.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectReportSignature.setStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportSignature.getId(),
+                                            projectReportSignature.getCreateBy(),
+                                            projectReportSignature.getCompany().getId(),
+                                            title,
+                                            content,
+                                            "144",
+                                            "0",
+                                            "待通知",
+                                            "审批通过"));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectReportSignature.getProcessInstanceId());
+
+            projectReportSignature.setStatus(1);
+            dao.updateApprovalSignature(projectReportSignature);
+        }
+
+
+    }
+}

+ 340 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/thread/SignatureThread.java

@@ -0,0 +1,340 @@
+package com.jeeplus.modules.ruralprojectrecords.thread;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.utils.SpringContextHolder;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectReportSignature;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.tools.utils.SignaturePostUtil;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * 报告签章线程信息
+ * @author: 徐滕
+ * @create: 2021-12-07 16:36
+ **/
+public class SignatureThread extends Thread {
+
+    private ProjectReportDataService projectReportDataService = SpringContextHolder.getBean(ProjectReportDataService.class);
+    private WorkattachmentService workattachmentService = SpringContextHolder.getBean(WorkattachmentService.class);
+    private RuralProjectMessageService ruralProjectMessageService = SpringContextHolder.getBean(RuralProjectMessageService.class);
+    private WorkActivityProcessService workActivityProcessService = SpringContextHolder.getBean(WorkActivityProcessService.class);
+    private WorkProjectNotifyService workProjectNotifyService = SpringContextHolder.getBean(WorkProjectNotifyService.class);
+    private RuralProjectMessageElectronicSealDao dao = SpringContextHolder.getBean(RuralProjectMessageElectronicSealDao.class);
+
+    private RuralProjectRecords ruralProjectRecords;
+    private ProjectReportSignature projectReportSignature;
+    private ProjectReportData projectReportData;
+    private Office office;
+
+
+    public SignatureThread(RuralProjectRecords ruralProjectRecords,ProjectReportSignature projectReportSignature,ProjectReportData projectReportData,Office office)
+    {
+        this.ruralProjectRecords = ruralProjectRecords;
+        this.projectReportSignature = projectReportSignature;
+        this.projectReportData = projectReportData;
+        this.office = office;
+    }
+
+    public void run(){
+        Boolean bool = true;
+        String disposeResult = "";
+        //下载审定单文件
+        String deleteFile = null;
+        try {
+            //进行签章调用
+            //根据项目id查询是否已经提交过了审定单签章
+            if(null == ruralProjectRecords){
+                bool = false;
+                disposeResult =  "查询不到该项目信息";
+            }
+            if(null!= ruralProjectRecords.getReportSignatureFlag() && 1 == ruralProjectRecords.getReportSignatureFlag()){
+                bool = false;
+                disposeResult =  "该项目已经报告盖章完成";
+            }
+            if(StringUtils.isBlank(ruralProjectRecords.getProjectMasterId())){
+                bool = false;
+                disposeResult =  "项目负责人为空,无法进行签章";
+            }
+
+            //根据项目id和附件类型的
+            Workattachment workClientAttachment = new Workattachment();
+            workClientAttachment.setAttachmentFlag("145");
+            workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
+            List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
+            if(fileList.size()>0){
+                Workattachment workattachment = fileList.get(0);
+                if(StringUtils.isBlank(workattachment.getUrl())){
+                    bool = false;
+                    disposeResult =  "报告签章文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
+                }
+                //下载审定单文件
+                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())){
+                    disposeResult =  "请上传doc、docx或者pdf的文件进行签章操作";
+                    bool = false;
+                }
+                //获取真签单的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)){
+                        disposeResult =  "签章文件创建失败";
+                        bool = false;
+                    }
+                }else{
+                    String message = hashMap.get("message").toString();
+                    disposeResult =  message;
+                    bool = false;
+                }
+                List<String> documentList = Lists.newArrayList();
+                documentList.add(documentId);
+                //根据项目id 和 documentId生成合同id
+                long s1 = System.currentTimeMillis();
+                HashMap contractIdHashMap = ruralProjectMessageService.getReportSignatureContractId(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)){
+                        disposeResult =  "签章文件创建失败";
+                        bool = false;
+                    }
+                }else{
+                    disposeResult =  contractIdHashMap.get("message").toString();
+                    bool = false;
+                }
+                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))){
+                        disposeResult =  signbyCompanyMessage;
+                        bool = false;
+                    }
+                }
+                long s4 = System.currentTimeMillis();
+                System.out.println("进行静默签署用时:" + (s4-s3));*/
+                notification(bool,disposeResult,documentId,contractId,srcFileName);
+                //将documentId 和contractId存储到质量复核对应的数据种
+            }else{
+                disposeResult =  "报告文件未找到,无法进行签章操作";
+                bool = false;
+                notification(bool,disposeResult,"","","");
+            }
+        }catch (Exception e){
+
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+    }
+
+    private void notification(Boolean bool,String disposeResult,String documentId,String contractId,String srcFileName){
+        if(bool){
+            //users.add(projectReportSignature.getCreateBy());
+            //审核完成提示框
+            String title = "报告号【"+projectReportData.getNumber()+"】报告签章审批登记完成";
+            String content = "报告号【"+projectReportData.getNumber()+"】报告签章审批登记完成,项目编号:"+ruralProjectRecords.getProjectId();
+            if ("yes".equals(projectReportSignature.getAct().getFlag())) {
+                projectReportSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectReportSignature.getId(),
+                                        projectReportSignature.getCreateBy(),
+                                        projectReportSignature.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "145",
+                                        "0",
+                                        "待通知",
+                                        "审批通过"));
+                //给苏州质控中的人员发送通知
+                List<User> szzks = UserUtils.getByRoleActivityEnname("szzk",3,office.getId(),"4",projectReportSignature.getCreateBy());
+                for (User szzk: szzks) {
+                    if(StringUtils.isNotBlank(szzk.getId())){
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectReportSignature.getId(),
+                                                szzk,
+                                                projectReportSignature.getCompany().getId(),
+                                                title,
+                                                content,
+                                                "145",
+                                                "0",
+                                                "待通知",
+                                                "审批通过"));
+                    }
+                }
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                if (projectReportSignature.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectReportSignature.setStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportSignature.getId(),
+                                            projectReportSignature.getCreateBy(),
+                                            projectReportSignature.getCompany().getId(),
+                                            title,
+                                            content,
+                                            "145",
+                                            "0",
+                                            "待通知",
+                                            "审批通过"));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectReportSignature.getProcessInstanceId());
+
+            //签章完成则进行数据的保存
+            ruralProjectRecords.setReportSignatureFlag(1);
+            ruralProjectRecords.setReportSignatureDocumentId(documentId);
+            ruralProjectRecords.setReportSignatureContractId(contractId);
+            ruralProjectRecords.setReportSignatureFileName(srcFileName);
+            ruralProjectRecords.setReportSignatureUploadFileUser(UserUtils.getUser());
+            ruralProjectRecords.setReportSignatureUploadDate(new Date());
+            //修改签章对应信息文件
+            projectReportDataService.updateReportSignatureInfo(ruralProjectRecords);
+
+            projectReportSignature.setStatus(5);
+            dao.updateReportSignature(projectReportSignature);
+        }else{
+            //users.add(projectReportSignature.getCreateBy());
+            //审核完成提示框
+            String title = "报告号【"+projectReportData.getNumber()+"】报告签章失败。原因:"+ disposeResult;
+            String content = "报告号【"+projectReportData.getNumber()+"】报告签章失败。原因:"+ disposeResult;
+            if ("yes".equals(projectReportSignature.getAct().getFlag())) {
+                projectReportSignature.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectReportSignature.getId(),
+                                        projectReportSignature.getCreateBy(),
+                                        projectReportSignature.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "145",
+                                        "0",
+                                        "待通知",
+                                        "审批通过"));
+                //给苏州质控中的人员发送通知
+                List<User> szzks = UserUtils.getByRoleActivityEnname("szzk",3,office.getId(),"4",projectReportSignature.getCreateBy());
+                for (User szzk: szzks) {
+                    if(StringUtils.isNotBlank(szzk.getId())){
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectReportSignature.getId(),
+                                                szzk,
+                                                projectReportSignature.getCompany().getId(),
+                                                title,
+                                                content,
+                                                "145",
+                                                "0",
+                                                "待通知",
+                                                "审批通过"));
+                    }
+                }
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectReportSignature.getId());
+                //userList = workProjectNotifyService.readByNotifyId(notify);
+                //users.add(projectReportSignature.getCreateBy());
+                if (projectReportSignature.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectReportSignature.setStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectReportSignature.getId(),
+                                            projectReportSignature.getCreateBy(),
+                                            projectReportSignature.getCompany().getId(),
+                                            title,
+                                            content,
+                                            "145",
+                                            "0",
+                                            "待通知",
+                                            "审批通过"));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectReportSignature.getProcessInstanceId());
+
+            projectReportSignature.setStatus(1);
+            dao.updateReportSignature(projectReportSignature);
+        }
+
+
+    }
+}

+ 0 - 21
src/main/resources/freemarker/projectSignature.ftl

@@ -744,17 +744,6 @@
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="006A655D">
 				<w:pPr>
-					<w:spacing w:after="78" w:line="480" w:line-rule="auto"/>
-					<w:rPr>
-						<w:rFonts w:hint="fareast"/>
-						<w:b/>
-						<w:sz w:val="28"/>
-						<w:sz-cs w:val="28"/>
-					</w:rPr>
-				</w:pPr>
-			</w:p>
-			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="006A655D">
-				<w:pPr>
 					<w:snapToGrid w:val="off"/>
 					<w:spacing w:after="78" w:line="288" w:line-rule="auto"/>
 					<w:ind w:right-chars="-174" w:right="-365"/>
@@ -903,16 +892,6 @@
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="006A655D">
 				<w:pPr>
-					<w:spacing w:after="78" w:line="288" w:line-rule="auto"/>
-					<w:rPr>
-						<w:rFonts w:hint="fareast"/>
-						<w:sz w:val="28"/>
-						<w:sz-cs w:val="28"/>
-					</w:rPr>
-				</w:pPr>
-			</w:p>
-			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="006A655D">
-				<w:pPr>
 					<w:spacing w:after="78"/>
 					<w:rPr>
 						<w:rFonts w:hint="fareast"/>

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

@@ -173,14 +173,14 @@
 							}
 						}
 
-						var attachmentProjectSort = ${projectRecords.attachmentProjectSort};
+						/*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;

+ 4 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectRecordsApprovalView.jsp

@@ -1210,7 +1210,10 @@
                                 <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>
-                                        <a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadAttach?contractId='+'${projectRecords.signatureContractId}'" class="op-btn  op-btn-download layui-bg-orange">审定单签章下载</a>
+                                        <c:if test="${not empty projectRecords.signatureContractId}">
+                                            <a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadAttach?contractId='+'${projectRecords.signatureContractId}'" class="op-btn  op-btn-download layui-bg-orange">审定单签章下载</a>
+                                        </c:if>
+
                                             <%--													<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>--%>

+ 3 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectRecordsReportSignatureView.jsp

@@ -1214,7 +1214,9 @@
                                     <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="${status.index == 0}">
-                                            <a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadReportAttach?contractId='+'${projectRecords.reportSignatureContractId}'" class="op-btn  op-btn-download layui-bg-orange">报告签章下载</a>
+                                            <c:if test="${not empty projectRecords.reportSignatureContractId}">
+                                                <a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadReportAttach?contractId='+'${projectRecords.reportSignatureContractId}'" class="op-btn  op-btn-download layui-bg-orange">报告签章下载</a>
+                                            </c:if>
                                         </c:if>
 
                                             <%--													<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">--%>

+ 4 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

@@ -869,6 +869,8 @@
 			if(d.falg=="1"){
 				if(d.approvalSignatureStatus == 0){
 					xml+="<a href=\"javascript:void(0)\"  onclick=\"openDialogBySave('审定单签章申请', '${ctx}/ruralProject/electronicSeal/approvalForm?id=" + d.id + "','90%', '90%','')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" align='center' style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 审定单签章申请</a>";
+				}else if(d.approvalSignatureStatus == 1){
+					xml+="<a href=\"#\" onclick=\"openDialogre('修改审定单签章申请', '${ctx}/ruralProject/electronicSeal/approvalForm?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改审定单签章申请</a>";
 				}else if(d.approvalSignatureStatus == 2){
 					xml+="<a href=\"${ctx}/ruralProject/electronicSeal/approvalRevoke?id=" + d.id + "&processInstanceId=" + d.procId + "\" onclick=\"return confirmx('确认要撤回该审定单签章申请吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 撤回</a>";
 				}else if(d.approvalSignatureStatus == 3){
@@ -879,6 +881,8 @@
 
 				if(d.reportSignatureStatus == 0){
 					xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogBySave('报告签章申请', '${ctx}/ruralProject/electronicSeal/reportSignatureForm?id=" + d.id + "','90%', '90%','')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 报告签章申请</a>";
+				}else if(d.reportSignatureStatus == 1){
+					xml+="<a href=\"#\" onclick=\"openDialogre('修改报告签章申请', '${ctx}/ruralProject/electronicSeal/reportSignatureForm?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height:32px;margin-top: 5px;margin-bottom: 5px;' > 修改报告签章申请</a>";
 				}else if(d.reportSignatureStatus == 2){
 					xml+="<a href=\"${ctx}/ruralProject/electronicSeal/reportSignatureRevoke?id=" + d.id + "&processInstanceId=" + d.procId + "\" onclick=\"return confirmx('确认要撤回该报告签章申请吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" style='height:32px;margin-top: 5px;margin-bottom: 5px;' > 撤回</a>";
 				}else if(d.reportSignatureStatus == 3){

+ 2 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementForm.jsp

@@ -128,14 +128,14 @@
 							}
 						}
 
-						var attachmentProjectSort = ${projectRecords.attachmentProjectSort};
+						/*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;

+ 2 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify.jsp

@@ -116,14 +116,14 @@
                     }
                 }
 
-                var attachmentProjectSort = ${attachmentProjectSort};
+                /*var attachmentProjectSort = ${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){