Jelajahi Sumber

评估项目作废

sangwenwei 1 tahun lalu
induk
melakukan
4a4fd7088f

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

@@ -675,4 +675,26 @@ public class ProjectListController {
         }
         return ResponseEntity.ok("操作成功");
     }
+
+    /*8
+    保存项目作废信息
+     */
+    @ApiOperation(value = "流程保存")
+    @PostMapping(value = "/saveCancellation")
+    public ResponseEntity saveCancellation(@RequestBody ProjectListDto projectListDto) throws Exception{
+        String id = projectListService.saveCancellation(projectListDto);
+        return ResponseUtil.newInstance().add("businessTable", "program_cancellation").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改项目作废状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改项目作废状态值status")
+    @PostMapping(value = "/updateStatusByCancellId")
+    public ResponseEntity<String> updateStatusByCancellId(@RequestBody ProjectListDto dto) {
+        String s = projectListService.updateStatusByCancellId(dto);
+        return ResponseEntity.ok(s);
+    }
 }

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

@@ -461,6 +461,16 @@ public class ProgramProjectListInfo extends BaseEntity {
     @TableField(exist = false)
     private String year;
 
+    /*8
+    作废信息
+     */
+    private String cancellId;
+    private String procInsIdCancell;
+    private String cancellationStatus;
+    private String taskIdCan;
+    private List<String> auditUserIdsCan;
+
+
 
 
 }

+ 11 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/ProgramCancellationMapper.java

@@ -0,0 +1,11 @@
+package com.jeeplus.assess.program.configuration.projectList.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.assess.program.configuration.projectList.domain.ProgramCancellation;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface ProgramCancellationMapper extends BaseMapper<ProgramCancellation> {
+    void updateStatusById(@Param("cancenllId") String cancellId,@Param("cancellationStatus") String cancellationStatus);
+}

+ 11 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramCancellationMapper.xml

@@ -0,0 +1,11 @@
+<?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.program.configuration.projectList.mapper.ProgramCancellationMapper">
+    <update id="updateStatusById">
+        update program_cancellation set status = #{cancellationStatus} where id = #{cancenllId}
+    </update>
+
+
+
+
+</mapper>

+ 12 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -160,7 +160,11 @@
            art2.ID_ as task_id_audit2,
            art3.ID_ as task_id_audit3,
            artd.ID_ as task_id_issued,
-           art_archive.ID_ as task_id_archive
+           art_archive.ID_ as task_id_archive,
+           pc.id as cancellId,
+            pc.proc_ins_id AS procInsIdCancell,
+            pc.status as cancellationStatus,
+            artCan.ID_ as task_id_can
         FROM
             program_project_list_info a
             LEFT JOIN sys_user b ON a.create_by_id = b.id
@@ -179,6 +183,8 @@
             LEFT JOIN act_ru_task art3 ON pa3.proc_ins_id = art3.PROC_INST_ID_
             LEFT JOIN act_ru_task artd ON d.proc_ins_id = artd.PROC_INST_ID_
             LEFT JOIN act_ru_task art_archive ON pa.proc_ins_id = art_archive.PROC_INST_ID_
+            left join program_cancellation pc on pc.project_id = a.id and pc.del_flag = '0'
+            LEFT JOIN act_ru_task artCan ON pc.proc_ins_id = artCan.PROC_INST_ID_
             ${ew.customSqlSegment}
             ORDER BY a.create_by_id = #{userId} desc,
             <if test="archiveStatusFlag == 1">
@@ -577,7 +583,9 @@
            pa.is_papers_archive,
            pa.is_invoice,
            pa.year,
-
+            pc.id as cancellId,
+            pc.proc_ins_id AS procInsIdCancell,
+            pc.status as cancellationStatus,
            d.id AS issued_id,
            d.proc_ins_id AS procInsId4,
            d.status AS issued_status
@@ -591,7 +599,8 @@
             LEFT JOIN program_audit pa3 ON pa3.program_id = a.id and pa3.audit_level = '3' and pa3.del_flag = '0'
             LEFT JOIN program_archive pa ON pa.program_id = a.id and pa.del_flag = '0'
             LEFT JOIN proofread_issued d ON a.id = d.project_id
-        where a.id = #{id}
+            left join program_cancellation pc on pc.project_id = a.id and pc.del_flag = '0'
+        where a.id = #{id} or pc.id = #{id}
     </select>
 
     <select id="findList" resultType="com.jeeplus.assess.program.configuration.projectList.service.dto.ExportFileDto">

+ 51 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java

@@ -98,6 +98,9 @@ public class ProjectListService {
     private IFlowableApi flowTaskService;
     @Autowired
     private ProgramMembersService programMembersService;
+
+    @Autowired
+    private ProgramCancellationMapper programCancellationMapper;
 //    @Autowired
 //    private UserService userService;
 
@@ -571,7 +574,7 @@ public class ProjectListService {
         BeanUtils.copyProperties(info, dto);
         // 查询联系人列表
         LambdaQueryWrapper<ProgramProjectListLink> linkWrapper = new LambdaQueryWrapper<>();
-        linkWrapper.eq(ProgramProjectListLink::getInfoId, id);
+        linkWrapper.eq(ProgramProjectListLink::getInfoId, info.getId());
         linkWrapper.eq(ProgramProjectListLink::getDelFlag, 0);
         List<ProgramProjectListLink> links = projectLinkMapper.selectList(linkWrapper);
         if (CollectionUtils.isNotEmpty(links)) {
@@ -579,7 +582,7 @@ public class ProjectListService {
         }
         // 查询成员列表
         LambdaQueryWrapper<ProgramProjectListMember> memberWrapper = new LambdaQueryWrapper<>();
-        memberWrapper.eq(ProgramProjectListMember::getInfoId, id);
+        memberWrapper.eq(ProgramProjectListMember::getInfoId, info.getId());
         memberWrapper.eq(ProgramProjectListMember::getDelFlag, 0);
         List<ProgramProjectListMember> members = projectMemberMapper.selectList(memberWrapper);
         if (CollectionUtils.isNotEmpty(members)) {
@@ -594,7 +597,7 @@ public class ProjectListService {
             dto.setMembers(members);
         }
         // 查询附件信息
-        List<WorkAttachmentInfo> files = workContractInfoMapper.findDtos(id);
+        List<WorkAttachmentInfo> files = workContractInfoMapper.findDtos(info.getId());
         if (CollectionUtils.isNotEmpty(files)) {
             for (WorkAttachmentInfo i : files) {
                 i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
@@ -821,6 +824,12 @@ public class ProjectListService {
                     item.setAuditUserIdsArchive(flowTaskService.getTaskAuditUsers(item.getTaskIdArchive()));  // 获取数据审核人
                 }
             }
+            // 作废
+            if (StringUtils.isNotBlank(item.getTaskIdCan()) && StringUtils.isNotBlank(item.getCancellationStatus())) {
+                if ("2".equals(item.getCancellationStatus())) { // “审核中”的数据要获取数据审核人
+                    item.setAuditUserIdsCan(flowTaskService.getTaskAuditUsers(item.getTaskIdCan()));  // 获取数据审核人
+                }
+            }
         });
         for (ProgramProjectListInfo item : pageList.getRecords()) {
             //判断项目是否归档
@@ -1918,4 +1927,43 @@ public class ProjectListService {
         }
         return "0";
     }
+
+    /**
+     * 保存作废信息
+     * @param projectListDto
+     * @return
+     */
+    public String saveCancellation(ProjectListDto projectListDto) {
+        String canId="";
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (StringUtils.isNotBlank(projectListDto.getCancellId())){
+            ProgramCancellation programCancellation = new ProgramCancellation();
+            programCancellation.setId(projectListDto.getCancellId());
+            programCancellation.setProjectId(projectListDto.getId());
+            programCancellation.setUpdateById(userDTO.getId());
+            programCancellation.setUpdateTime(new Date());
+            programCancellation.setStatus(projectListDto.getStatus());
+            programCancellationMapper.updateById(programCancellation);
+            canId=projectListDto.getCancellId();
+        }else {
+            String id = UUID.randomUUID().toString().replace("-", "");
+            ProgramCancellation programCancellation = new ProgramCancellation();
+            programCancellation.setId(id);
+            programCancellation.setProjectId(projectListDto.getId());
+            programCancellation.setStatus(projectListDto.getStatus());
+            programCancellationMapper.insert(programCancellation);
+            canId=id;
+        }
+        return canId;
+    }
+
+    /**
+     * 根据id修改作废状态
+     * @param dto
+     * @return
+     */
+    public String updateStatusByCancellId(ProjectListDto dto) {
+        programCancellationMapper.updateStatusById(dto.getCancellId(),dto.getCancellationStatus());
+        return "操作成功";
+    }
 }

+ 9 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/dto/ProjectListDto.java

@@ -176,4 +176,13 @@ public class ProjectListDto extends BaseEntity {
     private String isPapersArchive;	//底稿是否存档
     private String year;	//年份
 
+    /*
+    作废信息
+     */
+    private String cancellId;
+    private String procInsIdCancell;
+    private String cancellationStatus;
+    private String taskIdCan;
+    private List<String> auditUserIdsCan;
+
 }