Przeglądaj źródła

财务-报告作废流程

wangqiang 2 lat temu
rodzic
commit
f601a9ab31

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

@@ -25,4 +25,11 @@ public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
     List<String> getReportNo();
 
     List<CwProjectInfoData> selectInfoByReportId(String id);
+
+    /**
+     * 根据项目编码查流水号
+     * @param projectNo
+     * @return
+     */
+    String selectReportNumberByProjectNo(String projectNo);
 }

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

@@ -3,6 +3,7 @@ package com.jeeplus.test.cw.projectReport.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportCancel;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 报告文号报废表
@@ -12,5 +13,12 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface CwProjectReportCancelMapper extends BaseMapper<CwProjectReportCancel> {
 
-    void updateFlag(String flag);
+    /**
+     * 修改报废报告文号状态
+     * @param flag
+     * @param reportNo
+     */
+    void updateFlag(@Param("flag") String flag, @Param("reportNo") String reportNo);
+
+    void deleteByReportNo(String reportNo);
 }

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

@@ -16,4 +16,7 @@
     <select id="selectInfoByReportId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData">
         select * from cw_project_report_new_line where report_id = #{id}
     </select>
+    <select id="selectReportNumberByProjectNo" resultType="java.lang.String">
+        SELECT DISTINCT report_number FROM `cw_project_report_new_line` WHERE report_number like CONCAT('%',#{projectNo},'%') ORDER BY report_number desc
+    </select>
 </mapper>

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

@@ -2,6 +2,9 @@
 <!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.CwProjectReportCancelMapper">
     <update id="updateFlag">
-        update cw_project_report_cancel set del_flag = #{flag}
+        update cw_project_report_cancel set del_flag = #{flag} where report_no = #{reportNo}
     </update>
+    <delete id="deleteByReportNo">
+        delete from cw_project_report_cancel where report_no = #{reportNo}
+    </delete>
 </mapper>

+ 6 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -147,6 +147,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                 });
                 //先去数据库中查是否有数据,有则更新,无则添加
                 CwProjectInfoData cwProjectInfoData = infoMapper.selectById(in.getId());
+                //报告流水号生成  根据项目编号去new_line表查询
+                String reportNumber = infoMapper.selectReportNumberByProjectNo(report.getProjectNumber());
+
                 if (cwProjectInfoData == null){
                     try {
                         //在插入报告文号前先去报告文号报废表中根据时间排序查看是否有报告文号,有则使用,delflag改为1
@@ -155,7 +158,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                             for (int i = 0; i< finalInfoList.size(); i++){
                                 in.setReportNo(reportNo.get(i));
                                 //修改报废表的对应数据delflag为1
-                                cancelMapper.updateFlag("1");
+                                cancelMapper.updateFlag("1",reportNo.get(i));
                             }
                         }else {
                             String documentNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectInfoData.BIZ_CODE);
@@ -324,8 +327,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         if (StringUtils.isNotEmpty(projectReportData.getProjectMasterName())) {
             queryWrapper.like("e.name", projectReportData.getProjectMasterName());
         }
-        if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getName())) {
-            queryWrapper.like("e.name", projectReportData.getCreateBy().getName());
+        if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
+            queryWrapper.like("a.create_by", projectReportData.getCreateBy().getId());
         }
         //4、签约时间(区间)
         String[] contractDates = projectReportData.getContractDates();

+ 112 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/controller/ReportCancellApplyController.java

@@ -0,0 +1,112 @@
+package com.jeeplus.test.cw.reportCancellApply.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.reportCancellApply.service.ReportCancellApplyService;
+import com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-18 17:32
+ **/
+@RestController
+@Api("财务报告文号报废")
+@RequestMapping(value = "/cwProjectReportCancell")
+public class ReportCancellApplyController {
+
+    @Resource
+    private ReportCancellApplyService applyService;
+
+    /**
+     * 查询财务项目报告信息列表
+     * @param reportInfoDto
+     * @param page
+     * @return
+     */
+    @ApiLog("查询财务项目报告信息列表")
+    @PreAuthorize("hasAuthority('cwProjectReportCancell:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<ReportInfoDto>> data(ReportInfoDto reportInfoDto, Page<ReportInfoDto> page) throws Exception {
+        IPage<ReportInfoDto> result = new Page<ReportInfoDto>();
+        result = applyService.findList (page,reportInfoDto);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 保存报告作废信息-流程
+     * @param reportData
+     * @return
+     */
+    @ApiLog(value = "保存报告作废信息-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectReportCancell:add','cwProjectReportCancell:edit')")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody ReportInfoDto reportData) throws Exception {
+        String id = applyService.saveForm(reportData);
+        return ResponseUtil.newInstance().add("businessTable", "cw_project_report_cancell_apply").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 查询客户信息数据
+     * @param id
+     * @return
+     */
+    @ApiLog("查询报告作废数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReportCancell:view','cwProjectReportCancell:add','cwProjectReportCancell:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        ReportInfoDto reportInfoDto = applyService.queryById ( id );
+        return ResponseEntity.ok (reportInfoDto);
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param data
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody ReportInfoDto data) {
+        String s = applyService.updateStatusById(data);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询信息列表
+     * @param projectReportData
+     * @param page
+     * @return
+     */
+    @ApiLog("查询信息列表")
+    @PreAuthorize("hasAuthority('cwProjectReportCancell:findList')")
+    @GetMapping("findList")
+    public ResponseEntity<IPage<ReportInfoDto>> findList(ReportInfoDto projectReportData, Page<ReportInfoDto> page) throws Exception {
+        IPage<ReportInfoDto> result = new Page<ReportInfoDto>();
+        result = applyService.getList (page,projectReportData);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 删除业务提问
+     * @param ids
+     * @return
+     */
+    @ApiLog(value = "删除财务报告信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize ("hasAuthority('cwProjectReport:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        return applyService.deleteByIds(ids);
+    }
+}

+ 95 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/domain/ReportCancellApply.java

@@ -0,0 +1,95 @@
+package com.jeeplus.test.cw.reportCancellApply.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 报告文号报废表
+ * @author: 王强
+ * @create: 2022-11-18 17:34
+ **/
+@Data
+@TableName("cw_project_report_cancell_apply")
+public class ReportCancellApply extends BaseEntity {
+
+    @TableField(exist = false)
+    private String createById;
+
+    /**
+     * 项目编号
+     */
+    @TableField(exist = false)
+    private String projectNumber;
+
+    /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    private String userName;
+
+    /**
+     * 报告所属部门
+     */
+    @TableField(exist = false)
+    private String departmentName;
+
+    /**
+     * 项目名称
+     */
+    @TableField(exist = false)
+    private String projectName;
+
+    /**
+     * 报告主办人
+     */
+    @TableField(exist = false)
+    private String reportSponsor;
+
+    /**
+     * 报告申请单号
+     */
+    @TableField(exist = false)
+    private String documentNo;
+
+    /**
+     * 单据状态(报告流程status为5的)
+     */
+    @TableField(exist = false)
+    private String documentStatus;
+
+    /**
+     * 项目经理姓名
+     */
+    @TableField(exist = false)
+    private String projectMasterName;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /**
+     * 新建行id report_new_line_id
+     */
+    private String reportNewLineId;
+
+    /**
+     * 作废原因
+     */
+    private String cancellateReason;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+}

+ 39 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/mapper/ReportCancellApplyMapper.java

@@ -0,0 +1,39 @@
+package com.jeeplus.test.cw.reportCancellApply.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
+import com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 报告文号报废mapper
+ * @author: 王强
+ * @create: 2022-11-18 17:35
+ **/
+@Mapper
+public interface ReportCancellApplyMapper extends BaseMapper<ReportCancellApply> {
+
+    /**
+     * 查询报告数据集合
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    IPage<ReportInfoDto> getList(Page<ReportInfoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportInfoDto> queryWrapper);
+
+    ReportInfoDto queryById(@Param("id") String id);
+
+    /**
+     * 查询报告数据集合
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    IPage<ReportInfoDto> findList(Page<ReportInfoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportInfoDto> queryWrapper);
+}

+ 76 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/mapper/xml/ReportCancellApplyMapper.xml

@@ -0,0 +1,76 @@
+<?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.reportCancellApply.mapper.ReportCancellApplyMapper">
+    <select id="findList" resultType="com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto">
+        SELECT a.document_no,
+         case a.`status` WHEN '5' THEN '已完成' END as documentStatus,
+        b.report_no,
+        c.project_name,c.project_master_id,su.name as user_name,
+        su2.name as project_master_name,
+        b.id as report_new_line_id
+        FROM cw_project_report a
+        left join cw_project_report_new_line b
+        on a.id = b.report_id
+        LEFT JOIN cw_project_records c
+        on a.project_id = c.id
+        left join sys_user su on su.id = a.create_by and su.del_flag = '0'
+        left join sys_user su2 on su2.id = c.project_master_id and su2.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+    <select id="queryById" resultType="com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto">
+        SELECT a.id,a.create_by,a.create_date,
+        a.report_new_line_id,
+        a.cancellate_reason,a.report_no,a.proc_ins_id,a.status,a.process_definition_id,
+        c.document_no,case c.`status` WHEN '5' THEN '已完成' END as documentStatus,
+        d.project_name,d.project_master_id,
+        su.name as user_name,
+        su2.name as project_master_name
+
+        FROM cw_project_report_cancell_apply a
+        LEFT JOIN cw_project_report_new_line b
+        on a.report_new_line_id = b.id
+        LEFT JOIN cw_project_report c
+        on b.report_id = c.id
+        LEFT JOIN cw_project_records d
+        on c.project_id = d.id
+        left join sys_user su on su.id = a.create_by and su.del_flag = '0'
+        left join sys_user su2 on su2.id = d.project_master_id and su2.del_flag = '0'
+        where a.del_flag = '0' and a.id = #{id}
+    </select>
+    <select id="getList" resultType="com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto">
+        SELECT
+        a.id,
+        a.create_by as createById,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.remarks,
+        a.status,
+				a.proc_ins_id,
+        a.process_definition_id,
+				c.document_no,
+				c.office_id,
+				d.project_number as projectNumber,
+				d.project_name,
+				d.project_master_id,
+				e.name as departmentName,
+				f.name as userName,
+				g.name as projectMasterName
+
+				FROM cw_project_report_cancell_apply a
+				LEFT JOIN cw_project_report_new_line b
+				on a.report_new_line_id = b.id
+				LEFT JOIN cw_project_report c
+				on b.report_id = c.id
+				LEFT JOIN cw_project_records d
+				on c.project_id = d.id
+				LEFT JOIN sys_office e
+        on c.office_id = e.id
+				LEFT JOIN sys_user f
+        on a.create_by = f.id
+				LEFT JOIN sys_user g
+        on d.project_master_id = g.id
+        ${ew.customSqlSegment}
+    </select>
+</mapper>

+ 201 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/ReportCancellApplyService.java

@@ -0,0 +1,201 @@
+package com.jeeplus.test.cw.reportCancellApply.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+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.projectRecords.service.mapstruct.CwProjectRecordsWrapper;
+import com.jeeplus.test.cw.projectReport.domain.*;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportCancelMapper;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
+import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
+import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
+import com.jeeplus.test.cw.reportCancellApply.mapper.ReportCancellApplyMapper;
+import com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import liquibase.pro.packaged.A;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-18 17:36
+ **/
+@Service
+@Transactional
+public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMapper, ReportCancellApply> {
+
+    @Resource
+    private ReportCancellApplyMapper applyMapper;
+
+    @Resource
+    private CwProjectReportCancelMapper cancelMapper;
+
+    /**
+     * 差选项目列表信息
+     * @param page
+     * @param projectReportData
+     * @return
+     * @throws Exception
+     */
+    public IPage<ReportInfoDto> getList(Page<ReportInfoDto> page, ReportInfoDto projectReportData) throws Exception{
+        QueryWrapper<ReportInfoDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,ReportInfoDto.class);
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.orderByDesc("a.create_date");
+        //条件
+        if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
+            queryWrapper.like("b.project_number", projectReportData.getProjectNumber());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
+            queryWrapper.like("b.project_name", projectReportData.getProjectName());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getProjectMasterName())) {
+            queryWrapper.like("e.name", projectReportData.getProjectMasterName());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
+            queryWrapper.like("a.create_by", projectReportData.getCreateBy().getId());
+        }
+
+        IPage<ReportInfoDto> list = applyMapper.getList(page, queryWrapper);
+        return list;
+    }
+
+    /**
+     * 修改状态
+     * @param data
+     * @return
+     */
+    public String updateStatusById(ReportInfoDto data) {
+        ReportCancellApply cwProjectRecords = new ReportCancellApply();
+        BeanUtils.copyProperties(data, cwProjectRecords);
+        applyMapper.update(cwProjectRecords, new QueryWrapper<ReportCancellApply>().lambda().eq(ReportCancellApply::getId, cwProjectRecords.getId()));
+        return "操作成功";
+    }
+
+    public ReportInfoDto queryById(String id) {
+        ReportInfoDto reportData = applyMapper.queryById(id);
+        return reportData;
+    }
+
+    /**
+     * 保存项目以及其他相关信息
+     * @param reportData
+     * @return
+     * @throws Exception
+     */
+    public synchronized String saveForm(ReportInfoDto reportData) throws Exception{
+        if (StringUtils.isNotEmpty(reportData.getId())){
+
+            ReportCancellApply report = applyMapper.selectById(reportData.getId());
+            if (report != null){
+                reportData.setCreateBy(reportData.getCreateBy());
+                return update(reportData);
+            }
+        }
+        return add(reportData);
+
+    }
+
+    /**
+     * 合同登记修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(ReportInfoDto reportData) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        //修改
+        ReportCancellApply report = new ReportCancellApply();
+        BeanUtils.copyProperties(reportData, report);
+        report.setUpdateBy(userDTO.getId());
+        report.setUpdateDate(new Date());
+        //向存放报废报告号表中添加数据
+        CwProjectReportCancel cancel = new CwProjectReportCancel();
+        cancel.setId(UUID.randomUUID().toString().replace("-", ""));
+        cancel.setReportNo(reportData.getReportNo());
+        cancelMapper.insert(cancel);
+        applyMapper.updateById(report);
+
+        return report.getId();
+    }
+
+    /**
+     * 新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(ReportInfoDto reportData) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+
+        ReportCancellApply report = new ReportCancellApply();
+        BeanUtils.copyProperties(reportData, report);
+        if (ObjectUtil.isNotEmpty(report)) {
+            if (StringUtils.isBlank(report.getCreateBy())) {
+                report.setCreateBy(UserUtils.getCurrentUserDTO().getId());
+                String id = UUID.randomUUID().toString().replace("-", "");
+                report.setId(id);
+            }
+        }
+        //向存放报废报告号表中添加数据
+        CwProjectReportCancel cancel = new CwProjectReportCancel();
+        cancel.setId(UUID.randomUUID().toString().replace("-", ""));
+        cancel.setReportNo(reportData.getReportNo());
+        cancelMapper.insert(cancel);
+        this.applyMapper.insert(report);
+        return report.getId();
+    }
+
+    /**
+     * 差选项目列表信息
+     * @param page
+     * @param reportInfoDto
+     * @return
+     * @throws Exception
+     */
+    public IPage<ReportInfoDto> findList(Page<ReportInfoDto> page, ReportInfoDto reportInfoDto) throws Exception{
+        QueryWrapper<ReportInfoDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (reportInfoDto,ReportInfoDto.class);
+
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.eq("a.status","5");
+        queryWrapper.orderByDesc("a.create_date");
+        if (StringUtils.isNotEmpty(reportInfoDto.getProjectName())) {
+            queryWrapper.like("c.project_name", reportInfoDto.getProjectName());
+        }
+        IPage<ReportInfoDto> list = applyMapper.findList(page, queryWrapper);
+
+        return list;
+    }
+
+    public ResponseEntity deleteByIds(String ids) {
+        String idArray[] =ids.split(",");
+        //删除前先将报告文号给复原
+        ArrayList<String> strings = Lists.newArrayList(idArray);
+        for (int i=0;i<strings.size();i++){
+            ReportInfoDto reportInfoDto = applyMapper.queryById(strings.get(i));
+            cancelMapper.deleteByReportNo(reportInfoDto.getReportNo());
+        }
+        //将报告文号报废表的对应的报告文号给删除
+
+        this.removeByIds (Lists.newArrayList (idArray));
+        return ResponseEntity.ok ("删除成功");
+    }
+}

+ 85 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/dto/ReportInfoDto.java

@@ -0,0 +1,85 @@
+package com.jeeplus.test.cw.reportCancellApply.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 报告申请信息
+ * @author: 王强
+ * @create: 2022-11-20 11:34
+ **/
+@Data
+public class ReportInfoDto extends BaseDTO {
+    private static final long serialVersionUID = 1L;
+
+    @TableField(exist = false)
+    private String createById;
+
+    /**
+     * 项目编号
+     */
+    private String projectNumber;
+
+    /**
+     * 创建人
+     */
+    private String userName;
+
+    /**
+     * 报告所属部门
+     */
+    private String departmentName;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告主办人
+     */
+    private String reportSponsor;
+
+    /**
+     * 报告作废原因
+     */
+    private String cancellateReason;
+
+    /**
+     * 报告申请单号
+     */
+    private String documentNo;
+
+    /**
+     * 单据状态(报告流程status为5的)
+     */
+    private String documentStatus;
+
+    /**
+     * 项目经理姓名
+     */
+    private String projectMasterName;
+
+    /**
+     * 新建行id
+     */
+    private String reportNewLineId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+}