Przeglądaj źródła

签章功能接口开发

user5 2 lat temu
rodzic
commit
77b6ab779e

+ 0 - 379
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectRecordsService.java

@@ -231,383 +231,4 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
         return new ArrayList<>();
     }
 
-
-
-
-
-
-
-
-
-
-    /*public String createSignatureContractId(){
-    //public Map<String,Object> createSignatureContractId(){
-        List<WorkAttachment> fileList = Lists.newArrayList();
-        if(fileList.size()>0){
-
-            //下载审定单文件
-            String path = null;
-            if(System.getProperty("os.name").toLowerCase().contains("win")){
-                path = "D:/attachment-file/";
-            }else{
-                path = "/attachment-file/";
-            }
-            String aliyunUrl = Global.getAliyunUrl();
-            String aliDownloadUrl = Global.getAliDownloadUrl();
-
-            //获取文件生成的documentId
-            List<String> documentList = Lists.newArrayList();
-
-            for (WorkAttachment workattachment : fileList) {
-                String deleteFile = null;
-                try{
-                if(StringUtils.isBlank(workattachment.getUrl())){
-                    return "审定单文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
-                }
-
-                String file = workattachment.getUrl();
-                file = file.replace("amp;","");
-                String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
-                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 OSSClientService().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())){
-                    return "请上传doc、docx或者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;
-                }
-
-                documentList.add(documentId);
-
-                }catch (Exception e){
-
-                }finally {
-                    if(StringUtils.isNotBlank(deleteFile)){
-                        //根据路径创建文件对象
-                        File file = new File(deleteFile);
-                        //路径是个文件且不为空时删除文件
-                        if(file.isFile()&&file.exists()){
-                            file.delete();
-                        }
-                    }
-                }
-
-            }
-
-
-            //将documentId存入数据库中
-            projectReportData.setSignatureInvalidDocumentId(String.join(",", documentList));
-            //根据项目id 和 documentId生成合同id
-            HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractIdByPageSign(ruralProjectRecords.getId(), documentList);
-            String contractIdCode = contractIdHashMap.get("code").toString();
-            String contractId = "";
-            if("0".equals(contractIdCode)){
-                contractId = contractIdHashMap.get("contractId").toString();
-                if("".equals(contractId)){
-                    return "签章文件创建失败";
-                }
-                contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
-                System.out.println(contractUrl);
-            }else{
-                return contractIdHashMap.get("message").toString();
-            }
-            //将documentId 和contractId存储到质量复核对应的数据种
-            //签章完成则进行数据的保存
-            projectReportData.setSignatureFlag(1);
-            projectReportData.setSignatureDocumentId(documentId);
-            projectReportData.setSignatureContractId(contractId);
-            projectReportData.setSignatureFileName(srcFileName);
-            projectReportData.setSignatureUploadFileUser(UserUtils.getUser());
-            projectReportData.setSignatureUploadDate(new Date());
-            //修改签章对应信息文件
-            projectReportDataService.updateSignatureInfo(projectReportData);
-
-            //将数据信息以contractId作为key 并且有效期为1天 存储在redis中
-            Gson gson = new Gson();
-            String toJson = gson.toJson(projectApprovalSignature);
-
-            if(StringUtils.isNotBlank(toJson)){
-                Jedis jedis = JedisUtils.getResource();
-                String contractIdRedis = jedis.get("qiyuesuo" + contractId);
-                if (StringUtils.isBlank(contractIdRedis)) {
-                    //将该盖章url存放到redis 并设置1天的过期时间
-                    jedis.set("qiyuesuo" + contractId, toJson);
-                    jedis.expire("qiyuesuo" + contractId,86400);
-                }
-            }
-
-            String auditUserListJson = gson.toJson(auditUsers);
-
-            if(StringUtils.isNotBlank(auditUserListJson)){
-                Jedis jedis = JedisUtils.getResource();
-                String contractIdRedis = jedis.get("qiyuesuoAuditUserList" + contractId);
-                if (StringUtils.isBlank(contractIdRedis)) {
-                    //将该盖章url存放到redis 并设置1天的过期时间
-                    jedis.set("qiyuesuoAuditUserList" + contractId, auditUserListJson);
-                    jedis.expire("qiyuesuoAuditUserList" + contractId,86400);
-                }
-            }
-
-        }else{
-            return "审定单文件未找到,无法进行签章操作";
-        }
-        return null;
-    }
-
-
-
-
-
-    private static final String HTTPTOP = Global.getConfig("signature_http_top");
-    private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
-    private static final String COMPANYROUNDSEALIDVERTICAL = Global.getConfig("company_round_seal_id_vertical");
-    private static final String COMPANYPARTIESSEALID = Global.getConfig("company_parties_seal_id");
-    private static final String APPROVALCATEGORYID = Global.getConfig("approval_category_id");
-    private static final String APPROVALYCCATEGORYID = Global.getConfig("approval_YC_category_id");
-    private static final String REPORTCATEGORYID = Global.getConfig("report_category_id");
-    private static final String REPORTYCCATEGORYID = Global.getConfig("report_YC_category_id");
-    private static final String JUDGEMENTCATEGORYID = Global.getConfig("judgement_category_id");
-
-
-    *//**
-     * 根据项目id 和 documentId生成合同id(页面签署生成)
-     * 个人签字章功能
-     * @param projectId
-     * @param documentList
-     * @return
-     *//*
-    public HashMap getSignatureContractIdByPageSign(String projectId, List<String> documentList){
-        HashMap hashMap = new HashMap();
-        Set<String> serialIdSet = new HashSet<>();
-        //根据项目id查询项目信息
-        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
-        //创建签署方信息
-        List<Action> actions = Lists.newArrayList();
-        Action companyAction = new Action();
-        companyAction.setType("CORPORATE");
-        companyAction.setName("公司印章");
-        companyAction.setSerialNo("3");
-        //公司圆章-竖
-        //serialIdSet.add(COMPANYROUNDSEALIDVERTICAL);
-        //添加盖章位置
-        List<Location> locations = Lists.newArrayList();
-        *//*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);
-        }*//*
-
-        //根据角色信息录入签署方信息
-        //负责人
-        if(StringUtils.isNotBlank(principalUserId)){
-            User user = UserUtils.get(principalUserId);
-            if(null != user){
-                //获取成员印章id信息
-                String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"","江苏兴光项目管理有限公司公章");
-
-
-
-                if(StringUtils.isNotBlank(userSealId)){
-                    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","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
-                    return hashMap;
-                }
-            }
-        }else{
-            hashMap.put("code","2");
-            hashMap.put("message","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
-            return hashMap;
-        }
-
-        List<String> serialIdList = new ArrayList<String>(serialIdSet);
-        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
-        //判定该action是否采用自动签署
-        companyAction.setAutoSign("false");
-        companyAction.setLocations(locations);
-        actions.add(companyAction);
-
-        //创建个人职业章参数
-        Action professionalChapterAction = new Action();
-        professionalChapterAction.setType("PRACTICE");
-        professionalChapterAction.setName("杨荣华个人职业章");
-        professionalChapterAction.setSerialNo("1");
-
-        //添加盖章位置
-        List<Location> professionalChapterLocations = Lists.newArrayList();
-
-        Set<String> professionalChapterSerialIdSet = new HashSet<>();
-
-        //添加个人职业章人员信息
-        ActionOperatorInfo actionOperatorInfo = new ActionOperatorInfo();
-        actionOperatorInfo.setOperatorContact("15240492484");//个人职业章盖章人的手机号
-        List<ActionOperatorInfo> actionOperators = Lists.newArrayList();
-        actionOperators.add(actionOperatorInfo);
-        professionalChapterAction.setActionOperators(actionOperators);
-
-        //获取成员印章id信息
-        long s1=System.currentTimeMillis();
-        String userSealId = SignaturePostUtil.getUserSealByMobile("15240492484","","杨荣华个人签名");
-        long s2=System.currentTimeMillis();
-        System.out.println("第三个人员印章获取时间:" + (s2 - s1));
-        if(StringUtils.isNotBlank(userSealId)){
-        }else{
-            hashMap.put("code","2");
-            hashMap.put("message","查询不到项目负责人 的印章信息!请联系管理员");
-            return hashMap;
-        }
-
-        List<String> serialIdsList = new ArrayList<String>(professionalChapterSerialIdSet);
-        professionalChapterAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
-        professionalChapterAction.setLocations(professionalChapterLocations);
-        net.sf.json.JSONObject professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterAction);
-        System.out.println(professionalChapterJson.toString());
-        actions.add(professionalChapterAction);
-
-
-
-
-        //创建个人职业章参数
-        Action professionalChapterTwoAction = new Action();
-        professionalChapterTwoAction.setType("PRACTICE");
-        professionalChapterTwoAction.setName("刘建春个人职业章");
-        professionalChapterTwoAction.setSerialNo("2");
-
-        //添加盖章位置
-        List<Location> professionalChapterTwoLocations = Lists.newArrayList();
-
-        Set<String> professionalChapterTwoSerialIdSet = new HashSet<>();
-
-        //添加个人职业章人员信息
-        ActionOperatorInfo actionTwoOperatorInfo = new ActionOperatorInfo();
-        actionTwoOperatorInfo.setOperatorContact("13398782899");
-        List<ActionOperatorInfo> actionTwoOperators = Lists.newArrayList();
-        actionTwoOperators.add(actionTwoOperatorInfo);
-        professionalChapterTwoAction.setActionOperators(actionTwoOperators);
-
-        //获取成员印章id信息
-        long s3=System.currentTimeMillis();
-        String userSealId2 = SignaturePostUtil.getUserSealByMobile("13398782899","","杨荣华个人签名章");
-        long s4=System.currentTimeMillis();
-        System.out.println("第四个人员印章获取时间:" + (s4 - s3));
-
-        serialIdsList = new ArrayList<String>(professionalChapterTwoSerialIdSet);
-        professionalChapterTwoAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
-        professionalChapterTwoAction.setLocations(professionalChapterTwoLocations);
-        professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterTwoAction);
-        System.out.println(professionalChapterJson.toString());
-        actions.add(professionalChapterTwoAction);
-
-
-
-        //创建签署方信息表
-        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(true);
-        signatureContract.setSignatories(signatories);
-        signatureContract.setSn("");
-        signatureContract.setSubject(ruralProjectRecords.getProjectName());//添加项目名称
-        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
-        System.out.println(json.toString());
-        long s5=System.currentTimeMillis();
-        System.out.println(json.toString());
-        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
-        long s6=System.currentTimeMillis();
-        System.out.println("获取合同id获取时间:" + (s6 - s5));
-        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
-
-
-        return hashMap;
-    }*/
-
-
-    /**
-     * 审定单签章回调操作(个人职业章盖章)
-     * @param presignCallBack  回调参数
-     * @return
-     */
-    /*@RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
-    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
-
-        Jedis jedis = JedisUtils.getResource();
-        String contractIdRedis = jedis.get("qiyuesuo" + presignCallBack.getContractId());
-        String auditUsersStr = jedis.get("qiyuesuoAuditUserList" + presignCallBack.getContractId());
-        Gson gson = new Gson();
-        ProjectApprovalSignature projectApprovalSignature1 = gson.fromJson(contractIdRedis, ProjectApprovalSignature.class);
-
-        Type listType = new TypeToken<ArrayList<User>>(){}.getType();
-        List<User> auditUserList = new Gson().fromJson(auditUsersStr, listType);
-
-        //根据contractId查询对应的报告信息
-        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectApprovalSignature1.getProjectId());
-
-        if(null == projectReportData){
-            return null;
-        }
-        //根据项目id查询对应的审定单数据状态是否是已经被送审或者 是否存在值
-        ProjectApprovalSignature projectApprovalSignature = ruralProjectMessageElectronicSealService.getProjectApprovalSignature(projectReportData.getProject().getId());
-        projectApprovalSignature1.setCreateBy(projectApprovalSignature.getCreateBy());
-
-        //对流程数据进行处理
-        approvalSaveAudit(projectApprovalSignature1,auditUserList);
-
-        return null;
-    }*/
-
 }

+ 28 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java

@@ -285,4 +285,32 @@ public class CwProjectReportController {
         }
         EasyPoiUtil.exportExcel ( result, "报告信息",  options.getSheetName ( ), CwProjectReportData.class, fileName, response );
     }
+
+
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getAuditNodeByReportId")
+    public ResponseEntity getAuditNodeByReportId(@RequestParam("id") String id) {
+        Map<String, Object> auditNodeByReportId = projectReportService.getAuditNodeByReportId(id);
+        return ResponseEntity.ok (auditNodeByReportId);
+    }
+
+
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getSignatureTypeById")
+    public ResponseEntity getSignatureTypeById(@RequestParam("id") String id,@RequestParam("signatureType") String signatureType) {
+        Map<String, Object> signatureTypeById = projectReportService.getSignatureTypeById(id, signatureType);
+        return ResponseEntity.ok (signatureTypeById);
+    }
 }

+ 34 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java

@@ -20,14 +20,17 @@ import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper;
 import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.service.OSSClientService;
 import com.jeeplus.test.signature.domain.PresignCallBack;
 import com.jeeplus.test.signature.utils.SignaturePostUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.flowable.bpmn.model.FlowNode;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -63,6 +66,7 @@ public class CwProjectReportSignatureCallBackController {
     private OSSClientService ossClientService = SpringContextHolder.getBean(OSSClientService.class);
     private CwProjectReportSignatureMapper cwProjectReportSignatureMapper = SpringContextHolder.getBean(CwProjectReportSignatureMapper.class);
     private ProjectReportWorkAttachmentMapper attachmentMapper = SpringContextHolder.getBean(ProjectReportWorkAttachmentMapper.class);
+    private CwProjectReportMapper reportMapper = SpringContextHolder.getBean(CwProjectReportMapper.class);
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -85,7 +89,35 @@ public class CwProjectReportSignatureCallBackController {
      */
     @RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
     public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack, HttpServletResponse response) throws Exception {
-        // 在redis中取回流程审核所需的参数
+        //查询报告签章id
+        String id = (String) redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
+
+        CwProjectReportSignature reportSignature = new CwProjectReportSignature();
+        reportSignature.setId(id);
+        //查询流程id
+        String processInstanceId = reportMapper.getProcessInstanceIdById(id);
+        if(com.jeeplus.sys.utils.StringUtils.isNotBlank(processInstanceId)){
+            //根据流程id查询流程当前节点信息
+            FlowNode currentTask = flowTaskService.getCurrentTask(processInstanceId);
+            if(null != currentTask && com.jeeplus.sys.utils.StringUtils.isNotBlank(currentTask.getName())){
+                switch (currentTask.getName()){
+                    case "签字注师1审核":
+                        reportSignature.setSignatureAnnotator1Status("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                    case "签字注师2审核":
+                        reportSignature.setSignatureAnnotator2Status("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                    case "签章管理人审核":
+                        reportSignature.setSealAdminStatus("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                }
+            }
+        }
+
+        /*// 在redis中取回流程审核所需的参数
         CommitParamDTO<CwProjectReportData> commitParamDTO = (CommitParamDTO<CwProjectReportData>)redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
         // 将取回的数据转换为审核通过所需要的参数
         Map<String, Object> vars = Maps.newHashMap();
@@ -138,7 +170,7 @@ public class CwProjectReportSignatureCallBackController {
                 cwProjectReportSignature.setStatus("5");
                 cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
             }
-        }
+        }*/
         // 删除redis中的数据
         redisUtils.delete("cw_report_signature_" + presignCallBack.getContractId());
 

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportSignature.java

@@ -46,4 +46,19 @@ public class CwProjectReportSignature extends BaseEntity {
     private String processDefinitionId;
 
     private static final long serialVersionUID = 1L;
+
+    /**
+     * 签字注师1签章状态
+     */
+    private String signatureAnnotator1Status;
+
+    /**
+     * 签字注师2签章状态
+     */
+    private String signatureAnnotator2Status;
+
+    /**
+     * 盖章管理人签章状态
+     */
+    private String sealAdminStatus;
 }

+ 21 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java

@@ -9,6 +9,7 @@ import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
@@ -86,4 +87,24 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
      * @return
      */
     List<CwProjectReportData> getByProjectId(String projectId);
+
+    /**
+     * 根据报告签章id查询流程id
+     * @param id
+     * @return
+     */
+    String getProcessInstanceIdById(String id);
+
+    /**
+     * 修改签章流程节点状态
+     * @param repportSignature
+     */
+    void updateSignatureType(CwProjectReportSignature repportSignature);
+
+    /**
+     * 根据id查询报告签章数据信息
+     * @param id
+     * @return
+     */
+    CwProjectReportSignature getReportSignatureById(String id);
 }

+ 41 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml

@@ -277,4 +277,45 @@
 			AND attachment_id = #{id}
 			AND attachment_name = #{name}
     </select>
+
+    <select id="getProcessInstanceIdById" resultType="java.lang.String">
+        select proc_ins_id as "procInsId" from cw_project_report_signature where id = #{id}
+    </select>
+
+    <update id="updateSignatureType">
+        update cw_project_report_signature
+        set
+        id= #{id}
+        <if test="signatureAnnotator1Status != null and signatureAnnotator1Status != ''">
+            ,signature_annotator1_status = ${signatureAnnotator1Status}
+        </if>
+        <if test="signatureAnnotator2Status != null and signatureAnnotator2Status != ''">
+            ,signature_annotator2_status = ${signatureAnnotator2Status}
+        </if>
+        <if test="sealAdminStatus != null and sealAdminStatus != ''">
+            ,seal_admin_status = ${sealAdminStatus}
+        </if>
+    </update>
+
+    <select id="getReportSignatureById" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature">
+        select
+          id,
+          create_by,
+          create_date,
+          update_by,
+          update_date,
+          del_flag,
+          remarks,
+          report_id,
+          type,
+          proc_ins_id,
+          status,
+          process_definition_id,
+          signature_annotator1_status,
+          signature_annotator2_status,
+          seal_admin_status
+        from
+          cw_project_report_signature
+        where id = #{id}
+    </select>
 </mapper>

+ 77 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -46,6 +46,7 @@ import com.jeeplus.test.signature.utils.SignaturePostUtil;
 import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
 import org.apache.commons.beanutils.BeanMap;
 import org.apache.commons.collections4.CollectionUtils;
+import org.flowable.bpmn.model.FlowNode;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
 import org.springframework.beans.BeanUtils;
@@ -869,6 +870,12 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         CwProjectReportSignature cwProjectReportSignature = new CwProjectReportSignature();
         cwProjectReportSignature.setId(data.getId());
         cwProjectReportSignature.setStatus(data.getStatus());
+        //用于驳回后状态改变
+        if("4".equals(data.getStatus())){
+            cwProjectReportSignature.setSignatureAnnotator1Status("0");
+            cwProjectReportSignature.setSignatureAnnotator2Status("0");
+            cwProjectReportSignature.setSealAdminStatus("0");
+        }
         cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
         return "操作成功";
     }
@@ -1013,4 +1020,74 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             }
         }
     }
+
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param
+     * @return
+     */
+    public Map<String,Object> getAuditNodeByReportId(String id){
+        Map<String,Object> map = new HashMap<>();
+        //查询流程id
+        String processInstanceId = reportMapper.getProcessInstanceIdById(id);
+        if(StringUtils.isNotBlank(processInstanceId)){
+            //根据流程id查询流程当前节点信息
+            FlowNode currentTask = flowTaskService.getCurrentTask(processInstanceId);
+            if(null != currentTask && StringUtils.isNotBlank(currentTask.getName())){
+                map.put("success", true);
+                map.put("message", "获取签章流程成功");
+                map.put("signatureType", currentTask.getName());
+            }else{
+                map.put("success", false);
+                map.put("message", "获取签章流程失败");
+                map.put("signatureType", "");
+            }
+        }else{
+            map.put("success", false);
+            map.put("message", "获取签章流程失败");
+            map.put("signatureType", "");
+        }
+
+        return map;
+    }
+
+    /**
+     * 修改签章流程节点状态
+     * @param reportSignature
+     */
+    public void updateSignatureType(CwProjectReportSignature reportSignature){
+        reportMapper.updateSignatureType(reportSignature);
+    }
+
+    /**
+     * 根据签章节点获取签章状态数据信息
+     * @param id
+     * @param signatureType
+     * @return
+     */
+    public Map<String,Object> getSignatureTypeById(String id,String signatureType){
+        Map<String,Object> map = new HashMap<>();
+        CwProjectReportSignature reportSignatureInfo = reportMapper.getReportSignatureById(id);
+        if(null != reportSignatureInfo){
+            switch (signatureType){
+                case "签字注师1审核":
+                    map.put("signatureType", reportSignatureInfo.getSignatureAnnotator1Status());
+                    break;
+                case "签字注师2审核":
+                    map.put("signatureType", reportSignatureInfo.getSignatureAnnotator2Status());
+                    break;
+                case "签章管理人审核":
+                    map.put("signatureType", reportSignatureInfo.getSealAdminStatus());
+                    break;
+            }
+            map.put("success", true);
+            map.put("message", "获取签章完成情况成功");
+        }else{
+            map.put("success", false);
+            map.put("message", "获取签章完成情况失败");
+            map.put("signatureType", "0");
+        }
+        return map;
+    }
 }

+ 1 - 1
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -441,7 +441,7 @@ public class FlowTaskService {
      * @param processInstanceId
      * @return
      */
-    private FlowNode getCurrentTask(String processInstanceId){
+    public FlowNode getCurrentTask(String processInstanceId){
         //当前任务信息
         Task task =taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult();
 

+ 3 - 3
jeeplus-web/src/main/resources/application-development.yml

@@ -48,7 +48,7 @@ spring:
         master:
           username: root
           password: root
-          url: jdbc:mysql://127.0.0.1:3306/assess_process_master?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://192.168.2.4:3306/assess_process_master?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
           driver-class-name: com.mysql.cj.jdbc.Driver
 
           #oracle database settings
@@ -246,7 +246,7 @@ apptoken: uIJQmTwyGJ
 appsecret: 2NMBqFigKoInmd43Wohxv5aEDKiiHo
 signature: 232a44ee9ebd251d119f0a65628f678e
 
-signature_http_top: http://192.168.2.6:9182
+signature_http_top: http://192.168.2.130:9182
 
 #竖版模板templateId
 vertical_templateId: 2894156236229259396
@@ -259,7 +259,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 3032955004099797473
+approval_category_id: 3032265972836684447
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id

+ 2 - 2
jeeplus-web/src/main/resources/application-production.yml

@@ -248,7 +248,7 @@ apptoken: uIJQmTwyGJ
 appsecret: 2NMBqFigKoInmd43Wohxv5aEDKiiHo
 signature: 232a44ee9ebd251d119f0a65628f678e
 
-signature_http_top: http://192.168.2.6:9182
+signature_http_top: http://192.168.2.130:9182
 
 #竖版模板templateId
 vertical_templateId: 2894156236229259396
@@ -261,7 +261,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 3032955004099797473
+approval_category_id: 3032265972836684447
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id