소스 검색

项目报告签章

lizhenhao 2 년 전
부모
커밋
f0e6862b0f
13개의 변경된 파일485개의 추가작업 그리고 42개의 파일을 삭제
  1. 97 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java
  2. 97 16
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java
  3. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReport.java
  4. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java
  5. 49 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportSignature.java
  6. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportSignatureMapper.java
  7. 30 18
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml
  8. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportSignatureMapper.xml
  9. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml
  10. 57 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java
  11. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/dto/CwProjectReportSignatureDTO.java
  12. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/signature/utils/SignaturePostUtil.java
  13. 3 1
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/TaskComment.java

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

@@ -3,21 +3,31 @@ package com.jeeplus.test.cw.projectReport.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.redis.RedisUtils;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.test.signature.utils.SignaturePostUtil;
 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.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.validation.Valid;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @author: 王强
@@ -30,6 +40,8 @@ public class CwProjectReportController {
 
     @Resource
     private CwProjectReportService projectReportService;
+    @Autowired
+    private RedisUtils redisUtils;
 
     /**
      * 保存财务报告信息-流程
@@ -111,4 +123,89 @@ public class CwProjectReportController {
         result = projectReportService.findClineList (page,cwWorkClientBaseDTO,projectId);
         return ResponseEntity.ok (result);
     }
+
+    /**
+     * 签章流程审核通过
+     * @param cwProjectReportData
+     * @return
+     */
+    @ApiLog(value = "签章流程审核通过", type = LogTypeEnum.SAVE)
+    @PostMapping("saveFlowableParam")
+    public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody CwProjectReportData cwProjectReportData) {
+        CwProjectReportData cwProjectReportDto = projectReportService.queryById(cwProjectReportData.getId());
+        // 获取签章页面url
+        String mobile = UserUtils.getCurrentUserDTO().getMobile();
+        String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(cwProjectReportDto.getSignatureContractId(), mobile);
+        // 将数据存储到redis中,key为contractId
+        cwProjectReportData.getCommitParamDTO().setVars(cwProjectReportDto);
+        redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportData.getCommitParamDTO());
+        redisUtils.expire("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),24, TimeUnit.HOURS);
+        return ResponseEntity.ok(signatureContractUrl);
+    }
+
+    /**
+     * 签章流程送审
+     * @param cwProjectReportData
+     * @return
+     */
+    @ApiLog(value = "签章流程送审", type = LogTypeEnum.SAVE)
+    @PostMapping("saveData")
+    public ResponseEntity<String> saveData(@Valid @RequestBody CwProjectReportData cwProjectReportData) {
+        Map<String, Object> signatureContractId = projectReportService.createSignatureContractId(cwProjectReportData);
+        boolean bool = (boolean)signatureContractId.get("success");
+        if (bool) {
+            String signatureId = projectReportService.getSignature(cwProjectReportData.getId());
+            return ResponseUtil.newInstance().add("businessTable", "cw_project_report_signature").add("businessId", signatureId).ok ("操作成功");
+        }
+        return ResponseEntity.badRequest().body("操作失败");
+    }
+
+    /**
+     * 根据签章表id查询报告数据
+     * @param id
+     * @return
+     */
+    @ApiLog("根据签章表id查询报告数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("queryBySignatureId")
+    public ResponseEntity queryBySignatureId(@RequestParam("id") String id) {
+        CwProjectReportData projectReportData = projectReportService.queryBySignatureId ( id );
+        return ResponseEntity.ok (projectReportData);
+    }
+
+    /**
+     * 根据签章表id查询数据
+     * @param id
+     * @return
+     */
+    @ApiLog("根据签章表id查询数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("findBySignatureId")
+    public ResponseEntity findBySignatureId(@RequestParam("id") String id) {
+        CwProjectReportSignature cwProjectReportSignature = projectReportService.findBySignatureId ( id );
+        return ResponseEntity.ok (cwProjectReportSignature);
+    }
+
+    /**
+     * 根据id修改签章表状态值status
+     * @param data
+     * @return
+     */
+    @ApiOperation(value = "根据id修改签章表状态值status")
+    @PostMapping(value = "/updateSignatureStatusById")
+    public ResponseEntity<String> updateSignatureStatusById(@RequestBody CwProjectReportSignatureDTO data) {
+        String s = projectReportService.updateSignatureStatusById(data);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id修改签章表状态值status
+     * @return
+     */
+    @ApiOperation(value = "根据id修改签章表状态值status")
+    @PostMapping(value = "/aaa")
+    public ResponseEntity<String> updateSignatureStatusById() {
+        String s = "projectReportService.updateSignatureStatusById(data);";
+        return ResponseEntity.ok(s);
+    }
 }

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

@@ -1,13 +1,32 @@
 package com.jeeplus.test.cw.projectReport.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.jeeplus.common.redis.RedisUtils;
+import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.utils.Global;
 import com.jeeplus.sys.utils.SpringContextHolder;
+import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
 import com.jeeplus.test.signature.domain.PresignCallBack;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.engine.TaskService;
+import org.flowable.task.api.Task;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.connection.jedis.JedisUtils;
+import org.springframework.http.ResponseEntity;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -26,7 +45,7 @@ public class CwProjectReportSignatureCallBackController {
 
 
     private CwProjectReportService cwProjectReportService = SpringContextHolder.getBean(CwProjectReportService.class);
-
+    private CwProjectReportSignatureMapper cwProjectReportSignatureMapper = SpringContextHolder.getBean(CwProjectReportSignatureMapper.class);
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -34,6 +53,13 @@ public class CwProjectReportSignatureCallBackController {
     private final static String appsecret = Global.getConfig("appsecret");
     private final static String signature = Global.getConfig("signature");
 
+    @Autowired
+    private RedisUtils redisUtils;
+    @Autowired
+    private FlowTaskService flowTaskService;
+    @Autowired
+    private TaskService taskService;
+
 
     /**
      * 审定单签章回调操作(个人职业章盖章)
@@ -42,30 +68,85 @@ public class CwProjectReportSignatureCallBackController {
      */
     @RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
     public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
+        // 在redis中取回流程审核所需的参数
+        CommitParamDTO<CwProjectReportData> commitParamDTO = (CommitParamDTO<CwProjectReportData>)redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
+        // 将取回的数据转换为审核通过所需要的参数
+        Map<String, Object> vars = Maps.newHashMap();
+        Flow flow = new Flow();
+        flow.setTaskId(commitParamDTO.getTaskId());
+        flow.setTaskDefKey(commitParamDTO.getTaskDefKey());
+        flow.setProcInsId(commitParamDTO.getProcInsId());
+        flow.setProcDefId(commitParamDTO.getProcDefId());
+        flow.setAssignee(commitParamDTO.getAssignee());
+        flow.setComment(commitParamDTO.getComment());
+        Map<String, String> stringObjectMap = JSON.parseObject(JSON.toJSONString(commitParamDTO.getVars()), new TypeReference<Map<String, String>>() {});
+        for (Map.Entry<String, String> entry : stringObjectMap.entrySet()) {
+            String value = entry.getValue();
+            if("true".equals(value) || "false".equals(value)){
+                vars.put(entry.getKey(), Boolean.valueOf(value).booleanValue());
+            }else{
+                vars.put(entry.getKey(), value);
+            }
+        }
+        // 流程节点审核通过
+        flowTaskService.auditSave(flow, vars);
+        // 指定下一步处理人
+        Task task = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).active().singleResult();
+        // task为null时,则当前节点为最后一个审核节点
+        if(task != null){
+            if(StringUtils.isNotBlank(flow.getAssignee ())){
+                taskService.setAssignee(task.getId(), flow.getAssignee ());
+            }
+        } else {
+            // 修改数据流程状态为->审核通过
+            List<CwProjectReport> list = cwProjectReportService.list(new QueryWrapper<CwProjectReport>().lambda().eq(CwProjectReport::getSignatureContractId, presignCallBack.getContractId()));
+            if (CollectionUtil.isNotEmpty(list)){
+                CwProjectReport cwProjectReport = list.get(0);
+                CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                        .eq(CwProjectReportSignature::getReportId, cwProjectReport.getId())
+                        .eq(CwProjectReportSignature::getType, cwProjectReport.getSignatureType())
+                );
+                cwProjectReportSignature.setStatus("5");
+                cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+            }
+        }
+        // 删除redis中的数据
+        redisUtils.delete("cw_report_signature_" + presignCallBack.getContractId());
+
 
-        /*Jedis jedis = JedisUtils.getResource();
-        String contractIdRedis = jedis.get("qiyuesuo" + presignCallBack.getContractId());
-        String auditUsersStr = jedis.get("qiyuesuoAuditUserList" + presignCallBack.getContractId());
-        Gson gson = new Gson();
-        ProjectApprovalSignature projectApprovalSignature1 = gson.fromJson(contractIdRedis, ProjectApprovalSignature.class);
 
-        Type listType = new TypeToken<ArrayList<User>>(){}.getType();
-        List<User> auditUserList = new Gson().fromJson(auditUsersStr, listType);
 
-        //根据contractId查询对应的报告信息
-        CwProjectReportData projectReportData = cwProjectReportService.queryById(projectApprovalSignature1.getId());
 
-        if(null == projectReportData){
-            return null;
-        }
-        //根据项目id查询对应的审定单数据状态是否是已经被送审
-        ProjectApprovalSignature projectApprovalSignature = cwProjectReportService.getProjectApprovalSignature(projectReportData.getId());*/
+
+
+
+//        Jedis jedis = JedisUtils.getResource();
+//        String contractIdRedis = jedis.get("qiyuesuo" + presignCallBack.getContractId());
+//        String auditUsersStr = jedis.get("qiyuesuoAuditUserList" + presignCallBack.getContractId());
+//        Gson gson = new Gson();
+//        ProjectApprovalSignature projectApprovalSignature1 = gson.fromJson(contractIdRedis, ProjectApprovalSignature.class);
+//
+//        Type listType = new TypeToken<ArrayList<User>>(){}.getType();
+//        List<User> auditUserList = new Gson().fromJson(auditUsersStr, listType);
+//
+//        //根据contractId查询对应的报告信息
+//        CwProjectReportData projectReportData = cwProjectReportService.queryById(projectApprovalSignature1.getId());
+//
+//        if(null == projectReportData){
+//            return null;
+//        }
+//        //根据项目id查询对应的审定单数据状态是否是已经被送审
+//        ProjectApprovalSignature projectApprovalSignature = cwProjectReportService.getProjectApprovalSignature(projectReportData.getId());
 
         //对数据进以及流程行处理
         //approvalSaveAudit(projectApprovalSignature1,auditUserList);
 
         return null;
     }
-
+    @PostMapping(value = "/aaa")
+    public ResponseEntity<String> updateSignatureStatusById() {
+        String s = "projectReportService.updateSignatureStatusById(data);";
+        return ResponseEntity.ok(s);
+    }
 
 }

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

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

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

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

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

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

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

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

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

@@ -62,16 +62,22 @@
         c.name as departmentName,
         d.name as userName,
         a.create_date,
-        e.name as projectMasterName
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
         FROM cw_project_report a
-        left join cw_project_records b
-        on a.project_id = b.id
-        LEFT JOIN sys_office c
-        on a.office_id = c.id
-        LEFT JOIN sys_user d
-        on a.create_by = d.id
-        LEFT JOIN sys_user e
-        on b.project_master_id = e.id
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
         ${ew.customSqlSegment}
     </select>
     <select id="queryById" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReportData">
@@ -99,16 +105,22 @@
         c.name as departmentName,
         d.name as userName,
         a.create_date,
-        e.name as projectMasterName
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
         FROM cw_project_report a
-        left join cw_project_records b
-        on a.project_id = b.id
-        LEFT JOIN sys_office c
-        on a.office_id = c.id
-        LEFT JOIN sys_user d
-        on a.create_by = d.id
-        LEFT JOIN sys_user e
-        on b.project_master_id = e.id
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
         where a.id = #{id}
     </select>
     <select id="findClineList" resultType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO">

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

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

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

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

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

@@ -23,11 +23,9 @@ import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwProjectRecordsWrapper;
 import com.jeeplus.test.cw.projectReport.domain.*;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportCancelMapper;
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
-import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
+import com.jeeplus.test.cw.projectReport.mapper.*;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
@@ -101,6 +99,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     @Resource
     private UserMapper userMapper;
 
+    @Resource
+    private CwProjectReportSignatureMapper cwProjectReportSignatureMapper;
+
     /**
      * 保存项目以及其他相关信息
      * @param reportData
@@ -440,6 +441,21 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             });
         }
         this.reportMapper.insert(report);
+
+        // 添加签章流程初始数据
+        // 公章流程
+        CwProjectReportSignature cwProjectReportSignature1 = new CwProjectReportSignature();
+        cwProjectReportSignature1.setReportId(report.getId());
+        cwProjectReportSignature1.setType("1");
+        cwProjectReportSignature1.setStatus("0");
+        cwProjectReportSignatureMapper.insert(cwProjectReportSignature1);
+        // 公章+执业章流程
+        CwProjectReportSignature cwProjectReportSignature2 = new CwProjectReportSignature();
+        cwProjectReportSignature2.setReportId(report.getId());
+        cwProjectReportSignature2.setType("2");
+        cwProjectReportSignature2.setStatus("0");
+        cwProjectReportSignatureMapper.insert(cwProjectReportSignature2);
+
         return report.getId();
     }
 
@@ -690,9 +706,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                 }
                 projectReportData.setSignatureContractId(contractId);
                 this.updateSignatureInfo(projectReportData);
+//                map.put("contractId",contractId);
                 //修改签章对应信息文件
                 //contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
                 //System.out.println(contractUrl);
+
             }else{
                 map.put("success",false);
                 map.put("message",contractIdHashMap.get("message").toString());
@@ -706,7 +724,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         }
         map.put("success",true);
         map.put("message","生成签章contractId成功");
-        return null;
+        return map;
     }
 
     /**
@@ -936,4 +954,38 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
 
         return hashMap;
     }
+
+    public CwProjectReportData queryBySignatureId(String signatureId) {
+        CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectById(signatureId);
+        if (ObjectUtil.isNotEmpty(cwProjectReportSignature)){
+            if (StringUtils.isNotBlank(cwProjectReportSignature.getReportId())){
+                return this.queryById(cwProjectReportSignature.getReportId());
+            }
+        }
+        return new CwProjectReportData();
+    }
+
+    public CwProjectReportSignature findBySignatureId(String signatureId) {
+        return cwProjectReportSignatureMapper.selectById(signatureId);
+    }
+
+    public String updateSignatureStatusById(CwProjectReportSignatureDTO data) {
+        CwProjectReportSignature cwProjectReportSignature = new CwProjectReportSignature();
+        cwProjectReportSignature.setId(data.getId());
+        cwProjectReportSignature.setStatus(data.getStatus());
+        cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+        return "操作成功";
+    }
+
+    public String getSignature (String reportId){
+        CwProjectReportData cwProjectReportData1 = this.queryById(reportId);
+        String signatureType = cwProjectReportData1.getSignatureType();
+        CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectOne(new QueryWrapper<CwProjectReportSignature>().lambda()
+                .eq(CwProjectReportSignature::getReportId, reportId)
+                .eq(CwProjectReportSignature::getType, signatureType)
+        );
+        cwProjectReportSignature.setStatus("2");
+        cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
+        return cwProjectReportSignature.getId();
+    }
 }

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

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

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

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

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

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