lizhenhao 2 år sedan
förälder
incheckning
6ae469395a

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

@@ -11,6 +11,7 @@ import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
@@ -20,6 +21,7 @@ import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
 import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.signature.utils.SignaturePostUtil;
@@ -35,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
@@ -74,6 +77,21 @@ public class CwProjectReportController {
     }
 
     /**
+     * 签章附件保存
+     * @return
+     */
+    @ApiLog(value = "签章附件保存", type = LogTypeEnum.SAVE)
+    @PostMapping("saveSignFiles")
+    public ResponseEntity saveSignFiles(@RequestBody CwProjectReportData reportData) {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtil.isEmpty(reportData.getCwFileInfoList())) {
+            reportData.setCwFileInfoList(new ArrayList<>());
+        }
+        projectReportService.updateFiles(reportData.getCwFileInfoList(),userDTO,reportData.getId());
+        return ResponseEntity.ok("操作成功");
+    }
+
+    /**
      * 查询财务项目信息列表
      * @param projectReportData
      * @param page
@@ -371,4 +389,17 @@ public class CwProjectReportController {
         List<CwProjectReport> cwProjectReportList = projectReportService.getIdByContractId(contractId, cwProjectReport);
         return ResponseEntity.ok(cwProjectReportList);
     }
+
+    /**
+     * 生成报告归档信息
+     * @param reportId
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("saveReportArchive")
+    @ApiOperation(value = "生成报告归档信息")
+    public ResponseEntity saveReportArchive(String reportId) throws Exception {
+        projectReportService.saveReportArchive(reportId);
+        return ResponseEntity.ok("操作成功");
+    }
 }

+ 9 - 10
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportReviewService.java

@@ -1,5 +1,7 @@
 package com.jeeplus.test.cw.projectReport.service;
 
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
@@ -198,16 +200,13 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
                 }
             }
         }
-        if (review.getReviewStatus().equals("5")) {
-            CwProjectReport cwProjectReport = cwProjectReportService.getById(reportData.getId());
-            CwProjectReportArchive cwProjectReportArchive = new CwProjectReportArchive();
-            cwProjectReportArchive.setStatus("0");
-            cwProjectReportArchive.setReportId(reportData.getId());
-            cwProjectReportArchive.setCreateBy(cwProjectReport.getCreateBy());
-            cwProjectReportArchive.setProjectId(cwProjectReport.getProjectId());
-            String fileNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportArchiveDTO.BIZ_CODE);
-            cwProjectReportArchive.setFileNumber(fileNumber);
-            cwProjectReportArchiveMapper.insert(cwProjectReportArchive);
+        if (ObjectUtil.isNotEmpty(reportData)) {
+            if (ObjectUtil.isNotEmpty(reportData.getReportDate())) {
+                CwProjectInfoData line = new CwProjectInfoData();
+                line.setReportDate(reportData.getReportDate());
+                line.setReportId(reportData.getId());
+                infoMapper.update(line, new QueryWrapper<CwProjectInfoData>().lambda().eq(CwProjectInfoData::getReportId,reportData.getId()));
+            }
         }
         mapper.updateById(review);
         //将关联的项目信息的状态改为6

+ 21 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -37,6 +37,9 @@ import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchive;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveMapper;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientBaseWrapper;
@@ -131,6 +134,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     @Resource
     private CwProjectReportReviewMapper mapper;
 
+    @Resource
+    private CwProjectReportService cwProjectReportService;
+    @Resource
+    private CwProjectReportArchiveMapper cwProjectReportArchiveMapper;
+
     /**
      * 保存项目以及其他相关信息
      * @param reportData
@@ -1585,4 +1593,17 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         }
         return new ArrayList<>();
     }
+
+    public void saveReportArchive (String reportId) throws Exception {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        CwProjectReport cwProjectReport = cwProjectReportService.getById(reportId);
+        CwProjectReportArchive cwProjectReportArchive = new CwProjectReportArchive();
+        cwProjectReportArchive.setStatus("0");
+        cwProjectReportArchive.setReportId(reportId);
+        cwProjectReportArchive.setCreateBy(cwProjectReport.getCreateBy());
+        cwProjectReportArchive.setProjectId(cwProjectReport.getProjectId());
+        String fileNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportArchiveDTO.BIZ_CODE);
+        cwProjectReportArchive.setFileNumber(fileNumber);
+        cwProjectReportArchiveMapper.insert(cwProjectReportArchive);
+    }
 }