ソースを参照

报告作废调整

lizhenhao 2 年 前
コミット
e4dc5d0487

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

@@ -1,5 +1,6 @@
 package com.jeeplus.test.cw.reportCancellApply.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.logging.annotation.ApiLog;
@@ -109,4 +110,11 @@ public class ReportCancellApplyController {
     public ResponseEntity delete(String ids) {
         return applyService.deleteByIds(ids);
     }
+
+    @ApiLog("查询财务报告数据")
+    @GetMapping("queryByNo")
+    public ResponseEntity queryByNo(@RequestParam("no") String no) {
+        CwProjectReportData projectReportData = applyService.queryByNo ( no );
+        return ResponseEntity.ok(projectReportData);
+    }
 }

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

@@ -38,4 +38,6 @@ public interface ReportCancellApplyMapper extends BaseMapper<ReportCancellApply>
     IPage<ReportInfoDto> findList(Page<ReportInfoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportInfoDto> queryWrapper);
 
     ReportCancellApply selectByArchivedId(String id);
+
+    String queryReportIdByReportNo(String no);
 }

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

@@ -111,4 +111,8 @@
         left join cw_project_report_cancell_apply_archived b on a.id = b.archive_id
         where b.id = #{id}
     </select>
+    <select id="queryReportIdByReportNo" resultType="string">
+        select report_id
+        from cw_project_report_new_line where del_flag = '0' and report_no = #{no}
+    </select>
 </mapper>

+ 22 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/ReportCancellApplyService.java

@@ -23,6 +23,7 @@ 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.service.CwProjectReportService;
 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;
@@ -69,6 +70,9 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
     @Autowired
     private FlowTaskService flowTaskService;
 
+    @Resource
+    private CwProjectReportService projectReportService;
+
     /**
      * 差选项目列表信息
      * @param page
@@ -138,7 +142,13 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
 
     public ReportInfoDto queryById(String id) {
         ReportInfoDto reportData = applyMapper.queryById(id);
-
+        if (ObjectUtil.isNotEmpty(reportData) && StringUtils.isNotBlank(reportData.getReportNo())) {
+            String reportId = applyMapper.queryReportIdByReportNo(reportData.getReportNo());
+            if (StringUtils.isNotBlank(reportId)) {
+                CwProjectReportData cwProjectReportData = projectReportService.queryById(reportId);
+                reportData.setReportDetail(cwProjectReportData);
+            }
+        }
         return reportData;
     }
 
@@ -306,4 +316,15 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
         this.removeByIds (Lists.newArrayList (idArray));
         return ResponseEntity.ok ("删除成功");
     }
+
+    public CwProjectReportData queryByNo(String no) {
+        CwProjectReportData cwProjectReportData = new CwProjectReportData();
+        if (StringUtils.isNotBlank(no)) {
+            String reportId = applyMapper.queryReportIdByReportNo(no);
+            if (StringUtils.isNotBlank(reportId)) {
+                cwProjectReportData = projectReportService.queryById(reportId);
+            }
+        }
+        return cwProjectReportData;
+    }
 }

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

@@ -2,6 +2,7 @@ package com.jeeplus.test.cw.reportCancellApply.service.dto;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import lombok.Data;
 
 import java.util.List;
@@ -135,4 +136,9 @@ public class ReportInfoDto extends BaseDTO {
      * 报告id
      */
     private String reportId;
+
+    /**
+     * 报告详情
+     */
+    private CwProjectReportData reportDetail;
 }