فهرست منبع

项目批次整改

wangming 1 سال پیش
والد
کامیت
5639c2d8a3

+ 11 - 7
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/LuckysheetServiceImpl.java

@@ -1,10 +1,10 @@
 package com.rongwei.bscommon.sys.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bscommon.sys.feign.LuckySheetService;
+import com.rongwei.bscommon.sys.service.ZhcxProjectManageRectifyBatchService;
 import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
 import com.rongwei.bscommon.sys.utils.LuckySheet4SummaryHelp;
 import com.rongwei.bsentity.domain.LuckysheetDo;
@@ -12,6 +12,7 @@ import com.rongwei.bscommon.sys.dao.LuckysheetDao;
 import com.rongwei.bscommon.sys.service.LuckysheetService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
+import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
 import com.rongwei.bsentity.dto.luckysheet.CoverageUpdateJsonDataRequest;
 import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
 import com.rongwei.bsentity.dto.project.UpdateDataVerificationRequest;
@@ -42,6 +43,9 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
     @Autowired
     private LuckySheetService luckySheetService;
 
+    @Autowired
+    private ZhcxProjectManageRectifyBatchService projectManageRectifyBatchService;
+
     /**
      * 生成项目汇总文件
      *
@@ -72,14 +76,14 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
     public void updateDataVerification(UpdateDataVerificationRequest req) {
 
         //项目相关信息
-        ZhcxProjectManageDo project = projectManageService.getById(req.getProjectId()); //项目信息
+        ZhcxProjectManageRectifyBatchDo batchDo = projectManageRectifyBatchService.getById(req.getBatchId());//项目信息
 
         //下拉json
-        JSONObject dropdownJson = assembleDataVerification(project);
+        JSONObject dropdownJson = assembleDataVerification(batchDo);
 
         //更新excel中json
         JSONObject whereObj = new JSONObject();
-        whereObj.put("list_id", project.getSummaryfiles());
+        whereObj.put("list_id", batchDo.getSummaryfiles());
         whereObj.put("block_id", "fblock");
         whereObj.put("index", 1);
 
@@ -94,12 +98,12 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
     /**
      * 组装
      *
-     * @param project
+     * @param batchDo
      * @return
      */
-    private JSONObject assembleDataVerification(ZhcxProjectManageDo project) {
+    private JSONObject assembleDataVerification(ZhcxProjectManageRectifyBatchDo batchDo) {
         //获取第一页数据最大行数
-        List<JSONObject> sheetList = luckySheetService.getExcelJson(project.getSummaryfiles());
+        List<JSONObject> sheetList = luckySheetService.getExcelJson(batchDo.getSummaryfiles());
         if(ObjectUtil.isEmpty(sheetList)) {
             throw new CustomException("整改数据不存在");
         }

+ 6 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageRectifyBatchServiceImpl.java

@@ -11,6 +11,8 @@ import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+
 /**
  * <p>
  * 项目管理-整改批次 服务实现类
@@ -41,6 +43,10 @@ public class ZhcxProjectManageRectifyBatchServiceImpl extends ServiceImpl<ZhcxPr
 
         //组装汇总文件参数
         ProjectSummaryParamExcelDto paramExcelDto = projectManageService.assembleProjectSummaryParam(batchDo.getProjectid());
+
+        String[] mochineNos = batchDo.getMachineno().split(",");
+        paramExcelDto.setDeviceNumberList(Arrays.asList(mochineNos));
+
         JSONObject lssResult = luckySheetService.genLuckysheetExcel(paramExcelDto);
         String listId = lssResult.getString("data");
 

+ 18 - 6
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.aspose.cells.*;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.rongwei.bscommon.sys.config.api.ResponseVO;
 import com.rongwei.bscommon.sys.dao.LuckysheetDao;
@@ -15,12 +16,9 @@ import com.rongwei.bscommon.sys.service.*;
 import com.rongwei.bscommon.sys.utils.LuckySheet4SummaryHelp;
 import com.rongwei.bscommon.sys.utils.ProjectSummaryExcelHelp;
 import com.rongwei.bscommon.sys.utils.XlsSheetUtil;
-import com.rongwei.bsentity.domain.ZhcxProjectDeviceNumberDo;
-import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
+import com.rongwei.bsentity.domain.*;
 import com.rongwei.bscommon.sys.dao.ZhcxProjectManageDao;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwei.bsentity.domain.ZhcxProjectRectifyDo;
-import com.rongwei.bsentity.domain.ZhcxProjectRectifyMachineDo;
 import com.rongwei.bsentity.dto.RectifyDto;
 import com.rongwei.bsentity.dto.RectifyMachineDto;
 import com.rongwei.bsentity.dto.RectifyReportDto;
@@ -84,6 +82,10 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
     private ZhcxProjectManageDao zhcxProjectManageDao;
     @Autowired
     private LuckySheetService luckySheetFeignService;
+    @Autowired
+    private ZhcxProjectManageRectifyBatchService projectManageRectifyBatchService;
+
+
     private static final Color[] COLORS = {Color.fromArgb(255, 255, 204),
             Color.fromArgb(210, 242, 210),
             Color.fromArgb(255, 252, 213, 180),
@@ -1076,9 +1078,19 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
      * @return
      */
     private SaveSummaryDataBo assembleSaveSummaryDataParam(SavePorjectSummaryDto dto) {
-        //机号列表
-        List<ZhcxProjectDeviceNumberDo> deviceNumList = projectDeviceNumberService.getByProjectId(dto.getProjectId());
+
+        List<ZhcxProjectDeviceNumberDo> deviceNumList = null;
         Map<String, ZhcxProjectDeviceNumberDo> deviceNumMap = new LinkedHashMap<>();
+        //机号列表
+        if(ObjectUtil.isNotEmpty(dto.getBatchId())) {
+            ZhcxProjectManageRectifyBatchDo batchDo = projectManageRectifyBatchService.getById(dto.getBatchId());
+            String[] machineIds = batchDo.getMachinenoid().split(",");
+            LambdaQueryWrapper<ZhcxProjectDeviceNumberDo> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.in(ZhcxProjectDeviceNumberDo::getId, Arrays.asList(machineIds));
+            deviceNumList = projectDeviceNumberService.list(queryWrapper);
+        } else {
+            deviceNumList = projectDeviceNumberService.getByProjectId(dto.getProjectId());
+        }
         deviceNumList.forEach(item -> deviceNumMap.put(item.getDeviceNumber(), item));
 
         //组织机构

+ 5 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/project/ExportProjectSummaryDto.java

@@ -12,6 +12,11 @@ import java.util.List;
 @Builder
 public class ExportProjectSummaryDto {
 
+    /**
+     * 批次id
+     */
+    private String batchId;
+
     /**
      * excel数据
      */

+ 5 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/project/SavePorjectSummaryDto.java

@@ -12,6 +12,11 @@ import java.util.List;
 @Builder
 public class SavePorjectSummaryDto {
 
+    /**
+     * 批次id
+     */
+    private String batchId;
+
     /**
      * 项目id
      */

+ 5 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/project/UpdateDataVerificationRequest.java

@@ -10,4 +10,9 @@ import lombok.*;
 public class UpdateDataVerificationRequest {
 
     private String projectId;
+
+    /**
+     * 批次id
+     */
+    private String batchId;
 }