Browse Source

会计和评估 签章管理

sangwenwei 1 year ago
parent
commit
31d71c8702
40 changed files with 6605 additions and 0 deletions
  1. 1 0
      jeeplus-common/jeeplus-common-mybatis-plus/src/main/java/com/jeeplus/config/TenantLineHandlerImpl.java
  2. 148 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessDailyOfficeWorkSignatureCallBackController.java
  3. 148 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessDailyReportSignatureCallBackController.java
  4. 171 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessSignatureDailyOfficeWorkController.java
  5. 172 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessSignatureProjectReportController.java
  6. 82 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/Action.java
  7. 27 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/ActionOperatorInfo.java
  8. 82 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureDailyOfficeWork.java
  9. 76 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureProjectReportRelation.java
  10. 20 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureProjectReportRelevanceNumber.java
  11. 164 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/Location.java
  12. 126 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/PresignCallBack.java
  13. 95 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SealUserInfo.java
  14. 47 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SignatorieInfo.java
  15. 74 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SignatureContract.java
  16. 33 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureDailyOfficeWorkMapper.java
  17. 34 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureProjectReportMapper.java
  18. 9 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureProjectReportRelevanceNumberMapper.java
  19. 195 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/xml/AssessSignatureDailyOfficeWorkMapper.xml
  20. 204 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/xml/AssessSignatureProjectReportMapper.xml
  21. 661 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/AssessSignatureDailyOfficeWorkService.java
  22. 679 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/AssessSignatureProjectReportService.java
  23. 113 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/dto/AssessSignatureDailyOfficeWorkDTO.java
  24. 115 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/dto/AssessSignatureProjectReportRelationDTO.java
  25. 22 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramCancellation.java
  26. 500 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/Global.java
  27. 154 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/PropertiesLoader.java
  28. 816 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/SignaturePostUtil.java
  29. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwProjectRecordsController.java
  30. 4 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java
  31. 47 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml
  32. 52 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java
  33. 150 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/DailyOfficeWorkSignatureCallBackController.java
  34. 147 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/DailyReportSignatureCallBackController.java
  35. 172 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/SignatureProjectReportController.java
  36. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/SignatureProjectReportMapper.java
  37. 9 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/SignatureProjectReportRelevanceNumberMapper.java
  38. 203 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/xml/SignatureProjectReportMapper.xml
  39. 687 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/service/SignatureProjectReportService.java
  40. 115 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/service/dto/SignatureProjectReportRelationDTO.java

+ 1 - 0
jeeplus-common/jeeplus-common-mybatis-plus/src/main/java/com/jeeplus/config/TenantLineHandlerImpl.java

@@ -80,6 +80,7 @@ public class TenantLineHandlerImpl implements TenantLineHandler {
                 || (tableName.startsWith ( "zs_reimbursement_" ))
                 || (tableName.startsWith ( "human_" ))
                 || (tableName.startsWith ( "ccpm_" ))
+                || (tableName.startsWith ( "signature_" ))
                 || (tableName.startsWith ( "consultancy_" ))
                 || (tableName.startsWith ( "program_" ))) {
             return true;

+ 148 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessDailyOfficeWorkSignatureCallBackController.java

@@ -0,0 +1,148 @@
+package com.jeeplus.assess.assessSignatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.assess.assessSignatureDaily.domain.PresignCallBack;
+import com.jeeplus.assess.assessSignatureDaily.mapper.AssessSignatureDailyOfficeWorkMapper;
+import com.jeeplus.assess.assessSignatureDaily.service.AssessSignatureDailyOfficeWorkService;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 项目签章回调接口Controller
+ * @author 徐滕
+ * @version 2021-11-04
+ */
+@Controller
+@RequestMapping(value = "/assessDailyOfficeWork/signatureCallBack")
+public class AssessDailyOfficeWorkSignatureCallBackController {
+    private static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);
+
+    @Autowired
+    private AssessSignatureDailyOfficeWorkService dailyOfficeWorkService;
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private AssessSignatureDailyOfficeWorkMapper signatureDailyOfficeWorkMapper;
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+//    private final DailyOfficeWorkDao dailyOfficeWorkDao = SpringContextHolder.getBean(DailyOfficeWorkDao.class);
+
+    @ModelAttribute
+    public AssessSignatureDailyOfficeWorkDTO get(@RequestParam(required=false) String id) {
+        AssessSignatureDailyOfficeWorkDTO entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = dailyOfficeWorkService.findById(id);
+        }
+        if (entity == null){
+            entity = new AssessSignatureDailyOfficeWorkDTO();
+        }
+        return entity;
+    }
+
+    /**
+     * 审定单签章回调操作
+     * @param presignCallBack  回调参数
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCoordinates", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCoordinates(PresignCallBack presignCallBack, HttpServletRequest request , HttpServletResponse response) {
+        long t1 = System.currentTimeMillis();
+        //根据contractId查询对应的报告信息
+        String[] documentIds = presignCallBack.getDocumentId().split(",");
+
+        //根据contractId查询对应的报告信息
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWork = dailyOfficeWorkService.getByDocumentId(documentIds[0]);
+
+        if("5".equals(dailyOfficeWork.getStatus()) ){
+            return null;
+        }
+
+        if(StringUtils.isBlank(presignCallBack.getContractId())){
+
+            return null;
+        }
+        //修改签章信息
+        //签章完成则进行数据的保存
+        dailyOfficeWork.setSignatureFlag(1);
+        dailyOfficeWork.setSignatureContractId(presignCallBack.getContractId());
+        dailyOfficeWork.setSignatureUploadDate(new Date());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+
+            dailyOfficeWork.setSignatureUrl(signatureUrl);
+            dailyOfficeWork.setSignatureUrlFlag(1);
+
+            String input = signatureUrl;
+            int lastSlashIndex = input.lastIndexOf('/');
+            int lastDotIndex = input.lastIndexOf('.');
+
+            // 检查是否存在 / 和 .,以及 . 是否在 / 之后
+            if (lastSlashIndex != -1 && lastDotIndex != -1 && lastSlashIndex < lastDotIndex) {
+                String result = input.substring(lastSlashIndex + 1, input.length());
+                //添加文件名称
+                dailyOfficeWork.setSignatureFileName(result);
+            }
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getUserDTOByName("管理员");
+            dailyOfficeWork.setSignatureUploadFileUser(userDTO);
+
+        }
+        //修改签章对应信息文件
+        signatureDailyOfficeWorkMapper.updateSignatureInfo(dailyOfficeWork);
+
+        return null;
+    }
+
+    /**
+     * 日常签章每个节点处理方法
+     * @param presignCallBack
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCallBackAccomplish", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+
+        //根据contractId查询对应的报告信息
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWork = dailyOfficeWorkService.getByContractId(presignCallBack.getContractId());
+        if("5".equals(dailyOfficeWork.getStatus())){
+            return null;
+        }
+
+        String json = JSON.toJSONString(presignCallBack);
+        try {
+            String keySign = "dailyOfficeWorkSignatureSign" + dailyOfficeWork.getId();
+            String keyStatus = "dailyOfficeWorkSignatureSignStatus" + dailyOfficeWork.getId();
+
+            ValueOperations<String, String> operations = stringRedisTemplate.opsForValue();
+            operations.set(keySign, json, 1, TimeUnit.DAYS); // 设置有效期为1天
+            operations.set(keyStatus, "true", 1, TimeUnit.DAYS); // 设置有效期为1天
+        } catch (Exception e) {
+            logger.error("Error saving data to Redis", e);
+        }
+        return null;
+    }
+}

+ 148 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessDailyReportSignatureCallBackController.java

@@ -0,0 +1,148 @@
+package com.jeeplus.assess.assessSignatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.assess.assessSignatureDaily.domain.PresignCallBack;
+import com.jeeplus.assess.assessSignatureDaily.mapper.AssessSignatureProjectReportMapper;
+import com.jeeplus.assess.assessSignatureDaily.service.AssessSignatureProjectReportService;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 项目签章回调接口Controller
+ * @author 徐滕
+ * @version 2021-11-04
+ */
+@Controller
+@RequestMapping(value = "/assessDailyReport/signatureCallBack")
+public class AssessDailyReportSignatureCallBackController {
+    private static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);
+
+    @Autowired
+    private AssessSignatureProjectReportService signatureProjectReportService;
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private AssessSignatureProjectReportMapper signatureProjectReportMapper;
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+//    private final DailyOfficeWorkDao dailyOfficeWorkDao = SpringContextHolder.getBean(DailyOfficeWorkDao.class);
+
+    @ModelAttribute
+    public AssessSignatureProjectReportRelationDTO get(@RequestParam(required=false) String id) {
+        AssessSignatureProjectReportRelationDTO entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = signatureProjectReportService.findById(id);
+        }
+        if (entity == null){
+            entity = new AssessSignatureProjectReportRelationDTO();
+        }
+        return entity;
+    }
+
+    /**
+     * 审定单签章回调操作
+     * @param presignCallBack  回调参数
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCoordinates", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCoordinates(PresignCallBack presignCallBack, HttpServletRequest request , HttpServletResponse response) {
+        long t1 = System.currentTimeMillis();
+        //根据contractId查询对应的报告信息
+        String[] documentIds = presignCallBack.getDocumentId().split(",");
+
+        //根据contractId查询对应的报告信息
+        AssessSignatureProjectReportRelationDTO dailyOfficeWork = signatureProjectReportService.getByDocumentId(documentIds[0]);
+
+        if("5".equals(dailyOfficeWork.getStatus()) ){
+            return null;
+        }
+
+        if(StringUtils.isBlank(presignCallBack.getContractId())){
+
+            return null;
+        }
+        //修改签章信息
+        //签章完成则进行数据的保存
+        dailyOfficeWork.setSignatureFlag(1);
+        dailyOfficeWork.setSignatureContractId(presignCallBack.getContractId());
+        dailyOfficeWork.setSignatureUploadDate(new Date());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+
+            dailyOfficeWork.setSignatureUrl(signatureUrl);
+            dailyOfficeWork.setSignatureUrlFlag(1);
+
+            String input = signatureUrl;
+            int lastSlashIndex = input.lastIndexOf('/');
+            int lastDotIndex = input.lastIndexOf('.');
+
+            // 检查是否存在 / 和 .,以及 . 是否在 / 之后
+            if (lastSlashIndex != -1 && lastDotIndex != -1 && lastSlashIndex < lastDotIndex) {
+                String result = input.substring(lastSlashIndex + 1, input.length());
+                //添加文件名称
+                dailyOfficeWork.setSignatureFileName(result);
+            }
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getUserDTOByName("管理员");
+            dailyOfficeWork.setSignatureUploadFileUser(userDTO);
+
+        }
+        //修改签章对应信息文件
+        signatureProjectReportMapper.updateSignatureInfo(dailyOfficeWork);
+
+        return null;
+    }
+
+    /**
+     * 日常签章每个节点处理方法
+     * @param presignCallBack
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCallBackAccomplish", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+
+        //根据contractId查询对应的报告信息
+        AssessSignatureProjectReportRelationDTO dailyOfficeWork = signatureProjectReportService.getByContractId(presignCallBack.getContractId());
+        if("5".equals(dailyOfficeWork.getStatus())){
+            return null;
+        }
+
+        String json = JSON.toJSONString(presignCallBack);
+        try {
+            String keySign = "dailyOfficeWorkSignatureSign" + dailyOfficeWork.getId();
+            String keyStatus = "dailyOfficeWorkSignatureSignStatus" + dailyOfficeWork.getId();
+
+            ValueOperations<String, String> operations = stringRedisTemplate.opsForValue();
+            operations.set(keySign, json, 1, TimeUnit.DAYS); // 设置有效期为1天
+            operations.set(keyStatus, "true", 1, TimeUnit.DAYS); // 设置有效期为1天
+        } catch (Exception e) {
+            logger.error("Error saving data to Redis", e);
+        }
+        return null;
+    }
+}

+ 171 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessSignatureDailyOfficeWorkController.java

@@ -0,0 +1,171 @@
+package com.jeeplus.assess.assessSignatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.assess.assessSignatureDaily.domain.AssessSignatureDailyOfficeWork;
+import com.jeeplus.assess.assessSignatureDaily.service.AssessSignatureDailyOfficeWorkService;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO;
+import com.jeeplus.assess.projectRecords.Utils.EasyPoiUtil;
+import com.jeeplus.assess.utils.SignaturePostUtil;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.feign.IUserApi;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+@RestController
+@Api(tags ="日常办公签章")
+@RequestMapping(value = "/assess/signatureDaily")
+public class AssessSignatureDailyOfficeWorkController {
+
+    @Resource
+    private AssessSignatureDailyOfficeWorkService signatureDaulyOfficeWorkService;
+
+    @Autowired
+    private RedisUtils redisUtils;
+
+
+    /**
+     * 列表查询
+     * @param
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<AssessSignatureDailyOfficeWorkDTO>> list(Page<AssessSignatureDailyOfficeWorkDTO> page, AssessSignatureDailyOfficeWorkDTO dto) throws Exception{
+        IPage<AssessSignatureDailyOfficeWorkDTO> iPage = signatureDaulyOfficeWorkService.list(page, dto);
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
+     * 根据id查询数据
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/findById")
+    public ResponseEntity<AssessSignatureDailyOfficeWorkDTO> findById(@RequestParam String id) throws Exception{
+        AssessSignatureDailyOfficeWorkDTO dto = signatureDaulyOfficeWorkService.findById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "新增、修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody AssessSignatureDailyOfficeWorkDTO dto) throws Exception{
+        AssessSignatureDailyOfficeWork s = signatureDaulyOfficeWorkService.save(dto);
+        return ResponseUtil.newInstance().add("businessTable", "signature_daily_office_work")
+                .add("businessId", s.getId())
+                .add("number", s.getNumber())
+                .ok ("操作成功");
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping("/remove")
+    public ResponseEntity<String> remove(@RequestParam String id){
+        String s = signatureDaulyOfficeWorkService.remove(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody AssessSignatureDailyOfficeWorkDTO dto) {
+        signatureDaulyOfficeWorkService.updateStatusById(dto);
+    }
+
+    @ApiLog(value = "日常签章数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "日常签章数据")
+    public void exportFile(Page<AssessSignatureDailyOfficeWorkDTO> page, AssessSignatureDailyOfficeWorkDTO dto, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<AssessSignatureDailyOfficeWorkDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = signatureDaulyOfficeWorkService.list2 (page,dto).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = signatureDaulyOfficeWorkService.list2 (page,dto).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = signatureDaulyOfficeWorkService.list2 (page,dto).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, AssessSignatureDailyOfficeWorkDTO.class, fileName, response );
+
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getAuditNodeById")
+    public ResponseEntity getAuditNodeById(@RequestParam("id") String id) {
+        Map<String, Object> auditNodeByReportId = signatureDaulyOfficeWorkService.getAuditNodeById(id);
+        return ResponseEntity.ok (auditNodeByReportId);
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getSignatureTypeById")
+    public ResponseEntity getSignatureTypeById(@RequestParam("id") String id) {
+        Map<String, Object> signatureTypeById = signatureDaulyOfficeWorkService.getSignatureTypeById(id);
+        return ResponseEntity.ok (signatureTypeById);
+    }
+
+    /**
+     * 签章链接
+     * @param dto
+     * @return
+     */
+    @ApiLog(value = "签章链接", type = LogTypeEnum.SAVE)
+    @PostMapping("saveFlowableParam")
+    public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody AssessSignatureDailyOfficeWorkDTO dto) {
+
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWorkDTO = signatureDaulyOfficeWorkService.findById(dto.getId());
+        // 获取签章页面url
+        String mobile = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken()).getMobile();
+        String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(dailyOfficeWorkDTO.getSignatureContractId(), mobile);
+        // 将数据存储到redis中,key为contractId
+        redisUtils.set("assess_signature_daily_" + dailyOfficeWorkDTO.getSignatureContractId(),dailyOfficeWorkDTO.getId());
+        redisUtils.expire("assess_signature_daily_" + dailyOfficeWorkDTO.getSignatureContractId(),24, TimeUnit.HOURS);
+        return ResponseEntity.ok(signatureContractUrl);
+    }
+
+}

+ 172 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/controller/AssessSignatureProjectReportController.java

@@ -0,0 +1,172 @@
+package com.jeeplus.assess.assessSignatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.assess.assessSignatureDaily.domain.AssessSignatureProjectReportRelation;
+import com.jeeplus.assess.assessSignatureDaily.service.AssessSignatureProjectReportService;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO;
+import com.jeeplus.assess.projectRecords.Utils.EasyPoiUtil;
+import com.jeeplus.assess.utils.SignaturePostUtil;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.feign.IUserApi;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+@RestController
+@Api(tags ="报告签章")
+@RequestMapping(value = "/assess/signatureReport")
+public class AssessSignatureProjectReportController {
+
+    @Resource
+    private AssessSignatureProjectReportService signatureProjectReportService;
+
+    @Autowired
+    private RedisUtils redisUtils;
+
+
+
+    /**
+     * 列表查询
+     * @param
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<AssessSignatureProjectReportRelationDTO>> list(Page<AssessSignatureProjectReportRelationDTO> page, AssessSignatureProjectReportRelationDTO dto) throws Exception{
+        IPage<AssessSignatureProjectReportRelationDTO> iPage = signatureProjectReportService.list(page, dto);
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
+     * 根据id查询数据
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/findById")
+    public ResponseEntity<AssessSignatureProjectReportRelationDTO> findById(@RequestParam String id) throws Exception{
+        AssessSignatureProjectReportRelationDTO dto = signatureProjectReportService.findById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "新增、修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody AssessSignatureProjectReportRelationDTO dto) throws Exception{
+        AssessSignatureProjectReportRelation s = signatureProjectReportService.save(dto);
+        return ResponseUtil.newInstance().add("businessTable", "signature_project_report_relation")
+                .add("businessId", s.getId())
+                .add("number", s.getNumber())
+                .ok ("操作成功");
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping("/remove")
+    public ResponseEntity<String> remove(@RequestParam String id){
+        String s = signatureProjectReportService.remove(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody AssessSignatureProjectReportRelationDTO dto) {
+        signatureProjectReportService.updateStatusById(dto);
+    }
+
+    @ApiLog(value = "报告签章数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "报告签章数据")
+    public void exportFile(Page<AssessSignatureProjectReportRelationDTO> page, AssessSignatureProjectReportRelationDTO dto, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<AssessSignatureProjectReportRelationDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = signatureProjectReportService.list2 (page,dto).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = signatureProjectReportService.list2 (page,dto).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = signatureProjectReportService.list2 (page,dto).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, AssessSignatureProjectReportRelationDTO.class, fileName, response );
+
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getAuditNodeById")
+    public ResponseEntity getAuditNodeById(@RequestParam("id") String id) {
+        Map<String, Object> auditNodeByReportId = signatureProjectReportService.getAuditNodeById(id);
+        return ResponseEntity.ok (auditNodeByReportId);
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getSignatureTypeById")
+    public ResponseEntity getSignatureTypeById(@RequestParam("id") String id) {
+        Map<String, Object> signatureTypeById = signatureProjectReportService.getSignatureTypeById(id);
+        return ResponseEntity.ok (signatureTypeById);
+    }
+
+    /**
+     * 签章链接
+     * @param dto
+     * @return
+     */
+    @ApiLog(value = "签章链接", type = LogTypeEnum.SAVE)
+    @PostMapping("saveFlowableParam")
+    public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody AssessSignatureProjectReportRelationDTO dto) {
+
+        AssessSignatureProjectReportRelationDTO relationDTO = signatureProjectReportService.findById(dto.getId());
+        // 获取签章页面url
+        String mobile = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken()).getMobile();
+        String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(relationDTO.getSignatureContractId(), mobile);
+        // 将数据存储到redis中,key为contractId
+        redisUtils.set("assess_signature_report_" + relationDTO.getSignatureContractId(),relationDTO.getId());
+        redisUtils.expire("assess_signature_report_" + relationDTO.getSignatureContractId(),24, TimeUnit.HOURS);
+        return ResponseEntity.ok(signatureContractUrl);
+    }
+
+
+}

+ 82 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/Action.java

@@ -0,0 +1,82 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import java.util.List;
+
+/**
+ * @author: 大猫
+ * @create: 2021-11-02 18:32
+ **/
+public class Action {
+    private String type;
+    private String name;
+    private String serialNo;
+    private String sealId;
+    private String autoSign;
+    private String sealIds;
+    private List<ActionOperatorInfo> actionOperators; //签署人信息
+    private List<Location> locations; //位置信息
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+    public String getAutoSign() {
+        return autoSign;
+    }
+
+    public void setAutoSign(String autoSign) {
+        this.autoSign = autoSign;
+    }
+
+    public List<ActionOperatorInfo> getActionOperators() {
+        return actionOperators;
+    }
+
+    public void setActionOperators(List<ActionOperatorInfo> actionOperators) {
+        this.actionOperators = actionOperators;
+    }
+
+    public List<Location> getLocations() {
+        return locations;
+    }
+
+    public void setLocations(List<Location> locations) {
+        this.locations = locations;
+    }
+
+    public String getSealId() {
+        return sealId;
+    }
+
+    public void setSealId(String sealId) {
+        this.sealId = sealId;
+    }
+
+    public String getSealIds() {
+        return sealIds;
+    }
+
+    public void setSealIds(String sealIds) {
+        this.sealIds = sealIds;
+    }
+}

+ 27 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/ActionOperatorInfo.java

@@ -0,0 +1,27 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+/**
+ * 签署人信息
+ * @author: 徐滕
+ * @create: 2021-11-02 18:10
+ **/
+public class ActionOperatorInfo {
+    private String operatorName; //签署人名称
+    private String operatorContact; //签署人手机号
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public String getOperatorContact() {
+        return operatorContact;
+    }
+
+    public void setOperatorContact(String operatorContact) {
+        this.operatorContact = operatorContact;
+    }
+}

+ 82 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureDailyOfficeWork.java

@@ -0,0 +1,82 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("signature_daily_office_work")
+public class AssessSignatureDailyOfficeWork extends BaseEntity {
+    //日常签章编号(字典值)
+    public static final String BIZ_CODE = "33";
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 签章描述
+     */
+    private String signatureName;
+
+    /**
+     * 编号
+     */
+    private String number;
+
+    /**
+     * 签章类型
+     */
+    private String signatureType;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 签章contractId
+     */
+    private String signatureContractId;
+    /**
+     * 签章documentId
+     */
+    private String signatureDocumentId;
+    /**
+     * 签章url地址
+     */
+    private String signatureUrl;
+    /*
+    签章完成情况
+     */
+    private Integer signatureUrlFlag;
+    /*
+    签章附件名称
+     */
+    private String signatureFileName;
+    /**
+     * 签属时间
+     */
+    private Date signatureUploadDate;
+    /*
+    签属文件上传人
+     */
+    private String signatureUploadFileUser;
+    /*
+    签章状态
+     */
+    private Integer signatureFlag;
+
+}

+ 76 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureProjectReportRelation.java

@@ -0,0 +1,76 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("signature_project_report_relation")
+public class AssessSignatureProjectReportRelation extends BaseEntity {
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 签章描述
+     */
+    private String signatureName;
+
+    /**
+     * 签章编号
+     */
+    private String number;
+
+    /**
+     * 签章类型
+     */
+    private String signatureType;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+
+    /**
+     * 签章contractId
+     */
+    private String signatureContractId;
+    /**
+     * 签章documentId
+     */
+    private String signatureDocumentId;
+    /**
+     * 签章url地址
+     */
+    private String signatureUrl;
+    /*
+    签章完成情况
+     */
+    private Integer signatureUrlFlag;
+    /*
+    签章附件名称
+     */
+    private String signatureFileName;
+    /**
+     * 签属时间
+     */
+    private Date signatureUploadDate;
+    /*
+    签属文件上传人
+     */
+    private String signatureUploadFileUser;
+    /*
+    签章状态
+     */
+    private Integer signatureFlag;
+}

+ 20 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/AssessSignatureProjectReportRelevanceNumber.java

@@ -0,0 +1,20 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("signature_project_report_relevance_number")
+public class AssessSignatureProjectReportRelevanceNumber {
+
+    /**
+     * 报告签章表id
+     */
+    private String signatureProjectReportId;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+}

+ 164 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/Location.java

@@ -0,0 +1,164 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+/**
+ * 签署位置表
+ * @author: 徐滕
+ * @create: 2021-11-03 15:50
+ **/
+public class Location {
+    private String id;
+    private String documentId ; //合同文档ID
+    private String rectType ;   //签章类型
+    private String page ;      //签署页码,坐标指定位置时必须,0:全部页,-1:最后一页,其他:第page页
+    private String keyword ;    //关键字,关键字指定位置时必须
+    private Integer keywordIndex ;  //第几个关键字,0:全部,-1:最后一个,其他:第keyIndex 个,默认为1
+    private String offsetX ;    //X轴坐标,坐标定位时必传,关键字定位时选传
+    private String offsetY ;    //Y轴坐标,坐标定位时必传,关键字定位时选传
+    private String contractId ;
+    private String signatoryId ;
+    private String actionId ;
+    private String width ;
+    private String height ;
+    private String fromTemplate ;
+    private String createTime ;
+    private String samePositionId ;
+    private String sealId ;
+
+
+
+    public String getDocumentId() {
+        return documentId;
+    }
+
+    public void setDocumentId(String documentId) {
+        this.documentId = documentId;
+    }
+
+    public String getRectType() {
+        return rectType;
+    }
+
+    public void setRectType(String rectType) {
+        this.rectType = rectType;
+    }
+
+    public String getPage() {
+        return page;
+    }
+
+    public void setPage(String page) {
+        this.page = page;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    public Integer getKeywordIndex() {
+        return keywordIndex;
+    }
+
+    public void setKeywordIndex(Integer keywordIndex) {
+        this.keywordIndex = keywordIndex;
+    }
+
+    public String getOffsetX() {
+        return offsetX;
+    }
+
+    public void setOffsetX(String offsetX) {
+        this.offsetX = offsetX;
+    }
+
+    public String getOffsetY() {
+        return offsetY;
+    }
+
+    public void setOffsetY(String offsetY) {
+        this.offsetY = offsetY;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getSignatoryId() {
+        return signatoryId;
+    }
+
+    public void setSignatoryId(String signatoryId) {
+        this.signatoryId = signatoryId;
+    }
+
+    public String getActionId() {
+        return actionId;
+    }
+
+    public void setActionId(String actionId) {
+        this.actionId = actionId;
+    }
+
+    public String getWidth() {
+        return width;
+    }
+
+    public void setWidth(String width) {
+        this.width = width;
+    }
+
+    public String getHeight() {
+        return height;
+    }
+
+    public void setHeight(String height) {
+        this.height = height;
+    }
+
+    public String getFromTemplate() {
+        return fromTemplate;
+    }
+
+    public void setFromTemplate(String fromTemplate) {
+        this.fromTemplate = fromTemplate;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getSamePositionId() {
+        return samePositionId;
+    }
+
+    public void setSamePositionId(String samePositionId) {
+        this.samePositionId = samePositionId;
+    }
+
+    public String getSealId() {
+        return sealId;
+    }
+
+    public void setSealId(String sealId) {
+        this.sealId = sealId;
+    }
+}

+ 126 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/PresignCallBack.java

@@ -0,0 +1,126 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+/**
+ * 预签署回调参数表
+ * @author: 大猫
+ * @create: 2021-11-04 09:27
+ **/
+public class PresignCallBack {
+    private String contractId;  //文件编号
+    private String documentId;  //文档ID
+    private String tenantId;    //签署方编号
+    private String tenantName;  //签署方名称
+    private String sn;  //文件自定义编号
+    private String status;  //文件状态
+    private String type;    //回调类型
+    private String contact; //联系方式
+    private String operatorName;    //操作人姓名(签章人姓名)
+    private String operatorMobile;  //操作人手机号(签章人手机号)
+    private String operatorNumber;  //操作人员工编号
+    private String receiverNumber;  //经办人员工编号
+    private String storagePath;  //文件归档下载地址
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getDocumentId() {
+        return documentId;
+    }
+
+    public void setDocumentId(String documentId) {
+        this.documentId = documentId;
+    }
+
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getContact() {
+        return contact;
+    }
+
+    public void setContact(String contact) {
+        this.contact = contact;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public String getOperatorMobile() {
+        return operatorMobile;
+    }
+
+    public void setOperatorMobile(String operatorMobile) {
+        this.operatorMobile = operatorMobile;
+    }
+
+    public String getOperatorNumber() {
+        return operatorNumber;
+    }
+
+    public void setOperatorNumber(String operatorNumber) {
+        this.operatorNumber = operatorNumber;
+    }
+
+    public String getReceiverNumber() {
+        return receiverNumber;
+    }
+
+    public void setReceiverNumber(String receiverNumber) {
+        this.receiverNumber = receiverNumber;
+    }
+
+    public String getStoragePath() {
+        return storagePath;
+    }
+
+    public void setStoragePath(String storagePath) {
+        this.storagePath = storagePath;
+    }
+}

+ 95 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SealUserInfo.java

@@ -0,0 +1,95 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import java.util.Date;
+
+/**
+ * 员工印章表
+ * @author: 徐滕
+ * @create: 2021-11-05 09:18
+ **/
+public class SealUserInfo {
+    private String id;  //印章ID
+    private String owner;   //公司ID
+    private String name;    //印章名称
+    private String otherName;   //印章别名
+    //private SealType type;    //签章类型
+    //private SealSpec spec;    //印章规格
+    private String sealKey; //印章图片key
+    private Date createTime; //创建时间
+    //private SealStatus status; //印章状态
+    private String useCount; //印章使用的次数
+    private String category; //印章类型:物理章,电子章
+    private String sealCategoryName; //印章分类名称
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getOwner() {
+        return owner;
+    }
+
+    public void setOwner(String owner) {
+        this.owner = owner;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOtherName() {
+        return otherName;
+    }
+
+    public void setOtherName(String otherName) {
+        this.otherName = otherName;
+    }
+
+    public String getSealKey() {
+        return sealKey;
+    }
+
+    public void setSealKey(String sealKey) {
+        this.sealKey = sealKey;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUseCount() {
+        return useCount;
+    }
+
+    public void setUseCount(String useCount) {
+        this.useCount = useCount;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getSealCategoryName() {
+        return sealCategoryName;
+    }
+
+    public void setSealCategoryName(String sealCategoryName) {
+        this.sealCategoryName = sealCategoryName;
+    }
+}

+ 47 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SignatorieInfo.java

@@ -0,0 +1,47 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import java.util.List;
+
+/**
+ * 签署方信息表
+ * @author: 徐滕
+ * @create: 2021-11-02 18:08
+ **/
+public class SignatorieInfo {
+    private String tenantType; //签署方类型
+    private String tenantName; //签署方名称
+    private String serialNo; //签署顺序
+    private List<Action> actions; //签署顺序
+
+    public String getTenantType() {
+        return tenantType;
+    }
+
+    public void setTenantType(String tenantType) {
+        this.tenantType = tenantType;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+    public List<Action> getActions() {
+        return actions;
+    }
+
+    public void setActions(List<Action> actions) {
+        this.actions = actions;
+    }
+}

+ 74 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/domain/SignatureContract.java

@@ -0,0 +1,74 @@
+package com.jeeplus.assess.assessSignatureDaily.domain;
+
+import java.util.List;
+
+/**
+ * 签章合同表
+ * @author: 徐滕
+ * @create: 2021-11-02 18:05
+ **/
+public class SignatureContract {
+    private String subject; //合同名称
+    private String sn; //合同编号 非必填
+    private String categoryId; //用印流程ID 非必填
+    private String tenantName; //用印流程名称 非必填
+    private List<String> documents; //文档ID的集合 非必填
+    private List<SignatorieInfo> signatories; //签署方信息 非必填
+    private Boolean send;   //是否发起(预签署为不发起)
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public List<String> getDocuments() {
+        return documents;
+    }
+
+    public void setDocuments(List<String> documents) {
+        this.documents = documents;
+    }
+
+    public List<SignatorieInfo> getSignatories() {
+        return signatories;
+    }
+
+    public void setSignatories(List<SignatorieInfo> signatories) {
+        this.signatories = signatories;
+    }
+
+    public Boolean getSend() {
+        return send;
+    }
+
+    public void setSend(Boolean send) {
+        this.send = send;
+    }
+}

+ 33 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureDailyOfficeWorkMapper.java

@@ -0,0 +1,33 @@
+package com.jeeplus.assess.assessSignatureDaily.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.assess.assessSignatureDaily.domain.AssessSignatureDailyOfficeWork;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface AssessSignatureDailyOfficeWorkMapper extends BaseMapper<AssessSignatureDailyOfficeWork> {
+    IPage<AssessSignatureDailyOfficeWorkDTO> findList(Page<AssessSignatureDailyOfficeWorkDTO> page, @Param(Constants.WRAPPER) QueryWrapper<AssessSignatureDailyOfficeWorkDTO> queryWrapper);
+    IPage<AssessSignatureDailyOfficeWorkDTO> findList2(Page<AssessSignatureDailyOfficeWorkDTO> page,@Param(Constants.WRAPPER) QueryWrapper<AssessSignatureDailyOfficeWorkDTO> queryWrapper);
+
+    AssessSignatureDailyOfficeWorkDTO findById(@Param("id") String id);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
+
+    void updateStatusById(@Param("status") String status,@Param("id") String id);
+
+    void updateSignatureInfo(AssessSignatureDailyOfficeWorkDTO dailyOfficeWork);
+
+    AssessSignatureDailyOfficeWorkDTO getByDocumentId(@Param("documentId") String documentId);
+
+    AssessSignatureDailyOfficeWorkDTO getByContractId(@Param("contractId") String contractId);
+}

+ 34 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureProjectReportMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.assess.assessSignatureDaily.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.assess.assessSignatureDaily.domain.AssessSignatureProjectReportRelation;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface AssessSignatureProjectReportMapper extends BaseMapper<AssessSignatureProjectReportRelation> {
+
+    IPage<AssessSignatureProjectReportRelationDTO> findList(Page<AssessSignatureProjectReportRelationDTO> page, @Param(Constants.WRAPPER) QueryWrapper<AssessSignatureProjectReportRelationDTO> queryWrapper);
+
+    IPage<AssessSignatureProjectReportRelationDTO> findList2(Page<AssessSignatureProjectReportRelationDTO> page, @Param(Constants.WRAPPER) QueryWrapper<AssessSignatureProjectReportRelationDTO> queryWrapper);
+
+    AssessSignatureProjectReportRelationDTO findById(@Param("id") String id);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
+
+    void updateStatusById(@Param("status") String status, @Param("id") String id);
+
+    void updateSignatureInfo(AssessSignatureProjectReportRelationDTO relationDTO);
+
+    AssessSignatureProjectReportRelationDTO getByDocumentId(@Param("documentId") String documentId);
+
+    AssessSignatureProjectReportRelationDTO getByContractId(@Param("contractId") String contractId);
+}

+ 9 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/AssessSignatureProjectReportRelevanceNumberMapper.java

@@ -0,0 +1,9 @@
+package com.jeeplus.assess.assessSignatureDaily.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.assess.assessSignatureDaily.domain.AssessSignatureProjectReportRelevanceNumber;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AssessSignatureProjectReportRelevanceNumberMapper extends BaseMapper<AssessSignatureProjectReportRelevanceNumber> {
+}

+ 195 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/xml/AssessSignatureDailyOfficeWorkMapper.xml

@@ -0,0 +1,195 @@
+<?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.assess.assessSignatureDaily.mapper.AssessSignatureDailyOfficeWorkMapper">
+
+    <select id="findList" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_daily_office_work a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findList2" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findById" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_daily_office_work a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.id = #{id} and a.del_flag = 0
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			attachment_flag AS `attachmentFlag`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+    <update id="updateStatusById">
+        update signature_daily_office_work set status = #{status} where id = #{id}
+    </update>
+
+    <update id="updateSignatureInfo" >
+        UPDATE signature_daily_office_work SET
+        <if test="signatureDocumentId != null and signatureDocumentId != ''">
+            signature_document_id = #{signatureDocumentId}
+        </if>
+        <if test="signatureUrl != null">
+            ,signature_url = #{signatureUrl}
+        </if>
+        <if test="signatureUrlFlag != null">
+            ,signature_url_flag = #{signatureUrlFlag}
+        </if>
+        <if test="signatureContractId != null and signatureContractId != ''">
+            ,signature_contract_id = #{signatureContractId}
+        </if>
+        <if test="signatureFlag != null">
+            ,signature_flag = #{signatureFlag}
+        </if>
+        <if test="signatureFileName != null and signatureFileName != ''">
+            ,signature_file_name = #{signatureFileName}
+        </if>
+        <if test="signatureUploadFileUser != null and signatureUploadFileUser.id != null and signatureUploadFileUser.id != ''">
+            ,signature_upload_file_user = #{signatureUploadFileUser.id}
+        </if>
+        <if test="signatureUploadDate != null">
+            ,signature_upload_date = #{signatureUploadDate}
+        </if>
+        WHERE id = #{id}
+    </update>
+
+    <select id="getByDocumentId" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_daily_office_work a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_document_id like concat ('%',#{documentId},'%') and a.del_flag = 0
+    </select>
+
+    <select id="getByContractId" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_daily_office_work a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_contract_id = #{contractId} and a.del_flag = 0
+    </select>
+
+
+</mapper>

+ 204 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/mapper/xml/AssessSignatureProjectReportMapper.xml

@@ -0,0 +1,204 @@
+<?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.assess.assessSignatureDaily.mapper.AssessSignatureProjectReportMapper">
+    <select id="findList" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            (SELECT GROUP_CONCAT(pr.name  SEPARATOR ',')
+             FROM signature_project_report_relevance_number rn
+             LEFT JOIN program_project_list_info pr ON rn.project_id = pr.id
+             WHERE rn.signature_project_report_id = a.id) AS projectName,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findList2" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            (SELECT GROUP_CONCAT(pr.name  SEPARATOR ',')
+             FROM signature_project_report_relevance_number rn
+             LEFT JOIN program_project_list_info pr ON rn.project_id = pr.id
+             WHERE rn.signature_project_report_id = a.id) AS projectName,
+             c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findById" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.id = #{id} and a.del_flag = 0
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			attachment_flag AS `attachmentFlag`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+    <update id="updateStatusById">
+        update signature_project_report_relation set status = #{status} where id = #{id}
+    </update>
+
+    <update id="updateSignatureInfo" >
+        UPDATE signature_project_report_relation SET
+        <if test="signatureDocumentId != null and signatureDocumentId != ''">
+            signature_document_id = #{signatureDocumentId}
+        </if>
+        <if test="signatureUrl != null">
+            ,signature_url = #{signatureUrl}
+        </if>
+        <if test="signatureUrlFlag != null">
+            ,signature_url_flag = #{signatureUrlFlag}
+        </if>
+        <if test="signatureContractId != null and signatureContractId != ''">
+            ,signature_contract_id = #{signatureContractId}
+        </if>
+        <if test="signatureFlag != null">
+            ,signature_flag = #{signatureFlag}
+        </if>
+        <if test="signatureFileName != null and signatureFileName != ''">
+            ,signature_file_name = #{signatureFileName}
+        </if>
+        <if test="signatureUploadFileUser != null and signatureUploadFileUser.id != null and signatureUploadFileUser.id != ''">
+            ,signature_upload_file_user = #{signatureUploadFileUser.id}
+        </if>
+        <if test="signatureUploadDate != null">
+            ,signature_upload_date = #{signatureUploadDate}
+        </if>
+        WHERE id = #{id}
+    </update>
+
+    <select id="getByDocumentId" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_document_id like concat ('%',#{documentId},'%') and a.del_flag = 0
+    </select>
+
+    <select id="getByContractId" resultType="com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_contract_id = #{contractId} and a.del_flag = 0
+    </select>
+
+
+
+
+</mapper>

+ 661 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/AssessSignatureDailyOfficeWorkService.java

@@ -0,0 +1,661 @@
+package com.jeeplus.assess.assessSignatureDaily.service;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.assess.assessSignatureDaily.domain.*;
+import com.jeeplus.assess.assessSignatureDaily.mapper.AssessSignatureDailyOfficeWorkMapper;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureDailyOfficeWorkDTO;
+import com.jeeplus.assess.utils.Global;
+import com.jeeplus.assess.utils.SignaturePostUtil;
+import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.*;
+
+@Service
+@Transactional
+public class AssessSignatureDailyOfficeWorkService {
+
+    private static final byte[] SYN_BYTE = new byte[0];
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    /**
+     * 公司圆章-横
+     */
+    private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
+    //日常签章申请流程id
+    private static final String DAILYOFFICEWORK = Global.getConfig("signature_daily_office_work");
+
+    @Resource
+    private AssessSignatureDailyOfficeWorkMapper signatureDailyOfficeWorkMapper;
+
+    @Resource
+    private WorkContractInfoMapper mapper;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     * @return
+     */
+    public IPage<AssessSignatureDailyOfficeWorkDTO> list(Page<AssessSignatureDailyOfficeWorkDTO> page, AssessSignatureDailyOfficeWorkDTO dto) throws Exception {
+        QueryWrapper<AssessSignatureDailyOfficeWorkDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, AssessSignatureDailyOfficeWorkDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<AssessSignatureDailyOfficeWorkDTO> list = signatureDailyOfficeWorkMapper.findList(page, queryWrapper);
+
+        return list;
+    }
+
+    /**
+     * 用于导出数据
+     * @param page
+     * @param dto
+     * @return
+     * @throws Exception
+     */
+    public IPage<AssessSignatureDailyOfficeWorkDTO> list2(Page<AssessSignatureDailyOfficeWorkDTO> page, AssessSignatureDailyOfficeWorkDTO dto) throws Exception {
+        QueryWrapper<AssessSignatureDailyOfficeWorkDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, AssessSignatureDailyOfficeWorkDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<AssessSignatureDailyOfficeWorkDTO> list = signatureDailyOfficeWorkMapper.findList2(page, queryWrapper);
+
+        return list;
+    }
+
+    /*8
+    根据id查询数据
+     */
+    public AssessSignatureDailyOfficeWorkDTO findById(String id) {
+        AssessSignatureDailyOfficeWorkDTO dto = new AssessSignatureDailyOfficeWorkDTO();
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWorkDTO=signatureDailyOfficeWorkMapper.findById(id);
+        if (ObjectUtil.isNotEmpty(dailyOfficeWorkDTO)){
+            BeanUtils.copyProperties(dailyOfficeWorkDTO, dto);
+            //查询附件信息
+            List<WorkAttachmentInfo> fileList = signatureDailyOfficeWorkMapper.findFiles(id);
+
+            if (CollectionUtils.isNotEmpty(fileList)) {
+                for (WorkAttachmentInfo i : fileList) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            dto.setFiles(fileList);
+        }
+        return dto;
+    }
+
+    /**
+     * 新增或修改
+     * @param dto
+     * @return
+     */
+    public AssessSignatureDailyOfficeWork save(AssessSignatureDailyOfficeWorkDTO dto) throws Exception {
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (StringUtils.isNotBlank(dto.getId())){
+            return update(dto,userDTO);
+        }
+        return add(dto,userDTO);
+    }
+
+    private AssessSignatureDailyOfficeWork update(AssessSignatureDailyOfficeWorkDTO dto, UserDTO userDTO) {
+        // 修改基础信息
+        AssessSignatureDailyOfficeWork signatureDailyOfficeWork = new AssessSignatureDailyOfficeWork();
+        BeanUtils.copyProperties(dto, signatureDailyOfficeWork);
+        signatureDailyOfficeWork.setUpdateById(userDTO.getId());
+        signatureDailyOfficeWork.setUpdateTime(new Date());
+        signatureDailyOfficeWorkMapper.updateById(signatureDailyOfficeWork);
+        //生成签章信息
+        if (StringUtils.isNotBlank(dto.getStatus())&&dto.getStatus().equals("2")){
+            this.getManualSignatureUrl(dto.getId());
+        }
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            updateFiles(dto.getFiles(), userDTO, dto.getId(),"signatureDaily");
+        }
+        return signatureDailyOfficeWork;
+    }
+
+    private AssessSignatureDailyOfficeWork add(AssessSignatureDailyOfficeWorkDTO dto, UserDTO userDTO) throws Exception {
+        // 生成id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        // 生成编号
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE, TokenProvider.getCurrentToken());
+        //保存信息
+        AssessSignatureDailyOfficeWork signatureDailyOfficeWork = new AssessSignatureDailyOfficeWork();
+        BeanUtils.copyProperties(dto, signatureDailyOfficeWork);
+        signatureDailyOfficeWork.setId(id);
+        signatureDailyOfficeWork.setNumber(no);
+        signatureDailyOfficeWork.setCreateById(userDTO.getId());
+        signatureDailyOfficeWork.setCreateTime(new Date());
+        signatureDailyOfficeWork.setUpdateById(userDTO.getId());
+        signatureDailyOfficeWork.setUpdateTime(new Date());
+        signatureDailyOfficeWork.setDelFlag(0);
+        signatureDailyOfficeWorkMapper.insert(signatureDailyOfficeWork);
+        //生成签章流程
+        if ("2".equals(dto.getStatus())){
+            this.getManualSignatureUrl(id);
+        }
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            saveFiles(dto.getFiles(), userDTO, id);
+        }
+        return signatureDailyOfficeWork;
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("signatureDaily");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id, String attachmentFlag) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(id,attachmentFlag);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag(attachmentFlag);
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /*8
+    删除
+     */
+    public String remove(String id) {
+        signatureDailyOfficeWorkMapper.deleteById(id);
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    /**
+     * 根据id修改装填
+     * @param dto
+     */
+    public void updateStatusById(AssessSignatureDailyOfficeWorkDTO dto) {
+        signatureDailyOfficeWorkMapper.updateStatusById(dto.getStatus(),dto.getId());
+        //如果是撤销或者是驳回,则需要对签章流程进行恢复
+        if ("3".equals(dto.getStatus())||"4".equals(dto.getStatus())){
+            AssessSignatureDailyOfficeWork dailyOfficeWorkDTO = new AssessSignatureDailyOfficeWork();
+            dailyOfficeWorkDTO.setSignatureContractId("");
+            dailyOfficeWorkDTO.setSignatureDocumentId("");
+            dailyOfficeWorkDTO.setSignatureFlag(0);
+            dailyOfficeWorkDTO.setSignatureUrlFlag(0);
+            dailyOfficeWorkDTO.setSignatureUrl("");
+            dailyOfficeWorkDTO.setSignatureFileName("");
+            dailyOfficeWorkDTO.setSignatureUploadDate(null);
+            dailyOfficeWorkDTO.setId(dto.getId());
+            signatureDailyOfficeWorkMapper.updateById(dailyOfficeWorkDTO);
+        }
+    }
+
+    /**
+     * 根据documentId查询签章信息
+     * @param documentId
+     * @return
+     */
+    public AssessSignatureDailyOfficeWorkDTO getByDocumentId(String documentId) {
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWork = signatureDailyOfficeWorkMapper.getByDocumentId(documentId);
+        return dailyOfficeWork;
+    }
+    //根据contractId查询对应的报告信息
+    public AssessSignatureDailyOfficeWorkDTO getByContractId(String contractId) {
+        AssessSignatureDailyOfficeWorkDTO dailyOfficeWork = signatureDailyOfficeWorkMapper.getByContractId(contractId);
+        return dailyOfficeWork;
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param
+     * @return
+     */
+    public Map<String,Object> getAuditNodeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        //查询流程id
+        AssessSignatureDailyOfficeWorkDTO workDTO = signatureDailyOfficeWorkMapper.findById(id);
+        if(StringUtils.isNotBlank(workDTO.getProcInsId())){
+            //根据流程id查询流程当前节点信息
+            String currentTask = flowTaskService.getCurrentTaskName(workDTO.getProcInsId());
+            if(StringUtils.isNotEmpty(currentTask)){
+                map.put("success", true);
+                map.put("message", "获取签章流程成功");
+                map.put("signatureType", currentTask);
+            }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 id
+     * @return
+     */
+    public Map<String,Object> getSignatureTypeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        AssessSignatureDailyOfficeWorkDTO officeWorkDTO = signatureDailyOfficeWorkMapper.findById(id);
+        if(null != officeWorkDTO){
+            map.put("success", true);
+            map.put("message", "获取签章完成情况成功");
+            map.put("signatureType", officeWorkDTO.getSignatureFlag());
+        }else{
+            map.put("success", false);
+            map.put("message", "获取签章完成情况失败");
+            map.put("signatureType", "0");
+        }
+        return map;
+    }
+
+    /**
+     * 创建签章流程
+     * @param dailyOfficeWorkId
+     * @return
+     */
+    public HashMap<String, Object> getManualSignatureUrl( String dailyOfficeWorkId) {
+        HashMap<String, Object> map = Maps.newHashMap();
+        map.put("contractUrl","");
+        map.put("success",false);
+        //下载文件位置
+        String deleteFile = null;
+        try {
+            //根据项目id查询是否已经提交过了报告签章
+            AssessSignatureDailyOfficeWorkDTO dailyOfficeWork = this.findById(dailyOfficeWorkId);
+            if(null == dailyOfficeWork){
+                map.put("str","查询不到该签章申请信息");
+                map.put("success",false);
+                return map;
+            }
+            if(null!= dailyOfficeWork.getSignatureFlag() && 1 == dailyOfficeWork.getSignatureFlag()){
+                map.put("str","该盖章申请已完成");
+                map.put("success",false);
+                return map;
+            }
+
+            List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(dailyOfficeWorkId,"signatureDaily");
+
+
+            //创建一个用于存放签章文件documentId的集合
+            List<String> documentList = com.google.common.collect.Lists.newArrayList();
+            if(infoList.size()>0) {
+                String aliyunUrl = "http://cdn.gangwaninfo.com";
+                String aliDownloadUrl = "http://oss.gangwaninfo.com";
+                for (WorkAttachmentInfo workattachment : infoList) {
+                    if (StringUtils.isBlank(workattachment.getUrl())) {
+                        map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                        map.put("success", false);
+                    } else {
+                        if (StringUtils.isBlank(workattachment.getUrl())) {
+                            map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                            map.put("success", false);
+                        } else {
+                            //下载签章申请文件
+                            String path = null;
+                            if (System.getProperty("os.name").toLowerCase().contains("win")) {
+                                path = "D:/attachment-file/";
+                            } else {
+                                path = "/attachment-file/";
+                            }
+                            String file = aliyunUrl+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];
+                            SpringUtil.getBean ( IWorkAttachmentApi.class ).downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                            //将下载下来的文件转换为file文件
+                            File srcFile = new File(path + fileName);
+                            deleteFile = path + fileName;
+
+                            //截取文件后缀名
+                            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())) {
+                                map.put("str", "请上传doc、docx或者pdf的文件进行签章操作");
+                                map.put("success", false);
+                            } else {
+
+                                //获取真签单的documentId
+                                HashMap hashMap = new SignaturePostUtil().getDocument(srcFile);
+                                String code = hashMap.get("code").toString();
+
+                                if ("0".equals(code)) {
+                                    String documentId = "";
+                                    String result = hashMap.get("result").toString();
+                                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                    documentId = documentIdMap.get("documentId").toString();
+                                    if ("".equals(documentId)) {
+                                        map.put("str", "签章文件创建失败,签章文件存在问题");
+                                        map.put("success", false);
+                                    } else {
+                                        documentList.add(documentId);
+                                    }
+                                } else {
+                                    String message = hashMap.get("message").toString();
+                                    map.put("str", message);
+                                    map.put("success", false);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            //根据项目id 和 documentId生成合同id
+            HashMap contractIdHashMap = this.getManualSignatureContractId(documentList,dailyOfficeWork);
+            String contractIdCode = contractIdHashMap.get("code").toString();
+            String contractId = "";
+            if("0".equals(contractIdCode)){
+                contractId = contractIdHashMap.get("contractId").toString();
+                if("".equals(contractId)){
+                    map.put("str","签章文件创建失败");
+                    map.put("success",false);
+                    return map;
+                }
+            }else{
+                map.put("str",contractIdHashMap.get("message").toString());
+            }
+
+
+            String documents = String.join(",", documentList);
+            //修改报告信息中对应的签章contractId
+            dailyOfficeWork.setSignatureDocumentId(documents);
+            dailyOfficeWork.setSignatureContractId(contractId);
+            //修改签章对应信息文件
+            signatureDailyOfficeWorkMapper.updateSignatureInfo(dailyOfficeWork);
+
+            map.put("success",true);
+            return map;
+
+            //获取contractUrl路径
+            /*String contractUrl = this.getSignatureContractUrl(contractId);
+            if("".equals(contractUrl)){
+                map.put("str","签章文件创建失败");
+                map.put("success",false);
+                return map;
+            }else{
+
+                String documents = String.join(",", documentList);
+                //修改报告信息中对应的签章contractId
+                dailyOfficeWork.setSignatureDocumentId(documents);
+                dailyOfficeWork.setSignatureContractId(contractId);
+                //修改签章对应信息文件
+                dao.updateSignatureInfo(dailyOfficeWork);
+
+                map.put("contractUrl",contractUrl);
+                map.put("success",true);
+                return map;
+            }*/
+        } catch (Exception e) {
+            e.getMessage();
+        } finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+
+        return map;
+    }
+
+    /**
+     * 根据项目id 和 documentId生成合同id(手动签生成签署合同)
+     * @param documentList
+     * @return
+     */
+    public HashMap getManualSignatureContractId(List<String> documentList,AssessSignatureDailyOfficeWorkDTO dailyOfficeWork){
+        HashMap hashMap = new HashMap();
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Set<String> serialIdSet = new HashSet<>();
+
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //公司圆章-竖
+        serialIdSet.add(COMPANYROUNDSEALID);
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        for (String documentId: documentList) {
+            Location location = new Location();
+            location.setSealId(COMPANYROUNDSEALID);
+            location.setDocumentId(documentId);
+            location.setPage("0");
+            location.setRectType("SEAL_CORPORATE");
+            location.setKeywordIndex(-1);
+            location.setOffsetX("0.5264");
+            location.setOffsetY("0.6787");
+            locations.add(location);
+        }
+
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("false");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
+
+        //创建签署方信息表
+        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(DAILYOFFICEWORK);
+
+        signatureContract.setSend(true);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        if(null != dailyOfficeWork && StringUtils.isNotBlank(dailyOfficeWork.getNumber())){
+            signatureContract.setSubject(dailyOfficeWork.getNumber() + "。" + dailyOfficeWork.getSignatureName());//添加项目名称
+        }else if(null != dailyOfficeWork && StringUtils.isNotBlank(dailyOfficeWork.getSignatureName())){
+            signatureContract.setSubject(dailyOfficeWork.getSignatureName());//添加项目名称
+        }
+        JSONObject json = JSONObject.fromObject(signatureContract);
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+}

+ 679 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/AssessSignatureProjectReportService.java

@@ -0,0 +1,679 @@
+package com.jeeplus.assess.assessSignatureDaily.service;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.assess.assessSignatureDaily.domain.*;
+import com.jeeplus.assess.assessSignatureDaily.mapper.AssessSignatureProjectReportMapper;
+import com.jeeplus.assess.assessSignatureDaily.mapper.AssessSignatureProjectReportRelevanceNumberMapper;
+import com.jeeplus.assess.assessSignatureDaily.service.dto.AssessSignatureProjectReportRelationDTO;
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
+import com.jeeplus.assess.program.configuration.projectList.mapper.ProjectListMapper;
+import com.jeeplus.assess.utils.Global;
+import com.jeeplus.assess.utils.SignaturePostUtil;
+import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.*;
+
+@Service
+@Transactional
+public class AssessSignatureProjectReportService {
+    private static final byte[] SYN_BYTE = new byte[0];
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    /**
+     * 公司圆章-横
+     */
+    private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
+    //日常签章申请流程id
+    private static final String SIGNATUREREPORTCAREGORYID = Global.getConfig("signature_report_caregory_id");
+
+
+    @Resource
+    private AssessSignatureProjectReportMapper signatureProjectReportMapper;
+
+    @Resource
+    private AssessSignatureProjectReportRelevanceNumberMapper relevanceNumberMapper;
+
+    @Resource
+    private ProjectListMapper cwProjectRecordsMapper;
+
+    @Resource
+    private WorkContractInfoMapper mapper;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     * @return
+     * @throws Exception
+     */
+    public IPage<AssessSignatureProjectReportRelationDTO> list(Page<AssessSignatureProjectReportRelationDTO> page, AssessSignatureProjectReportRelationDTO dto) throws Exception {
+        QueryWrapper<AssessSignatureProjectReportRelationDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, AssessSignatureProjectReportRelationDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<AssessSignatureProjectReportRelationDTO> list = signatureProjectReportMapper.findList(page, queryWrapper);
+
+        return list;
+    }
+    /*8
+    用于导出数据
+     */
+    public IPage<AssessSignatureProjectReportRelationDTO> list2(Page<AssessSignatureProjectReportRelationDTO> page, AssessSignatureProjectReportRelationDTO dto) throws Exception {
+        QueryWrapper<AssessSignatureProjectReportRelationDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, AssessSignatureProjectReportRelationDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<AssessSignatureProjectReportRelationDTO> list = signatureProjectReportMapper.findList2(page, queryWrapper);
+
+        return list;
+    }
+
+    public AssessSignatureProjectReportRelationDTO findById(String id) {
+        AssessSignatureProjectReportRelationDTO dto = new AssessSignatureProjectReportRelationDTO();
+        AssessSignatureProjectReportRelationDTO reportRelationDTO=signatureProjectReportMapper.findById(id);
+        if (ObjectUtil.isNotEmpty(reportRelationDTO)){
+            BeanUtils.copyProperties(reportRelationDTO, dto);
+            List<ProgramProjectListInfo> dtoList = new ArrayList<>();
+            //查询报告签章表所关联的项目id
+            List<AssessSignatureProjectReportRelevanceNumber> relevanceNumberList = relevanceNumberMapper.selectList(new QueryWrapper<AssessSignatureProjectReportRelevanceNumber>().eq("signature_project_report_id", id));
+            if (CollectionUtils.isNotEmpty(relevanceNumberList)){
+                for (AssessSignatureProjectReportRelevanceNumber number : relevanceNumberList) {
+                    ProgramProjectListInfo projectRecordsDTO = cwProjectRecordsMapper.getById(number.getProjectId());
+                    dtoList.add(projectRecordsDTO);
+                }
+                dto.setProjectList(dtoList);
+            }
+            //查询附件信息
+            List<WorkAttachmentInfo> fileList = signatureProjectReportMapper.findFiles(id);
+            if (CollectionUtils.isNotEmpty(fileList)) {
+                for (WorkAttachmentInfo i : fileList) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            dto.setFiles(fileList);
+        }
+        return dto;
+    }
+
+    public AssessSignatureProjectReportRelation save(AssessSignatureProjectReportRelationDTO dto) throws Exception {
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (StringUtils.isNotBlank(dto.getId())){
+            return update(dto,userDTO);
+        }
+        return add(dto,userDTO);
+    }
+
+    private AssessSignatureProjectReportRelation update(AssessSignatureProjectReportRelationDTO dto, UserDTO userDTO) {
+        // 修改基础信息
+        AssessSignatureProjectReportRelation signatureProjectReportRelation = new AssessSignatureProjectReportRelation();
+        BeanUtils.copyProperties(dto, signatureProjectReportRelation);
+        signatureProjectReportRelation.setUpdateById(userDTO.getId());
+        signatureProjectReportRelation.setUpdateTime(new Date());
+        signatureProjectReportMapper.updateById(signatureProjectReportRelation);
+        //根据id删除签章项目关联表中的信息
+        relevanceNumberMapper.delete(new QueryWrapper<AssessSignatureProjectReportRelevanceNumber>().eq("signature_project_report_id",dto.getId()));
+        //将新的项目信息存到关联表中
+        if (CollectionUtils.isNotEmpty(dto.getProjectList())){
+            for (ProgramProjectListInfo projectRecordsDTO : dto.getProjectList()) {
+                AssessSignatureProjectReportRelevanceNumber signatureProjectReportRelevanceNumber = new AssessSignatureProjectReportRelevanceNumber();
+                signatureProjectReportRelevanceNumber.setProjectId(projectRecordsDTO.getId());
+                signatureProjectReportRelevanceNumber.setSignatureProjectReportId(dto.getId());
+                relevanceNumberMapper.insert(signatureProjectReportRelevanceNumber);
+            }
+        }
+        //获取当前节点信息
+        String currentTask = flowTaskService.getCurrentTaskName(dto.getProcInsId());
+        if (StringUtils.isNotBlank(currentTask)){
+            if (currentTask.equals("部门主任审批")){
+                //部门主任同意之后生成签章信息
+                if (StringUtils.isNotBlank(dto.getStatus())&&dto.getStatus().equals("2")){
+                    this.getManualSignatureUrl(dto.getId());
+                }
+            }
+        }
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            updateFiles(dto.getFiles(), userDTO, dto.getId(),"signatureReport");
+        }
+        return signatureProjectReportRelation;
+    }
+
+    private AssessSignatureProjectReportRelation add(AssessSignatureProjectReportRelationDTO dto, UserDTO userDTO) throws Exception {
+        // 生成id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        // 生成编号
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE, TokenProvider.getCurrentToken());
+        //保存信息
+        AssessSignatureProjectReportRelation signatureProjectReportRelation = new AssessSignatureProjectReportRelation();
+        BeanUtils.copyProperties(dto, signatureProjectReportRelation);
+        signatureProjectReportRelation.setId(id);
+        signatureProjectReportRelation.setNumber(no);
+        signatureProjectReportRelation.setCreateById(userDTO.getId());
+        signatureProjectReportRelation.setCreateTime(new Date());
+        signatureProjectReportRelation.setUpdateById(userDTO.getId());
+        signatureProjectReportRelation.setUpdateTime(new Date());
+        signatureProjectReportRelation.setDelFlag(0);
+        signatureProjectReportMapper.insert(signatureProjectReportRelation);
+        //保存项目信息
+        if (CollectionUtils.isNotEmpty(dto.getProjectList())){
+            for (ProgramProjectListInfo projectRecordsDTO : dto.getProjectList()) {
+                AssessSignatureProjectReportRelevanceNumber signatureProjectReportRelevanceNumber = new AssessSignatureProjectReportRelevanceNumber();
+                signatureProjectReportRelevanceNumber.setProjectId(projectRecordsDTO.getId());
+                signatureProjectReportRelevanceNumber.setSignatureProjectReportId(id);
+                relevanceNumberMapper.insert(signatureProjectReportRelevanceNumber);
+            }
+        }
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            saveFiles(dto.getFiles(), userDTO, id);
+        }
+
+        return signatureProjectReportRelation;
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("signatureReport");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id, String attachmentFlag) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(id,attachmentFlag);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag(attachmentFlag);
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    public String remove(String id) {
+        signatureProjectReportMapper.deleteById(id);
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    public void updateStatusById(AssessSignatureProjectReportRelationDTO dto) {
+        signatureProjectReportMapper.updateStatusById(dto.getStatus(),dto.getId());
+        //如果是撤销或者是驳回,则需要对签章流程进行恢复
+        if ("3".equals(dto.getStatus())||"4".equals(dto.getStatus())){
+            AssessSignatureProjectReportRelation signatureProjectReportRelation = new AssessSignatureProjectReportRelation();
+            signatureProjectReportRelation.setSignatureContractId("");
+            signatureProjectReportRelation.setSignatureDocumentId("");
+            signatureProjectReportRelation.setSignatureFlag(0);
+            signatureProjectReportRelation.setSignatureUrlFlag(0);
+            signatureProjectReportRelation.setSignatureUrl("");
+            signatureProjectReportRelation.setSignatureFileName("");
+            signatureProjectReportRelation.setSignatureUploadDate(null);
+            signatureProjectReportRelation.setId(dto.getId());
+            signatureProjectReportMapper.updateById(signatureProjectReportRelation);
+        }
+    }
+
+    /**
+     * 创建签章流程
+     * @param dailyOfficeWorkId
+     * @return
+     */
+    public HashMap<String, Object> getManualSignatureUrl( String dailyOfficeWorkId) {
+        HashMap<String, Object> map = Maps.newHashMap();
+        map.put("contractUrl","");
+        map.put("success",false);
+        //下载文件位置
+        String deleteFile = null;
+        try {
+            //根据项目id查询是否已经提交过了报告签章
+            AssessSignatureProjectReportRelationDTO relationDTO = this.findById(dailyOfficeWorkId);
+            if(null == relationDTO){
+                map.put("str","查询不到该签章申请信息");
+                map.put("success",false);
+                return map;
+            }
+            if(null!= relationDTO.getSignatureFlag() && 1 == relationDTO.getSignatureFlag()){
+                map.put("str","该盖章申请已完成");
+                map.put("success",false);
+                return map;
+            }
+
+            List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(dailyOfficeWorkId,"signatureReport");
+
+
+            //创建一个用于存放签章文件documentId的集合
+            List<String> documentList = Lists.newArrayList();
+            if(infoList.size()>0) {
+                String aliyunUrl = "http://cdn.gangwaninfo.com";
+                String aliDownloadUrl = "http://oss.gangwaninfo.com";
+                for (WorkAttachmentInfo workattachment : infoList) {
+                    if (StringUtils.isBlank(workattachment.getUrl())) {
+                        map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                        map.put("success", false);
+                    } else {
+                        if (StringUtils.isBlank(workattachment.getUrl())) {
+                            map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                            map.put("success", false);
+                        } else {
+                            //下载签章申请文件
+                            String path = null;
+                            if (System.getProperty("os.name").toLowerCase().contains("win")) {
+                                path = "D:/attachment-file/";
+                            } else {
+                                path = "/attachment-file/";
+                            }
+                            String file = aliyunUrl+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];
+                            SpringUtil.getBean ( IWorkAttachmentApi.class ).downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                            //将下载下来的文件转换为file文件
+                            File srcFile = new File(path + fileName);
+                            deleteFile = path + fileName;
+
+                            //截取文件后缀名
+                            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())) {
+                                map.put("str", "请上传doc、docx或者pdf的文件进行签章操作");
+                                map.put("success", false);
+                            } else {
+
+                                //获取真签单的documentId
+                                HashMap hashMap = new SignaturePostUtil().getDocument(srcFile);
+                                String code = hashMap.get("code").toString();
+
+                                if ("0".equals(code)) {
+                                    String documentId = "";
+                                    String result = hashMap.get("result").toString();
+                                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                    documentId = documentIdMap.get("documentId").toString();
+                                    if ("".equals(documentId)) {
+                                        map.put("str", "签章文件创建失败,签章文件存在问题");
+                                        map.put("success", false);
+                                    } else {
+                                        documentList.add(documentId);
+                                    }
+                                } else {
+                                    String message = hashMap.get("message").toString();
+                                    map.put("str", message);
+                                    map.put("success", false);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            //根据项目id 和 documentId生成合同id
+            HashMap contractIdHashMap = this.getManualSignatureContractId(documentList,relationDTO);
+            String contractIdCode = contractIdHashMap.get("code").toString();
+            String contractId = "";
+            if("0".equals(contractIdCode)){
+                contractId = contractIdHashMap.get("contractId").toString();
+                if("".equals(contractId)){
+                    map.put("str","签章文件创建失败");
+                    map.put("success",false);
+                    return map;
+                }
+            }else{
+                map.put("str",contractIdHashMap.get("message").toString());
+            }
+
+
+            String documents = String.join(",", documentList);
+            //修改报告信息中对应的签章contractId
+            relationDTO.setSignatureDocumentId(documents);
+            relationDTO.setSignatureContractId(contractId);
+            //修改签章对应信息文件
+            signatureProjectReportMapper.updateSignatureInfo(relationDTO);
+
+            map.put("success",true);
+            return map;
+
+            //获取contractUrl路径
+            /*String contractUrl = this.getSignatureContractUrl(contractId);
+            if("".equals(contractUrl)){
+                map.put("str","签章文件创建失败");
+                map.put("success",false);
+                return map;
+            }else{
+
+                String documents = String.join(",", documentList);
+                //修改报告信息中对应的签章contractId
+                dailyOfficeWork.setSignatureDocumentId(documents);
+                dailyOfficeWork.setSignatureContractId(contractId);
+                //修改签章对应信息文件
+                dao.updateSignatureInfo(dailyOfficeWork);
+
+                map.put("contractUrl",contractUrl);
+                map.put("success",true);
+                return map;
+            }*/
+        } catch (Exception e) {
+            e.getMessage();
+        } finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+
+        return map;
+    }
+
+    /**
+     * 根据项目id 和 documentId生成合同id(手动签生成签署合同)
+     * @param documentList
+     * @return
+     */
+    public HashMap getManualSignatureContractId(List<String> documentList,AssessSignatureProjectReportRelationDTO relationDTO){
+        HashMap hashMap = new HashMap();
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Set<String> serialIdSet = new HashSet<>();
+
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //公司圆章-竖
+        serialIdSet.add(COMPANYROUNDSEALID);
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        for (String documentId: documentList) {
+            Location location = new Location();
+            location.setSealId(COMPANYROUNDSEALID);
+            location.setDocumentId(documentId);
+            location.setPage("0");
+            location.setRectType("SEAL_CORPORATE");
+            location.setKeywordIndex(-1);
+            location.setOffsetX("0.5264");
+            location.setOffsetY("0.6787");
+            locations.add(location);
+        }
+
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("false");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
+
+        //创建签署方信息表
+        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(SIGNATUREREPORTCAREGORYID);
+
+        signatureContract.setSend(true);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        if(null != relationDTO && StringUtils.isNotBlank(relationDTO.getNumber())){
+            signatureContract.setSubject(relationDTO.getNumber() + "。" + relationDTO.getSignatureName());//添加项目名称
+        }else if(null != relationDTO && StringUtils.isNotBlank(relationDTO.getSignatureName())){
+            signatureContract.setSubject(relationDTO.getSignatureName());//添加项目名称
+        }
+        JSONObject json = JSONObject.fromObject(signatureContract);
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
+     * 根据documentId查询签章信息
+     * @param documentId
+     * @return
+     */
+    public AssessSignatureProjectReportRelationDTO getByDocumentId(String documentId) {
+        AssessSignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.getByDocumentId(documentId);
+        return relationDTO;
+    }
+    //根据contractId查询对应的报告信息
+    public AssessSignatureProjectReportRelationDTO getByContractId(String contractId) {
+        AssessSignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.getByContractId(contractId);
+        return relationDTO;
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param
+     * @return
+     */
+    public Map<String,Object> getAuditNodeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        //查询流程id
+        AssessSignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.findById(id);
+        if(StringUtils.isNotBlank(relationDTO.getProcInsId())){
+            //根据流程id查询流程当前节点信息
+            String currentTask = flowTaskService.getCurrentTaskName(relationDTO.getProcInsId());
+            if(StringUtils.isNotEmpty(currentTask)){
+                map.put("success", true);
+                map.put("message", "获取签章流程成功");
+                map.put("signatureType", currentTask);
+            }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 id
+     * @return
+     */
+    public Map<String,Object> getSignatureTypeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        AssessSignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.findById(id);
+        if(null != relationDTO){
+            map.put("success", true);
+            map.put("message", "获取签章完成情况成功");
+            map.put("signatureType", relationDTO.getSignatureFlag());
+        }else{
+            map.put("success", false);
+            map.put("message", "获取签章完成情况失败");
+            map.put("signatureType", "0");
+        }
+        return map;
+    }
+}

+ 113 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/dto/AssessSignatureDailyOfficeWorkDTO.java

@@ -0,0 +1,113 @@
+package com.jeeplus.assess.assessSignatureDaily.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class AssessSignatureDailyOfficeWorkDTO extends BaseEntity {
+
+        //日常签章编号(字典值)
+        public static final String BIZ_CODE = "33";
+
+        private String id;
+
+        /**
+         * 备注
+         */
+        private String remarks;
+
+        /**
+         * 签章描述
+         */
+        @Excel(name = "签章描述", width = 30, orderNum = "2")
+        private String signatureName;
+
+        /**
+         * 编号
+         */
+        @Excel(name = "签章编号", width = 30, orderNum = "1")
+        private String number;
+
+        /**
+         * 签章类型
+         */
+        @Excel(name = "签章类型", width = 30, orderNum = "3",dict = "signature_daily")
+        private String signatureType;
+
+        /**
+         * 状态
+         */
+        private String status;
+
+        /**
+         * 流程信息
+         */
+        private String procInsId;
+        private String processDefinitionId;
+        private String taskId;
+
+        /**
+         * 报销日期
+         */
+        @DateTimeFormat(pattern = "yyyy-MM-dd")
+        @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+        @Excel(name = "创建时间", width = 30, orderNum = "5")
+        private Date createTime;
+
+        /**
+         * 创建时间
+         */
+        private String[] dates;
+        @Excel(name = "创建人", width = 30, orderNum = "4")
+        private String createName;
+
+        private String officeName;
+
+        private String officeId;
+
+        private List<WorkAttachmentInfo> files;
+
+        /**
+         * 签章contractId
+         */
+        private String signatureContractId;
+        /**
+         * 签章documentId
+         */
+        private String signatureDocumentId;
+        /**
+         * 签章url地址
+         */
+        private String signatureUrl;
+        /*
+        签章完成情况
+         */
+        private Integer signatureUrlFlag;
+        /*
+        签章附件名称
+         */
+        private String signatureFileName;
+        /**
+         * 签属时间
+         */
+        private Date signatureUploadDate;
+        /*
+        签属文件上传人
+         */
+        private UserDTO signatureUploadFileUser;
+        /*
+        签章状态
+         */
+        private Integer signatureFlag;
+
+}

+ 115 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/assessSignatureDaily/service/dto/AssessSignatureProjectReportRelationDTO.java

@@ -0,0 +1,115 @@
+package com.jeeplus.assess.assessSignatureDaily.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class AssessSignatureProjectReportRelationDTO extends BaseEntity {
+    //日常签章编号(字典值)
+    public static final String BIZ_CODE = "34";
+
+    private String id;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 签章描述
+     */
+    @Excel(name = "签章描述", width = 30, orderNum = "2")
+    private String signatureName;
+
+    /**
+     * 签章编号
+     */
+    @Excel(name = "签章编号", width = 30, orderNum = "1")
+    private String number;
+
+    /**
+     * 签章类型
+     */
+    @Excel(name = "签章类型", width = 30, orderNum = "4",dict = "signature_project_report")
+    private String signatureType;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+    private String taskId;
+
+    /**
+     * 报销日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, orderNum = "6")
+    private Date createTime;
+
+    /**
+     * 创建时间
+     */
+    private String[] dates;
+    @Excel(name = "创建人", width = 30, orderNum = "5")
+    private String createName;
+
+    private String officeName;
+
+    private String officeId;
+
+    private List<WorkAttachmentInfo> files;
+
+    private List<ProgramProjectListInfo> projectList;
+    @Excel(name = "签章项目", width = 30, orderNum = "3")
+    private String projectName;
+
+    /**
+     * 签章contractId
+     */
+    private String signatureContractId;
+    /**
+     * 签章documentId
+     */
+    private String signatureDocumentId;
+    /**
+     * 签章url地址
+     */
+    private String signatureUrl;
+    /*
+    签章完成情况
+     */
+    private Integer signatureUrlFlag;
+    /*
+    签章附件名称
+     */
+    private String signatureFileName;
+    /**
+     * 签属时间
+     */
+    private Date signatureUploadDate;
+    /*
+    签属文件上传人
+     */
+    private UserDTO signatureUploadFileUser;
+    /*
+    签章状态
+     */
+    private Integer signatureFlag;
+}

+ 22 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramCancellation.java

@@ -0,0 +1,22 @@
+package com.jeeplus.assess.program.configuration.projectList.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+/**
+ * 评估-项目作废表
+ */
+@Data
+@TableName("program_cancellation")
+public class ProgramCancellation extends BaseEntity {
+
+    //项目id
+    private String projectId;
+    //状态
+    private String status;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+}

+ 500 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/Global.java

@@ -0,0 +1,500 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.assess.utils;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.core.io.DefaultResourceLoader;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * 全局配置类
+ * @author jeeplus
+ * @version 2014-06-25
+ */
+public class Global {
+
+	/**
+	 * 当前对象实例
+	 */
+	private static Global global = new Global();
+
+	/**
+	 * 保存全局属性值
+	 */
+	private static Map<String, String> map = Maps.newHashMap();
+
+	/**
+	 * 属性文件加载对象
+	 */
+	private static PropertiesLoader loader = new PropertiesLoader("application-finance.yml");
+
+
+	/**
+	 * 显示/隐藏
+	 */
+	public static final String SHOW = "1";
+	public static final String HIDE = "0";
+
+	/**
+	 * 是/否
+	 */
+	public static final String YES = "1";
+	public static final String NO = "0";
+
+	/**
+	 * 对/错
+	 */
+	public static final String TRUE = "true";
+	public static final String FALSE = "false";
+
+	/**
+	 * 上传文件基础虚拟路径
+	 */
+	public static final String USERFILES_BASE_URL = "/userfiles/";
+
+	/**
+	 * 获取当前对象实例
+	 */
+	public static Global getInstance() {
+		return global;
+	}
+
+	/**
+	 * 获取配置
+	 * @see {fns:getConfig('adminPath')}
+	 */
+	public static String getConfig1(String key) {
+		String value = map.get(key);
+		if (value == null){
+			value = loader.getProperty(key);
+			map.put(key, value != null ? value : StringUtils.EMPTY);
+		}
+		return value;
+	}
+
+	public static String getConfig(String key) {
+		String value = null;
+		try {
+			String property = loader.getProperty("active");
+
+			if (StringUtils.isNotBlank(property)) {
+				switch (property){
+					case "development":
+						PropertiesLoader devLoader = new PropertiesLoader("application-finance-development.yml");
+						value = devLoader.getProperty(key);
+						break;
+					case "production":
+						PropertiesLoader proLoader = new PropertiesLoader("application-finance-production.yml");
+						value = proLoader.getProperty(key);
+						break;
+				}
+			}
+
+		} catch (Exception e) {
+
+		}
+		return value;
+	}
+
+	/**
+	 * 获取管理端根路径
+	 */
+	public static String getAdminPath() {
+		return getConfig("adminPath");
+	}
+	/**
+	 */
+	public static String getAliyunUrl() {
+		return getConfig("aliyunDownloadUrl");
+	}
+	/**
+	 */
+	public static String getAliDownloadUrl() {
+		return getConfig("aliyunUrl");
+	}
+	/**
+	 */
+	public static String getEndpoint() {
+		return getConfig("endpoint");
+	}
+	/**
+	 */
+	public static String getAccessKeyId() {
+		return getConfig("accessKeyId");
+	}
+	/**
+	 */
+	public static String getAccessKeySecret() {
+		return getConfig("accessKeySecret");
+	}
+	/**
+	 */
+	public static String getBucketName() {
+		return getConfig("bucketName");
+	}
+	/**
+	 */
+	public static String getQzBucketName() {
+		return getConfig("qzBucketName");
+	}
+	/**
+	 */
+	public static String getAvatarDir() {
+		return getConfig("avatarDir");
+	}
+	/**
+	 */
+	public static String getNotifyDir() {
+		return getConfig("notifyDir");
+	}
+	/**
+	 */
+	public static String getReportDir() {
+		return getConfig("reportDir");
+	}
+	/**
+	 */
+	public static String getRqcode() {
+		return getConfig("rqcode");
+	}
+	/**
+	 */
+	public static String getGoout() {
+		return getConfig("goout");
+	}
+	/**
+	 */
+	public static String getLeave() {
+		return getConfig("leave");
+	}
+	/**
+	 */
+	public static String getOvertimeform() {
+		return getConfig("overtimeform");
+	}
+	/**
+	 */
+	public static String getSealform() {
+		return getConfig("sealform");
+	}
+	/**
+	 *
+	 */
+	public static String getWorkReimbur() {return getConfig("workReimbur");}
+	/**
+	 */
+	public static String getEvection() {
+		return getConfig("evection");
+	}
+	/**
+	 */
+	public static String getOaBuy() {
+		return getConfig("oaBuy");
+	}
+	/**
+	 */
+	public static String getOaAll() {
+		return getConfig("oaAll");
+	}
+	/**
+	 */
+	public static String getIm() {
+		return getConfig("im");
+	}/**
+	 */
+	public static String getWorkContractInfo() {
+		return getConfig("workContractInfo");
+	}
+	/**
+	 */
+	public static String getNotifyData() {
+		return getConfig("notifyData");
+	}
+    /**
+     */
+    public static String getAppData() {
+        return getConfig("appData");
+    }
+	/**
+	 */
+	public static String getLogo() {
+		return getConfig("logo");
+	}
+    /**
+     */
+	public static String getPhoto() {
+		return getConfig("photo");
+	}
+	/**
+	 *
+	 */
+	public static String getUserEvaluation(){return getConfig("userEvaluation");}
+	/**
+	 */
+	public static String getWorkBidingDocument() {return getConfig("workBidingDocument");}
+	/**
+	 */
+	public static String getWorkEngineeringProject() {return getConfig("workEngineeringProject");}
+
+	/**
+	 */
+	public static String getWorkFullExecute() {return getConfig("workFullExecute");}
+	/**
+	 */
+	public static String getWorkFullMeetingminutes() {return getConfig("workFullMeetingminutes");}
+	/**
+	 */
+	public static String getWorkFullDesignchange(){return getConfig("workFullDesignchange");}
+	/**
+	 */
+	public static String getWorkFullConstructsheet(){return getConfig("workFullConstructsheet");}
+	/**
+	 */
+	public static String getWorkFullProprietorsheet(){return getConfig("workFullProprietorsheet");}
+	/**
+	 */
+	public static String getWorkFullSupervisorsheet(){return getConfig("workFullSupervisorsheet");}
+	/**
+	 */
+	public static String getWorkProjectReport() {return getConfig("workProjectReport");}
+	/**
+	 */
+	public static String getWorkProjectBasis() {return getConfig("workProjectBasis");}
+	/**
+	 */
+	public static String getWorkProjectRemote() {return getConfig("workProjectRemote");}
+	/**
+	 */
+	public static String getWorkProjectSummary() {return getConfig("workProjectSummary");}
+	/**
+	 */
+	public static String getWorkProjectOther() {return getConfig("workProjectOther");}
+	/**
+	 */
+	public static String getWorkVisa() {return getConfig("workVisa");}
+	/**
+	 */
+	public static String getOfficehonor() {return getConfig("Officehonor");}
+	/**
+	 *
+	 */
+	public static String getJobResume() {return getConfig("jobResume");}
+	/**
+	 *
+	 */
+	public static String getSatisfaction() {return getConfig("satisfaction");}
+	/**
+	 *
+	 */
+	public static String getCertificate() {return getConfig("certificate");}
+	/**
+	 *
+	 */
+	public static String getJudgeAttachment() {return getConfig("judgeAttachment");}
+	/**
+	 * 获取前端根路径
+	 */
+	public static String getFrontPath() {
+		return getConfig("frontPath");
+	}
+
+	/**
+	 * 获取URL后缀
+	 */
+	public static String getUrlSuffix() {
+		return getConfig("urlSuffix");
+	}
+
+	/**
+	 * 获取电子签章文件路径
+	 */
+	public static String getISignature() {
+		return getConfig("iSignature");
+	}
+
+	/**
+	 */
+	public static String getOSSUrl() {
+		return getConfig("oSSUrl");
+	}
+	public static String getContractNumPath() {
+		return getConfig("contract_num_path");
+	}
+	/**
+	 * 是否是演示模式,演示模式下不能修改用户、岗位、密码、菜单、授权
+	 */
+	public static Boolean isDemoMode() {
+		String dm = getConfig("demoMode");
+		return "true".equals(dm) || "1".equals(dm);
+	}
+
+	/**
+	 * 在修改系统用户和岗位时是否同步到Activiti
+	 */
+	public static Boolean isSynActivitiIndetity() {
+		String dm = getConfig("activiti.isSynActivitiIndetity");
+		return "true".equals(dm) || "1".equals(dm);
+	}
+
+	/**
+	 * 页面获取常量
+	 * @see {fns:getConst('YES')}
+	 */
+	public static Object getConst(String field) {
+		try {
+			return Global.class.getField(field).get(null);
+		} catch (Exception e) {
+			// 异常代表无配置,这里什么也不做
+		}
+		return null;
+	}
+
+    /**
+     * 获取工程路径
+     * @return
+     */
+    public static String getProjectPath(){
+    	// 如果配置了工程路径,则直接返回,否则自动获取。
+		String projectPath = Global.getConfig("projectPath");
+		if (StringUtils.isNotBlank(projectPath)){
+			return projectPath;
+		}
+		try {
+			File file = new DefaultResourceLoader().getResource("").getFile();
+			if (file != null){
+				while(true){
+					File f = new File(file.getPath() + File.separator + "src" + File.separator + "main");
+					if (f == null || f.exists()){
+						break;
+					}
+					if (file.getParentFile() != null){
+						file = file.getParentFile();
+					}else{
+						break;
+					}
+				}
+				projectPath = file.toString();
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return projectPath;
+    }
+
+    /**
+     * 获取短信SMS信息
+     */
+    public static String getSmsUserid() {
+        return getConfig("sms_userid");
+    }
+    public static String getSmsAccount() {
+        return getConfig("sms_account");
+    }
+    public static String getSmsPassword() {
+        return getConfig("sms_password");
+    }
+    public static String getSmsMobile() {
+        return getConfig("sms_mobile");
+    }
+    public static String getSmsContent() {
+        return getConfig("sms_content");
+    }
+    public static String getSmsSendTime() {
+        return getConfig("sms_sendTime");
+    }
+    public static String getSmsAction() {
+        return getConfig("sms_action");
+    }
+    public static String getSmsCheckcontent() {
+        return getConfig("sms_checkcontent");
+    }
+
+	/**
+	 * 获取数据库连接信息
+	 */
+	public static String getJdbcUserName() {
+		return getConfig("jdbc.username");
+	}
+	public static String getJdbcPassword() {
+		return getConfig("jdbc.password");
+	}
+	public static String getJdbcUrl() {
+		return getConfig("jdbc.url");
+	}
+	public static String getJdbcDriver() {
+		return getConfig("jdbc.driver");
+	}
+
+	/**
+	 * 获取容联云账户信息
+	 */
+	public static String getRongUserid() {
+		return getConfig("rong_userid");
+	}
+	public static String getRongToken() {
+		return getConfig("rong_token");
+	}
+	//应用id
+	public static String getAppId() {
+		return getConfig("app_id");
+	}
+	//模板id
+	public static String getTemplateId() {
+		return getConfig("template_id");
+	}
+	//短信发送方式(1:旧的 2:容联云通讯)
+	public static String getCodeType() {
+		return getConfig("code_type");
+	}
+
+    public static String getOpenOfficeAddr() {
+        return getConfig("open_office_addr");
+    }
+
+    public static int getOpenOfficePort() {
+        String openOfficePort = getConfig("open_office_port");
+        return StringUtils.isBlank(openOfficePort)?8100:Integer.valueOf(openOfficePort);
+    }
+    public static String getOpenfireServer() {
+        String openOfficePort = getConfig("openfire.server");
+        return StringUtils.isBlank(openOfficePort)?"oa-pre.ssruihua.com":openOfficePort;
+    }
+    public static String getSysNotify() {
+        String sysNotify = getConfig("sys.notify");
+        return StringUtils.isBlank(sysNotify)?"http://cdn.gangwaninfo.com/jeeplus-resource-data/static/sys/notify.png":sysNotify;
+    }
+
+    public static String getStaffBasicFilePath() {
+        return getConfig("staff_basic_file_path");
+    }
+	public static String getDbName() {
+		return getConfig("db.name");
+	}
+	public static String getVersion() {
+		return getConfig("app_version");
+	}
+	public static String getTestVersion() {
+		return getConfig("app_version_test");
+	}
+
+    public static String getProjectTemplatePath() {
+        return getConfig("project.plan.template.path");
+    }
+
+    public static String getYyApiCode(){
+		return getConfig("yy_apicode");
+	}
+
+	public static String getYyMhUrl(){
+		return getConfig("yy_mhcxurl");
+	}
+
+	public static String getYyShUrl(){
+		return getConfig("yy_shcxurl");
+	}
+}

+ 154 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/PropertiesLoader.java

@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2005-2011 springside.org.cn
+ * 
+ * $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
+ */
+package com.jeeplus.assess.utils;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.DefaultResourceLoader;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+
+/**
+ * Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
+ * @author calvin
+ * @version 2013-05-15
+ */
+public class PropertiesLoader {
+
+	private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
+
+	private static ResourceLoader resourceLoader = new DefaultResourceLoader();
+
+	private final Properties properties;
+
+	public PropertiesLoader(String... resourcesPaths) {
+		properties = loadProperties(resourcesPaths);
+	}
+
+	public Properties getProperties() {
+		return properties;
+	}
+
+	/**
+	 * 取出Property,但以System的Property优先,取不到返回空字符串.
+	 */
+	private String getValue(String key) {
+		String systemProperty = System.getProperty(key);
+		if (systemProperty != null) {
+			return systemProperty;
+		}
+		if (properties.containsKey(key)) {
+	        return properties.getProperty(key);
+	    }
+	    return "";
+	}
+
+	/**
+	 * 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
+	 */
+	public String getProperty(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return value;
+	}
+
+	/**
+	 * 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
+	 */
+	public String getProperty(String key, String defaultValue) {
+		String value = getValue(key);
+		return value != null ? value : defaultValue;
+	}
+
+	/**
+	 * 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
+	 */
+	public Integer getInteger(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Integer.valueOf(value);
+	}
+
+	/**
+	 * 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
+	 */
+	public Integer getInteger(String key, Integer defaultValue) {
+		String value = getValue(key);
+		return value != null ? Integer.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
+	 */
+	public Double getDouble(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Double.valueOf(value);
+	}
+
+	/**
+	 * 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
+	 */
+	public Double getDouble(String key, Integer defaultValue) {
+		String value = getValue(key);
+		return value != null ? Double.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
+	 */
+	public Boolean getBoolean(String key) {
+		String value = getValue(key);
+		if (value == null) {
+			throw new NoSuchElementException();
+		}
+		return Boolean.valueOf(value);
+	}
+
+	/**
+	 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
+	 */
+	public Boolean getBoolean(String key, boolean defaultValue) {
+		String value = getValue(key);
+		return value != null ? Boolean.valueOf(value) : defaultValue;
+	}
+
+	/**
+	 * 载入多个文件, 文件路径使用Spring Resource格式.
+	 */
+	private Properties loadProperties(String... resourcesPaths) {
+		Properties props = new Properties();
+
+		for (String location : resourcesPaths) {
+
+//			logger.debug("Loading properties file from:" + location);
+
+			InputStream is = null;
+			try {
+				Resource resource = resourceLoader.getResource(location);
+				is = resource.getInputStream();
+				props.load(is);
+			} catch (IOException ex) {
+				logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
+			} finally {
+				IOUtils.closeQuietly(is);
+			}
+		}
+		return props;
+	}
+}

+ 816 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/utils/SignaturePostUtil.java

@@ -0,0 +1,816 @@
+package com.jeeplus.assess.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.jeeplus.assess.assessSignatureDaily.domain.SealUserInfo;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.Charset;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+//import com.jeeplus.sys.utils.Global;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-02 14:20
+ **/
+public class SignaturePostUtil {
+
+    //竖版模板templateId
+    private static final String VERTICALTEMPLATEID = Global.getConfig("vertical_templateId");
+    //横板模板templateId
+    private static final String ACROSSTEMPLATEID = Global.getConfig("across_templateId");
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    private final static String apptoken = Global.getConfig("apptoken");
+//    private final static String appsecret = Global.getConfig("appsecret");
+    private final static String signature = Global.getConfig("signature");
+
+
+    /**
+     * 发送get请求
+     *
+     * @param requestUrl
+     *      请求url
+     * @param requestHeader
+     *      请求头
+     * @param responseEncoding
+     *      响应编码
+     * @return 页面响应html
+     */
+    public static String sendGet(String requestUrl, Map<String, String> requestHeader, String responseEncoding) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * 发送下载压缩包get请求
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String downloadZipGet(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding, HttpServletResponse response) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+            //获取自己数组
+            byte[] getData = readInputStream(inputStream);
+
+            //设置HTTP响应头
+            response.reset();//重置 响应头
+            response.setContentType("application/x-download");//告知浏览器下载文件,而不是直接打开,浏览器默认为打开
+            fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
+            response.addHeader("Content-Disposition" ,"attachment;filename=" +fileName+ "");//下载文件的名称
+            // 循环取出流中的数据
+            response.getOutputStream().write(getData);
+            response.getOutputStream().close();
+
+            if(inputStream!=null){
+                inputStream.close();
+            }
+
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 下载文件并保存到指定位置
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static Map<String,Object> downloadZipDesignated(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding) {
+        Map<String,Object> map = new HashMap<>();
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                map.put("success",false);
+                map.put("message",fileName + " 的请求路径为空");
+                map.put("fileName",fileName);
+                map.put("filePath","");
+                return map;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+
+            BufferedInputStream bis = new BufferedInputStream(inputStream);
+            //判断文件的保存路径后面是否以/结尾
+            String filePath = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                filePath = "D:/attachment-file/";
+            }else{
+                filePath = "/attachment-file/";
+            }
+            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+            fileName = fileName.replaceAll("\\\\","");
+            fileName = fileName.replaceAll("/","");
+            fileName = fileName.replaceAll("\\*","");
+            fileName = fileName.replaceAll("\\?","");
+            fileName = fileName.replaceAll("\"","");
+            fileName = fileName.replaceAll("<","");
+            fileName = fileName.replaceAll(">","");
+            fileName = fileName.replaceAll("\\|","");
+            fileName = fileName.replaceAll("\\’","'");
+            fileName = fileName.replaceAll("\\”","\"");
+            fileName = fileName.replaceAll("【","(");
+            fileName = fileName.replaceAll("\\{","(");
+            fileName = fileName.replaceAll("】",")");
+            fileName = fileName.replaceAll("}",")");
+            fileName = fileName.replaceAll(",",",");
+            fileName = fileName.replaceAll(":",":");
+            fileName = fileName.replaceAll("—","-");
+            fileName = fileName.replaceAll("……","");
+            fileName = fileName.replaceAll("±","");
+            fileName = fileName.replaceAll("#","");
+            fileName = fileName.replaceAll("%","");
+            fileName = fileName.replaceAll("Π","");
+
+            FileOutputStream fileOut = new FileOutputStream(filePath + fileName);
+            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+
+            byte[] buf = new byte[4096];
+            int length = bis.read(buf);
+            //保存文件
+            while(length != -1)
+            {
+                bos.write(buf, 0, length);
+                length = bis.read(buf);
+            }
+            //response.getOutputStream().close();
+            bos.close();
+            fileOut.close();
+            bis.close();
+            if(inputStream!=null){
+                inputStream.close();
+            }
+            map.put("success",true);
+            map.put("message","下载成功");
+            map.put("fileName",fileName);
+            map.put("filePath",filePath);
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 从输入流中获取字节数组
+     * @param inputStream
+     * @return
+     * @throws IOException
+     */
+    public static byte[] readInputStream(InputStream inputStream) throws IOException {
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        while((len = inputStream.read(buffer)) != -1) {
+            bos.write(buffer, 0, len);
+        }
+        bos.close();
+        return bos.toByteArray();
+    }
+
+    /**
+     * 发送post请求
+     *
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param formTexts 表单数据
+     * @param files 上传文件
+     * @param requestEncoding 请求编码
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String sendPost(String requestUrl, Map<String, String> requestHeader, Map<String, String> formTexts, File[] files, String requestEncoding, String responseEncoding) {
+        OutputStream out = null;
+        BufferedReader reader = null;
+        String result = "";
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setRequestMethod("POST");
+            if (requestEncoding == null || requestEncoding.isEmpty()) {
+                requestEncoding = "UTF-8";
+            }
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            if (files == null || files.length == 0) {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+            } else {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+                for (File file : files) {
+                    if (!file.exists()) {
+                        continue;
+                    }
+                    out.write(("--" + boundary + "\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Disposition: form-data; name=\" file \"; filename=\"" + file.getName() + "\"\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Type: application/x-msdownload\r\n\r\n").getBytes(requestEncoding));
+                    DataInputStream in = new DataInputStream(new FileInputStream(file));
+                    int bytes = 0;
+                    byte[] bufferOut = new byte[1024];
+                    while ((bytes = in.read(bufferOut)) != -1) {
+                        out.write(bufferOut, 0, bytes);
+                    }
+                    in.close();
+                    out.write(("\r\n").getBytes(requestEncoding));
+                }
+                out.write(("--" + boundary + "--").getBytes(requestEncoding));
+            }
+            out.flush();
+            out.close();
+            out = null;
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送POST请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * ApplicationJson的post请求
+     * @return
+     */
+    public static String sendPostApplicationJson(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "application/json");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+    /**
+     * imagePng的post请求
+     * @return
+     */
+    public static String sendPostImagePng(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "image/png");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+
+    public static String decodeUnicode(String asciicode) {
+        String[] asciis = asciicode.split ("\\\\u");
+        String nativeValue = asciis[0];
+        try
+        {
+            for ( int i = 1; i < asciis.length; i++ )
+            {
+                String code = asciis[i];
+                nativeValue += (char) Integer.parseInt (code.substring (0, 4), 16);
+                if (code.length () > 4)
+                {
+                    nativeValue += code.substring (4, code.length ());
+                }
+            }
+        }
+        catch (NumberFormatException e)
+        {
+            return asciicode;
+        }
+        return nativeValue;
+    }
+
+    /**
+     * 根据文件创建合同信息
+     * @param srcFile
+     * @return
+     */
+    public static HashMap getDocument(File srcFile) {
+        //截取文件后缀名
+        String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
+        //截取文件名称
+        String fileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("fileType",substring);
+        //创建文件数组
+        File[] files = new File[]{srcFile};
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/v2/document/createbyfile", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",VERTICALTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getAcrossVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",ACROSSTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+
+    public static String doGet(Map<String, String> paramMap, String url){
+        String result = "";
+        HttpGet get = new HttpGet(url);
+        try{
+            // 设置请求头鉴权
+            get.setHeader("x-qys-accesstoken", apptoken);
+            get.setHeader("x-qys-signature", signature);
+            get.setHeader("x-qys-timestamp", "0");
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            List<NameValuePair> params = setHttpParams(paramMap);
+            String param = URLEncodedUtils.format(params, "UTF-8");
+            get.setURI(URI.create(url + "?" + param));
+            HttpResponse response = httpClient.execute(get);
+            result = getHttpEntityContent(response);
+
+            if(response.getStatusLine().getStatusCode()!= HttpStatus.SC_OK){
+                result = "服务器异常";
+            }
+        } catch (Exception e){
+            System.out.println("请求异常");
+            throw new RuntimeException(e);
+        } finally{
+            get.abort();
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    public static List<NameValuePair> setHttpParams(Map<String, String> paramMap){
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        Set<Entry<String, String>> set = paramMap.entrySet();
+        for(Entry<String, String> entry : set){
+            params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
+        }
+        return params;
+    }
+
+    public static String getHttpEntityContent(HttpResponse response) throws UnsupportedOperationException, IOException{
+        String result = "";
+        HttpEntity entity = response.getEntity();
+        if(entity != null){
+            InputStream in = entity.getContent();
+            BufferedReader br = new BufferedReader(new InputStreamReader(in, "utf-8"));
+            StringBuilder strber= new StringBuilder();
+            String line = null;
+            while((line = br.readLine())!=null){
+                strber.append(line+'\n');
+            }
+            br.close();
+            in.close();
+            result = strber.toString();
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 根据用户手机号查询用户章信息
+     * @param userMobile
+     * @param employeeNo 用户编号
+     * @param sealName 印章名称
+     * @return
+     */
+    public static String getUserSealByMobile(String userMobile,String employeeNo,String sealName){
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+
+        Map map =new HashMap();
+        map.put("companyName","江苏兴光项目管理有限公司");
+        map.put("mobile",userMobile);
+        map.put("employeeNo",employeeNo);
+        String viewUrlStr = SignaturePostUtil.doGet(map, HTTPTOP + "/seal/user/charge");
+        HashMap userSealStrMap = JSON.parseObject(viewUrlStr, HashMap.class);
+        String code = userSealStrMap.get("code").toString();
+        if("0".equals(code)){
+            String resultStr = userSealStrMap.get("result").toString();
+            //获取成员印章信息列表
+            List<SealUserInfo> userSealList = (List<SealUserInfo>) JSONArray.parseArray(resultStr, SealUserInfo.class);
+            //ZList <SealUserInfo> userSealList =new Gson().fromJson(resultStr, new TypeToken<List<SealUserInfo>>() {}.getType());
+            if(userSealList.size()>0){
+                //如果需要判定得印章名称不为空则进行精确印章处理
+                if(StringUtils.isNotBlank(sealName)){
+                    for (SealUserInfo userSeal: userSealList) {
+                        if(sealName.equals(userSeal.getName())){
+                            //返回成员印章编号id
+                            return userSeal.getId();
+                        }
+                    }
+                }else{
+                    if(StringUtils.isNotBlank(userSealList.get(0).getId())){
+                        //返回成员第一个印章编号id
+                        return userSealList.get(0).getId();
+                    }
+                }
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 根据合同编号查询签章合同对应的url访问界面
+     * @param contractId 签章合同id
+     * @param contact 签章人手机号
+     * @return
+     */
+    public static String getSignatureContractUrl( String contractId,String contact ){
+        Map map = new HashMap();
+        map.put("contractId",contractId);
+        map.put("tenantType","COMPANY");
+        map.put("tenantName","江苏兴光项目管理有限公司");
+        map.put("contact",contact);
+        String jsonString = JSON.toJSONString(map);
+        String contractIdUrl = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/signurl", jsonString);
+        HashMap signUrlHashMap = JSON.parseObject(contractIdUrl, HashMap.class);
+        String code = signUrlHashMap.get("code").toString();
+        if("0".equals(code)){
+            String signUrl = signUrlHashMap.get("signUrl").toString();
+            return signUrl;
+        }
+        return "";
+    }
+
+    /**
+     * zip文件解压
+     * @param file 需解压的文件
+     * @param destDirPath 解压文件地址
+     */
+    public static void unZipFile(File file,String destDirPath){
+        // 开始解压
+        ZipFile zipFile = null;
+        try {
+            //zipFile = new ZipFile(file);
+            //添加解压编码,解决解压报错问题
+            zipFile = new ZipFile(file, Charset.forName("GBK"));
+            Enumeration<?> entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                System.out.println("解压" + entry.getName());
+                // 如果是文件夹,就创建个文件夹
+                if (entry.isDirectory()) {
+                    String dirPath = destDirPath + "/" + entry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(destDirPath + "/" + entry.getName());
+                    // 保证这个文件的父文件夹必须要存在
+                    if(!targetFile.getParentFile().exists()){
+                        targetFile.getParentFile().mkdirs();
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(entry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[1024];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if(zipFile != null){
+                try {
+                    zipFile.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+}
+

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwProjectRecordsController.java

@@ -120,6 +120,21 @@ public class CwProjectRecordsController {
     }
 
     /**
+     * 查询财务项目信息列表
+     * @param cwProjectRecordsDTO
+     * @param page
+     * @return
+     */
+    @ApiLog("查询财务项目信息列表")
+    // @PreAuthorize("hasAuthority('cwProjectRecords:list')")
+    @GetMapping("getList")
+    public ResponseEntity<IPage<CwProjectRecordsDTO>> getList(CwProjectRecordsDTO cwProjectRecordsDTO, Page<CwProjectRecordsDTO> page) throws Exception {
+        IPage<CwProjectRecordsDTO> result = new Page<CwProjectRecordsDTO>();
+        result = cwProjectRecordsService.getList (page,cwProjectRecordsDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
      * 查询项目数据集合,和上面list接口是一样的,目的是跳过findList mapper接口的数据规则(比如仅部门可见、仅自己可见之类的)
      */
     @GetMapping("list2")

+ 4 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java

@@ -38,6 +38,8 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
      * 查询项目信息(无报告的项目及老项目)
      */
     IPage<CwProjectRecordsDTO> findNoReportList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+
+    IPage<CwProjectRecordsDTO> getList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
     /**
      * 查询项目数据集合,和上面findList是一样的,目的是跳过findList接口的数据规则(比如仅部门可见、仅自己可见之类的)
      */
@@ -49,6 +51,8 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
      */
     CwProjectRecordsDTO queryById(@Param("id") String id);
 
+    CwProjectRecordsDTO getInfoById(@Param("id") String id);
+
     /**
      * 根据项目id删除项目相关的所有被服务单位
      * @param projectId

+ 47 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml

@@ -380,6 +380,53 @@
         ORDER BY a.create_time DESC
     </select>
 
+    <select id="getList" resultType="com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as createName,
+        cw_wci.contract_name,
+        cw_wci.contract_amount,
+        cw_wci.contract_num,
+        cw_wci.payer_subject,
+        cw_wci.payment_method,
+        cw_wcb.name as clientContactsName,
+        cw_pbt.name as business_type_name,
+        new_line.report_no as reportNo
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = a.contract_id and cw_wci.del_flag = '0'
+        left join cw_work_client_base cw_wcb on cw_wci.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join cw_project_business_type cw_pbt on cw_pbt.id = a.business_type and cw_pbt.del_flag = '0'
+        left join cw_project_report pr on a.id =pr.project_id and pr.del_flag = '0'
+        left join cw_project_report_new_line new_line on pr.id = new_line.report_id and new_line.del_flag = '0'
+        ${ew.customSqlSegment}
+        ORDER BY a.create_time DESC
+    </select>
+
+    <select id="getInfoById" resultType="com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as createName,
+        cw_wci.contract_name,
+        cw_wci.contract_amount,
+        cw_wci.contract_num,
+        cw_wci.payer_subject,
+        cw_wci.payment_method,
+        cw_wcb.name as clientContactsName,
+        cw_pbt.name as business_type_name,
+        new_line.report_no as reportNo
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = a.contract_id and cw_wci.del_flag = '0'
+        left join cw_work_client_base cw_wcb on cw_wci.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join cw_project_business_type cw_pbt on cw_pbt.id = a.business_type and cw_pbt.del_flag = '0'
+        left join cw_project_report pr on a.id =pr.project_id and pr.del_flag = '0'
+        left join cw_project_report_new_line new_line on pr.id = new_line.report_id and new_line.del_flag = '0'
+        where a.id = #{id}
+    </select>
+
     <select id="findList2" resultMap="BaseResultMap">
         select
         DISTINCT

+ 52 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java

@@ -360,6 +360,58 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
         return list;
     }
 
+    /**
+     * 查询无报告项目及老项目列表信息
+     * @param page
+     * @param cwProjectRecordsDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwProjectRecordsDTO> getList(Page<CwProjectRecordsDTO> page, CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception{
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        QueryWrapper<CwProjectRecords> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO), CwProjectRecords.class );
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.eq("a.create_by_id",userDTO.getId());
+        if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO)) {
+            if (ArrayUtil.isNotEmpty(cwProjectRecordsDTO.getCreateDates())) {
+                queryWrapper.between("a.create_time", cwProjectRecordsDTO.getCreateDates()[0], cwProjectRecordsDTO.getCreateDates()[1]);
+            }
+            if (StringUtils.isNotBlank(cwProjectRecordsDTO.getProjectMasterName())) {
+                queryWrapper.in("a.project_master_id", cwProjectRecordsDTO.getProjectMasterName());
+            }
+            if (StringUtils.isNotBlank(cwProjectRecordsDTO.getBusinessType())){
+                queryWrapper.eq("a.business_type",cwProjectRecordsDTO.getBusinessType());
+            }
+            if (StringUtils.isNotBlank(cwProjectRecordsDTO.getProjectMasterName2())) {
+                List<User> userList = SpringUtil.getBean ( IUserApi.class ).selectListByName(cwProjectRecordsDTO.getProjectMasterName2());
+                if (CollectionUtils.isNotEmpty(userList)){
+                    List<String> ids = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
+                    if (CollectionUtil.isNotEmpty(ids)) {
+                        queryWrapper.in("a.project_master_id", ids);
+                    } else {
+                        return new Page<>();
+                    }
+                } else {
+                    queryWrapper.in("a.project_master_id", cwProjectRecordsDTO.getProjectMasterName());
+                }
+            }
+            if (StringUtils.isNotBlank(cwProjectRecordsDTO.getRealHeaderName())) {
+                queryWrapper.in("a.real_header", cwProjectRecordsDTO.getRealHeaderName());
+            }
+            if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateId())){
+                queryWrapper.eq("a.create_by_id", cwProjectRecordsDTO.getCreateId());
+            }
+            // 创建人
+            if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO.getCreateBy())){
+                if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateBy().getName())){
+                    queryWrapper.in("a.create_by_id",cwProjectRecordsDTO.getCreateBy().getName());
+                }
+            }
+        }
+
+        IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.getList(page, queryWrapper);
+        return list;
+    }
 
 
 

+ 150 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/DailyOfficeWorkSignatureCallBackController.java

@@ -0,0 +1,150 @@
+package com.jeeplus.finance.signatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.projectReport.domain.PresignCallBack;
+import com.jeeplus.finance.signatureDaily.mapper.SignatureDailyOfficeWorkMapper;
+import com.jeeplus.finance.signatureDaily.service.SignatureDaulyOfficeWorkService;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.SpringContextHolder;
+import com.jeeplus.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
+import org.springframework.data.redis.connection.jedis.JedisUtils;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 项目签章回调接口Controller
+ * @author 徐滕
+ * @version 2021-11-04
+ */
+@Controller
+@RequestMapping(value = "/dailyOfficeWork/signatureCallBack")
+public class DailyOfficeWorkSignatureCallBackController {
+    private static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);
+
+    @Autowired
+    private SignatureDaulyOfficeWorkService dailyOfficeWorkService;
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private SignatureDailyOfficeWorkMapper signatureDailyOfficeWorkMapper;
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+//    private final DailyOfficeWorkDao dailyOfficeWorkDao = SpringContextHolder.getBean(DailyOfficeWorkDao.class);
+
+    @ModelAttribute
+    public SignatureDailyOfficeWorkDTO get(@RequestParam(required=false) String id) {
+        SignatureDailyOfficeWorkDTO entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = dailyOfficeWorkService.findById(id);
+        }
+        if (entity == null){
+            entity = new SignatureDailyOfficeWorkDTO();
+        }
+        return entity;
+    }
+
+    /**
+     * 审定单签章回调操作
+     * @param presignCallBack  回调参数
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCoordinates", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCoordinates(PresignCallBack presignCallBack, HttpServletRequest request , HttpServletResponse response) {
+        long t1 = System.currentTimeMillis();
+        //根据contractId查询对应的报告信息
+        String[] documentIds = presignCallBack.getDocumentId().split(",");
+
+        //根据contractId查询对应的报告信息
+        SignatureDailyOfficeWorkDTO dailyOfficeWork = dailyOfficeWorkService.getByDocumentId(documentIds[0]);
+
+        if("5".equals(dailyOfficeWork.getStatus()) ){
+            return null;
+        }
+
+        if(StringUtils.isBlank(presignCallBack.getContractId())){
+
+            return null;
+        }
+        //修改签章信息
+        //签章完成则进行数据的保存
+        dailyOfficeWork.setSignatureFlag(1);
+        dailyOfficeWork.setSignatureContractId(presignCallBack.getContractId());
+        dailyOfficeWork.setSignatureUploadDate(new Date());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+
+            dailyOfficeWork.setSignatureUrl(signatureUrl);
+            dailyOfficeWork.setSignatureUrlFlag(1);
+
+            String input = signatureUrl;
+            int lastSlashIndex = input.lastIndexOf('/');
+            int lastDotIndex = input.lastIndexOf('.');
+
+            // 检查是否存在 / 和 .,以及 . 是否在 / 之后
+            if (lastSlashIndex != -1 && lastDotIndex != -1 && lastSlashIndex < lastDotIndex) {
+                String result = input.substring(lastSlashIndex + 1, input.length());
+                //添加文件名称
+                dailyOfficeWork.setSignatureFileName(result);
+            }
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getUserDTOByName("管理员");
+            dailyOfficeWork.setSignatureUploadFileUser(userDTO);
+
+        }
+        //修改签章对应信息文件
+        signatureDailyOfficeWorkMapper.updateSignatureInfo(dailyOfficeWork);
+
+        return null;
+    }
+
+    /**
+     * 日常签章每个节点处理方法
+     * @param presignCallBack
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCallBackAccomplish", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+
+        //根据contractId查询对应的报告信息
+        SignatureDailyOfficeWorkDTO dailyOfficeWork = dailyOfficeWorkService.getByContractId(presignCallBack.getContractId());
+        if("5".equals(dailyOfficeWork.getStatus())){
+            return null;
+        }
+
+        String json = JSON.toJSONString(presignCallBack);
+        try {
+            String keySign = "dailyOfficeWorkSignatureSign" + dailyOfficeWork.getId();
+            String keyStatus = "dailyOfficeWorkSignatureSignStatus" + dailyOfficeWork.getId();
+
+            ValueOperations<String, String> operations = stringRedisTemplate.opsForValue();
+            operations.set(keySign, json, 1, TimeUnit.DAYS); // 设置有效期为1天
+            operations.set(keyStatus, "true", 1, TimeUnit.DAYS); // 设置有效期为1天
+        } catch (Exception e) {
+            logger.error("Error saving data to Redis", e);
+        }
+        return null;
+    }
+}

+ 147 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/DailyReportSignatureCallBackController.java

@@ -0,0 +1,147 @@
+package com.jeeplus.finance.signatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.projectReport.domain.PresignCallBack;
+import com.jeeplus.finance.signatureDaily.mapper.SignatureProjectReportMapper;
+import com.jeeplus.finance.signatureDaily.service.SignatureProjectReportService;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 项目签章回调接口Controller
+ * @author 徐滕
+ * @version 2021-11-04
+ */
+@Controller
+@RequestMapping(value = "/dailyReport/signatureCallBack")
+public class DailyReportSignatureCallBackController {
+    private static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);
+
+    @Autowired
+    private SignatureProjectReportService signatureProjectReportService;
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private SignatureProjectReportMapper signatureProjectReportMapper;
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+//    private final DailyOfficeWorkDao dailyOfficeWorkDao = SpringContextHolder.getBean(DailyOfficeWorkDao.class);
+
+    @ModelAttribute
+    public SignatureProjectReportRelationDTO get(@RequestParam(required=false) String id) {
+        SignatureProjectReportRelationDTO entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = signatureProjectReportService.findById(id);
+        }
+        if (entity == null){
+            entity = new SignatureProjectReportRelationDTO();
+        }
+        return entity;
+    }
+
+    /**
+     * 审定单签章回调操作
+     * @param presignCallBack  回调参数
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCoordinates", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCoordinates(PresignCallBack presignCallBack, HttpServletRequest request , HttpServletResponse response) {
+        long t1 = System.currentTimeMillis();
+        //根据contractId查询对应的报告信息
+        String[] documentIds = presignCallBack.getDocumentId().split(",");
+
+        //根据contractId查询对应的报告信息
+        SignatureProjectReportRelationDTO dailyOfficeWork = signatureProjectReportService.getByDocumentId(documentIds[0]);
+
+        if("5".equals(dailyOfficeWork.getStatus()) ){
+            return null;
+        }
+
+        if(StringUtils.isBlank(presignCallBack.getContractId())){
+
+            return null;
+        }
+        //修改签章信息
+        //签章完成则进行数据的保存
+        dailyOfficeWork.setSignatureFlag(1);
+        dailyOfficeWork.setSignatureContractId(presignCallBack.getContractId());
+        dailyOfficeWork.setSignatureUploadDate(new Date());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+
+            dailyOfficeWork.setSignatureUrl(signatureUrl);
+            dailyOfficeWork.setSignatureUrlFlag(1);
+
+            String input = signatureUrl;
+            int lastSlashIndex = input.lastIndexOf('/');
+            int lastDotIndex = input.lastIndexOf('.');
+
+            // 检查是否存在 / 和 .,以及 . 是否在 / 之后
+            if (lastSlashIndex != -1 && lastDotIndex != -1 && lastSlashIndex < lastDotIndex) {
+                String result = input.substring(lastSlashIndex + 1, input.length());
+                //添加文件名称
+                dailyOfficeWork.setSignatureFileName(result);
+            }
+            UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getUserDTOByName("管理员");
+            dailyOfficeWork.setSignatureUploadFileUser(userDTO);
+
+        }
+        //修改签章对应信息文件
+        signatureProjectReportMapper.updateSignatureInfo(dailyOfficeWork);
+
+        return null;
+    }
+
+    /**
+     * 日常签章每个节点处理方法
+     * @param presignCallBack
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/getDailyOfficeWorkCallBackAccomplish", method= RequestMethod.POST)
+    public String getDailyOfficeWorkCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+
+        //根据contractId查询对应的报告信息
+        SignatureProjectReportRelationDTO dailyOfficeWork = signatureProjectReportService.getByContractId(presignCallBack.getContractId());
+        if("5".equals(dailyOfficeWork.getStatus())){
+            return null;
+        }
+
+        String json = JSON.toJSONString(presignCallBack);
+        try {
+            String keySign = "dailyOfficeWorkSignatureSign" + dailyOfficeWork.getId();
+            String keyStatus = "dailyOfficeWorkSignatureSignStatus" + dailyOfficeWork.getId();
+
+            ValueOperations<String, String> operations = stringRedisTemplate.opsForValue();
+            operations.set(keySign, json, 1, TimeUnit.DAYS); // 设置有效期为1天
+            operations.set(keyStatus, "true", 1, TimeUnit.DAYS); // 设置有效期为1天
+        } catch (Exception e) {
+            logger.error("Error saving data to Redis", e);
+        }
+        return null;
+    }
+}

+ 172 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/controller/SignatureProjectReportController.java

@@ -0,0 +1,172 @@
+package com.jeeplus.finance.signatureDaily.controller;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.invoice.util.EasyPoiUtil;
+import com.jeeplus.finance.invoice.util.SignaturePostUtil;
+import com.jeeplus.finance.signatureDaily.domain.SignatureDailyOfficeWork;
+import com.jeeplus.finance.signatureDaily.domain.SignatureProjectReportRelation;
+import com.jeeplus.finance.signatureDaily.service.SignatureProjectReportService;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.feign.IUserApi;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+@RestController
+@Api(tags ="报告签章")
+@RequestMapping(value = "/cw/signatureReport")
+public class SignatureProjectReportController {
+
+    @Resource
+    private SignatureProjectReportService signatureProjectReportService;
+    @Autowired
+    private RedisUtils redisUtils;
+
+
+
+    /**
+     * 列表查询
+     * @param
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<SignatureProjectReportRelationDTO>> list(Page<SignatureProjectReportRelationDTO> page, SignatureProjectReportRelationDTO dto) throws Exception{
+        IPage<SignatureProjectReportRelationDTO> iPage = signatureProjectReportService.list(page, dto);
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
+     * 根据id查询数据
+     */
+    @ApiOperation(value = "查询")
+    @GetMapping("/findById")
+    public ResponseEntity<SignatureProjectReportRelationDTO> findById(@RequestParam String id) throws Exception{
+        SignatureProjectReportRelationDTO dto = signatureProjectReportService.findById(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
+     * 新增/修改
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "新增、修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody SignatureProjectReportRelationDTO dto) throws Exception{
+        SignatureProjectReportRelation s = signatureProjectReportService.save(dto);
+        return ResponseUtil.newInstance().add("businessTable", "cw_signature_project_report_relation")
+                .add("businessId", s.getId())
+                .add("number", s.getNumber())
+                .ok ("操作成功");
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping("/remove")
+    public ResponseEntity<String> remove(@RequestParam String id){
+        String s = signatureProjectReportService.remove(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody SignatureProjectReportRelationDTO dto) {
+        signatureProjectReportService.updateStatusById(dto);
+    }
+
+    @ApiLog(value = "报告签章数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "报告签章数据")
+    public void exportFile(Page<SignatureProjectReportRelationDTO> page, SignatureProjectReportRelationDTO dto, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<SignatureProjectReportRelationDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = signatureProjectReportService.list2 (page,dto).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = signatureProjectReportService.list2 (page,dto).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = signatureProjectReportService.list2 (page,dto).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, SignatureProjectReportRelationDTO.class, fileName, response );
+
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getAuditNodeById")
+    public ResponseEntity getAuditNodeById(@RequestParam("id") String id) {
+        Map<String, Object> auditNodeByReportId = signatureProjectReportService.getAuditNodeById(id);
+        return ResponseEntity.ok (auditNodeByReportId);
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getSignatureTypeById")
+    public ResponseEntity getSignatureTypeById(@RequestParam("id") String id) {
+        Map<String, Object> signatureTypeById = signatureProjectReportService.getSignatureTypeById(id);
+        return ResponseEntity.ok (signatureTypeById);
+    }
+
+    /**
+     * 签章链接
+     * @param dto
+     * @return
+     */
+    @ApiLog(value = "签章链接", type = LogTypeEnum.SAVE)
+    @PostMapping("saveFlowableParam")
+    public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody SignatureDailyOfficeWorkDTO dto) {
+
+        SignatureProjectReportRelationDTO relationDTO = signatureProjectReportService.findById(dto.getId());
+        // 获取签章页面url
+        String mobile = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken()).getMobile();
+        String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(relationDTO.getSignatureContractId(), mobile);
+        // 将数据存储到redis中,key为contractId
+        redisUtils.set("cw_signature_report_" + relationDTO.getSignatureContractId(),relationDTO.getId());
+        redisUtils.expire("cw_signature_report_" + relationDTO.getSignatureContractId(),24, TimeUnit.HOURS);
+        return ResponseEntity.ok(signatureContractUrl);
+    }
+
+
+}

+ 36 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/SignatureProjectReportMapper.java

@@ -0,0 +1,36 @@
+package com.jeeplus.finance.signatureDaily.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.finance.signatureDaily.domain.SignatureProjectReportRelation;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface SignatureProjectReportMapper extends BaseMapper<SignatureProjectReportRelation> {
+
+    IPage<SignatureProjectReportRelationDTO> findList(Page<SignatureProjectReportRelationDTO> page, @Param(Constants.WRAPPER) QueryWrapper<SignatureProjectReportRelationDTO> queryWrapper);
+
+    IPage<SignatureProjectReportRelationDTO> findList2(Page<SignatureProjectReportRelationDTO> page, @Param(Constants.WRAPPER) QueryWrapper<SignatureProjectReportRelationDTO> queryWrapper);
+
+    SignatureProjectReportRelationDTO findById(@Param("id") String id);
+
+    List<WorkAttachmentInfo> findFiles(@Param("id") String id);
+
+    void updateStatusById(@Param("status") String status, @Param("id") String id);
+
+
+    void updateSignatureInfo(SignatureProjectReportRelationDTO relationDTO);
+
+    SignatureProjectReportRelationDTO getByDocumentId(@Param("documentId") String documentId);
+
+    SignatureProjectReportRelationDTO getByContractId(@Param("contractId") String contractId);
+}

+ 9 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/SignatureProjectReportRelevanceNumberMapper.java

@@ -0,0 +1,9 @@
+package com.jeeplus.finance.signatureDaily.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.signatureDaily.domain.SignatureProjectReportRelevanceNumber;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SignatureProjectReportRelevanceNumberMapper extends BaseMapper<SignatureProjectReportRelevanceNumber> {
+}

+ 203 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/mapper/xml/SignatureProjectReportMapper.xml

@@ -0,0 +1,203 @@
+<?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.finance.signatureDaily.mapper.SignatureProjectReportMapper">
+    <select id="findList" resultType="com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            (SELECT GROUP_CONCAT(pr.project_name  SEPARATOR ',')
+             FROM signature_project_report_relevance_number rn
+             LEFT JOIN cw_project_records pr ON rn.project_id = pr.id
+             WHERE rn.signature_project_report_id = a.id) AS projectName,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from cw_signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findList2" resultType="com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            (SELECT GROUP_CONCAT(pr.project_name  SEPARATOR ',')
+             FROM signature_project_report_relevance_number rn
+             LEFT JOIN cw_project_records pr ON rn.project_id = pr.id
+             WHERE rn.signature_project_report_id = a.id) AS projectName,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from cw_signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        ${ew.customSqlSegment}
+		ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findById" resultType="com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from cw_signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.id = #{id} and a.del_flag = 0
+    </select>
+
+    <select id="findFiles" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			attachment_flag AS `attachmentFlag`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+    <update id="updateStatusById">
+        update cw_signature_project_report_relation set status = #{status} where id = #{id}
+    </update>
+
+    <update id="updateSignatureInfo" >
+        UPDATE cw_signature_project_report_relation SET
+        <if test="signatureDocumentId != null and signatureDocumentId != ''">
+            signature_document_id = #{signatureDocumentId}
+        </if>
+        <if test="signatureUrl != null">
+            ,signature_url = #{signatureUrl}
+        </if>
+        <if test="signatureUrlFlag != null">
+            ,signature_url_flag = #{signatureUrlFlag}
+        </if>
+        <if test="signatureContractId != null and signatureContractId != ''">
+            ,signature_contract_id = #{signatureContractId}
+        </if>
+        <if test="signatureFlag != null">
+            ,signature_flag = #{signatureFlag}
+        </if>
+        <if test="signatureFileName != null and signatureFileName != ''">
+            ,signature_file_name = #{signatureFileName}
+        </if>
+        <if test="signatureUploadFileUser != null and signatureUploadFileUser.id != null and signatureUploadFileUser.id != ''">
+            ,signature_upload_file_user = #{signatureUploadFileUser.id}
+        </if>
+        <if test="signatureUploadDate != null">
+            ,signature_upload_date = #{signatureUploadDate}
+        </if>
+        WHERE id = #{id}
+    </update>
+
+    <select id="getByDocumentId" resultType="com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from cw_signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_document_id like concat ('%',#{documentId},'%') and a.del_flag = 0
+    </select>
+
+    <select id="getByContractId" resultType="com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO">
+        select distinct
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.signature_name,
+            a.number,
+            a.signature_type,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_contract_id,
+            a.signature_document_id,
+            a.signature_url,
+            a.signature_url_flag,
+            a.signature_file_name,
+            a.signature_upload_date,
+            a.signature_upload_file_user,
+            a.signature_flag,
+            c.name as createName,
+            d.ID_ AS task_id,
+            so.name as officeName
+        from cw_signature_project_report_relation a
+        LEFT JOIN sys_user c ON a.create_by_id =  c.id
+        left join sys_office so on so.id = c.office_id and so.del_flag = 0
+        left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+        LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+        where a.signature_contract_id = #{contractId} and a.del_flag = 0
+    </select>
+
+
+
+</mapper>

+ 687 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/service/SignatureProjectReportService.java

@@ -0,0 +1,687 @@
+package com.jeeplus.finance.signatureDaily.service;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.finance.invoice.util.SignaturePostUtil;
+import com.jeeplus.finance.projectRecords.mapper.CwProjectRecordsMapper;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.finance.projectReport.domain.Action;
+import com.jeeplus.finance.projectReport.domain.Location;
+import com.jeeplus.finance.projectReport.domain.SignatorieInfo;
+import com.jeeplus.finance.projectReport.domain.SignatureContract;
+import com.jeeplus.finance.signatureDaily.domain.SignatureDailyOfficeWork;
+import com.jeeplus.finance.signatureDaily.domain.SignatureProjectReportRelation;
+import com.jeeplus.finance.signatureDaily.domain.SignatureProjectReportRelevanceNumber;
+import com.jeeplus.finance.signatureDaily.mapper.SignatureProjectReportMapper;
+import com.jeeplus.finance.signatureDaily.mapper.SignatureProjectReportRelevanceNumberMapper;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureProjectReportRelationDTO;
+import com.jeeplus.finance.utils.Global;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.*;
+
+@Service
+@Transactional
+public class SignatureProjectReportService {
+
+    private static final byte[] SYN_BYTE = new byte[0];
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    /**
+     * 公司圆章-横
+     */
+    private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
+    //日常签章申请流程id
+    private static final String SIGNATUREREPORTCAREGORYID = Global.getConfig("signature_report_caregory_id");
+
+    @Resource
+    private SignatureProjectReportMapper signatureProjectReportMapper;
+
+    @Resource
+    private SignatureProjectReportRelevanceNumberMapper relevanceNumberMapper;
+
+    @Resource
+    private CwProjectRecordsMapper cwProjectRecordsMapper;
+
+    @Resource
+    private ContractInfoMapper mapper;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     * @return
+     * @throws Exception
+     */
+    public IPage<SignatureProjectReportRelationDTO> list(Page<SignatureProjectReportRelationDTO> page, SignatureProjectReportRelationDTO dto) throws Exception {
+        QueryWrapper<SignatureProjectReportRelationDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, SignatureProjectReportRelationDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<SignatureProjectReportRelationDTO> list = signatureProjectReportMapper.findList(page, queryWrapper);
+
+        return list;
+    }
+    /*8
+    用于导出数据
+     */
+    public IPage<SignatureProjectReportRelationDTO> list2(Page<SignatureProjectReportRelationDTO> page, SignatureProjectReportRelationDTO dto) throws Exception {
+        QueryWrapper<SignatureProjectReportRelationDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, SignatureProjectReportRelationDTO.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+
+        // 创建时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.create_time", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 创建人
+        if (StringUtils.isNotEmpty(dto.getCreateById())) {
+            queryWrapper.apply("(a.create_by_id",dto.getCreateById());
+        }
+
+        // 状态
+        if (StringUtils.isNotEmpty(dto.getStatus())) {
+            queryWrapper.eq("a.status", dto.getStatus());
+        }
+        // 部门
+        if (StringUtils.isNotEmpty(dto.getOfficeId())) {
+            queryWrapper.eq("so.id", dto.getOfficeId());
+        }
+
+        // 签章类型
+        if (StringUtils.isNotBlank(dto.getSignatureType())) {
+            queryWrapper.eq("a.signature_type", dto.getSignatureType());
+        }
+
+        // 签章描述
+        if (StringUtils.isNotEmpty(dto.getSignatureName())) {
+            queryWrapper.like("a.signature_name", dto.getSignatureName());
+        }
+
+
+        IPage<SignatureProjectReportRelationDTO> list = signatureProjectReportMapper.findList2(page, queryWrapper);
+
+        return list;
+    }
+
+    public SignatureProjectReportRelationDTO findById(String id) {
+        SignatureProjectReportRelationDTO dto = new SignatureProjectReportRelationDTO();
+        SignatureProjectReportRelationDTO reportRelationDTO=signatureProjectReportMapper.findById(id);
+        if (ObjectUtil.isNotEmpty(reportRelationDTO)){
+            BeanUtils.copyProperties(reportRelationDTO, dto);
+            List<CwProjectRecordsDTO> dtoList = new ArrayList<>();
+            //查询报告签章表所关联的项目id
+            List<SignatureProjectReportRelevanceNumber> relevanceNumberList = relevanceNumberMapper.selectList(new QueryWrapper<SignatureProjectReportRelevanceNumber>().eq("signature_project_report_id", id));
+            if (CollectionUtils.isNotEmpty(relevanceNumberList)){
+                for (SignatureProjectReportRelevanceNumber number : relevanceNumberList) {
+                    CwProjectRecordsDTO projectRecordsDTO = cwProjectRecordsMapper.getInfoById(number.getProjectId());
+                    dtoList.add(projectRecordsDTO);
+                }
+                dto.setProjectList(dtoList);
+            }
+            //查询附件信息
+            List<WorkAttachmentInfo> fileList = signatureProjectReportMapper.findFiles(id);
+            if (CollectionUtils.isNotEmpty(fileList)) {
+                for (WorkAttachmentInfo i : fileList) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            dto.setFiles(fileList);
+        }
+        return dto;
+    }
+
+    public SignatureProjectReportRelation save(SignatureProjectReportRelationDTO dto) throws Exception {
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (StringUtils.isNotBlank(dto.getId())){
+            return update(dto,userDTO);
+        }
+        return add(dto,userDTO);
+    }
+
+    private SignatureProjectReportRelation update(SignatureProjectReportRelationDTO dto, UserDTO userDTO) {
+        // 修改基础信息
+        SignatureProjectReportRelation signatureProjectReportRelation = new SignatureProjectReportRelation();
+        BeanUtils.copyProperties(dto, signatureProjectReportRelation);
+        signatureProjectReportRelation.setUpdateById(userDTO.getId());
+        signatureProjectReportRelation.setUpdateTime(new Date());
+        signatureProjectReportMapper.updateById(signatureProjectReportRelation);
+        //根据id删除签章项目关联表中的信息
+        relevanceNumberMapper.delete(new QueryWrapper<SignatureProjectReportRelevanceNumber>().eq("signature_project_report_id",dto.getId()));
+        //将新的项目信息存到关联表中
+        if (CollectionUtils.isNotEmpty(dto.getProjectList())){
+            for (CwProjectRecordsDTO projectRecordsDTO : dto.getProjectList()) {
+                SignatureProjectReportRelevanceNumber signatureProjectReportRelevanceNumber = new SignatureProjectReportRelevanceNumber();
+                signatureProjectReportRelevanceNumber.setProjectId(projectRecordsDTO.getId());
+                signatureProjectReportRelevanceNumber.setSignatureProjectReportId(dto.getId());
+                relevanceNumberMapper.insert(signatureProjectReportRelevanceNumber);
+            }
+        }
+        //获取当前节点信息
+        String currentTask = flowTaskService.getCurrentTaskName(dto.getProcInsId());
+        if (StringUtils.isNotBlank(currentTask)){
+            if (currentTask.equals("部门主任审批")){
+                //部门主任同意之后生成签章信息
+                if (StringUtils.isNotBlank(dto.getStatus())&&dto.getStatus().equals("2")){
+                    this.getManualSignatureUrl(dto.getId());
+                }
+            }
+        }
+
+        // 修改附件信息列表
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            updateFiles(dto.getFiles(), userDTO, dto.getId(),"signatureReport");
+        }
+        return signatureProjectReportRelation;
+    }
+
+    private SignatureProjectReportRelation add(SignatureProjectReportRelationDTO dto, UserDTO userDTO) throws Exception {
+        // 生成id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        // 生成编号
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE, TokenProvider.getCurrentToken());
+        //保存信息
+        SignatureProjectReportRelation signatureProjectReportRelation = new SignatureProjectReportRelation();
+        BeanUtils.copyProperties(dto, signatureProjectReportRelation);
+        signatureProjectReportRelation.setId(id);
+        signatureProjectReportRelation.setNumber(no);
+        signatureProjectReportRelation.setCreateById(userDTO.getId());
+        signatureProjectReportRelation.setCreateTime(new Date());
+        signatureProjectReportRelation.setUpdateById(userDTO.getId());
+        signatureProjectReportRelation.setUpdateTime(new Date());
+        signatureProjectReportRelation.setDelFlag(0);
+        signatureProjectReportMapper.insert(signatureProjectReportRelation);
+        //保存项目信息
+        if (CollectionUtils.isNotEmpty(dto.getProjectList())){
+            for (CwProjectRecordsDTO projectRecordsDTO : dto.getProjectList()) {
+                SignatureProjectReportRelevanceNumber signatureProjectReportRelevanceNumber = new SignatureProjectReportRelevanceNumber();
+                signatureProjectReportRelevanceNumber.setProjectId(projectRecordsDTO.getId());
+                signatureProjectReportRelevanceNumber.setSignatureProjectReportId(id);
+                relevanceNumberMapper.insert(signatureProjectReportRelevanceNumber);
+            }
+        }
+        // 保存附件列表信息
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            saveFiles(dto.getFiles(), userDTO, id);
+        }
+
+        return signatureProjectReportRelation;
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("signatureReport");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+//            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id, String attachmentFlag) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(id,attachmentFlag);
+        if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+//                    ossServiceMapper.deleteById(i.getId());
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag(attachmentFlag);
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+//                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    public String remove(String id) {
+        signatureProjectReportMapper.deleteById(id);
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    public void updateStatusById(SignatureProjectReportRelationDTO dto) {
+        signatureProjectReportMapper.updateStatusById(dto.getStatus(),dto.getId());
+        //如果是撤销或者是驳回,则需要对签章流程进行恢复
+        if ("3".equals(dto.getStatus())||"4".equals(dto.getStatus())){
+            SignatureProjectReportRelation signatureProjectReportRelation = new SignatureProjectReportRelation();
+            signatureProjectReportRelation.setSignatureContractId("");
+            signatureProjectReportRelation.setSignatureDocumentId("");
+            signatureProjectReportRelation.setSignatureFlag(0);
+            signatureProjectReportRelation.setSignatureUrlFlag(0);
+            signatureProjectReportRelation.setSignatureUrl("");
+            signatureProjectReportRelation.setSignatureFileName("");
+            signatureProjectReportRelation.setSignatureUploadDate(null);
+            signatureProjectReportRelation.setId(dto.getId());
+            signatureProjectReportMapper.updateById(signatureProjectReportRelation);
+        }
+    }
+
+    /**
+     * 创建签章流程
+     * @param dailyOfficeWorkId
+     * @return
+     */
+    public HashMap<String, Object> getManualSignatureUrl( String dailyOfficeWorkId) {
+        HashMap<String, Object> map = Maps.newHashMap();
+        map.put("contractUrl","");
+        map.put("success",false);
+        //下载文件位置
+        String deleteFile = null;
+        try {
+            //根据项目id查询是否已经提交过了报告签章
+            SignatureProjectReportRelationDTO relationDTO = this.findById(dailyOfficeWorkId);
+            if(null == relationDTO){
+                map.put("str","查询不到该签章申请信息");
+                map.put("success",false);
+                return map;
+            }
+            if(null!= relationDTO.getSignatureFlag() && 1 == relationDTO.getSignatureFlag()){
+                map.put("str","该盖章申请已完成");
+                map.put("success",false);
+                return map;
+            }
+
+            List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(dailyOfficeWorkId,"signatureReport");
+
+
+            //创建一个用于存放签章文件documentId的集合
+            List<String> documentList = Lists.newArrayList();
+            if(infoList.size()>0) {
+                String aliyunUrl = "http://cdn.gangwaninfo.com";
+                String aliDownloadUrl = "http://oss.gangwaninfo.com";
+                for (WorkAttachmentInfo workattachment : infoList) {
+                    if (StringUtils.isBlank(workattachment.getUrl())) {
+                        map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                        map.put("success", false);
+                    } else {
+                        if (StringUtils.isBlank(workattachment.getUrl())) {
+                            map.put("str", "签章文件存储路径为空,无法进行签章操作,请驳回后重新上传盖章文件");
+                            map.put("success", false);
+                        } else {
+                            //下载签章申请文件
+                            String path = null;
+                            if (System.getProperty("os.name").toLowerCase().contains("win")) {
+                                path = "D:/attachment-file/";
+                            } else {
+                                path = "/attachment-file/";
+                            }
+                            String file = aliyunUrl+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];
+                            SpringUtil.getBean ( IWorkAttachmentApi.class ).downByStreamSaveLocal(ossKey,fileName,path+fileName);
+                            //将下载下来的文件转换为file文件
+                            File srcFile = new File(path + fileName);
+                            deleteFile = path + fileName;
+
+                            //截取文件后缀名
+                            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())) {
+                                map.put("str", "请上传doc、docx或者pdf的文件进行签章操作");
+                                map.put("success", false);
+                            } else {
+
+                                //获取真签单的documentId
+                                HashMap hashMap = new SignaturePostUtil().getDocument(srcFile);
+                                String code = hashMap.get("code").toString();
+
+                                if ("0".equals(code)) {
+                                    String documentId = "";
+                                    String result = hashMap.get("result").toString();
+                                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                    documentId = documentIdMap.get("documentId").toString();
+                                    if ("".equals(documentId)) {
+                                        map.put("str", "签章文件创建失败,签章文件存在问题");
+                                        map.put("success", false);
+                                    } else {
+                                        documentList.add(documentId);
+                                    }
+                                } else {
+                                    String message = hashMap.get("message").toString();
+                                    map.put("str", message);
+                                    map.put("success", false);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            //根据项目id 和 documentId生成合同id
+            HashMap contractIdHashMap = this.getManualSignatureContractId(documentList,relationDTO);
+            String contractIdCode = contractIdHashMap.get("code").toString();
+            String contractId = "";
+            if("0".equals(contractIdCode)){
+                contractId = contractIdHashMap.get("contractId").toString();
+                if("".equals(contractId)){
+                    map.put("str","签章文件创建失败");
+                    map.put("success",false);
+                    return map;
+                }
+            }else{
+                map.put("str",contractIdHashMap.get("message").toString());
+            }
+
+
+            String documents = String.join(",", documentList);
+            //修改报告信息中对应的签章contractId
+            relationDTO.setSignatureDocumentId(documents);
+            relationDTO.setSignatureContractId(contractId);
+            //修改签章对应信息文件
+            signatureProjectReportMapper.updateSignatureInfo(relationDTO);
+
+            map.put("success",true);
+            return map;
+
+            //获取contractUrl路径
+            /*String contractUrl = this.getSignatureContractUrl(contractId);
+            if("".equals(contractUrl)){
+                map.put("str","签章文件创建失败");
+                map.put("success",false);
+                return map;
+            }else{
+
+                String documents = String.join(",", documentList);
+                //修改报告信息中对应的签章contractId
+                dailyOfficeWork.setSignatureDocumentId(documents);
+                dailyOfficeWork.setSignatureContractId(contractId);
+                //修改签章对应信息文件
+                dao.updateSignatureInfo(dailyOfficeWork);
+
+                map.put("contractUrl",contractUrl);
+                map.put("success",true);
+                return map;
+            }*/
+        } catch (Exception e) {
+            e.getMessage();
+        } finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+        }
+
+
+        return map;
+    }
+
+    /**
+     * 根据项目id 和 documentId生成合同id(手动签生成签署合同)
+     * @param documentList
+     * @return
+     */
+    public HashMap getManualSignatureContractId(List<String> documentList,SignatureProjectReportRelationDTO relationDTO){
+        HashMap hashMap = new HashMap();
+        //创建签署方信息
+        List<Action> actions = Lists.newArrayList();
+        Set<String> serialIdSet = new HashSet<>();
+
+        Action companyAction = new Action();
+        companyAction.setType("CORPORATE");
+        companyAction.setName("公司印章");
+        companyAction.setSerialNo("1");
+        //公司圆章-竖
+        serialIdSet.add(COMPANYROUNDSEALID);
+        //添加盖章位置
+        List<Location> locations = Lists.newArrayList();
+        for (String documentId: documentList) {
+            Location location = new Location();
+            location.setSealId(COMPANYROUNDSEALID);
+            location.setDocumentId(documentId);
+            location.setPage("0");
+            location.setRectType("SEAL_CORPORATE");
+            location.setKeywordIndex(-1);
+            location.setOffsetX("0.5264");
+            location.setOffsetY("0.6787");
+            locations.add(location);
+        }
+
+        List<String> serialIdList = new ArrayList<String>(serialIdSet);
+        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
+        companyAction.setAutoSign("false");
+        companyAction.setLocations(locations);
+        actions.add(companyAction);
+
+
+        //创建签署方信息表
+        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(SIGNATUREREPORTCAREGORYID);
+
+        signatureContract.setSend(true);
+        signatureContract.setSignatories(signatories);
+        signatureContract.setSn("");
+        if(null != relationDTO && StringUtils.isNotBlank(relationDTO.getNumber())){
+            signatureContract.setSubject(relationDTO.getNumber() + "。" + relationDTO.getSignatureName());//添加项目名称
+        }else if(null != relationDTO && StringUtils.isNotBlank(relationDTO.getSignatureName())){
+            signatureContract.setSubject(relationDTO.getSignatureName());//添加项目名称
+        }
+        JSONObject json = JSONObject.fromObject(signatureContract);
+        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
+        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
+     * 根据documentId查询签章信息
+     * @param documentId
+     * @return
+     */
+    public SignatureProjectReportRelationDTO getByDocumentId(String documentId) {
+        SignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.getByDocumentId(documentId);
+        return relationDTO;
+    }
+    //根据contractId查询对应的报告信息
+    public SignatureProjectReportRelationDTO getByContractId(String contractId) {
+        SignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.getByContractId(contractId);
+        return relationDTO;
+    }
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param
+     * @return
+     */
+    public Map<String,Object> getAuditNodeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        //查询流程id
+        SignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.findById(id);
+        if(StringUtils.isNotBlank(relationDTO.getProcInsId())){
+            //根据流程id查询流程当前节点信息
+            String currentTask = flowTaskService.getCurrentTaskName(relationDTO.getProcInsId());
+            if(StringUtils.isNotEmpty(currentTask)){
+                map.put("success", true);
+                map.put("message", "获取签章流程成功");
+                map.put("signatureType", currentTask);
+            }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 id
+     * @return
+     */
+    public Map<String,Object> getSignatureTypeById(String id){
+        Map<String,Object> map = new HashMap<>();
+        SignatureProjectReportRelationDTO relationDTO = signatureProjectReportMapper.findById(id);
+        if(null != relationDTO){
+            map.put("success", true);
+            map.put("message", "获取签章完成情况成功");
+            map.put("signatureType", relationDTO.getSignatureFlag());
+        }else{
+            map.put("success", false);
+            map.put("message", "获取签章完成情况失败");
+            map.put("signatureType", "0");
+        }
+        return map;
+    }
+}

+ 115 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/signatureDaily/service/dto/SignatureProjectReportRelationDTO.java

@@ -0,0 +1,115 @@
+package com.jeeplus.finance.signatureDaily.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class SignatureProjectReportRelationDTO extends BaseEntity {
+    //日常签章编号(字典值)
+    public static final String BIZ_CODE = "32";
+
+    private String id;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 签章描述
+     */
+    @Excel(name = "签章描述", width = 30, orderNum = "2")
+    private String signatureName;
+
+    /**
+     * 签章编号
+     */
+    @Excel(name = "签章编号", width = 30, orderNum = "1")
+    private String number;
+
+    /**
+     * 签章类型
+     */
+    @Excel(name = "签章类型", width = 30, orderNum = "4",dict = "signature_project_report")
+    private String signatureType;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程信息
+     */
+    private String procInsId;
+    private String processDefinitionId;
+    private String taskId;
+
+    /**
+     * 报销日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, orderNum = "6")
+    private Date createTime;
+
+    /**
+     * 创建时间
+     */
+    private String[] dates;
+    @Excel(name = "创建人", width = 30, orderNum = "5")
+    private String createName;
+
+    private String officeName;
+
+    private String officeId;
+
+    private List<WorkAttachmentInfo> files;
+
+    private List<CwProjectRecordsDTO> projectList;
+    @Excel(name = "签章项目", width = 30, orderNum = "3")
+    private String projectName;
+
+    /**
+     * 签章contractId
+     */
+    private String signatureContractId;
+    /**
+     * 签章documentId
+     */
+    private String signatureDocumentId;
+    /**
+     * 签章url地址
+     */
+    private String signatureUrl;
+    /*
+    签章完成情况
+     */
+    private Integer signatureUrlFlag;
+    /*
+    签章附件名称
+     */
+    private String signatureFileName;
+    /**
+     * 签属时间
+     */
+    private Date signatureUploadDate;
+    /*
+    签属文件上传人
+     */
+    private UserDTO signatureUploadFileUser;
+    /*
+    签章状态
+     */
+    private Integer signatureFlag;
+}