Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

wangqiang před 2 roky
rodič
revize
0767e69561
28 změnil soubory, kde provedl 1836 přidání a 45 odebrání
  1. 4 0
      jeeplus-module/jeeplus-test/pom.xml
  2. 138 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java
  3. 371 16
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java
  4. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReport.java
  5. 51 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java
  6. 49 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportSignature.java
  7. 13 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java
  8. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportSignatureMapper.java
  9. 7 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java
  10. 83 18
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml
  11. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportSignatureMapper.xml
  12. 9 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml
  13. 142 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java
  14. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/dto/CwProjectReportSignatureDTO.java
  15. 82 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/controller/CwProjectReportArchiveDetailController.java
  16. 128 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/domain/CwProjectReportArchiveDetail.java
  17. 22 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/CwProjectReportArchiveDetailMapper.java
  18. 47 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/xml/CwProjectReportArchiveDetailMapper.xml
  19. 139 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/CwProjectReportArchiveDetailService.java
  20. 292 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/dto/CwProjectReportArchiveDetailDTO.java
  21. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/mapstruct/CwProjectReportArchiveDetailWrapper.java
  22. 122 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OSSClientService.java
  23. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/signature/utils/SignaturePostUtil.java
  24. 1 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/config/WebSecurityConfig.java
  25. 3 1
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/TaskComment.java
  26. 5 0
      jeeplus-web/pom.xml
  27. 4 2
      jeeplus-web/src/main/resources/application-development.yml
  28. 3 1
      jeeplus-web/src/main/resources/application-production.yml

+ 4 - 0
jeeplus-module/jeeplus-test/pom.xml

@@ -40,6 +40,10 @@
             <artifactId>fastjson</artifactId>
             <version>1.2.28</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
 
     </dependencies>
 

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

@@ -1,23 +1,49 @@
 package com.jeeplus.test.cw.projectReport.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Maps;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.redis.RedisUtils;
 import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
+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.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.CwProjectReportDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.signature.utils.SignaturePostUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.engine.TaskService;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @author: 王强
@@ -30,6 +56,14 @@ public class CwProjectReportController {
 
     @Resource
     private CwProjectReportService projectReportService;
+    @Autowired
+    private RedisUtils redisUtils;
+    @Resource
+    private ProjectReportWorkAttachmentMapper attachmentMapper;
+    @Autowired
+    private FlowTaskService flowTaskService;
+    @Autowired
+    private TaskService taskService;
 
     /**
      * 保存财务报告信息-流程
@@ -111,4 +145,108 @@ public class CwProjectReportController {
         result = projectReportService.findClineList (page,cwWorkClientBaseDTO,projectId);
         return ResponseEntity.ok (result);
     }
+
+    /**
+     * 签章流程审核通过
+     * @param cwProjectReportData
+     * @return
+     */
+    @ApiLog(value = "签章流程审核通过", type = LogTypeEnum.SAVE)
+    @PostMapping("saveFlowableParam")
+    public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody CwProjectReportData cwProjectReportData) {
+        //查询报告文件信息(电子章)
+        List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(cwProjectReportData.getId());
+        // 有电子章的附件时,走签章流程
+        if (CollectionUtil.isNotEmpty(fileList)) {
+            CwProjectReportData cwProjectReportDto = projectReportService.queryById(cwProjectReportData.getId());
+            // 获取签章页面url
+            String mobile = UserUtils.getCurrentUserDTO().getMobile();
+            String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(cwProjectReportDto.getSignatureContractId(), mobile);
+            // 将数据存储到redis中,key为contractId
+            cwProjectReportData.getCommitParamDTO().setVars(cwProjectReportDto);
+            redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportData.getCommitParamDTO());
+            redisUtils.expire("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),24, TimeUnit.HOURS);
+            return ResponseEntity.ok(signatureContractUrl);
+        } else {
+            // 没有电子章的附件时,走正常审核流程
+            // 流程审核通过
+            projectReportService.commitFlowable(cwProjectReportData);
+            return ResponseEntity.ok("操作成功");
+        }
+    }
+
+    /**
+     * 签章流程送审
+     * @param cwProjectReportData
+     * @return
+     */
+    @ApiLog(value = "签章流程送审", type = LogTypeEnum.SAVE)
+    @PostMapping("saveData")
+    public ResponseEntity<String> saveData(@Valid @RequestBody CwProjectReportData cwProjectReportData) {
+        //查询报告文件信息(电子章)
+        List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(cwProjectReportData.getId());
+        if (CollectionUtil.isNotEmpty(fileList)) {
+            // 有电子章的附件时,走签章流程
+            Map<String, Object> signatureContractId = projectReportService.createSignatureContractId(cwProjectReportData);
+            boolean bool = (boolean)signatureContractId.get("success");
+            if (bool) {
+                String signatureId = projectReportService.getSignature(cwProjectReportData.getId());
+                return ResponseUtil.newInstance().add("businessTable", "cw_project_report_signature").add("businessId", signatureId).ok ("操作成功");
+            }
+            return ResponseEntity.badRequest().body((String) signatureContractId.get("message"));
+        } else {
+            // 没有电子章的附件时,走正常审核流程
+            String signatureId = projectReportService.getSignature(cwProjectReportData.getId());
+            return ResponseUtil.newInstance().add("businessTable", "cw_project_report_signature").add("businessId", signatureId).ok ("操作成功");
+        }
+    }
+
+    /**
+     * 根据签章表id查询报告数据
+     * @param id
+     * @return
+     */
+    @ApiLog("根据签章表id查询报告数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("queryBySignatureId")
+    public ResponseEntity queryBySignatureId(@RequestParam("id") String id) {
+        CwProjectReportData projectReportData = projectReportService.queryBySignatureId ( id );
+        return ResponseEntity.ok (projectReportData);
+    }
+
+    /**
+     * 根据签章表id查询数据
+     * @param id
+     * @return
+     */
+    @ApiLog("根据签章表id查询数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("findBySignatureId")
+    public ResponseEntity findBySignatureId(@RequestParam("id") String id) {
+        CwProjectReportSignature cwProjectReportSignature = projectReportService.findBySignatureId ( id );
+        return ResponseEntity.ok (cwProjectReportSignature);
+    }
+
+    /**
+     * 根据id修改签章表状态值status
+     * @param data
+     * @return
+     */
+    @ApiOperation(value = "根据id修改签章表状态值status")
+    @PostMapping(value = "/updateSignatureStatusById")
+    public ResponseEntity<String> updateSignatureStatusById(@RequestBody CwProjectReportSignatureDTO data) {
+        String s = projectReportService.updateSignatureStatusById(data);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id修改签章表状态值status
+     * @return
+     */
+    @ApiOperation(value = "根据id修改签章表状态值status")
+    @PostMapping(value = "/aaa")
+    public ResponseEntity<String> updateSignatureStatusById() {
+        String s = "projectReportService.updateSignatureStatusById(data);";
+        return ResponseEntity.ok(s);
+    }
 }

+ 371 - 16
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java

@@ -1,17 +1,47 @@
 package com.jeeplus.test.cw.projectReport.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.utils.Global;
 import com.jeeplus.sys.utils.SpringContextHolder;
+import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
+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.projectReport.mapper.CwProjectReportSignatureMapper;
+import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
+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.engine.TaskService;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.connection.jedis.JedisUtils;
+import org.springframework.http.ResponseEntity;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.mock.web.MockMultipartFile;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
 import java.lang.reflect.Type;
 import java.util.*;
 
@@ -25,8 +55,14 @@ import java.util.*;
 public class CwProjectReportSignatureCallBackController {
 
 
-    private CwProjectReportService cwProjectReportService = SpringContextHolder.getBean(CwProjectReportService.class);
+    private static final String DIRECTORY = "/attachment-file";
+
+    private static final String ALIYUNURL = "http://oss.gangwaninfo.com";
 
+    private CwProjectReportService cwProjectReportService = SpringContextHolder.getBean(CwProjectReportService.class);
+    private OSSClientService ossClientService = SpringContextHolder.getBean(OSSClientService.class);
+    private CwProjectReportSignatureMapper cwProjectReportSignatureMapper = SpringContextHolder.getBean(CwProjectReportSignatureMapper.class);
+    private ProjectReportWorkAttachmentMapper attachmentMapper = SpringContextHolder.getBean(ProjectReportWorkAttachmentMapper.class);
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -34,6 +70,13 @@ public class CwProjectReportSignatureCallBackController {
     private final static String appsecret = Global.getConfig("appsecret");
     private final static String signature = Global.getConfig("signature");
 
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private FlowTaskService flowTaskService;
+    @Autowired
+    private TaskService taskService;
+
 
     /**
      * 审定单签章回调操作(个人职业章盖章)
@@ -41,25 +84,88 @@ public class CwProjectReportSignatureCallBackController {
      * @return
      */
     @RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
-    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
+    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack, HttpServletResponse response) throws Exception {
+        // 在redis中取回流程审核所需的参数
+        CommitParamDTO<CwProjectReportData> commitParamDTO = (CommitParamDTO<CwProjectReportData>)redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
+        // 将取回的数据转换为审核通过所需要的参数
+        Map<String, Object> vars = Maps.newHashMap();
+        Flow flow = new Flow();
+        flow.setTaskId(commitParamDTO.getTaskId());
+        flow.setTaskDefKey(commitParamDTO.getTaskDefKey());
+        flow.setProcInsId(commitParamDTO.getProcInsId());
+        flow.setProcDefId(commitParamDTO.getProcDefId());
+        flow.setAssignee(commitParamDTO.getAssignee());
+        flow.setComment(commitParamDTO.getComment());
+        Map<String, String> stringObjectMap = JSON.parseObject(JSON.toJSONString(commitParamDTO.getVars()), new TypeReference<Map<String, String>>() {});
+        for (Map.Entry<String, String> entry : stringObjectMap.entrySet()) {
+            String value = entry.getValue();
+            if("true".equals(value) || "false".equals(value)){
+                vars.put(entry.getKey(), Boolean.valueOf(value).booleanValue());
+            }else{
+                vars.put(entry.getKey(), value);
+            }
+        }
+        // 流程节点审核通过
+        flowTaskService.auditSave(flow, vars);
+        CwProjectReport cwProjectReport = cwProjectReportService.list(new QueryWrapper<CwProjectReport>().lambda().eq(CwProjectReport::getSignatureContractId, presignCallBack.getContractId())).get(0);
+        // 指定下一步处理人
+        Task task = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).active().singleResult();
+        // task为null时,则当前节点为最后一个审核节点
+        if(task != null){
+            if(StringUtils.isNotBlank(flow.getAssignee ())){
+                taskService.setAssignee(task.getId(), flow.getAssignee ());
+            }
+            if(ObjectUtil.isNotEmpty(cwProjectReport)) {
+                CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                        .eq(CwProjectReportSignature::getReportId, cwProjectReport.getId())
+                        .eq(CwProjectReportSignature::getType, cwProjectReport.getSignatureType())
+                );
+                if ("2".equals(cwProjectReportSignature.getStatus())){
+                    cwProjectReportSignature.setStatus("6");
+                    cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+                }else if ("6".equals(cwProjectReportSignature.getStatus())){
+                    cwProjectReportSignature.setStatus("7");
+                    cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+                }
+            }
+        } else {
+            // 修改数据流程状态为->审核通过
+            if(ObjectUtil.isNotEmpty(cwProjectReport)) {
+                CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                        .eq(CwProjectReportSignature::getReportId, cwProjectReport.getId())
+                        .eq(CwProjectReportSignature::getType, cwProjectReport.getSignatureType())
+                );
+                cwProjectReportSignature.setStatus("5");
+                cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+            }
+        }
+        // 删除redis中的数据
+        redisUtils.delete("cw_report_signature_" + presignCallBack.getContractId());
 
-        /*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查询对应的报告信息
-        CwProjectReportData projectReportData = cwProjectReportService.queryById(projectApprovalSignature1.getId());
 
-        if(null == projectReportData){
-            return null;
-        }
-        //根据项目id查询对应的审定单数据状态是否是已经被送审
-        ProjectApprovalSignature projectApprovalSignature = cwProjectReportService.getProjectApprovalSignature(projectReportData.getId());*/
+
+
+
+
+//        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查询对应的报告信息
+//        CwProjectReportData projectReportData = cwProjectReportService.queryById(projectApprovalSignature1.getId());
+//
+//        if(null == projectReportData){
+//            return null;
+//        }
+//        //根据项目id查询对应的审定单数据状态是否是已经被送审
+//        ProjectApprovalSignature projectApprovalSignature = cwProjectReportService.getProjectApprovalSignature(projectReportData.getId());
 
         //对数据进以及流程行处理
         //approvalSaveAudit(projectApprovalSignature1,auditUserList);
@@ -68,4 +174,253 @@ public class CwProjectReportSignatureCallBackController {
     }
 
 
+    @RequestMapping(value = "/getApprovalCallBackAccomplish", method= RequestMethod.POST)
+    public String getApprovalCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+//        //根据contractId查询对应的报告信息
+        CwProjectReportData projectReportData = cwProjectReportService.queryByContractId(presignCallBack.getContractId());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+            signatureUrl = signatureUrl.replace("/xg-qz","");
+            projectReportData.setSignatureUrl(signatureUrl);
+        }
+
+        //将签章完成地址保存到数据库对应报告信息中
+        cwProjectReportService.updateSignatureUrl(projectReportData);
+
+
+        //将文件下载并对原有文件地址进行替换
+        String deleteFile = null;
+        String unzipFileStr = null;
+        try{
+            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();
+
+
+            String file = aliyunUrl + signatureUrl;
+            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];
+            ossClientService.downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(path+fileName);
+            deleteFile = path+fileName;
+
+            //截取文件名称
+            String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+
+            //解压后文件地址
+            unzipFileStr = path + srcFileName;
+
+            //将下载后的文件进行解压
+            SignaturePostUtil.unZipFile(srcFile,unzipFileStr);
+
+            //遍历解压后文件夹中的所有文件信息
+            File unZipFile = new File(unzipFileStr);
+
+            File[] unZipFileList = unZipFile.listFiles();
+
+            for (File f : unZipFileList) {
+                String filepath = "";
+                //取得上传文件
+                //将文件上传到oss云盘中
+                MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                if (cMultiFile != null && !cMultiFile.isEmpty()) {
+                    // 文件保存路径
+                    String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
+                    //文件原名称
+                    String newName = cMultiFile.getOriginalFilename();
+                    newName = newName.substring(13, newName.length());
+                    ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
+                    filepath = "/" + realPath + newName;
+                }
+
+                System.out.println(f.getName());
+                //截取文件后缀名
+                String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+                //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+
+                //查询报告文件信息(电子章)
+                List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
+                if(fileList.size()>0){
+                    for (WorkAttachment workattachment : fileList) {
+                        //根据url截取文件名成
+                        String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+
+                        if(f.getName().contains(workattachmentName)){
+                            workattachment.setUrl(filepath);
+                            workattachment.setType(substring);
+                            workattachment.setAttachmentName(f.getName());
+                            attachmentMapper.updateByIdOnSignature(workattachment);
+                        }
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+            File file = new File(unzipFileStr);
+            deleteFile(file);
+        }
+
+        return null;
+    }
+
+
+    @RequestMapping(value = "/download", method= RequestMethod.POST)
+    public String download(String signatureUrl) {
+//        //根据contractId查询对应的报告信息
+        CwProjectReportData projectReportData = cwProjectReportService.queryByContractId("3032604994397941821");
+
+        //将文件下载并对原有文件地址进行替换
+        String deleteFile = null;
+        String unzipFileStr = null;
+        try{
+            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();
+
+
+            String file = aliyunUrl + signatureUrl;
+            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];
+            ossClientService.downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(path+fileName);
+            deleteFile = path+fileName;
+
+            //截取文件名称
+            String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+
+            //解压后文件地址
+            unzipFileStr = path + srcFileName;
+
+            //将下载后的文件进行解压
+            SignaturePostUtil.unZipFile(srcFile,unzipFileStr);
+
+            //遍历解压后文件夹中的所有文件信息
+            File unZipFile = new File(unzipFileStr);
+
+            File[] unZipFileList = unZipFile.listFiles();
+
+            for (File f : unZipFileList) {
+                String filepath = "";
+                //取得上传文件
+                //将文件上传到oss云盘中
+                MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                if (cMultiFile != null && !cMultiFile.isEmpty()) {
+                    // 文件保存路径
+                    String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
+                    //文件原名称
+                    String newName = cMultiFile.getOriginalFilename();
+                    newName = newName.substring(13, newName.length());
+                    ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
+                    filepath = "/" + realPath + newName;
+                }
+
+                System.out.println(f.getName());
+                //截取文件后缀名
+                String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+                //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+
+                //查询报告文件信息(电子章)
+                List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
+                if(fileList.size()>0){
+                    for (WorkAttachment workattachment : fileList) {
+                        //根据url截取文件名成
+                        String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+
+                        if(f.getName().contains(workattachmentName)){
+                            workattachment.setUrl(filepath);
+                            workattachment.setType(substring);
+                            workattachment.setAttachmentName(f.getName());
+                            attachmentMapper.updateByIdOnSignature(workattachment);
+                        }
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+            File file = new File(unzipFileStr);
+            deleteFile(file);
+        }
+
+        return null;
+    }
+
+    public static Boolean deleteFile(File file) {
+        //判断文件不为null或文件目录存在
+        if (file == null || !file.exists()) {
+            System.out.println("文件删除失败,请检查文件是否存在以及文件路径是否正确");
+            return false;
+        }
+        //获取目录下子文件
+        File[] files = file.listFiles();
+        //遍历该目录下的文件对象
+        for (File f : files) {
+            //判断子目录是否存在子目录,如果是文件则删除
+            if (f.isDirectory()) {
+                //递归删除目录下的文件
+                deleteFile(f);
+            } else {
+                //文件删除
+                f.delete();
+                //打印文件名
+                System.out.println("文件名:" + f.getName());
+            }
+        }
+        //文件夹删除
+        file.delete();
+        System.out.println("目录名:" + file.getName());
+        return true;
+    }
+
 }

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReport.java

@@ -107,4 +107,9 @@ public class CwProjectReport extends BaseEntity {
 
     @TableField(exist = false)
     private String[] contractDates;
+
+    /**
+     * 签章合同id
+     */
+    private String signatureContractId;
 }

+ 51 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java

@@ -3,6 +3,7 @@ package com.jeeplus.test.cw.projectReport.domain;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
 import lombok.Data;
 
 import java.util.List;
@@ -103,4 +104,54 @@ public class CwProjectReportData extends BaseDTO {
      * 签章contractId
      */
     private String signatureContractId;
+
+    /**
+     * 流程通过所需参数DTO
+     */
+    private CommitParamDTO<CwProjectReportData> CommitParamDTO;
+
+    /**
+     * 公章流程procInsId
+     */
+    private String procInsId1;
+
+    /**
+     * 公章流程processDefinitionId
+     */
+    private String processDefinitionId1;
+
+    /**
+     * 公章流程status
+     */
+    private String status1;
+
+    /**
+     * 公章流程表id
+     */
+    private String sid1;
+
+    /**
+     * 公章+执业章流程procInsId
+     */
+    private String procInsId2;
+
+    /**
+     * 公章+执业章流程processDefinitionId
+     */
+    private String processDefinitionId2;
+
+    /**
+     * 公章+执业章流程status
+     */
+    private String status2;
+
+    /**
+     * 公章+执业章流程表id
+     */
+    private String sid2;
+
+    /**
+     * 电子签章文件地址
+     */
+    private String signatureUrl;
 }

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

@@ -0,0 +1,49 @@
+package com.jeeplus.test.cw.projectReport.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 财务-项目报告-签章流程表
+ * @TableName cw_project_report_signature
+ */
+@Data
+@TableName("cw_project_report_signature")
+public class CwProjectReportSignature extends BaseEntity {
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
+     * 签章类型:1公章  2公章+执业章
+     */
+    private String type;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 
+     */
+    private String processDefinitionId;
+
+    private static final long serialVersionUID = 1L;
+}

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

@@ -49,8 +49,21 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
     void updateSignatureInfo(CwProjectReportData cwProjectReportData);
 
     /**
+     * 更改报告号签章id信息
+     * @param cwProjectReportData
+     */
+    void updateSignatureUrl(CwProjectReportData cwProjectReportData);
+
+    /**
      * 根据id修改del_flag状态
      * @param id
      */
     void updateDelFlag(@Param("flag")int flag,@Param("id") String id);
+
+    /**
+     * 根据签章id查询报告信息
+     * @param contractId
+     * @return
+     */
+    CwProjectReportData queryByContractId(@Param("contractId") String contractId);
 }

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportSignatureMapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.test.cw.projectReport.mapper;
+
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature
+ */
+@Mapper
+public interface CwProjectReportSignatureMapper extends BaseMapper<CwProjectReportSignature> {
+
+}
+
+
+
+

+ 7 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java

@@ -33,4 +33,11 @@ public interface ProjectReportWorkAttachmentMapper extends BaseMapper<CwProjectR
      * @return
      */
     List<WorkAttachment> selectWorkAttachmentByReportId(String id);
+
+    /**
+     * 根据id修改文件信息(cw签章文件替换)
+     * @param workattachment
+     * @return
+     */
+    Integer updateByIdOnSignature(WorkAttachment workattachment);
 }

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

@@ -62,16 +62,22 @@
         c.name as departmentName,
         d.name as userName,
         a.create_date,
-        e.name as projectMasterName
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
         FROM cw_project_report a
-        left join cw_project_records b
-        on a.project_id = b.id
-        LEFT JOIN sys_office c
-        on a.office_id = c.id
-        LEFT JOIN sys_user d
-        on a.create_by = d.id
-        LEFT JOIN sys_user e
-        on b.project_master_id = e.id
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
         ${ew.customSqlSegment}
     </select>
     <select id="queryById" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReportData">
@@ -99,16 +105,22 @@
         c.name as departmentName,
         d.name as userName,
         a.create_date,
-        e.name as projectMasterName
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
         FROM cw_project_report a
-        left join cw_project_records b
-        on a.project_id = b.id
-        LEFT JOIN sys_office c
-        on a.office_id = c.id
-        LEFT JOIN sys_user d
-        on a.create_by = d.id
-        LEFT JOIN sys_user e
-        on b.project_master_id = e.id
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
         where a.id = #{id}
     </select>
     <select id="findClineList" resultType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO">
@@ -131,7 +143,60 @@
         signature_contract_id = #{signatureContractId}
         where id = #{id}
     </update>
+
+    <update id="updateSignatureUrl">
+        update cw_project_report set
+        signature_url = #{signatureUrl}
+        where id = #{id}
+    </update>
     <update id="updateDelFlag">
         UPDATE cw_project_report SET del_flag = #{flag} where id = #{id}
     </update>
+
+
+
+
+    <select id="queryByContractId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReportData">
+        SELECT
+        a.id,
+        a.create_by as createById,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.remarks,
+        a.status,
+        a.document_no,
+        a.project_report_number,
+        a.project_id,
+        a.office_id,
+        a.signature_type,
+        a.signature_annotator1,
+        a.signature_annotator2,
+        a.signature_contract_id,
+        a.proc_ins_id,
+        a.process_definition_id,
+        b.project_number as projectNumber,
+        b.project_name as projectName,
+        c.name as departmentName,
+        d.name as userName,
+        a.create_date,
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
+        FROM cw_project_report a
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
+        where a.signature_contract_id = #{contractId}
+    </select>
 </mapper>

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

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="reportId" column="report_id" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
+            <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+            <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        cw_prs.id,
+        cw_prs.create_by,
+        cw_prs.create_date,
+        cw_prs.update_by,
+        cw_prs.update_date,
+        cw_prs.del_flag,
+        cw_prs.remarks,
+        cw_prs.report_id,
+        cw_prs.type,
+        cw_prs.proc_ins_id,
+        cw_prs.status,
+        cw_prs.process_definition_id
+    </sql>
+</mapper>

+ 9 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml

@@ -24,7 +24,15 @@
 
         select a.* from work_attachment a
         left join cw_project_report_file cf on cf.report_file_id = a.id
-        where a.attachment_id in (select id from cw_project_report_new_line where report_id = #{id}) and cf.file_type = 1
+        where a.attachment_id in (select id from cw_project_report_new_line where report_id = #{id}) and cf.seal_type = 1
     </select>
 
+    <update id="updateByIdOnSignature">
+        update work_attachment
+        set url = #{url},
+        type = #{type},
+        attachment_name= #{attachmentName}
+        where id = #{id}
+    </update>
+
 </mapper>

+ 142 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -4,13 +4,17 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.service.UserService;
 import com.jeeplus.sys.mapper.UserMapper;
@@ -18,16 +22,15 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.Global;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
 import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwProjectRecordsWrapper;
 import com.jeeplus.test.cw.projectReport.domain.*;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportCancelMapper;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
-import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
+import com.jeeplus.test.cw.projectReport.mapper.*;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
@@ -40,7 +43,10 @@ import com.jeeplus.test.oss.service.OSSClientService;
 import com.jeeplus.test.oss.service.OssService;
 import com.jeeplus.test.signature.domain.*;
 import com.jeeplus.test.signature.utils.SignaturePostUtil;
+import org.apache.commons.beanutils.BeanMap;
 import org.apache.commons.collections4.CollectionUtils;
+import org.flowable.engine.TaskService;
+import org.flowable.task.api.Task;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.connection.jedis.JedisUtils;
@@ -101,6 +107,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     @Resource
     private UserMapper userMapper;
 
+    @Resource
+    private CwProjectReportSignatureMapper cwProjectReportSignatureMapper;
+
+    @Autowired
+    private FlowTaskService flowTaskService;
+
+    @Autowired
+    private TaskService taskService;
+
     /**
      * 保存项目以及其他相关信息
      * @param reportData
@@ -324,6 +339,14 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     }
 
     /**
+     * 保存签章文件地址
+     * @param projectReportData
+     */
+    public void updateSignatureUrl(CwProjectReportData projectReportData){
+        reportMapper.updateSignatureUrl(projectReportData);
+    }
+
+    /**
      * 新增
      */
     @Transactional(rollbackFor = Exception.class)
@@ -438,6 +461,21 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             });
         }
         this.reportMapper.insert(report);
+
+        // 添加签章流程初始数据
+        // 公章流程
+        CwProjectReportSignature cwProjectReportSignature1 = new CwProjectReportSignature();
+        cwProjectReportSignature1.setReportId(report.getId());
+        cwProjectReportSignature1.setType("1");
+        cwProjectReportSignature1.setStatus("0");
+        cwProjectReportSignatureMapper.insert(cwProjectReportSignature1);
+        // 公章+执业章流程
+        CwProjectReportSignature cwProjectReportSignature2 = new CwProjectReportSignature();
+        cwProjectReportSignature2.setReportId(report.getId());
+        cwProjectReportSignature2.setType("2");
+        cwProjectReportSignature2.setStatus("0");
+        cwProjectReportSignatureMapper.insert(cwProjectReportSignature2);
+
         return report.getId();
     }
 
@@ -688,9 +726,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                 }
                 projectReportData.setSignatureContractId(contractId);
                 this.updateSignatureInfo(projectReportData);
+//                map.put("contractId",contractId);
                 //修改签章对应信息文件
                 //contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
                 //System.out.println(contractUrl);
+
             }else{
                 map.put("success",false);
                 map.put("message",contractIdHashMap.get("message").toString());
@@ -704,7 +744,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         }
         map.put("success",true);
         map.put("message","生成签章contractId成功");
-        return null;
+        return map;
     }
 
     /**
@@ -934,4 +974,101 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
 
         return hashMap;
     }
+
+    public CwProjectReportData queryBySignatureId(String signatureId) {
+        CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectById(signatureId);
+        if (ObjectUtil.isNotEmpty(cwProjectReportSignature)){
+            if (StringUtils.isNotBlank(cwProjectReportSignature.getReportId())){
+                return this.queryById(cwProjectReportSignature.getReportId());
+            }
+        }
+        return new CwProjectReportData();
+    }
+
+    public CwProjectReportSignature findBySignatureId(String signatureId) {
+        return cwProjectReportSignatureMapper.selectById(signatureId);
+    }
+
+    public String updateSignatureStatusById(CwProjectReportSignatureDTO data) {
+        CwProjectReportSignature cwProjectReportSignature = new CwProjectReportSignature();
+        cwProjectReportSignature.setId(data.getId());
+        cwProjectReportSignature.setStatus(data.getStatus());
+        cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+        return "操作成功";
+    }
+
+    public String getSignature (String reportId){
+        CwProjectReportData cwProjectReportData1 = this.queryById(reportId);
+        String signatureType = cwProjectReportData1.getSignatureType();
+        CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                .eq(CwProjectReportSignature::getReportId, reportId)
+                .eq(CwProjectReportSignature::getType, signatureType)
+        );
+        cwProjectReportSignature.setStatus("2");
+        cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+        return cwProjectReportSignature.getId();
+    }
+
+    public void commitFlowable(CwProjectReportData cwProjectReportData) {
+        CwProjectReportData cwProjectReportDto = this.queryById(cwProjectReportData.getId());
+        cwProjectReportData.getCommitParamDTO().setVars(cwProjectReportDto);
+        CommitParamDTO<CwProjectReportData> commitParamDTO = cwProjectReportData.getCommitParamDTO();
+        Map<String, Object> vars = Maps.newHashMap();
+        Flow flow = new Flow();
+        flow.setTaskId(commitParamDTO.getTaskId());
+        flow.setTaskDefKey(commitParamDTO.getTaskDefKey());
+        flow.setProcInsId(commitParamDTO.getProcInsId());
+        flow.setProcDefId(commitParamDTO.getProcDefId());
+        flow.setAssignee(commitParamDTO.getAssignee());
+        flow.setComment(commitParamDTO.getComment());
+        String var = JSON.toJSONString(commitParamDTO.getVars());
+        Map<String, String> stringObjectMap = JSON.parseObject(var, new TypeReference<Map<String, String>>() {});
+        for (Map.Entry<String, String> entry : stringObjectMap.entrySet()) {
+            String value = entry.getValue();
+            if("true".equals(value) || "false".equals(value)){
+                vars.put(entry.getKey(), Boolean.valueOf(value).booleanValue());
+            }else{
+                vars.put(entry.getKey(), value);
+            }
+        }
+        // 流程节点审核通过
+        flowTaskService.auditSave(flow, vars);
+        CwProjectReport report = this.getOne(new QueryWrapper<CwProjectReport>().lambda().eq(CwProjectReport::getId, cwProjectReportData.getId()));
+        // 指定下一步处理人
+        Task task = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).active().singleResult();
+        // task为null时,则当前节点为最后一个审核节点
+        if(task != null){
+            if(org.apache.commons.lang3.StringUtils.isNotBlank(flow.getAssignee ())){
+                taskService.setAssignee(task.getId(), flow.getAssignee ());
+            }
+            if(ObjectUtil.isNotEmpty(report)) {
+                CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                        .eq(CwProjectReportSignature::getReportId, report.getId())
+                        .eq(CwProjectReportSignature::getType, report.getSignatureType())
+                );
+                if ("2".equals(cwProjectReportSignature.getStatus())){
+                    cwProjectReportSignature.setStatus("6");
+                    cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+                }else if ("6".equals(cwProjectReportSignature.getStatus())){
+                    cwProjectReportSignature.setStatus("7");
+                    cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+                }
+            }
+        } else {
+            // 修改数据流程状态为->审核通过
+            if (ObjectUtil.isNotEmpty(report)){
+                CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                        .eq(CwProjectReportSignature::getReportId, report.getId())
+                        .eq(CwProjectReportSignature::getType, report.getSignatureType())
+                );
+                cwProjectReportSignature.setStatus("5");
+                cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+            }
+        }
+    }
+
+    public CwProjectReportData queryByContractId(String contractId){
+        CwProjectReportData reportData = reportMapper.queryByContractId(contractId);
+        return reportData;
+    }
 }

+ 46 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/dto/CwProjectReportSignatureDTO.java

@@ -0,0 +1,46 @@
+package com.jeeplus.test.cw.projectReport.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 财务-项目报告-签章流程表
+ * @TableName cw_project_report_signature
+ */
+@Data
+public class CwProjectReportSignatureDTO extends BaseDTO {
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
+     * 签章类型:1公章  2公章+执业章
+     */
+    private String type;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 
+     */
+    private String processDefinitionId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 82 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/controller/CwProjectReportArchiveDetailController.java

@@ -0,0 +1,82 @@
+package com.jeeplus.test.cw.projectReportArchive.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.cw.projectReportArchive.service.CwProjectReportArchiveDetailService;
+import com.jeeplus.test.cw.projectReportArchive.service.CwProjectReportArchiveService;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.ReportDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 财务项目报告归档
+ */
+@RestController
+@Api("财务项目报告归档")
+@RequestMapping(value = "/cwProjectReportArchiveDetail")
+public class CwProjectReportArchiveDetailController {
+
+    @Resource
+    private CwProjectReportArchiveDetailService cwProjectReportArchiveDetailService;
+
+    /**
+     * 查询财务项目报告归档信息列表
+     * @param cwProjectReportArchiveDetailDTO
+     * @param page
+     * @return
+     */
+    @ApiLog("查询报告归档状态信息")
+    @PreAuthorize("hasAuthority('cwProjectReportArchiveDetail:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwProjectReportArchiveDetailDTO>> data(CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO, Page<CwProjectReportArchiveDetailDTO> page) throws Exception {
+        IPage<CwProjectReportArchiveDetailDTO> result = new Page<CwProjectReportArchiveDetailDTO>();
+        result = cwProjectReportArchiveDetailService.findList (page, cwProjectReportArchiveDetailDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 导出分所报销数据
+     * @param cwProjectReportArchiveDetailDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出分所报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出分所报销数据excel")
+    public void exportFile(CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO, Page <CwProjectReportArchiveDetailDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename ( );
+
+        List<CwProjectReportArchiveDetailDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords().stream ( ).filter ( info ->
+                    options.getSelectIds ( ).contains ( info.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "归档信息",  options.getSheetName ( ), CwProjectReportArchiveDetailDTO.class, fileName, response );
+    }
+
+}

+ 128 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/domain/CwProjectReportArchiveDetail.java

@@ -0,0 +1,128 @@
+package com.jeeplus.test.cw.projectReportArchive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 财务-项目报告归档-项目归档
+ * @TableName cw_project_report_archive
+ */
+@Data
+@TableName("cw_project_report_archive")
+public class CwProjectReportArchiveDetail extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 报告日期
+     */
+    private Date reportDate;
+
+    /**
+     * 归档时间
+     */
+    private Date auditDate;
+
+    /**
+     * 归档状态
+     */
+    private String status;
+
+    /**
+     * 超期天数
+     */
+    private String overDueDay;
+
+    /**
+     * 罚款金额
+     */
+    private String fineMoney;
+
+    /**
+     * 项目负责人
+     */
+    private String projectMasterName;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNumber;
+
+    /**
+     * 案卷号
+     */
+    private String number;
+
+    /**
+     * 报告到归档时间差(天数)
+     */
+    private Integer archiveDay;
+
+    /**
+     * 逾期天数(天数)
+     */
+    private String overdueDay;
+
+    /**
+     * 签字注师1
+     */
+    private String signatureAnnotatorName1;
+
+    /**
+     * 签字注师2
+     */
+    private String signatureAnnotatorName2;
+
+    /**
+     * 项目信息
+     */
+    private CwProjectRecordsDTO cwProjectRecordsDTO;
+
+    /**
+     * 归档时间区间
+     */
+    private String[] auditDates;
+
+    /**
+     * 报告时间区间
+     */
+    private String[] reportDates;
+
+    /**
+     * 档案号
+     */
+    @Query(tableColumn = "cw_pa.file_number",type = QueryType.LIKE)
+    private String fileNumber;
+
+    private static final long serialVersionUID = 1L;
+}

+ 22 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/CwProjectReportArchiveDetailMapper.java

@@ -0,0 +1,22 @@
+package com.jeeplus.test.cw.projectReportArchive.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface CwProjectReportArchiveDetailMapper extends BaseMapper<CwProjectReportArchiveDetail> {
+
+    IPage<CwProjectReportArchiveDetailDTO> findList(Page<CwProjectReportArchiveDetailDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportArchiveDetail> queryWrapper,@Param("cwProjectReportArchiveDetailDTO") CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO);
+
+}
+
+
+
+

+ 47 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/xml/CwProjectReportArchiveDetailMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveDetailMapper">
+
+    <select id="findList" resultType="com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO">
+        select a.id as 'id',
+        a.report_no as 'reportNo',
+        date_format(a.report_date,'%Y-%m-%d') as 'reportDate',
+        date_format(pra.audit_date,'%Y-%m-%d') as 'auditDate',
+        p.id as 'projectId',
+        p.id as 'cwProjectRecordsDTO.id',
+        pm.name as 'projectMasterName',
+        pm.name as 'cwProjectRecordsDTO.projectMasterName',
+        p.project_name as 'projectName',
+        p.project_name as 'cwProjectRecordsDTO.projectName',
+        su1.name as 'signatureAnnotatorName1',
+        su2.name as 'signatureAnnotatorName2',
+        pra.number as 'number',
+        (case when pra.audit_date is null then timestampdiff(day,a.report_date,now()) when pra.audit_date is not null then timestampdiff(day,a.report_date,pra.audit_date) end) as archiveDay
+        from cw_project_report_new_line a
+        left join cw_project_report pr on pr.id = a.report_id
+        left join sys_user su1 on su1.id = pr.signature_annotator1
+        left join sys_user su2 on su2.id = pr.signature_annotator2
+        left join cw_project_records p on p.id = pr.project_id
+        left join sys_user pm on pm.id = p.project_master_id
+        left join cw_project_report_archive_report prar on a.id = prar.report_id
+        left join cw_project_report_archive pra on prar.archive_id = pra.id
+        ${ew.customSqlSegment}
+        and a.report_number is not null and a.report_date is not null
+        <if test="cwProjectReportArchiveDetailDTO.status == '超期未归档'">
+            and pra.audit_date is null and timestampdiff(day,a.report_date,now())>60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '暂时未归档'">
+            and pra.audit_date is null and timestampdiff(day,a.report_date,now()) &lt;= 60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '已超期归档'">
+            and pra.audit_date is not null and timestampdiff(day,a.report_date,pra.audit_date)>60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '已按时归档'">
+            and pra.audit_date is not null and timestampdiff(day,a.report_date,pra.audit_date) &lt;= 60
+        </if>
+
+        order by a.report_date asc
+    </select>
+</mapper>

+ 139 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/CwProjectReportArchiveDetailService.java

@@ -0,0 +1,139 @@
+package com.jeeplus.test.cw.projectReportArchive.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.mapper.UserMapper;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectRecordsMapper;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchive;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveReport;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveDetailMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveFileMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveReportMapper;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.mapstruct.CwProjectReportArchiveDetailWrapper;
+import com.jeeplus.test.cw.projectReportArchive.service.mapstruct.CwProjectReportArchiveWrapper;
+import com.jeeplus.test.mould.service.SerialnumTplService;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.oss.service.OssService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@Transactional
+public class CwProjectReportArchiveDetailService extends ServiceImpl<CwProjectReportArchiveDetailMapper, CwProjectReportArchiveDetail> {
+
+    @Resource
+    private CwProjectReportArchiveDetailMapper cwProjectReportArchiveDetailMapper;
+    @Resource
+    private CwProjectReportArchiveReportMapper cwProjectReportArchiveReportMapper;
+    @Resource
+    private CwProjectRecordsMapper cwProjectRecordsMapper;
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private CwProjectInfoMapper cwProjectInfoMapper;
+
+    /**
+     * 项目归档列表信息
+     * @param page
+     * @param cwProjectReportArchiveDetailDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwProjectReportArchiveDetailDTO> findList(Page<CwProjectReportArchiveDetailDTO> page, CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO) throws Exception{
+        QueryWrapper<CwProjectReportArchiveDetail> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectReportArchiveDetailWrapper.INSTANCE.toEntity(cwProjectReportArchiveDetailDTO), CwProjectReportArchiveDetail.class );
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.eq("pr.del_flag","0");
+        if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDetailDTO)) {
+            if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO())){
+                // 项目名称
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectName())){
+                    List<CwProjectRecords> cwProjectRecords = cwProjectRecordsMapper.selectList(new QueryWrapper<CwProjectRecords>().lambda().like(CwProjectRecords::getProjectName, cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectName()));
+                    List<String> ids = cwProjectRecords.stream().distinct().map(CwProjectRecords::getId).collect(Collectors.toList());
+                    if(CollectionUtil.isNotEmpty(ids)) {
+                        queryWrapper.in("p.id",ids);
+                    }else{
+                        return new Page<>();
+                    }
+                }
+                // 项目经理
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectMasterId())){
+                    queryWrapper.eq("p.project_master_id",cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectMasterId());
+                }
+                // 创建时间
+                if (ArrayUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getReportDates())){
+                    queryWrapper.between("a.report_date", cwProjectReportArchiveDetailDTO.getReportDates()[0], cwProjectReportArchiveDetailDTO.getReportDates()[1]);
+                }
+                // 归档时间
+                if (ArrayUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getAuditDates())){
+                    queryWrapper.between("pra.audit_date", cwProjectReportArchiveDetailDTO.getAuditDates()[0], cwProjectReportArchiveDetailDTO.getAuditDates()[1]);
+                }
+                // 报告文号
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getReportNo())){
+                    queryWrapper.like("a.report_no",cwProjectReportArchiveDetailDTO.getReportNo());
+                }
+                // 案卷号
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getNumber())){
+                    queryWrapper.like("pra.number",cwProjectReportArchiveDetailDTO.getNumber());
+                }
+            }
+        }
+        IPage<CwProjectReportArchiveDetailDTO> list = cwProjectReportArchiveDetailMapper.findList(page, queryWrapper,cwProjectReportArchiveDetailDTO);
+        List<CwProjectReportArchiveDetailDTO> records = list.getRecords();
+        if (null != records && records.size()>0){
+            //循环查询出来的数据
+            for (CwProjectReportArchiveDetailDTO info : records) {
+                //如果归档日期为空,则表示该报告还未归档
+                if(null == info.getAuditDate()){
+                    //如果归档日期差大于60天,表示超期未归档
+                    if(info.getArchiveDay()>60){
+                        info.setStatus("超期未归档");
+                        long n = (info.getArchiveDay()) / 60;
+                        String money = Long.toString(n * 200);
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney(money);
+                    }else{
+                        //如果归档日期差小于等于60天,表示暂时未归档
+                        info.setStatus("暂时未归档");
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney("0");
+                    }
+                } else {
+                    //如果归档日期不为空,则表示该报告已归档
+
+                    //如果归档日期差大于60天,表示已超期归档
+                    if(info.getArchiveDay()>60){
+                        info.setStatus("已超期归档");
+                        long n = (info.getArchiveDay()) / 60;
+                        String money = Long.toString(n * 200);
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney(money);
+                    }else{
+                        //如果归档日期差小于等于60天,表示已按时归档
+                        info.setStatus("已按时归档");
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney("0");
+                    }
+                }
+            }
+        }
+        return list;
+    }
+}

+ 292 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/dto/CwProjectReportArchiveDetailDTO.java

@@ -0,0 +1,292 @@
+package com.jeeplus.test.cw.projectReportArchive.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务-项目报告归档-项目归档
+ */
+public class CwProjectReportArchiveDetailDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称",width = 40)
+    private String projectName;
+
+    /**
+     * 项目负责人
+     */
+    @Excel(name = "项目负责人",width = 12)
+    private String projectMasterName;
+
+    /**
+     * 报告文号
+     */
+    @Excel(name = "报告文号",width = 26)
+    private String reportNo;
+
+    /**
+     * 报告日期
+     */
+    @Excel(name = "报告日期", exportFormat="yyyy-MM-dd",width = 16)
+    private Date reportDate;
+
+    /**
+     * 归档时间
+     */
+    @Excel(name = "归档日期", exportFormat="yyyy-MM-dd",width = 16)
+    private Date auditDate;
+
+    /**
+     * 签字注师1
+     */
+    @Excel(name = "签字注师1",width = 12)
+    private String signatureAnnotatorName1;
+
+    /**
+     * 签字注师2
+     */
+    @Excel(name = "签字注师2",width = 12)
+    private String signatureAnnotatorName2;
+
+    /**
+     * 逾期天数(天数)
+     */
+    @Excel(name = "逾期天数",type = 10,width = 10)
+    private String overdueDay;
+
+    /**
+     * 归档状态
+     */
+    @Excel(name = "归档状态",width = 12)
+    private String status;
+
+    /**
+     * 罚款金额
+     */
+    @Excel(name = "罚款金额",type = 10,width = 10)
+    private String fineMoney;
+
+    /**
+     * 超期天数
+     */
+    private String overDueDay;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNumber;
+
+    /**
+     * 案卷号
+     */
+    private String number;
+
+    /**
+     * 报告到归档时间差(天数)
+     */
+    private Integer archiveDay;
+
+    /**
+     * 项目信息
+     */
+    private CwProjectRecordsDTO cwProjectRecordsDTO;
+
+    /**
+     * 归档时间区间
+     */
+    private String[] auditDates;
+
+    /**
+     * 报告时间区间
+     */
+    private String[] reportDates;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getReportNo() {
+        return reportNo;
+    }
+
+    public void setReportNo(String reportNo) {
+        this.reportNo = reportNo;
+    }
+
+    public Date getReportDate() {
+        return reportDate;
+    }
+
+    public void setReportDate(Date reportDate) {
+        this.reportDate = reportDate;
+    }
+
+    public Date getAuditDate() {
+        return auditDate;
+    }
+
+    public void setAuditDate(Date auditDate) {
+        this.auditDate = auditDate;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getOverDueDay() {
+        return overDueDay;
+    }
+
+    public void setOverDueDay(String overDueDay) {
+        this.overDueDay = overDueDay;
+    }
+
+    public String getFineMoney() {
+        return fineMoney;
+    }
+
+    public void setFineMoney(String fineMoney) {
+        this.fineMoney = fineMoney;
+    }
+
+    public String getProjectMasterName() {
+        return projectMasterName;
+    }
+
+    public void setProjectMasterName(String projectMasterName) {
+        this.projectMasterName = projectMasterName;
+    }
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getContractNumber() {
+        return contractNumber;
+    }
+
+    public void setContractNumber(String contractNumber) {
+        this.contractNumber = contractNumber;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public Integer getArchiveDay() {
+        return archiveDay;
+    }
+
+    public void setArchiveDay(Integer archiveDay) {
+        this.archiveDay = archiveDay;
+    }
+
+    public String getOverdueDay() {
+        return overdueDay;
+    }
+
+    public void setOverdueDay(String overdueDay) {
+        this.overdueDay = overdueDay;
+    }
+
+    public String getSignatureAnnotatorName1() {
+        return signatureAnnotatorName1;
+    }
+
+    public void setSignatureAnnotatorName1(String signatureAnnotatorName1) {
+        this.signatureAnnotatorName1 = signatureAnnotatorName1;
+    }
+
+    public String getSignatureAnnotatorName2() {
+        return signatureAnnotatorName2;
+    }
+
+    public void setSignatureAnnotatorName2(String signatureAnnotatorName2) {
+        this.signatureAnnotatorName2 = signatureAnnotatorName2;
+    }
+
+    public CwProjectRecordsDTO getCwProjectRecordsDTO() {
+        return cwProjectRecordsDTO;
+    }
+
+    public void setCwProjectRecordsDTO(CwProjectRecordsDTO cwProjectRecordsDTO) {
+        this.cwProjectRecordsDTO = cwProjectRecordsDTO;
+    }
+
+    public String[] getAuditDates() {
+        return auditDates;
+    }
+
+    public void setAuditDates(String[] auditDates) {
+        this.auditDates = auditDates;
+    }
+
+    public String[] getReportDates() {
+        return reportDates;
+    }
+
+    public void setReportDates(String[] reportDates) {
+        this.reportDates = reportDates;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+}

+ 16 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/mapstruct/CwProjectReportArchiveDetailWrapper.java

@@ -0,0 +1,16 @@
+package com.jeeplus.test.cw.projectReportArchive.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwProjectReportArchiveDetailWrapper extends EntityWrapper<CwProjectReportArchiveDetailDTO, CwProjectReportArchiveDetail> {
+
+    CwProjectReportArchiveDetailWrapper INSTANCE = Mappers.getMapper(CwProjectReportArchiveDetailWrapper.class);
+
+}

+ 122 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OSSClientService.java

@@ -6,6 +6,7 @@ import com.aliyun.oss.OSSClientBuilder;
 import com.aliyun.oss.model.OSSObject;
 import com.aliyun.oss.model.PutObjectResult;
 import com.aliyun.oss.model.SimplifiedObjectMeta;
+import com.jeeplus.sys.utils.Global;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,9 @@ public class OSSClientService {
     @Value("${config.accessory.aliyun.bucketName}")
     private String bucketName;
 
+    @Value("${qzBucketName}")
+    private String qzBucketName;
+
     @Value("${config.accessory.aliyun.endpoint}")
     private String endpoint;
 
@@ -200,6 +204,124 @@ public class OSSClientService {
         }
     }
 
+
+    /**
+     * 文件下载(签章系统)
+     * @param key
+     * @param fileName
+     */
+    public byte[] downQzBytesByStream(String key, String fileName){
+        OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+        byte[] bytes = null;
+        BufferedInputStream in = null;
+        ByteArrayOutputStream outputStream = null;
+        log.info("开始从云服务器加载文件,文件名:{}",fileName);
+        try {
+            // 创建OSSClient实例
+            long start = System.currentTimeMillis();
+            OSSObject ossObject = ossClient.getObject(qzBucketName, key);
+            in = new BufferedInputStream(ossObject.getObjectContent());
+            outputStream = new ByteArrayOutputStream();
+            byte[] car=new byte[1024];
+            int L=0;
+            while((L=in.read(car))!=-1){
+                outputStream.write(car, 0,L);
+            }
+            bytes = outputStream.toByteArray();
+            long end = System.currentTimeMillis();
+            log.info("从云服务器加载文件成功,文件名:{},耗时:{}ms",fileName,end-start);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            if (in!=null){
+                try {
+                    in.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (outputStream!=null){
+                try {
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return  bytes;
+    }
+
+
+    /**
+     * 附件下载到本地指定文件夹(签章系统)
+     * @param key
+     * @param fileName
+     */
+    public void downQzByStreamSaveLocal(String key, String fileName,String downFileStr){
+        try {
+            // 创建OSSClient实例
+            OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+            OSSObject ossObject = ossClient.getObject(qzBucketName, key);
+            BufferedInputStream in = new BufferedInputStream(ossObject.getObjectContent());
+
+
+            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+            FileOutputStream fileOut = new FileOutputStream(downFileStr);
+            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+            byte[] buf = new byte[4096];
+            int length = in.read(buf);
+            //保存文件
+            while(length != -1)
+            {
+                bos.write(buf, 0, length);
+                length = in.read(buf);
+            }
+            if(bos!=null){
+                bos.flush();
+                bos.close();
+            }
+            if(in!=null){
+                in.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 阿里云获取临时文件查看url
+     * 签章文件查看
+     * @param file
+     */
+    public String getQzFileTemporaryLookUrl(String file){
+        URL url = null;
+        try {
+            OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+
+            file = file.replace("amp;","");
+            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 key = file.split(cons+"/")[1];
+            // 指定过期时间为24小时。
+            Date expiration = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 );
+            url = ossClient.generatePresignedUrl(qzBucketName, key, expiration);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+        return url.toString();
+    }
+
+
     public String datePath(){
         Calendar date = Calendar.getInstance();
         String year = String.valueOf(date.get(Calendar.YEAR));

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/signature/utils/SignaturePostUtil.java

@@ -737,7 +737,7 @@ public class SignaturePostUtil {
      * @param contact 签章人手机号
      * @return
      */
-    public String getSignatureContractUrl( String contractId,String contact ){
+    public static String getSignatureContractUrl( String contractId,String contact ){
         Map map = new HashMap();
         map.put("contractId",contractId);
         map.put("tenantType","COMPANY");

+ 1 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/config/WebSecurityConfig.java

@@ -72,6 +72,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                         "/getAppFlowChart",
                         "/sys/getCode",
                         "/sys/getLoginCodeNumber",
+                        "/cwProjectReport/signatureCallBack/**",
                         "/app/sys/getCode",
                         "/sys/casLogin").permitAll() // 允许请求无需认证
                 .antMatchers( HttpMethod.OPTIONS, "/**").permitAll()

+ 3 - 1
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/TaskComment.java

@@ -5,9 +5,11 @@ import com.jeeplus.flowable.constant.FlowableConstant;
 import com.jeeplus.flowable.vo.ActionType;
 import lombok.Data;
 
+import java.io.Serializable;
+
 
 @Data
-public class TaskComment {
+public class TaskComment implements Serializable {
 
     private String type; // 操作按钮编码
     private String commentType; //历史记录的类型

+ 5 - 0
jeeplus-web/pom.xml

@@ -116,6 +116,11 @@
             <artifactId>jeeplus-test</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

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

@@ -48,7 +48,7 @@ spring:
         master:
           username: root
           password: root
-          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
+          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
           driver-class-name: com.mysql.cj.jdbc.Driver
 
           #oracle database settings
@@ -211,6 +211,8 @@ yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpris
 publicPassword: jsxgpassword
 #阿里云文件夹路径
 aliyun_directory: attachment-file/assess
+#签章阿里云文件bucketName
+qzBucketName: xg-qz
 
 #apptoken: Mt4een4BN8
 #appsecret: qhA4aV2GKE8Oq8k4G3twLiUn4U60cN
@@ -257,7 +259,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 2895582833566102435
+approval_category_id: 3032139783803457567
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id

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

@@ -213,6 +213,8 @@ publicPassword: jsxgpassword
 
 #阿里云文件夹路径
 aliyun_directory: attachment-file/assess
+  #签章阿里云文件bucketName
+  qzBucketName: xg-qz
 
 #apptoken: Mt4een4BN8
 #appsecret: qhA4aV2GKE8Oq8k4G3twLiUn4U60cN
@@ -259,7 +261,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 2895582833566102435
+approval_category_id: 3032265972836684447
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id