瀏覽代碼

项目登记添加:有无报告,签章退回

sangwenwei 1 年之前
父節點
當前提交
8daf0393dc
共有 14 個文件被更改,包括 963 次插入3 次删除
  1. 31 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwProjectRecordsController.java
  2. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectRecords.java
  3. 8 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java
  4. 77 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml
  5. 191 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java
  6. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/dto/CwProjectRecordsDTO.java
  7. 38 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/controller/CwProjectReportController.java
  8. 16 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwProjectReportData.java
  9. 38 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwRevocationSignature.java
  10. 8 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java
  11. 10 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwRevocationSignatureMapper.java
  12. 100 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectReportMapper.xml
  13. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwRevocationSignatureMapper.xml
  14. 431 1
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java

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

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

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectRecords.java

@@ -118,6 +118,11 @@ public class CwProjectRecords extends BaseEntity {
      */
     private String projectClassification;
 
+    /**
+     * 是否有报告(0:无,1:有)
+     */
+    private String isHaveReport;
+
 
 
 

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

@@ -31,6 +31,14 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
     // @InterceptorIgnore(tenantLine = "true")
     IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
     /**
+     * 查询项目信息(有报告的项目及老项目)
+     */
+    IPage<CwProjectRecordsDTO> findNewList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+    /**
+     * 查询项目信息(无报告的项目及老项目)
+     */
+    IPage<CwProjectRecordsDTO> findNoReportList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+    /**
      * 查询项目数据集合,和上面findList是一样的,目的是跳过findList接口的数据规则(比如仅部门可见、仅自己可见之类的)
      */
     IPage<CwProjectRecordsDTO> findList2(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);

+ 77 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml

@@ -91,7 +91,8 @@
         a.real_header,
         a.report_type,
         a.project_classification,
-        a.report_review
+        a.report_review,
+        a.is_have_report
     </sql>
     <sql id="File_Column_List">
         wa.id,
@@ -304,6 +305,81 @@
         ${ew.customSqlSegment}
         ORDER BY a.create_time DESC
     </select>
+
+    <select id="findNewList" resultMap="BaseResultMap">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as user_name,
+        su2.name as project_master_name,
+        su2.name as projectMasterName2,
+        su3.name as real_header_name,
+        cw_wci.contract_name,
+        cw_wci.contract_amount,
+        cw_wci.contract_num,
+        cw_wci.payer_subject,
+        cw_wci.payment_method,
+        cw_wcb.name as client_contacts_name,
+        cw_pbt.name as business_type_name,
+        b.member_count
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = '0'
+        left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
+        left join sys_user su3 on su3.id = a.real_header and su3.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 (select rec.id,count(cw_pm.id) as member_count
+        from cw_project_records rec
+        left join cw_project_members cw_pm on cw_pm.project_id = rec.id and cw_pm.del_flag = '0'
+        group by rec.id
+        ) b on b.id = a.id
+        left join cw_project_members cpm on a.id = cpm.project_id
+        left join sys_user sub on cpm.user_id = sub.id
+        left join sys_user_manage_office sumo on sumo.office_id = sub.office_id
+        ${ew.customSqlSegment}
+        and ((a.create_time >=(SELECT dv.label FROM sys_dict_type dt LEFT JOIN sys_dict_value dv on dt.id = dv.dict_type_id where dt.type='new_project_time')
+        and a.is_have_report = '1') or a.create_time &lt; (SELECT dv.label FROM sys_dict_type dt LEFT JOIN sys_dict_value dv on dt.id = dv.dict_type_id where dt.type='new_project_time'))
+        ORDER BY a.create_time DESC
+    </select>
+
+    <select id="findNoReportList" resultMap="BaseResultMap">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as user_name,
+        su2.name as project_master_name,
+        su2.name as projectMasterName2,
+        su3.name as real_header_name,
+        cw_wci.contract_name,
+        cw_wci.contract_amount,
+        cw_wci.contract_num,
+        cw_wci.payer_subject,
+        cw_wci.payment_method,
+        cw_wcb.name as client_contacts_name,
+        cw_pbt.name as business_type_name,
+        b.member_count
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = '0'
+        left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
+        left join sys_user su3 on su3.id = a.real_header and su3.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 (select rec.id,count(cw_pm.id) as member_count
+        from cw_project_records rec
+        left join cw_project_members cw_pm on cw_pm.project_id = rec.id and cw_pm.del_flag = '0'
+        group by rec.id
+        ) b on b.id = a.id
+        left join cw_project_members cpm on a.id = cpm.project_id
+        left join sys_user sub on cpm.user_id = sub.id
+        left join sys_user_manage_office sumo on sumo.office_id = sub.office_id
+        ${ew.customSqlSegment}
+        and ((a.create_time >=(SELECT dv.label FROM sys_dict_type dt LEFT JOIN sys_dict_value dv on dt.id = dv.dict_type_id where dt.type='new_project_time')
+        and a.is_have_report = '0') or a.create_time &lt; (SELECT dv.label FROM sys_dict_type dt LEFT JOIN sys_dict_value dv on dt.id = dv.dict_type_id where dt.type='new_project_time'))
+        ORDER BY a.create_time DESC
+    </select>
+
     <select id="findList2" resultMap="BaseResultMap">
         select
         DISTINCT

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

@@ -35,6 +35,7 @@ import com.jeeplus.finance.workClientInfo.domain.CwWorkClientContact;
 import com.jeeplus.finance.workClientInfo.service.CwWorkClientContactService;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.feign.IDictApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 import com.jeeplus.sys.service.dto.UserDTO;
@@ -172,6 +173,196 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
         });
         return list;
     }
+
+    /**
+     * 查询有报告项目及老项目列表信息
+     * @param page
+     * @param cwProjectRecordsDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwProjectRecordsDTO> findNewList(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.findNewList(page, queryWrapper);
+        List<UserDTO> allUserInfo = (List<UserDTO>) RedisUtils.getInstance().get(CacheNames.USER_CACHE_USER_ALL_INFO);
+        if (null == allUserInfo || allUserInfo.size() == 0) {
+            allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
+        }
+        List<UserDTO> finalAllUserInfo = allUserInfo;
+        list.getRecords().forEach(li->{
+            if (StringUtils.isBlank(li.getProjectMasterName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getProjectMasterId())){
+                    UserDTO matchingUser = null;
+                    for (UserDTO user : finalAllUserInfo) {
+                        if (li.getProjectMasterId().equals(user.getId())) {
+                            matchingUser = user;
+                            break;
+                        }
+                    }
+                    if (matchingUser != null) {
+                        String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
+                        li.setProjectMasterName(projectMasterName);
+                    }
+                }
+            }
+            if (StringUtils.isBlank(li.getRealHeaderName())) {
+                if (StringUtils.isNotBlank(li.getRealHeader())){
+                    UserDTO matchingUser = null;
+                    for (UserDTO user : finalAllUserInfo) {
+                        if (li.getRealHeader().equals(user.getId())) {
+                            matchingUser = user;
+                            break;
+                        }
+
+                    }
+                    if (matchingUser != null) {
+                        String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
+                        li.setRealHeaderName(projectMasterName);
+                    }
+                }
+            }
+
+        });
+        return list;
+    }
+
+    /**
+     * 查询无报告项目及老项目列表信息
+     * @param page
+     * @param cwProjectRecordsDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwProjectRecordsDTO> findNoReportList(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.findNoReportList(page, queryWrapper);
+        List<UserDTO> allUserInfo = (List<UserDTO>) RedisUtils.getInstance().get(CacheNames.USER_CACHE_USER_ALL_INFO);
+        if (null == allUserInfo || allUserInfo.size() == 0) {
+            allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
+        }
+        List<UserDTO> finalAllUserInfo = allUserInfo;
+        list.getRecords().forEach(li->{
+            if (StringUtils.isBlank(li.getProjectMasterName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getProjectMasterId())){
+                    UserDTO matchingUser = null;
+                    for (UserDTO user : finalAllUserInfo) {
+                        if (li.getProjectMasterId().equals(user.getId())) {
+                            matchingUser = user;
+                            break;
+                        }
+                    }
+                    if (matchingUser != null) {
+                        String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
+                        li.setProjectMasterName(projectMasterName);
+                    }
+                }
+            }
+            if (StringUtils.isBlank(li.getRealHeaderName())) {
+                if (StringUtils.isNotBlank(li.getRealHeader())){
+                    UserDTO matchingUser = null;
+                    for (UserDTO user : finalAllUserInfo) {
+                        if (li.getRealHeader().equals(user.getId())) {
+                            matchingUser = user;
+                            break;
+                        }
+
+                    }
+                    if (matchingUser != null) {
+                        String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
+                        li.setRealHeaderName(projectMasterName);
+                    }
+                }
+            }
+
+        });
+        return list;
+    }
+
+
+
+
     /**
      * 查询项目数据集合,和上面findList是一样的,目的是跳过findList接口的数据规则(比如仅部门可见、仅自己可见之类的)
      */

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/dto/CwProjectRecordsDTO.java

@@ -255,6 +255,11 @@ public class CwProjectRecordsDTO extends BaseDTO {
     private String loginName;
     private String reportId;
 
+    /**
+     * 是否有报告(0:无,1:有)
+     */
+    private String isHaveReport;
+
 
 
 }

+ 38 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/controller/CwProjectReportController.java

@@ -797,4 +797,42 @@ public class CwProjectReportController {
         folder.delete(); // 删除空文件夹或者文件
     }
 
+    /**
+     * 保存撤回签章流程
+     * @param reportData
+     * @return
+     */
+    @ApiLog(value = "保存撤回签章流程", type = LogTypeEnum.SAVE)
+    //@PreAuthorize("hasAnyAuthority('cwProjectReport:add','cwProjectReport:edit')")
+    @PostMapping("saveRevocation")
+    public ResponseEntity saveRevocation(@Valid @RequestBody CwProjectReportData reportData) throws Exception {
+        String id = projectReportService.saveRevocation(reportData);
+        return ResponseUtil.newInstance().add("businessTable", "cw_revocation_signature").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 撤回签章 根据id修改状态值status
+     * @param data
+     * @return
+     */
+    @ApiOperation(value = "撤回签章 根据id修改状态值status")
+    @PostMapping(value = "/updateStatusByIdRe")
+    public ResponseEntity<String> updateStatusByIdRe(@RequestBody CwProjectReportData data) {
+        String s = projectReportService.updateStatusByIdRe(data);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询撤回签章数据
+     * @param id
+     * @return
+     */
+    @ApiLog("查询撤回签章数据")
+    // @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("queryByReId")
+    public ResponseEntity queryByReId(@RequestParam("id") String id) {
+        CwProjectReportData projectReportData = projectReportService.queryByReId ( id );
+        return ResponseEntity.ok (projectReportData);
+    }
+
 }

+ 16 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwProjectReportData.java

@@ -578,4 +578,20 @@ public class CwProjectReportData extends BaseDTO {
 
     //当前登录人角色是否是苏州报告签字盖章代办
     private String isXs;
+
+    //撤回签章状态
+    @TableField(exist = false)
+    private String rebackStatus;
+    @TableField(exist = false)
+    private String procInsReId;
+    @TableField(exist = false)
+    private String procDefReId;
+    @TableField(exist = false)
+    private String revocationTaskId;
+    //撤回签章原因
+    @TableField(exist = false)
+    private String rebackReason;
+    //撤回签章id
+    @TableField(exist = false)
+    private String revocationId;
 }

+ 38 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/domain/CwRevocationSignature.java

@@ -0,0 +1,38 @@
+package com.jeeplus.finance.projectReport.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("cw_revocation_signature")
+public class CwRevocationSignature extends BaseEntity {
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /*
+    撤回原因
+     */
+    private String reason;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     *  流程taskId
+     */
+    @TableField(exist = false)
+    private String taskId;
+}

+ 8 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java

@@ -58,6 +58,14 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
     CwProjectReportData queryById(@Param("id") String id);
 
     /**
+     * 根据id查询撤回签章信息
+     * @param id
+     * @return
+     */
+    @InterceptorIgnore(tenantLine = "true")
+    CwProjectReportData queryByReId(@Param("id") String id);
+
+    /**
      * 查询被服务单位
      * @param page
      * @param queryWrapper

+ 10 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwRevocationSignatureMapper.java

@@ -0,0 +1,10 @@
+package com.jeeplus.finance.projectReport.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectReport.domain.CwRevocationSignature;
+import org.apache.ibatis.annotations.Mapper;
+
+
+@Mapper
+public interface CwRevocationSignatureMapper extends BaseMapper<CwRevocationSignature> {
+}

+ 100 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectReportMapper.xml

@@ -105,7 +105,12 @@
         cw_nra.proc_ins_id as applyReviewProcId,
         cw_nra.process_definition_id as applyReviewProcDefId,
         ifnull(cw_nra.review_status,'0') as applyReviewStatus,
-        cw_ci.contract_name
+        cw_ci.contract_name,
+        rs.id as revocationId,
+        rs.status as rebackStatus,
+        rs.proc_ins_id as procInsReId,
+        rs.process_definition_id as procDefReId,
+        actru.ID_ as revocationTaskId
         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
@@ -133,6 +138,8 @@
         LEFT JOIN cw_project_report_number_review_apply cw_nra on  a.id = cw_nra.report_id
          left join act_ru_task arta ON cw_na.proc_ins_id = arta.PROC_INST_ID_
          left join act_ru_task artar ON cw_nra.proc_ins_id = artar.PROC_INST_ID_
+         left join cw_revocation_signature rs on a.id = rs.report_id and rs.del_flag = '0'
+         left join act_ru_task actru ON rs.proc_ins_id = actru.PROC_INST_ID_
         ${ew.customSqlSegment}
         ORDER BY a.create_time DESC
     </select>
@@ -324,6 +331,98 @@
         LEFT JOIN cw_project_report_archive cw_pa on  a.id = cw_pa.report_id and cw_pa.del_flag = '0'
         where a.id = #{id}
     </select>
+
+    <select id="queryByReId" resultType="com.jeeplus.finance.projectReport.domain.CwProjectReportData">
+        SELECT
+        a.id,
+        a.create_by_id as createById,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.del_flag,
+        a.remarks,
+        a.status,
+        a.document_no,
+        a.project_report_number,
+        a.project_id,
+        a.office_id,
+        a.signature_type,
+        a.signature_annotator1,
+        a.signature_annotator2,
+        a.signature_contract_id,
+        a.proc_ins_id,
+        a.process_definition_id,
+        a.signature_annotator_status,
+        b.project_number as projectNumber,
+        b.project_name as projectName,
+        c.name as departmentName,
+        d.name as userName,
+        a.create_time,
+        ifnull(cw_pa.audit_money,"") as "auditFees",
+        e.name as projectMasterName,
+        a.real_create,
+        a.business_type,
+        a.audit_business_type,
+        a.register_address,
+        a.business_location,
+        a.security_business,
+        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,
+        cw_prs3.proc_ins_id as proc_ins_ids3,
+        cw_prs3.process_definition_id as process_definition_id3,
+        cw_prs3.status as status3,
+        cw_prs3.id as sid3,
+        new_line.served_unit_id as servedUnitId,
+        new_line.report_date as reportDate,
+        new_line.report_type as reportType,
+        new_line.report_number as reportNumber,
+        new_line.report_no as reportNo,
+        new_line.opinion_type as opinionType,
+        new_line.seal_type as sealType,
+        cw_re.proc_ins_id as procInsId3,
+        ifnull(cw_re.review_status,'0') as reviewStatus,
+        cw_re.audit_time as auditTime,
+        suser.name as real_header_name,
+        b.project_master_id as project_master_id1,
+        b.real_header as project_master_id2,
+        a.industry,
+        a.business_objects,
+        a.report_name,
+        cw_na.proc_ins_id as applyProcId,
+        cw_na.process_definition_id as applyProcDefId,
+        ifnull(cw_na.review_status,'0') as applyStatus,
+        cw_na.take_number_type as takeNumberType,
+        cw_na.improper_take_cause as improperTakeCause,
+
+        cw_nra.proc_ins_id as applyReviewProcId,
+        cw_nra.process_definition_id as applyReviewProcDefId,
+        ifnull(cw_nra.review_status,'0') as applyReviewStatus,
+        rs.reason as rebackReason,
+        rs.status as rebackStatus,
+        rs.id as revocationId
+        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_id = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN sys_user suser on b.real_header = suser.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'
+        LEFT JOIN cw_project_report_signature cw_prs3 on cw_prs3.report_id = a.id and cw_prs3.type = '3' and cw_prs3.del_flag = '0'
+        left join cw_project_report_new_line new_line on a.id = new_line.report_id
+        left join cw_project_report_review cw_re on a.id = cw_re.report_id and cw_re.del_flag = '0'
+        LEFT JOIN cw_project_report_number_apply cw_na on  a.id = cw_na.report_id and cw_na.del_flag = '0'
+        LEFT JOIN cw_project_report_number_review_apply cw_nra on  a.id = cw_nra.report_id and cw_nra.del_flag = '0'
+        LEFT JOIN cw_project_report_archive cw_pa on  a.id = cw_pa.report_id and cw_pa.del_flag = '0'
+        left join cw_revocation_signature rs on a.id = rs.report_id and rs.del_flag = '0'
+        where (rs.id = #{id} or a.id = #{id})
+    </select>
     <select id="queryContainDelById" resultType="com.jeeplus.finance.projectReport.domain.CwProjectReportData">
         SELECT
         a.id,

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwRevocationSignatureMapper.xml

@@ -0,0 +1,5 @@
+<?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.projectReport.mapper.CwRevocationSignatureMapper">
+
+</mapper>

+ 431 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java

@@ -119,6 +119,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     @Resource
     private CwProjectReportNumberApplyMapper applyMapper;
 
+    @Resource
+    private CwRevocationSignatureMapper cwRevocationSignatureMapper;
+
 
     /**
      * 保存项目以及其他相关信息
@@ -1131,6 +1134,386 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         return reportData;
     }
 
+    public CwProjectReportData queryByReId(String id) {
+
+        CwProjectReportData reportData = reportMapper.queryByReId(id);
+
+        //如果质控审核已经完成且审核通过时间存在,则判断审核时间是否已经超过一天,若不超过,则可以重复发起质控审核
+        if (null != reportData && null != reportData.getAuditTime() && "5".equals(reportData.getReviewStatus())){
+            reportData.setRepetitionReviewFlag(getRepetitionReviewFlag(reportData.getAuditTime()));
+        }
+
+        //将新增行数据查询出来放入到cwProjectInfoList中
+        CwProjectInfoData cwProjectInfoData = infoMapper.selectByReportId(id);
+        if (null != cwProjectInfoData){
+            reportData.setServedUnitName(cwProjectInfoData.getServedUnitName());
+            reportData.setServedUnitId(cwProjectInfoData.getServedUnitId());
+            reportData.setReportDate(cwProjectInfoData.getReportDate());
+            reportData.setReportType(cwProjectInfoData.getReportType());
+            reportData.setReportNumber(cwProjectInfoData.getReportNumber());
+            reportData.setReportNo(cwProjectInfoData.getReportNo());
+            reportData.setSealType(cwProjectInfoData.getSealType());
+        }
+
+//        List<CwProjectInfoData> infoData = new ArrayList<>();
+
+        List<ProjectReportWorkAttachmentDTO> dtoList = new ArrayList<>();
+        List<ProjectReportWorkAttachmentDTO> signatureList = new ArrayList<>();
+        if ( null != reportData){
+            List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
+            if (null != dtos){
+
+                Iterator<ProjectReportWorkAttachmentDTO> it = dtos.iterator();
+                while(it.hasNext()){
+                    ProjectReportWorkAttachmentDTO d = it.next();
+                    //根据id查出cw_project_report_file文件表的其他信息
+                    //未签章附件
+                    CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
+                    if (null != file) {
+                        d.setFileType(file.getFileType());
+                        d.setSealType(file.getSealType());
+                        d.setSealedFile(file.getSealedFile());
+                        d.setSealUser(file.getSealUser());
+                        d.setSealDate(file.getSealDate());
+                        d.setRemarks(file.getRemarks());
+                        UserDTO userDTO = new UserDTO();
+                        //根据创建人id查出创建人名称
+                        String name = reportMapper.getUserNameById(file.getCreateById());
+                        userDTO.setId(file.getCreateById());
+                        userDTO.setName(name);
+                        d.setCreateBy(userDTO);
+                        d.setCreateTime(file.getCreateTime());
+                        dtoList.add(d);
+                        it.remove();
+                    }
+
+                    //已签章附件
+                    CwProjectReportFile signatureFile = attachmentMapper.selectInfoByFileId(d.getId(),"1");
+                    if (null != signatureFile){
+                        d.setFileType(signatureFile.getFileType());
+                        d.setSealType(signatureFile.getSealType());
+                        d.setSealedFile(signatureFile.getSealedFile());
+                        d.setSealUser(signatureFile.getSealUser());
+                        d.setSealDate(signatureFile.getSealDate());
+                        d.setRemarks(signatureFile.getRemarks());
+                        UserDTO userDTO2 = new UserDTO();
+                        //根据创建人id查出创建人名称
+                        String name2 = reportMapper.getUserNameById(signatureFile.getCreateById());
+                        userDTO2.setId(signatureFile.getCreateById());
+                        userDTO2.setName(name2);
+                        d.setCreateBy(userDTO2);
+                        d.setCreateTime(signatureFile.getCreateTime());
+                        signatureList.add(d);
+                        it.remove();
+                    }
+                }
+                reportData.setCwFileInfoList(dtoList);
+                reportData.setSignatureFileList(signatureList);
+            }
+
+            //将附件信息查出
+            // 查询附件信息
+            List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(id);
+            List<WorkAttachmentInfo> reportFileList = Lists.newArrayList();
+            if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
+                for (ProjectReportWorkAttachmentDTO dto : dtos) {
+                    for (WorkAttachmentInfo workAttachmentDto : fileInfo2) {
+                        if(dto.getId().equals(workAttachmentDto.getId())){
+                            reportFileList.add(workAttachmentDto);
+                        }
+                    }
+                }
+            }
+
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentInfo i : reportFileList) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+            }
+            reportData.setCwFileInfoList2(reportFileList);
+            //设置历史报告列表
+            //根据项目id查出所有的信息
+            List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());
+            List<CwProjectInfoData> dataInfoList = new ArrayList<>();
+            if (null != byProjectList) {
+                CwProjectReportData finalReportData1 = reportData;
+                byProjectList.forEach(pro->{
+                    //根据reportid查出新增行数据
+                    CwProjectInfoData infoData = infoMapper.getByReportId(pro.getId());
+                    //根据reportid查出所有的附件信息
+                    List<ProjectReportWorkAttachmentDTO> fileList = new ArrayList<>();
+                    List<ProjectReportWorkAttachmentDTO> cwFileInfoList = attachmentMapper.selectByInfoIdAndNewLineId(finalReportData1.getId());
+                    //历史的附件信息是否是查改reportid对应的所有附件
+                    if (null != cwFileInfoList){
+                        cwFileInfoList.forEach(fi->{
+                            //未签章附件
+                            CwProjectReportFile file = attachmentMapper.selectInfoByFileId(fi.getId(),"0");
+                            if (null != file) {
+                                fi.setFileType(file.getFileType());
+                                fi.setSealType(file.getSealType());
+                                fi.setSealedFile(file.getSealedFile());
+                                fi.setSealUser(file.getSealUser());
+                                fi.setSealDate(file.getSealDate());
+                                fi.setRemarks(file.getRemarks());
+                                UserDTO userDTO = new UserDTO();
+                                //根据创建人id查出创建人名称
+                                String name = reportMapper.getUserNameById(file.getCreateById());
+                                userDTO.setId(file.getCreateById());
+                                userDTO.setName(name);
+                                fi.setCreateBy(userDTO);
+                                fi.setCreateTime(file.getCreateTime());
+                                fileList.add(fi);
+                            }
+                        });
+                        //设置附件信息
+                        infoData.setCwFileInfoList(fileList);
+                        if (pro.getStatus().equals("5")) {
+                            infoData.setDocumentStatus("已完成");
+                        }
+                        dataInfoList.add(infoData);
+                    }
+                });
+            }
+
+            reportData.setCwWorkClientContactDTOList(dataInfoList);
+
+            //将复核数据查出来
+            CwProjectReview review = reviewMapper.selectByReportId(reportData.getId());
+            if ( null != review) {
+                reportData.setReviewStatus(review.getReviewStatus());
+                reportData.setAllPrintNum(review.getAllPrintNum());
+                reportData.setIssueNum(review.getIssueNum());
+                reportData.setPlaceOnFileNum(review.getPlaceOnFileNum());
+                reportData.setPrintedBy(review.getPrintedBy());
+                reportData.setCheckAutograph(review.getCheckAutograph());
+                reportData.setReportTitleType(review.getReportTitleType());
+                reportData.setNeedUpdate1(review.getNeedUpdate1());
+                reportData.setNeedUpdate2(review.getNeedUpdate2());
+                reportData.setNeedUpdate3(review.getNeedUpdate3());
+                reportData.setRemark1(review.getRemark1());
+                reportData.setRemark2(review.getRemark2());
+                reportData.setRemark3(review.getRemark3());
+                reportData.setComputerNo(review.getComputerNo());
+                reportData.setReportReviewNo(review.getReportReviewNo());
+                reportData.setReviewBy(review.getReviewBy());
+                //将一级复核等填入数据查出
+                List<CwProofreadDetail> details = detailMapper.findByReportInfoId(review.getId());
+                if (null != details) {
+                    reportData.setDetails(details);
+                }
+            }
+            //根据报告类型查询下一节点用户
+            List<ReviewUser> stringList = new ArrayList<>();
+            //如果是苏州分部,这里写死
+            String officeId = reportMapper.getCorrelationOfficeIdByName("苏州分公司");
+            if (StringUtils.isNotBlank(officeId) && officeId.contains(reportData.getOfficeId())){
+                stringList = reportMapper.getReviewByPost("质控-苏州分部");
+            }else if (reportData.getReportType().equals("1")) {
+                stringList = reportMapper.getReviewByPost("质控-财务-苏兴会基字");
+            } else {
+                stringList = reportMapper.getReviewByPost("质控-财务-非苏兴会基字");
+            }
+            reportData.setReviewBys(stringList);
+        } else {
+            //传来的是复核表的id
+            CwProjectReview review = reviewMapper.selectById(id);
+            if (null != review) {
+                reportData = reportMapper.queryById(review.getReportId());
+                if ( null != reportData){
+
+                    //如果质控审核已经完成且审核通过时间存在,则判断审核时间是否已经超过一天,若不超过,则可以重复发起质控审核
+                    if (null != reportData.getAuditTime() && "5".equals(reportData.getReviewStatus())){
+                        reportData.setRepetitionReviewFlag(getRepetitionReviewFlag(reportData.getAuditTime()));
+                    }
+
+                    List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
+                    if (null != dtos){
+
+                        Iterator<ProjectReportWorkAttachmentDTO> it = dtos.iterator();
+                        while(it.hasNext()){
+                            ProjectReportWorkAttachmentDTO d = it.next();
+                            //根据id查出cw_project_report_file文件表的其他信息
+                            //未签章附件
+                            CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
+                            if (null != file) {
+                                d.setFileType(file.getFileType());
+                                d.setSealType(file.getSealType());
+                                d.setSealedFile(file.getSealedFile());
+                                d.setSealUser(file.getSealUser());
+                                d.setSealDate(file.getSealDate());
+                                d.setRemarks(file.getRemarks());
+                                UserDTO userDTO = new UserDTO();
+                                //根据创建人id查出创建人名称
+                                String name = reportMapper.getUserNameById(file.getCreateById());
+                                userDTO.setId(file.getCreateById());
+                                userDTO.setName(name);
+                                d.setCreateBy(userDTO);
+                                d.setCreateTime(file.getCreateTime());
+                                dtoList.add(d);
+                                it.remove();
+                            }
+
+                            //已签章附件
+                            CwProjectReportFile signatureFile = attachmentMapper.selectInfoByFileId(d.getId(),"1");
+                            if (null != signatureFile){
+                                d.setFileType(signatureFile.getFileType());
+                                d.setSealType(signatureFile.getSealType());
+                                d.setSealedFile(signatureFile.getSealedFile());
+                                d.setSealUser(signatureFile.getSealUser());
+                                d.setSealDate(signatureFile.getSealDate());
+                                d.setRemarks(signatureFile.getRemarks());
+                                UserDTO userDTO2 = new UserDTO();
+                                //根据创建人id查出创建人名称
+                                String name2 = reportMapper.getUserNameById(signatureFile.getCreateById());
+                                userDTO2.setId(signatureFile.getCreateById());
+                                userDTO2.setName(name2);
+                                d.setCreateBy(userDTO2);
+                                d.setCreateTime(signatureFile.getCreateTime());
+                                signatureList.add(d);
+                                it.remove();
+                            }
+                        }
+                        reportData.setCwFileInfoList(dtoList);
+                        reportData.setSignatureFileList(signatureList);
+                    }
+                    //将附件信息查出
+                    // 查询附件信息
+                    List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
+                    List<WorkAttachmentInfo> reportFileList = Lists.newArrayList();
+                    if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
+                        for (ProjectReportWorkAttachmentDTO dto : dtos) {
+                            for (WorkAttachmentInfo workAttachmentDto : fileInfo2) {
+                                if(dto.getId().equals(workAttachmentDto.getId())){
+                                    reportFileList.add(workAttachmentDto);
+                                }
+                            }
+                        }
+                    }
+
+                    if (CollectionUtils.isNotEmpty(dtos)) {
+                        for (WorkAttachmentInfo i : reportFileList) {
+                            i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                        }
+                    }
+                    reportData.setCwFileInfoList2(reportFileList);
+                    //设置历史报告列表
+                    //根据项目id查出所有的信息
+                    List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());
+                    List<CwProjectInfoData> dataInfoList = new ArrayList<>();
+                    if (null != byProjectList) {
+                        CwProjectReportData finalReportData = reportData;
+                        byProjectList.forEach(pro->{
+                            //根据reportid查出新增行数据
+                            CwProjectInfoData infoData = infoMapper.getByReportId(pro.getId());
+                            //根据reportid查出所有的附件信息
+                            List<ProjectReportWorkAttachmentDTO> fileList = new ArrayList<>();
+                            List<ProjectReportWorkAttachmentDTO> cwFileInfoList = attachmentMapper.selectByInfoIdAndNewLineId(finalReportData.getId());
+                            //历史的附件信息是否是查改reportid对应的所有附件
+                            if (null != cwFileInfoList){
+                                cwFileInfoList.forEach(fi->{
+                                    //未签章附件
+                                    CwProjectReportFile file = attachmentMapper.selectInfoByFileId(fi.getId(),"0");
+                                    if (null != file) {
+                                        fi.setFileType(file.getFileType());
+                                        fi.setSealType(file.getSealType());
+                                        fi.setSealedFile(file.getSealedFile());
+                                        fi.setSealUser(file.getSealUser());
+                                        fi.setSealDate(file.getSealDate());
+                                        fi.setRemarks(file.getRemarks());
+                                        UserDTO userDTO = new UserDTO();
+                                        //根据创建人id查出创建人名称
+                                        String name = reportMapper.getUserNameById(file.getCreateById());
+                                        userDTO.setId(file.getCreateById());
+                                        userDTO.setName(name);
+                                        fi.setCreateBy(userDTO);
+                                        fi.setCreateTime(file.getCreateTime());
+                                        fileList.add(fi);
+                                    }
+                                });
+                                //设置附件信息
+                                infoData.setCwFileInfoList(fileList);
+                                if (pro.getStatus().equals("5")) {
+                                    infoData.setDocumentStatus("已完成");
+                                }
+                                dataInfoList.add(infoData);
+                            }
+                        });
+                    }
+
+                    reportData.setCwWorkClientContactDTOList(dataInfoList);
+
+                    //将复核数据查出来
+//                CwProjectReview review = reviewMapper.selectByReportId(reportData.getId());
+//                    if ( null != review) {
+//
+//                    }
+                    reportData.setReviewStatus(review.getReviewStatus());
+                    reportData.setAllPrintNum(review.getAllPrintNum());
+                    reportData.setIssueNum(review.getIssueNum());
+                    reportData.setPlaceOnFileNum(review.getPlaceOnFileNum());
+                    reportData.setPrintedBy(review.getPrintedBy());
+                    reportData.setCheckAutograph(review.getCheckAutograph());
+                    reportData.setReportTitleType(review.getReportTitleType());
+                    reportData.setNeedUpdate1(review.getNeedUpdate1());
+                    reportData.setNeedUpdate2(review.getNeedUpdate2());
+                    reportData.setNeedUpdate3(review.getNeedUpdate3());
+                    reportData.setRemark1(review.getRemark1());
+                    reportData.setRemark2(review.getRemark2());
+                    reportData.setRemark3(review.getRemark3());
+                    reportData.setComputerNo(review.getComputerNo());
+                    reportData.setReviewBy(review.getReviewBy());
+
+                    //将一级复核等填入数据查出
+                    List<CwProofreadDetail> details = detailMapper.findByReportInfoId(review.getId());
+                    if (null != details) {
+                        reportData.setDetails(details);
+                    }
+                    //根据报告类型查询下一节点用户
+                    List<ReviewUser> stringList = new ArrayList<>();
+                    //如果是苏州分部,这里写死
+                    String officeId = reportMapper.getCorrelationOfficeIdByName("苏州分公司");
+                    if (StringUtils.isNotBlank(officeId) && officeId.contains(reportData.getOfficeId())){
+                        stringList = reportMapper.getReviewByPost("质控-苏州分部");
+                    }else if (reportData.getReportType().equals("1")) {
+                        stringList = reportMapper.getReviewByPost("质控-财务-苏兴会基字");
+                    } else {
+                        stringList = reportMapper.getReviewByPost("质控-财务-非苏兴会基字");
+                    }
+                    reportData.setReviewBys(stringList);
+                    //将新增行数据查询出来放入到cwProjectInfoList中
+                    cwProjectInfoData = infoMapper.selectByReportId(reportData.getId());
+                    if (null != cwProjectInfoData){
+                        reportData.setServedUnitName(cwProjectInfoData.getServedUnitName());
+                        reportData.setServedUnitId(cwProjectInfoData.getServedUnitId());
+                        reportData.setReportDate(cwProjectInfoData.getReportDate());
+                        reportData.setReportType(cwProjectInfoData.getReportType());
+                        reportData.setReportNumber(cwProjectInfoData.getReportNumber());
+                        reportData.setReportNo(cwProjectInfoData.getReportNo());
+                        reportData.setSealType(cwProjectInfoData.getSealType());
+                    }
+                }
+            }
+
+        }
+        CwSignatureAnnotator cwSignatureAnnotator=cwSignatureAnnotatorMapper.getSigById(id);
+        if (ObjectUtil.isNotEmpty(cwSignatureAnnotator)){
+            reportData.setProcInsSigId(cwSignatureAnnotator.getProcInsId());
+            reportData.setSigReason(cwSignatureAnnotator.getReason());
+        }
+        //获取当前登录人角色是否是苏州报告签字盖章代办
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
+            for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
+                RoleDTO dtoById = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(roleDTO.getId());
+                if ("szbgqzgzdb".equals(dtoById.getEnName())){
+                    reportData.setIsXs("1");
+                }
+            }
+        }
+
+        return reportData;
+    }
+
     public CwProjectReportData queryById2(String id) {
 
         CwProjectReportData reportData = reportMapper.queryById(id);
@@ -4070,6 +4453,53 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     }
 
 
+    /**
+     * 保存或修改撤回签章流程
+     * @param reportData
+     * @return
+     */
+    public String saveRevocation(CwProjectReportData reportData) {
+        String id="";
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if(StringUtils.isNotBlank(reportData.getRevocationId())){
+            CwRevocationSignature cwRevocationSignature = new CwRevocationSignature();
+            cwRevocationSignature.setUpdateById(userDTO.getId());
+            cwRevocationSignature.setUpdateTime(new Date());
+            cwRevocationSignature.setId(reportData.getRevocationId());
+            cwRevocationSignature.setReason(reportData.getRebackReason());
+            cwRevocationSignature.setStatus(reportData.getRebackStatus());
+            cwRevocationSignature.setReportId(reportData.getId());
+            cwRevocationSignatureMapper.updateById(cwRevocationSignature);
+            if ("5".equals(reportData.getRebackStatus())){
+                //重新复核
+                this.rebackReviewSign(reportData.getId());
+                //然后将撤回签章数据进行逻辑删除
+                cwRevocationSignatureMapper.deleteById(reportData.getRevocationId());
+            }
+            id=reportData.getRevocationId();
+        }else {
+            String detailId = UUID.randomUUID().toString().replace("-", "");
+            CwRevocationSignature cwRevocationSignature = new CwRevocationSignature();
+            cwRevocationSignature.setId(detailId);
+            cwRevocationSignature.setReason(reportData.getRebackReason());
+            cwRevocationSignature.setStatus(reportData.getRebackStatus());
+            cwRevocationSignature.setReportId(reportData.getId());
+            cwRevocationSignatureMapper.insert(cwRevocationSignature);
+            id=detailId;
+        }
+        return id;
+    }
 
-
+    /**
+     * 撤回签章  根据id修改状态
+     * @param data
+     * @return
+     */
+    public String updateStatusByIdRe(CwProjectReportData data) {
+        CwRevocationSignature cwRevocationSignature = new CwRevocationSignature();
+        cwRevocationSignature.setId(data.getRevocationId());
+        cwRevocationSignature.setStatus(data.getRebackStatus());
+        cwRevocationSignatureMapper.updateById(cwRevocationSignature);
+        return "操作成功";
+    }
 }