Explorar el Código

Merge remote-tracking branch 'origin/master'

zhuang hace 1 año
padre
commit
1b05eabffe
Se han modificado 21 ficheros con 869 adiciones y 819 borrados
  1. 0 20
      business-common/pom.xml
  2. 1 1
      business-common/src/main/java/com/rongwei/bscommon/sys/dao/LuckysheetDao.java
  3. 16 0
      business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxProjectManageRectifyBatchDao.java
  4. 24 3
      business-common/src/main/java/com/rongwei/bscommon/sys/feign/LuckySheetService.java
  5. 8 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/LuckysheetService.java
  6. 23 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectManageRectifyBatchService.java
  7. 17 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectManageService.java
  8. 109 87
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/LuckysheetServiceImpl.java
  9. 60 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageRectifyBatchServiceImpl.java
  10. 158 43
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java
  11. 52 638
      business-common/src/main/java/com/rongwei/bscommon/sys/utils/LuckySheet4SummaryHelp.java
  12. 28 0
      business-common/src/main/java/com/rongwei/bscommon/sys/utils/MSExcelUtil.java
  13. 172 14
      business-common/src/main/java/com/rongwei/bscommon/sys/utils/XlsSheetUtil.java
  14. 79 0
      business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectManageRectifyBatchDo.java
  15. 38 0
      business-entity/src/main/java/com/rongwei/bsentity/dto/luckysheet/CoverageUpdateJsonDataRequest.java
  16. 20 0
      business-entity/src/main/java/com/rongwei/bsentity/dto/luckysheet/DataVerificationParamBo.java
  17. 5 0
      business-entity/src/main/java/com/rongwei/bsentity/dto/project/ExportProjectSummaryDto.java
  18. 5 0
      business-entity/src/main/java/com/rongwei/bsentity/dto/project/SavePorjectSummaryDto.java
  19. 18 0
      business-entity/src/main/java/com/rongwei/bsentity/dto/project/UpdateDataVerificationRequest.java
  20. 34 11
      business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxProjectManageController.java
  21. 2 2
      business-server/src/main/resources/bootstrap.yml

+ 0 - 20
business-common/pom.xml

@@ -89,26 +89,6 @@
         </dependency>
         <!-- 解决maven打包 错误: 程序包com.sun.istack.internal不存在 - BBSMAX -->
 
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-            <version>2.2.4</version>
-        </dependency>
-
-        <!-- websocket start -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-websocket</artifactId>
-            <version>1.3.5.RELEASE</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-websocket</artifactId>
-            <version>4.3.6.RELEASE</version>
-        </dependency>
-        <!-- websocket end -->
-
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>

+ 1 - 1
business-common/src/main/java/com/rongwei/bscommon/sys/dao/LuckysheetDao.java

@@ -31,7 +31,7 @@ public interface LuckysheetDao extends BaseMapper<LuckysheetDo> {
             "o.ID, " +
             "o.PID, " +
             "o.SHORTNAME, " +
-            "so.SHORTNAME AS pshortName " +
+            "so.SHORTNAME AS PSHORTNAME " +
             "FROM " +
             "SYS_ORGANIZATION o " +
             "JOIN SYS_ORGANIZATION so ON so.ID = o.PID  " +

+ 16 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxProjectManageRectifyBatchDao.java

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 项目管理-整改批次 Mapper 接口
+ * </p>
+ *
+ * @author wm
+ * @since 2024-08-05
+ */
+public interface ZhcxProjectManageRectifyBatchDao extends BaseMapper<ZhcxProjectManageRectifyBatchDo> {
+
+}

+ 24 - 3
business-common/src/main/java/com/rongwei/bscommon/sys/feign/LuckySheetService.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.feign;
 
 import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bscommon.sys.config.api.ResponseVO;
+import com.rongwei.bsentity.dto.luckysheet.CoverageUpdateJsonDataRequest;
 import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -9,7 +10,9 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(name = "luckySheetService", url = "${luckysheet-provider.url}")
+import java.util.List;
+
+@FeignClient(name = "luckySheetService", url = "${luckysheet-provider.url}/luckysheet")
 public interface LuckySheetService {
 
     /**
@@ -18,10 +21,28 @@ public interface LuckySheetService {
      * @param excelDto
      * @return
      */
-    @PostMapping("luckysheet/api/genLuckysheetExcel")
+    @PostMapping("api/genLuckysheetExcel")
     JSONObject genLuckysheetExcel(@RequestBody ProjectSummaryParamExcelDto excelDto);
 
-    @GetMapping("luckysheet/test/get/LuckySheetJson")
+    @GetMapping("test/get/LuckySheetJson")
     ResponseVO getLuckySheetJson(@RequestParam("listId") String listId);
 
+    /**
+     * 获取整个excel json
+     *
+     * @param listId
+     * @return
+     */
+    @GetMapping("api/get/excelJson")
+    List<JSONObject> getExcelJson(@RequestParam("listId") String listId);
+
+    /**
+     * 覆盖更新jsondata
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping("api/updateCoverageJsonData")
+    ResponseVO updateJsonData(@RequestBody CoverageUpdateJsonDataRequest req);
+
 }

+ 8 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/LuckysheetService.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.service;
 
 import com.rongwei.bsentity.domain.LuckysheetDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.dto.project.UpdateDataVerificationRequest;
 
 /**
  * <p>
@@ -21,4 +22,11 @@ public interface LuckysheetService extends IService<LuckysheetDo> {
      */
     String genProjectSummaryFiles(String projectId);
 
+    /**
+     * 更新项目数据校验
+     *
+     * @param req
+     */
+    void updateDataVerification(UpdateDataVerificationRequest req);
+
 }

+ 23 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectManageRectifyBatchService.java

@@ -0,0 +1,23 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 项目管理-整改批次 服务类
+ * </p>
+ *
+ * @author wm
+ * @since 2024-08-05
+ */
+public interface ZhcxProjectManageRectifyBatchService extends IService<ZhcxProjectManageRectifyBatchDo> {
+
+    /**
+     * 生成批次整改清单
+     *
+     * @param batchId
+     * @return
+     */
+    String genProjectSummaryFiles(String batchId);
+}

+ 17 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectManageService.java

@@ -1,5 +1,6 @@
 package com.rongwei.bscommon.sys.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.rongwei.bsentity.dto.project.ExportProjectSummaryDto;
@@ -9,6 +10,7 @@ import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -28,6 +30,14 @@ public interface ZhcxProjectManageService extends IService<ZhcxProjectManageDo>
      */
     SysFileItemDo genSummaryFiles(String projectId);
 
+    /**
+     * 组装汇总文件参数
+     *
+     * @param projectId
+     * @return
+     */
+    ProjectSummaryParamExcelDto assembleProjectSummaryParam(String projectId);
+
     /**
      * 组装汇总文件参数
      *
@@ -53,4 +63,11 @@ public interface ZhcxProjectManageService extends IService<ZhcxProjectManageDo>
      * @param dto
      */
     void exportRectifyReportDataInSummary(ExportProjectSummaryDto dto, HttpServletResponse response);
+
+    /**
+     * 获取车间列表
+     *
+     * @return
+     */
+    List<JSONObject> getWorkshop();
 }

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

@@ -1,9 +1,10 @@
 package com.rongwei.bscommon.sys.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 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;
@@ -11,12 +12,19 @@ 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.dto.luckysheet.SheetConfigResultDto;
+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;
+import com.rongwei.rwcommon.base.exception.CustomException;
+import com.rongwei.rwcommon.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import static com.rongwei.bscommon.sys.utils.LuckySheet4SummaryHelp.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -35,6 +43,9 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
     @Autowired
     private LuckySheetService luckySheetService;
 
+    @Autowired
+    private ZhcxProjectManageRectifyBatchService projectManageRectifyBatchService;
+
     /**
      * 生成项目汇总文件
      *
@@ -43,15 +54,8 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
      */
     @Override
     public String genProjectSummaryFiles(String projectId) {
-
-        //项目信息
-        ZhcxProjectManageDo project = projectManageService.getById(projectId);
-
         //组装汇总文件参数
-        ProjectSummaryParamExcelDto paramExcelDto = projectManageService.assembleProjectSummaryParam(project);
-
-        //生成excel
-//        String listId = genLuckysheetObj(paramExcelDto);
+        ProjectSummaryParamExcelDto paramExcelDto = projectManageService.assembleProjectSummaryParam(projectId);
 
         JSONObject lssResult = luckySheetService.genLuckysheetExcel(paramExcelDto);
         String listId = lssResult.getString("data");
@@ -64,94 +68,112 @@ public class LuckysheetServiceImpl extends ServiceImpl<LuckysheetDao, Luckysheet
     }
 
     /**
-     * 组装汇总文件参数
+     * 更新项目数据校验
      *
-     * @param paramExcelDto
-     * @return
+     * @param req
      */
-    private SheetConfigResultDto assembleProjectSummaryTitle(ProjectSummaryParamExcelDto paramExcelDto) {
-        //合并配置
-        JSONObject mergeConfig = LuckySheet4SummaryHelp.getMergeConfig(paramExcelDto.getDeviceNumberList());
-        //边框信息
-        JSONArray borderInfo = LuckySheet4SummaryHelp.getBorderInfo(paramExcelDto.getDeviceNumberList());
-        //下拉框
-        JSONObject dataVerification = LuckySheet4SummaryHelp.getDataVerification(paramExcelDto);
-        //数据
-        JSONArray cellData = getCellData(paramExcelDto);
-        //行高
-        JSONObject rowLenObj = new JSONObject();
-        rowLenObj.put("0", 24);
-
-        return SheetConfigResultDto.builder()
-                .borderInfoConfig(borderInfo)
-                .dataVerification(dataVerification)
-                .celldata(cellData)
-                .mergeConfig(mergeConfig)
-                .rowlenConfig(rowLenObj)
+    @Override
+    public void updateDataVerification(UpdateDataVerificationRequest req) {
+
+        //项目相关信息
+        ZhcxProjectManageRectifyBatchDo batchDo = projectManageRectifyBatchService.getById(req.getBatchId());//项目信息
+
+        //下拉json
+        JSONObject dropdownJson = assembleDataVerification(batchDo);
+
+        //更新excel中json
+        JSONObject whereObj = new JSONObject();
+        whereObj.put("list_id", batchDo.getSummaryfiles());
+        whereObj.put("block_id", "fblock");
+        whereObj.put("index", 1);
+
+        CoverageUpdateJsonDataRequest updateReq = CoverageUpdateJsonDataRequest.builder()
+                .key("dataVerification")
+                .value(dropdownJson)
+                .andWhereObj(whereObj)
                 .build();
+        luckySheetService.updateJsonData(updateReq);
     }
 
     /**
-     * 获取数据
+     * 组装
      *
-     * @param paramExcelDto
+     * @param batchDo
      * @return
      */
-    public JSONArray getCellData(ProjectSummaryParamExcelDto paramExcelDto) {
-
-        String[] titleFirst = MAIN_TITLE_FIRST;
-        String[] titleSecond = MAIN_TITLE_SECOND;
-        String[] machineTitleCols = MACHINE_TITLE_COLS;
-
-        int colsSize = titleFirst.length + paramExcelDto.getDeviceNumberList().size() * machineTitleCols.length + titleSecond.length;
-        //数据
-        JSONArray celldata = LuckySheet4SummaryHelp.assembleFirstTitle(paramExcelDto.getFileName(), colsSize);
-        //二级标题1
-        JSONArray celldata1 = LuckySheet4SummaryHelp.assembleCommonCol1();
-
-        JSONArray celldata2 = new JSONArray();
-        celldata2.addAll(LuckySheet4SummaryHelp.assembleCommonRow2Col1());
-
-        //遍历机号
-        for(int m = 0, n = paramExcelDto.getDeviceNumberList().size(); m < n; m++) {
-            //机号
-            celldata1.addAll(LuckySheet4SummaryHelp.genDeviceNumberFirstTitle(paramExcelDto.getDeviceNumberList().get(m), titleFirst.length + m * machineTitleCols.length));
-            //机号标题
-            celldata2.addAll(LuckySheet4SummaryHelp.assembleDeviceNumberSecondTitle(titleFirst.length + m * machineTitleCols.length));
+    private JSONObject assembleDataVerification(ZhcxProjectManageRectifyBatchDo batchDo) {
+        //获取第一页数据最大行数
+        List<JSONObject> sheetList = luckySheetService.getExcelJson(batchDo.getSummaryfiles());
+        if(ObjectUtil.isEmpty(sheetList)) {
+            throw new CustomException("整改数据不存在");
         }
 
-        celldata1.addAll(LuckySheet4SummaryHelp.assembleCommonRow1Col2(titleFirst.length + paramExcelDto.getDeviceNumberList().size() * machineTitleCols.length));
-
-        //最后6列数据
-        celldata2.addAll(LuckySheet4SummaryHelp.assembleCommonCol2(titleFirst.length + paramExcelDto.getDeviceNumberList().size() * machineTitleCols.length));
-        celldata.addAll(celldata1);
-        celldata.addAll(celldata2);
+        JSONArray celldatas = sheetList.get(0).getJSONArray("celldata");
+        int maxRowIdx = 3;
+        Map<Integer, Integer> dataVerifyMap = new HashMap<>();
+        for(int m = 0,  n = celldatas.size(); m < n; m++) {
+            JSONObject cellData = celldatas.getJSONObject(m);
+
+            if(cellData.getIntValue("r") > maxRowIdx) {
+                maxRowIdx = cellData.getIntValue("r");
+            }
+
+            //找出所有第三行中标题所在列下标
+            //状态、施工部门、责任部门、总状态
+            if(cellData.getIntValue("r") != 2) {
+                continue;
+            }
+
+            String v = LuckySheet4SummaryHelp.getCellValue4V(cellData.getJSONObject("v"), String.class);
+            if("状态".equals(v) || "总状态".equals(v)) {
+                dataVerifyMap.put(cellData.getInteger("c"), 1);
+            } else if("施工部门".equals(v) || "责任部门".equals(v)) {
+                dataVerifyMap.put(cellData.getInteger("c"), 0);
+            }
+        }
 
-        return celldata;
+        return getDataVerification(dataVerifyMap, maxRowIdx);
     }
 
-//    public static void main(String[] args) {
-//        List<String> deviceNumList = new ArrayList<>();
-//        deviceNumList.add("1#");
-//        deviceNumList.add("2#");
-//        deviceNumList.add("3#");
-//        deviceNumList.add("4#");
-//        deviceNumList.add("5#");
-//        deviceNumList.add("6#");
-//        deviceNumList.add("7#");
-//        deviceNumList.add("8#");
-//        deviceNumList.add("9#");
-//        deviceNumList.add("10#");
-//        deviceNumList.add("11#");
-//        deviceNumList.add("12#");
-//
-//        ProjectSummaryParamExcelDto excelDto = ProjectSummaryParamExcelDto.builder()
-//                .deviceNumberList(deviceNumList)
-//                .fileName("1002000938马士基埃及桥吊项目整改文字版")
-//                .build();
-//
-//        JSONArray cellData = getCellData(excelDto);
-//
-//        System.out.println(cellData.toString(SerializerFeature.WriteMapNullValue));
-//    }
+    /**
+     * 数据校验
+     *
+     * @param dataVerifyMap
+     * @param maxRowIdx
+     * @return
+     */
+    private JSONObject getDataVerification(Map<Integer, Integer> dataVerifyMap, int maxRowIdx) {
+        JSONObject result = new JSONObject();
+
+        //数据校验值
+        //部门
+        List<JSONObject> workshopList = projectManageService.getWorkshop();
+        List<String> departList = workshopList.stream()
+                .map(item -> item.getString("SHORTNAME"))
+                .collect(Collectors.toList());
+        //状态
+        List<String> verifyStatus = LuckySheet4SummaryHelp.DATA_VERIFY_STATUS;
+        String[] vals = new String[] {StringUtils.join(departList, ","), StringUtils.join(verifyStatus, ",")};
+
+        /* 给每行指定列加上数据校验
+         * "3_4": {
+         * 			"type": "dropdown",
+         * 			"remote": false,
+         * 			"value1": "OK,X,√",
+         * 			"value2": "",
+         * 			"checked": false,
+         * 			"hintShow": false,
+         * 			"hintText": "",
+         * 			"prohibitInput": false
+         * }
+         */
+        //行
+        for(int startRows = 3; startRows <= maxRowIdx; startRows++) {
+            for(Integer colIdx : dataVerifyMap.keySet()) {
+                JSONObject statusObj = LuckySheet4SummaryHelp.getNewDataVerification(vals[dataVerifyMap.get(colIdx)]);
+                result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colIdx)), statusObj);
+            }
+        }
+        return result;
+    }
 }

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

@@ -0,0 +1,60 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rongwei.bscommon.sys.feign.LuckySheetService;
+import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
+import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
+import com.rongwei.bscommon.sys.dao.ZhcxProjectManageRectifyBatchDao;
+import com.rongwei.bscommon.sys.service.ZhcxProjectManageRectifyBatchService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+
+/**
+ * <p>
+ * 项目管理-整改批次 服务实现类
+ * </p>
+ *
+ * @author wm
+ * @since 2024-08-05
+ */
+@Service
+public class ZhcxProjectManageRectifyBatchServiceImpl extends ServiceImpl<ZhcxProjectManageRectifyBatchDao, ZhcxProjectManageRectifyBatchDo> implements ZhcxProjectManageRectifyBatchService {
+
+    @Autowired
+    private LuckySheetService luckySheetService;
+
+    @Autowired
+    private ZhcxProjectManageService projectManageService;
+
+    /**
+     * 生成批次整改清单
+     *
+     * @param batchId
+     * @return
+     */
+    @Override
+    public String genProjectSummaryFiles(String batchId) {
+
+        ZhcxProjectManageRectifyBatchDo batchDo = getById(batchId);
+
+        //组装汇总文件参数
+        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");
+
+        ZhcxProjectManageRectifyBatchDo entity = new ZhcxProjectManageRectifyBatchDo();
+        entity.setId(batchId);
+        entity.setSummaryfiles(listId);
+        updateById(entity);
+
+        return listId;
+    }
+}

+ 158 - 43
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),
@@ -113,6 +115,17 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
         return fileItemDo;
     }
 
+    /**
+     * 组装汇总文件参数
+     *
+     * @param projectId
+     * @return
+     */
+    @Override
+    public ProjectSummaryParamExcelDto assembleProjectSummaryParam(String projectId) {
+        return assembleProjectSummaryParam(getById(projectId));
+    }
+
     /**
      * 组装整改汇总文件参数
      *
@@ -427,13 +440,30 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
         }
     }
 
+    /**
+     * 获取车间列表
+     *
+     * @return
+     */
+    @Override
+    public List<JSONObject> getWorkshop() {
+        //正常组织结构
+        List<JSONObject> workshopList = luckysheetDao.getWorkshop();
+
+        //额外数据字典中配置
+        List<JSONObject> workshopDictList = luckysheetDao.getWorkshopDict();
+
+        workshopList.addAll(workshopDictList);
+
+        return workshopList;
+    }
+
     /**
      * 导出整改报表
      *
      * @param workbook
      * @param worksheet
      * @param map
-     * @param response
      * @return
      */
     private int exportRectifyReportDataBySheet(Workbook workbook, Worksheet worksheet, Map<String, Object> map) {
@@ -581,8 +611,6 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
      * 设置动态列
      * @param cells
      * @param noList
-     * @param colIndex
-     * @param colorIndex
      */
     private void setTrendsHeader(Cells cells, List<String> noList) {
         int colIndex = 2;
@@ -757,7 +785,11 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
             main.setSupervisorcode(row.getString("监理编号"));
             main.setArcposition(row.getString("部位"));
             main.setArccontent(row.getString("内容"));
-            main.setMainstatus(row.getString("总状态"));
+            String status = row.getString("总状态");
+            if(ObjectUtil.isNotEmpty(status)) {
+                status = status.toLowerCase();
+            }
+            main.setMainstatus(status);
             main.setReqdate(LuckySheet4SummaryHelp.getDateDefaultNull(row, "提出日期"));
             main.setRequser(row.getString("提出者"));
             main.setRectifydate(LuckySheet4SummaryHelp.getDateDefaultNull(row, "整改日期"));
@@ -788,7 +820,11 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                 machine.setMachineid(numberDo.getId());
 
                 machine.setFinishdate(LuckySheet4SummaryHelp.getDateDefaultNull(machineObj, "完成日期"));
-                machine.setStatus(machineObj.getString("状态"));
+                String mochineStatus = machineObj.getString("状态");
+                if(ObjectUtil.isNotEmpty(mochineStatus)) {
+                    mochineStatus = mochineStatus.toLowerCase();
+                }
+                machine.setStatus(mochineStatus);
 
                 Map<String, JSONObject> orgMap = summaryDataBo.getOrgMap();
 
@@ -805,47 +841,68 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                         departNames = departName.split("、");
                     }
 
-                    for(String departNameTemp : departNames) {
+                    for(String depName : departNames) {
+
+                        //去掉无用部分
+                        String realDepartName = getRealDepartName(depName);
+
+                        if(ObjectUtil.isEmpty(realDepartName)) {
+                            continue;
+                        }
 
                         ZhcxProjectRectifyMachineDo machineEntity = new ZhcxProjectRectifyMachineDo();
                         BeanUtil.copyProperties(machine, machineEntity);
 
-                        JSONObject org = orgMap.get(departNameTemp);
+                        JSONObject org = orgMap.get(realDepartName);
                         if(ObjectUtil.isNotNull(org)) {
                             machineEntity.setDeptid(org.getString("ID"));
                             machineEntity.setFirstdeptid(org.getString("PID"));
-                            machineEntity.setFirstdeptname(org.getString("pshortName"));
+                            machineEntity.setFirstdeptname(org.getString("PSHORTNAME"));
 
                             machineEntity.setDutydeptid(org.getString("ID"));
                             machineEntity.setFirstdutydeptid(org.getString("PID"));
-                            machineEntity.setFirstdutydeptname(org.getString("pshortName"));
+                            machineEntity.setFirstdutydeptname(org.getString("PSHORTNAME"));
                         }
-                        machineEntity.setDeptname(departNameTemp);
-                        machineEntity.setDutydeptname(departNameTemp);
+                        machineEntity.setDeptname(realDepartName);
+                        machineEntity.setDutydeptname(realDepartName);
 
                         machineEntity.setId(SecurityUtil.getUUID());
                         slaveList.add(machineEntity);
                     }
 
                 } else {
+
+                    //去掉无用
+                    String realDepartName = getRealDepartName(departName);
+                    if(ObjectUtil.isEmpty(realDepartName)) {
+                        continue;
+                    }
+
                     //施工部门
-                    JSONObject departOrg = orgMap.get(departName);
+                    JSONObject departOrg = orgMap.get(realDepartName);
                     if(ObjectUtil.isNotEmpty(departName) && ObjectUtil.isNotNull(departOrg)) {
                         machine.setDeptid(departOrg.getString("ID"));
                         machine.setFirstdeptid(departOrg.getString("PID"));
-                        machine.setFirstdeptname(departOrg.getString("pshortName"));
+                        machine.setFirstdeptname(departOrg.getString("PSHORTNAME"));
                     }
-                    machine.setDeptname(departName);
+                    machine.setDeptname(realDepartName);
 
                     //责任部门
                     String dutyDepartName = machineObj.getString("责任部门");
-                    JSONObject dutyDepartOrg = orgMap.get(dutyDepartName);
-                    if(ObjectUtil.isNotEmpty(dutyDepartName) && ObjectUtil.isNotNull(dutyDepartOrg)) {
+
+                    //去掉无用
+                    String realDutyDepartName = getRealDepartName(dutyDepartName);
+                    if(ObjectUtil.isEmpty(realDepartName)) {
+                        continue;
+                    }
+
+                    JSONObject dutyDepartOrg = orgMap.get(realDutyDepartName);
+                    if(ObjectUtil.isNotEmpty(realDutyDepartName) && ObjectUtil.isNotNull(dutyDepartOrg)) {
                         machine.setDutydeptid(dutyDepartOrg.getString("ID"));
                         machine.setFirstdutydeptid(dutyDepartOrg.getString("PID"));
-                        machine.setFirstdutydeptname(dutyDepartOrg.getString("pshortName"));
+                        machine.setFirstdutydeptname(dutyDepartOrg.getString("PSHORTNAME"));
                     }
-                    machine.setDutydeptname(dutyDepartName);
+                    machine.setDutydeptname(realDutyDepartName);
 
                     machine.setId(SecurityUtil.getUUID());
                     slaveList.add(machine);
@@ -863,6 +920,30 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
         }
     }
 
+    /**
+     * 获取真实部门
+     *
+     * @param departName
+     * @return
+     */
+    private String getRealDepartName(String departName) {
+        if(ObjectUtil.isEmpty(departName)) {
+            return null;
+        }
+
+        if(departName.contains("(")) {
+            String[] split = departName.split("\\(");
+            return split[0];
+        }
+
+        if(departName.contains("(")) {
+            String[] split = departName.split("(");
+            return split[0];
+        }
+
+        return departName;
+    }
+
     /**
      * 解析数据
      * {
@@ -923,7 +1004,11 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
             }
 
             //显示值
-            String m1 = v.getString("m");
+            String m1 = getCellValueByV(v);
+
+            if(ObjectUtil.isEmpty(m1)) {
+                continue;
+            }
 
             //列下标
             String colIndex = cellData.getString("c");
@@ -959,6 +1044,44 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
         return rows;
     }
 
+    /**
+     * 获取单元值
+     *
+     * @param v
+     * @return
+     */
+    private String getCellValueByV(JSONObject v) {
+
+        /* 处理以下数据结构
+             {
+                "celldata": [{
+                    "c": 0,
+                    "r": 8,
+                    "v": {
+                        "ct": {
+                            "s": [{
+                                "v": "sdsdgdf\r\ndfgdfg\r\ndsfgdfgdf\r\ndsfgdfg"
+                            }],
+                            "t": "inlineStr",
+                            "fa": "General"
+                        }
+                    }
+                }]
+            }
+             */
+        if(!v.containsKey("v") && v.containsKey("ct")) {
+            JSONObject ct = v.getJSONObject("ct");
+            JSONArray s = ct.getJSONArray("s");
+
+            if(ObjectUtil.isNotNull(s)) {
+                JSONObject s0 = s.getJSONObject(0);
+                return s0.getString("v");
+            }
+        }
+
+        return v.getString("m");
+    }
+
     /**
      * 保存数据封装
      *
@@ -966,9 +1089,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));
 
         //组织机构
@@ -1113,24 +1246,6 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
         return prjTitle;
     }
 
-    /**
-     * 获取车间列表
-     *
-     * @return
-     */
-    private List<JSONObject> getWorkshop() {
-
-        //正常组织结构
-        List<JSONObject> workshopList = luckysheetDao.getWorkshop();
-
-        //额外数据字典中配置
-        List<JSONObject> workshopDictList = luckysheetDao.getWorkshopDict();
-
-        workshopList.addAll(workshopDictList);
-
-        return workshopList;
-    }
-
     /**
      * 组装文件
      *

+ 52 - 638
business-common/src/main/java/com/rongwei/bscommon/sys/utils/LuckySheet4SummaryHelp.java

@@ -6,16 +6,10 @@ import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONException;
 import com.alibaba.fastjson.JSONObject;
-import com.rongwei.bsentity.dto.luckysheet.AssembleCellParam;
-import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
-import com.rongwei.bsentity.dto.project.SheetInfoParam;
-import com.rongwei.rwcommon.utils.StringUtils;
 
-import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import java.util.stream.Collectors;
 
 public class LuckySheet4SummaryHelp {
 
@@ -31,6 +25,56 @@ public class LuckySheet4SummaryHelp {
      */
     public static final String[] MAIN_TITLE_SECOND = {"总状态","提出日期","整改期限","提出者","备注1","备注2"};
 
+    /**
+     * 状态
+     */
+    public static final List<String> DATA_VERIFY_STATUS = Arrays.asList(new String[] {"OK", "X", "/"});
+
+    /**
+     * 获取单元格值
+     *
+     * @param vObject
+     * @return
+     */
+    public static <T> T getCellValue4V(JSONObject vObject, Class<T> clazz) {
+        /* 处理以下数据结构
+             {
+                "celldata": [{
+                    "c": 0,
+                    "r": 8,
+                    "v": {
+                        "ct": {
+                            "s": [{
+                                "v": "sdsdgdf\r\ndfgdfg\r\ndsfgdfgdf\r\ndsfgdfg"
+                            }],
+                            "t": "inlineStr",
+                            "fa": "General"
+                        }
+                    }
+                }]
+            }
+             */
+
+        if(!vObject.containsKey("v") && vObject.containsKey("ct")){
+            JSONObject ct=vObject.getJSONObject("ct");
+            if(ct.containsKey("s")){
+
+                JSONArray s = ct.getJSONArray("s");
+
+                if(ObjectUtil.isNotNull(s)) {
+                    JSONObject s0 = s.getJSONObject(0);
+                    s0.getString("v");
+                    if(s0 != null) {
+                        vObject.put("v", s0.get("v"));
+                    }
+                }
+
+            }
+        }
+
+        return vObject.getObject("v", clazz);
+    }
+
     /**
      * 字符串转日期格式  无法转换日期给null
      *
@@ -112,642 +156,12 @@ public class LuckySheet4SummaryHelp {
         return ymdSb.toString();
     }
 
-
-    /**
-     * {
-     * 		"c": 0,
-     * 		"r": 0,
-     * 		"v": {
-     * 			"m": "1002000938马士基埃及桥吊项目整改文字版",
-     * 			"v": "1002000938马士基埃及桥吊项目整改文字版",
-     * 			"bg": "rgb(51, 102, 255)",
-     * 			"bl": 1,
-     * 			"ct": {
-     * 				"t": "g",
-     * 				"fa": "General"
-     *                        },
-     * 			"fc": "rgb(0, 0, 0)",
-     * 			"ff": 5,
-     * 			"fs": 16,
-     * 			"ht": 0,
-     * 			"it": 0,
-     * 			"mc": {
-     * 				"c": 0,
-     * 				"r": 0,
-     * 				"cs": 58,
-     * 				"rs": 1
-     *            },
-     * 			"vt": 0* 		}
-     *    }
-     *
-     * @param fileName
-     * @param colSize
-     * @return
-     */
-    public static JSONArray assembleFirstTitle(String fileName, int colSize) {
-
-        AssembleCellParam cellParam = AssembleCellParam.builder()
-                .fontsize(16)
-                .startRowPos(0)
-                .startColPos(0)
-                .rowSize(1)
-                .colSize(colSize)
-                .value(fileName)
-                .build();
-        return assembleMergeTitle(cellParam);
-    }
-
-    /**
-     * {
-     * 		"c": 0,
-     * 		"r": 1,
-     * 		"v": {
-     * 			"m": "总序号",
-     * 			"v": "总序号",
-     * 			"bg": "rgb(204, 255, 204)",
-     * 			"bl": 0,
-     * 			"ct": {
-     * 				"t": "g",
-     * 				"fa": "General"
-     *           },
-     * 			"fc": "rgb(0, 0, 0)",
-     * 			"ff": 5,
-     * 			"fs": 11,
-     * 			"ht": 0,
-     * 			"it": 0,
-     * 			"mc": {
-     * 				"c": 0,
-     * 				"r": 1,
-     * 				"cs": 1,
-     * 				"rs": 2
-     *           },
-     * 			"vt": 0
-     * 		}
-     * }
-     *
-     * @return
-     */
-    public static JSONArray assembleCommonCol1() {
-
-        JSONArray result = new JSONArray();
-
-        for(int m = 0, n = MAIN_TITLE_FIRST.length; m < n; m++) {
-            //一级标题
-            JSONObject remark2 = new JSONObject();
-            remark2.put("c", m);
-            remark2.put("r", 1);
-            JSONObject remark2v = new JSONObject();
-            remark2v.put("m", MAIN_TITLE_FIRST[m]);
-            remark2v.put("v", MAIN_TITLE_FIRST[m]);
-            remark2v.put("bg", "rgb(204, 255, 204)");
-            remark2v.put("bl", 1);
-            remark2v.put("fc", "rgb(0, 0, 0)");
-            remark2v.put("ff", 5);
-            remark2v.put("fs", 11);
-            remark2v.put("ht", 0);
-            remark2v.put("it", 0);
-            remark2v.put("vt", 1);
-
-            JSONObject ct = new JSONObject();
-            ct.put("t", "g");
-            ct.put("fa", "General");
-            remark2v.put("ct", ct);
-
-            JSONObject mc = new JSONObject();
-            mc.put("c", m);
-            mc.put("r", 1);
-            mc.put("cs", 1);
-            mc.put("rs", 2);
-            remark2v.put("mc", mc);
-
-            remark2.put("v", remark2v);
-            result.add(remark2);
-        }
-
-        return result;
-    }
-
-    /**
-     * 第三行开头
-     *
-     * @return
-     */
-    public static JSONArray assembleCommonRow2Col1() {
-
-        JSONArray result = new JSONArray();
-
-        for(int m = 0; m < MAIN_TITLE_FIRST.length; m++) {
-            JSONObject temp = new JSONObject();
-
-            JSONObject mc2 = new JSONObject();
-            mc2.put("c", m);
-            mc2.put("r", 1);
-
-            JSONObject v = new JSONObject();
-            v.put("mc",  mc2);
-
-            temp.put("c", m);
-            temp.put("r", 2);
-            temp.put("v", v);
-            result.add(temp);
-        }
-
-        return result;
-    }
-
-    /**
-     * 状态	提出日期	整改期限	提出者	备注1	备注2
-     * {
-     * 		"c": 57,
-     * 		"r": 2,
-     * 		"v": {
-     * 			"m": "备注2",
-     * 			"v": "备注2",
-     * 			"bl": 1,
-     * 			"ct": {
-     * 				"t": "g",
-     * 				"fa": "General"
-     *                        },
-     * 			"fc": "rgb(0, 0, 0)",
-     * 			"ff": 5,
-     * 			"fs": 11,
-     * 			"ht": 0,
-     * 			"it": 0,
-     * 			"vt": 1
-     * 	    }
-     * }
-     *
-     * @param startColPosition 起始位置
-     * @return
-     */
-    public static JSONArray assembleCommonCol2(int startColPosition) {
-        return assembleSingleTitle(startColPosition, 2, MAIN_TITLE_SECOND);
-    }
-
-    /**
-     * 第二行最后六个
-     * {
-     * 		"c": 56,
-     * 		"r": 1,
-     * 		"v": {
-     * 			"m": "",
-     * 			"bg": "rgb(204, 255, 204)",
-     * 			"bl": 1,
-     * 			"fc": "rgb(0, 0, 0)",
-     * 			"ff": 5,
-     * 			"fs": 11,
-     * 			"ht": 0,
-     * 			"it": 0,
-     * 			"vt": 0
-     *       }
-     * }
-     *
-     * @param startColPosition
-     * @return
-     */
-    public static JSONArray assembleCommonRow1Col2(int startColPosition) {
-
-        JSONArray result = new JSONArray();
-
-        for(int m = 0, n = 6; m < n; m++) {
-            //备注2
-            JSONObject remark2 = new JSONObject();
-            remark2.put("c", startColPosition + m);
-            remark2.put("r", 1);
-
-            JSONObject remark2v = new JSONObject();
-            remark2v.put("m", "");
-            remark2v.put("bl", 1);
-            remark2v.put("fc", "rgb(0, 0, 0)");
-            remark2v.put("ff", 5);
-            remark2v.put("fs", 11);
-            remark2v.put("ht", 0);
-            remark2v.put("it", 0);
-            remark2v.put("vt", 0);
-
-            remark2.put("v", remark2v);
-            result.add(remark2);
-        }
-        return result;
-    }
-
-    /**
-     * 机号一级标题
-     *
-     * @param startColPosition
-     * @return
-     */
-    public static JSONArray genDeviceNumberFirstTitle(String cellName, int startColPosition) {
-        AssembleCellParam cellParam = AssembleCellParam.builder()
-                .fontsize(11)
-                .startRowPos(1)
-                .startColPos(startColPosition)
-                .rowSize(1)
-                .colSize(MACHINE_TITLE_COLS.length)
-                .value(cellName)
-                .build();
-        return assembleMergeTitle(cellParam);
-    }
-
-    /**
-     * 生成机号标题
-     *
-     * @param startColPosition
-     * @return
-     */
-    public static JSONArray assembleDeviceNumberSecondTitle(int startColPosition) {
-        return assembleSingleTitle(startColPosition, 2, MACHINE_TITLE_COLS);
-    }
-
-    /**
-     * 生成单个单元格
-     *
-     * @param startColPosition
-     * @param cols
-     * @return
-     */
-    public static JSONArray assembleSingleTitle(int startColPosition, int startRowPosition, String[] cols) {
-
-        JSONArray result = new JSONArray();
-
-        for(int m = 0, n = cols.length; m < n; m++) {
-            //备注2
-            JSONObject remark2 = new JSONObject();
-            remark2.put("c", startColPosition + m);
-            remark2.put("r", startRowPosition);
-            JSONObject remark2v = new JSONObject();
-            remark2v.put("m", cols[m]);
-            remark2v.put("v", cols[m]);
-            remark2v.put("bl", 1);
-            remark2v.put("fc", "rgb(0, 0, 0)");
-            remark2v.put("ff", 5);
-            remark2v.put("fs", 11);
-            remark2v.put("ht", 0);
-            remark2v.put("it", 0);
-            remark2v.put("vt", 1);
-            JSONObject ct = new JSONObject();
-            ct.put("t", "g");
-            ct.put("fa", "General");
-            remark2v.put("ct", ct);
-            remark2.put("v", remark2v);
-            result.add(remark2);
-        }
-        return result;
-    }
-
     /**
-     * 组装合并单元格
+     * 数组验证 下拉框
      *
-     * @param param
+     * @param options
      * @return
      */
-    public static JSONArray assembleMergeTitle(AssembleCellParam param) {
-        JSONArray result = new JSONArray();
-        //一级标题
-        JSONObject remark2 = new JSONObject();
-        remark2.put("c", param.getStartColPos());
-        remark2.put("r", param.getStartRowPos());
-        JSONObject remark2v = new JSONObject();
-        remark2v.put("m", param.getValue());
-        remark2v.put("v", param.getValue());
-        remark2v.put("bl", 1);
-        remark2v.put("fc", "rgb(0, 0, 0)");
-        remark2v.put("ff", 5);
-        remark2v.put("fs", param.getFontsize());
-        remark2v.put("ht", 0);
-        remark2v.put("it", 0);
-        remark2v.put("vt", 1);
-        JSONObject ct = new JSONObject();
-        ct.put("t", "g");
-        ct.put("fa", "General");
-        remark2v.put("ct", ct);
-
-        JSONObject mc = new JSONObject();
-        mc.put("c", param.getStartColPos());
-        mc.put("r", param.getStartRowPos());
-        mc.put("cs", param.getColSize());
-        mc.put("rs", param.getRowSize());
-        remark2v.put("mc", mc);
-
-        remark2.put("v", remark2v);
-        result.add(remark2);
-
-        /**
-         * {
-         * 		"c": 1,
-         * 		"r": 0,
-         * 		"v": {
-         * 			"mc": {
-         * 				"c": 0,
-         * 				"r": 0
-         *          }
-         *       }
-         * 	}
-         */
-        for(int m = 1; m < param.getColSize(); m++) {
-            JSONObject temp = new JSONObject();
-
-            JSONObject mc2 = new JSONObject();
-            mc2.put("c", param.getStartColPos());
-            mc2.put("r", param.getStartRowPos());
-
-            JSONObject v = new JSONObject();
-            v.put("mc",  mc2);
-
-            temp.put("c", m + param.getStartColPos());
-            temp.put("r", param.getStartRowPos());
-            temp.put("v", v);
-            result.add(temp);
-        }
-
-        return result;
-    }
-
-    /**
-     * 获取空的sheet对象
-     *
-     * {
-     * 	"row": 84,
-     * 	"name": "Sheet2",
-     * 	"chart": [],
-     * 	"color": "",
-     * 	"index": "2",
-     * 	"order": 1,
-     * 	"column": 60,
-     * 	"config": {},
-     * 	"status": 0,
-     * 	"celldata": [],
-     * 	"ch_width": 4748,
-     * 	"rowsplit": [],
-     * 	"rh_height": 1790,
-     * 	"scrollTop": 0,
-     * 	"scrollLeft": 0,
-     * 	"visibledatarow": [],
-     * 	"visibledatacolumn": [],
-     * 	"jfgird_select_save": [{
-     * 		"row": [4, 4],
-     * 		"top": 85,
-     * 		"left": 0,
-     * 		"width": 73,
-     * 		"column": [0, 0],
-     * 		"height": 19,
-     * 		"top_move": 85,
-     * 		"left_move": 0,
-     * 		"row_focus": 4,
-     * 		"width_move": 73,
-     * 		"height_move": 19,
-     * 		"column_focus": 0
-     *        }],
-     * 	"jfgrid_selection_range": {}
-     * }
-     *
-     * @param param
-     * @return
-     */
-    public static JSONObject getEmptySheet(SheetInfoParam param) {
-        JSONObject obj = new JSONObject();
-        obj.put("row", 84);
-        obj.put("name", param.getSheetName());
-        obj.put("chart", new JSONArray());
-        obj.put("color", "");
-        obj.put("index", param.getIndex());
-        obj.put("order", param.getOrder());
-        obj.put("column", 60);
-        obj.put("config", new JSONObject());
-        obj.put("status", 0);
-        obj.put("celldata", new JSONArray());
-        obj.put("ch_width", 4748);
-        obj.put("rowsplit", new JSONArray());
-        obj.put("rh_height", 1790);
-        obj.put("scrollTop", 0);
-        obj.put("scrollLeft", 0);
-        obj.put("dataVerification", new JSONObject());
-        obj.put("visibledatarow", new JSONArray());
-        obj.put("visibledatacolumn", new JSONArray());
-
-        /**
-         * {
-     * 		"row": [4, 4],
-     * 		"top": 85,
-     * 		"left": 0,
-     * 		"width": 73,
-     * 		"column": [0, 0],
-     * 		"height": 19,
-     * 		"top_move": 85,
-     * 		"left_move": 0,
-     * 		"row_focus": 4,
-     * 		"width_move": 73,
-     * 		"height_move": 19,
-     * 		"column_focus": 0
-     *        }
-         */
-        JSONObject selectSave = new JSONObject();
-        selectSave.put("row", new String[]{"4", "4"});
-        selectSave.put("top", 85);
-        selectSave.put("left", 0);
-        selectSave.put("width", 73);
-        selectSave.put("column", new String[]{"0", "0"});
-        selectSave.put("height", 19);
-        selectSave.put("top_move", 85);
-        selectSave.put("left_move", 0);
-        selectSave.put("row_focus", 4);
-        selectSave.put("width_move", 73);
-        selectSave.put("height_move", 19);
-        selectSave.put("column_focus", 0);
-
-        JSONArray selectSaves = new JSONArray();
-        selectSaves.add(selectSave);
-
-        obj.put("jfgird_select_save", selectSaves);
-        obj.put("jfgrid_selection_range", new JSONObject());
-
-        return obj;
-    }
-
-    /**
-     * 获取合并配置
-     *           "0_0": {
-     * 				"c": 0,
-     * 				"r": 0,
-     * 				"cs": 58,
-     * 				"rs": 1
-     *           },
-     *
-     * @param deviceNumberList
-     * @return
-     */
-    public static JSONObject getMergeConfig(List<String> deviceNumberList) {
-        JSONObject result = new JSONObject();
-
-        int colSize = deviceNumberList.size() * MACHINE_TITLE_COLS.length
-                + MAIN_TITLE_FIRST.length
-                + MAIN_TITLE_SECOND.length;
-
-        //第一行 标题
-        JSONObject row0Title = new JSONObject();
-        row0Title.put("c", 0);
-        row0Title.put("r", 0);
-        row0Title.put("cs", colSize);
-        row0Title.put("rs", 1);
-        result.put("0_0", row0Title);
-
-        //第二行 前4列
-        for(int m = 0, n = MAIN_TITLE_FIRST.length; m < n; m++) {
-            JSONObject row1Col0Title = new JSONObject();
-            row1Col0Title.put("c", m);
-            row1Col0Title.put("r", 1);
-            row1Col0Title.put("cs", 1);
-            row1Col0Title.put("rs", 2);
-            result.put("1_".concat(String.valueOf(m)), row1Col0Title);
-        }
-
-        //第二行机号
-        for(int m = 0,  n = deviceNumberList.size(); m < n; m++) {
-            JSONObject deviceNumObj = new JSONObject();
-            int colPos = MAIN_TITLE_FIRST.length + m * MACHINE_TITLE_COLS.length;
-            deviceNumObj.put("c", colPos);
-            deviceNumObj.put("r", 1);
-            deviceNumObj.put("cs", MACHINE_TITLE_COLS.length);
-            deviceNumObj.put("rs", 1);
-            result.put("1_".concat(String.valueOf(colPos)), deviceNumObj);
-        }
-
-        return result;
-    }
-
-    /**
-     * {
-     * 			"value": {
-     * 				"b": {
-     * 					"color": "rgb(0, 0, 0)",
-     * 					"style": 1
-     *              },
-     * 				"l": {
-     * 					"color": "rgb(0, 0, 0)",
-     * 					"style": 1
-     *              },
-     * 				"t": {
-     * 					"color": "rgb(0, 0, 0)",
-     * 					"style": 1
-     *                },
-     * 				"col_index": 0,
-     * 				"row_index": 0
-     * 			},
-     * 			"rangeType": "cell"
-     * }
-     *
-     * @param deviceNumberList
-     * @return
-     */
-    public static JSONArray getBorderInfo(List<String> deviceNumberList) {
-        JSONArray result = new JSONArray();
-
-        //计算列行
-        int rowsSize = 3, colsSize = deviceNumberList.size() * MACHINE_TITLE_COLS.length
-                + MAIN_TITLE_FIRST.length
-                + MAIN_TITLE_SECOND.length;;
-
-        //行
-        for(int m = 0; m < rowsSize; m++) {
-            for(int n = 0; n < colsSize; n++) {
-                JSONObject value = new JSONObject();
-                JSONObject b = new JSONObject();
-                b.put("color", "rgb(0, 0, 0)");
-                b.put("style", 1);
-                value.put("b", b);
-
-                JSONObject l = new JSONObject();
-                l.put("color", "rgb(0, 0, 0)");
-                l.put("style", 1);
-                value.put("l", l);
-
-                JSONObject t = new JSONObject();
-                t.put("color", "rgb(0, 0, 0)");
-                t.put("style", 1);
-                value.put("t", t);
-
-                value.put("col_index", n);
-                value.put("row_index", m);
-
-                JSONObject obj = new JSONObject();
-                obj.put("rangeType", "cell");
-                obj.put("value", value);
-                result.add(obj);
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 数据校验
-     *
-     * @param paramExcelDto
-     * @return
-     */
-    public static JSONObject getDataVerification(ProjectSummaryParamExcelDto paramExcelDto) {
-        JSONObject result = new JSONObject();
-
-        //部门
-        List<String> departList = paramExcelDto.getWorkshopList().stream()
-                .map(item -> item.getString("SHORTNAME"))
-                .collect(Collectors.toList());
-        String departChose = StringUtils.join(departList, ",");
-
-        for(int m = 0,  n = paramExcelDto.getDeviceNumberList().size() - 1; m <= n; m++) {
-            int colPos = MAIN_TITLE_FIRST.length + m * MACHINE_TITLE_COLS.length;
-//            int departColPos = 4 + 4 * m;
-            for(int startRows = 3, endRows = 200; startRows < endRows; startRows++) {
-
-                //状态
-                /**
-                 * "3_4": {
-                 * 			"type": "dropdown",
-                 * 			"remote": false,
-                 * 			"value1": "OK,X,√",
-                 * 			"value2": "",
-                 * 			"checked": false,
-                 * 			"hintShow": false,
-                 * 			"hintText": "",
-                 * 			"prohibitInput": false
-                 * }
-                 */
-                JSONObject statusObj = getNewDataVerification("OK,X,√");
-                result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos)), statusObj);
-
-                //部门
-                /**
-                 * "3_4": {
-                 * 			"type": "dropdown",
-                 * 			"remote": false,
-                 * 			"value1": "OK,X,√",
-                 * 			"value2": "",
-                 * 			"checked": false,
-                 * 			"hintShow": false,
-                 * 			"hintText": "",
-                 * 			"prohibitInput": false
-                 * }
-                 */
-                //施工部门
-                JSONObject departObj = getNewDataVerification(departChose);
-                result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos + 1)), departObj);
-
-                //责任部门
-                JSONObject depart2Obj = getNewDataVerification(departChose);
-                result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos + 3)), depart2Obj);
-            }
-        }
-
-        //总状态
-        int statusColIndex = MAIN_TITLE_FIRST.length + paramExcelDto.getDeviceNumberList().size() * MACHINE_TITLE_COLS.length;
-        for(int startRows = 3, endRows = 200; startRows < endRows; startRows++) {
-            JSONObject statusObj = getNewDataVerification("OK,X,√");
-            result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(statusColIndex)), statusObj);
-        }
-
-        return result;
-    }
-
     public static JSONObject getNewDataVerification(String options) {
         JSONObject departObj = new JSONObject();
         departObj.put("type", "dropdown");

+ 28 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/utils/MSExcelUtil.java

@@ -0,0 +1,28 @@
+package com.rongwei.bscommon.sys.utils;
+
+public class MSExcelUtil {
+    public static final short EXCEL_COLUMN_WIDTH_FACTOR = 256;
+    public static final short EXCEL_ROW_HEIGHT_FACTOR = 20;
+    public static final int UNIT_OFFSET_LENGTH = 7;
+    public static final int[] UNIT_OFFSET_MAP = new int[] { 0, 36, 73, 109, 146, 182, 219 };
+
+    public static short pixel2WidthUnits(int pxs) {
+        short widthUnits = (short) (EXCEL_COLUMN_WIDTH_FACTOR * (pxs / UNIT_OFFSET_LENGTH));
+        widthUnits += UNIT_OFFSET_MAP[(pxs % UNIT_OFFSET_LENGTH)];
+        return widthUnits;
+    }
+
+    public static int widthUnits2Pixel(short widthUnits) {
+        int pixels = (widthUnits / EXCEL_COLUMN_WIDTH_FACTOR) * UNIT_OFFSET_LENGTH;
+        int offsetWidthUnits = widthUnits % EXCEL_COLUMN_WIDTH_FACTOR;
+        pixels += Math.floor((float) offsetWidthUnits / ((float) EXCEL_COLUMN_WIDTH_FACTOR / UNIT_OFFSET_LENGTH));
+        return pixels;
+    }
+
+    public static int heightUnits2Pixel(int heightUnits) {
+        int pixels = (heightUnits / EXCEL_ROW_HEIGHT_FACTOR);
+        int offsetWidthUnits = heightUnits % EXCEL_ROW_HEIGHT_FACTOR;
+        pixels += Math.floor((float) offsetWidthUnits / ((float) EXCEL_ROW_HEIGHT_FACTOR / UNIT_OFFSET_LENGTH));
+        return pixels;
+    }
+}

+ 172 - 14
business-common/src/main/java/com/rongwei/bscommon/sys/utils/XlsSheetUtil.java

@@ -1,9 +1,11 @@
 package com.rongwei.bscommon.sys.utils;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.rongwei.rwcommon.utils.JSONUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 
@@ -56,7 +58,7 @@ public class XlsSheetUtil {
             }
         }
 
-        setColumAndRow(dbObject,sheet);
+        setColumAndRow(dbObject,sheet, wb);
 
     }
 
@@ -141,9 +143,11 @@ public class XlsSheetUtil {
                     //bg 背景颜色
                     if(v_json.containsKey("bg")){
                         String _v=getByDBObject(v_json,"bg");
-                        Short _color=ColorUtil.getColorByStr(_v);
-                        if(_color!=null) {
-                            style.setFillBackgroundColor(_color);
+                        if(_v != null) {
+                            Short _color=ColorUtil.getColorByStr(_v);
+                            if(_color!=null) {
+                                style.setFillBackgroundColor(_color);
+                            }
                         }
                     }
 
@@ -212,19 +216,21 @@ public class XlsSheetUtil {
      * @param dbObject
      * @param sheet
      */
-    private static void setColumAndRow(JSONObject dbObject, Sheet sheet){
+    private static void setColumAndRow(JSONObject dbObject, Sheet sheet, Workbook wb){
         if(dbObject.containsKey("config")){
             JSONObject config = dbObject.getJSONObject("config");
 
-            if(config.containsKey("columlen")){
-                JSONObject columlen = config.getJSONObject("columlen");
+            if(config.containsKey("columnlen")){
+                JSONObject columlen = config.getJSONObject("columnlen");
                 if(columlen!=null){
                     for(String k:columlen.keySet()){
                         Integer _i=getStrToInt(k);
                         Integer _v=getStrToInt(columlen.get(k).toString());
                         if(_i!=null && _v!=null){
-                            //sheet.setColumnWidth(_i,MSExcelUtil.heightUnits2Pixel(_v.shortValue()))
-                            sheet.setColumnWidth(_i,_v.shortValue());
+
+//                            sheet.setColumnWidth(_i,MSExcelUtil.widthUnits2Pixel(_v.shortValue()));
+                            int i = MSExcelUtil.widthUnits2Pixel(_v.shortValue());
+                            sheet.setColumnWidth(_i,i * 5 * 256);
                         }
                     }
                 }
@@ -245,6 +251,155 @@ public class XlsSheetUtil {
                     }
                 }
             }
+
+            //边框
+            setColumAndRowBorderInfo(config, sheet, wb);
+
+        }
+    }
+
+    /**
+     * 设置边框
+     *
+     * @param config
+     * @param sheet
+     */
+    private static void setColumAndRowBorderInfo(JSONObject config, Sheet sheet, Workbook wb) {
+        if(config == null) {
+            return ;
+        }
+
+        //边框
+        if(!config.containsKey("borderInfo")) {
+            return ;
+        }
+
+        JSONArray borderInfo = config.getJSONArray("borderInfo");
+        if(borderInfo == null) {
+            return ;
+        }
+
+        for(int m = 0, n = borderInfo.size(); m < n; m++) {
+            JSONObject borderCell = borderInfo.getJSONObject(m);
+            String rangeType = borderCell.getString("rangeType");
+            JSONObject cellBorderValue = borderCell.getJSONObject("value");
+
+            if("range".equals(rangeType)) {
+                JSONArray ranges = borderCell.getJSONArray("range");
+                JSONObject range = ranges.getJSONObject(0);
+                JSONArray rows = range.getJSONArray("row");
+                JSONArray cols = range.getJSONArray("column");
+
+                String color = borderCell.getString("color");
+                Short style = borderCell.getShort("style");
+
+                if(color == null) {
+                    continue;
+                }
+
+                if(style == null) {
+                    continue;
+                }
+
+                Short colorByStr = ColorUtil.getColorByStr(color);
+                BorderStyle borderStyle = BorderStyle.valueOf(style);
+
+                for(int i = rows.getIntValue(0), j = rows.getIntValue(1); i <= j; i++) {
+                    Row row = sheet.getRow(i);
+
+                    if(row == null) {
+                        row = sheet.createRow(i);
+                    }
+
+                    for(int colStart = cols.getIntValue(0), colEnd = cols.getIntValue(1); colStart <= colEnd; colStart++) {
+
+                        Cell cell = row.getCell(colStart);
+
+                        CellStyle cellStyle;
+                        if(cell == null) {
+                            cell = row.createCell(colStart);
+                            cellStyle = wb.createCellStyle();
+                            cell.setCellStyle(cellStyle);
+                        } else {
+                            cellStyle = cell.getCellStyle();
+                        }
+
+
+
+
+                        cellStyle.setBottomBorderColor(colorByStr);
+                        cellStyle.setBorderBottom(borderStyle);
+
+                        cellStyle.setTopBorderColor(colorByStr);
+                        cellStyle.setBorderTop(borderStyle);
+
+                        cellStyle.setLeftBorderColor(colorByStr);
+                        cellStyle.setBorderLeft(borderStyle);
+
+                        cellStyle.setRightBorderColor(colorByStr);
+                        cellStyle.setBorderRight(borderStyle);
+
+                    }
+                }
+            }
+            //单个单元格
+            else if("cell".equals(rangeType)) {
+                int rowIndex = cellBorderValue.getIntValue("row_index");
+                int colIndex = cellBorderValue.getIntValue("col_index");
+
+                Row row = sheet.getRow(rowIndex);
+                if(row == null) {
+                    continue;
+                }
+
+                Cell cell = row.getCell(colIndex);
+
+                if(cell == null) {
+                    continue;
+                }
+
+                CellStyle cellStyle = cell.getCellStyle();
+
+                if(cellStyle == null) {
+                    continue;
+                }
+
+
+                JSONObject bObj = cellBorderValue.getJSONObject("b");
+                if(bObj != null) {
+                    String color = bObj.getString("color");
+                    Short style = bObj.getShort("style");
+                    cellStyle.setBottomBorderColor(ColorUtil.getColorByStr(color));
+                    cellStyle.setBorderBottom(BorderStyle.valueOf(style));
+                }
+
+                JSONObject tObj = cellBorderValue.getJSONObject("t");
+                if(tObj != null) {
+                    String color = tObj.getString("color");
+                    Short style = tObj.getShort("style");
+                    cellStyle.setTopBorderColor(ColorUtil.getColorByStr(color));
+                    cellStyle.setBorderTop(BorderStyle.valueOf(style));
+                }
+
+                JSONObject lObj = cellBorderValue.getJSONObject("l");
+                if(lObj != null) {
+                    String color = lObj.getString("color");
+                    Short style = lObj.getShort("style");
+                    cellStyle.setLeftBorderColor(ColorUtil.getColorByStr(color));
+                    cellStyle.setBorderLeft(BorderStyle.valueOf(style));
+                }
+
+                JSONObject rObj = cellBorderValue.getJSONObject("r");
+                if(rObj != null) {
+                    String color = rObj.getString("color");
+                    Short style = rObj.getShort("style");
+                    cellStyle.setRightBorderColor(ColorUtil.getColorByStr(color));
+                    cellStyle.setBorderRight(BorderStyle.valueOf(style));
+                }
+            }
+
+
+
         }
     }
 
@@ -408,11 +563,14 @@ public class XlsSheetUtil {
              */
             JSONObject ct=dbObject.getJSONObject("ct");
             if(ct.containsKey("s")){
-                Object s=ct.get("s");
-                if(s instanceof List && ((List) s).size()>0){
-                    JSONObject _s1=(JSONObject)((List) s).get(0);
-                    if(_s1.containsKey("v") && _s1.get("v")instanceof String){
-                        dbObject.put("v",_s1.get("v"));
+
+                JSONArray s = ct.getJSONArray("s");
+
+                if(ObjectUtil.isNotNull(s)) {
+                    JSONObject s0 = s.getJSONObject(0);
+                    s0.getString("v");
+                    if(s0 != null) {
+                        dbObject.put("v", s0.get("v"));
                         style.setWrapText(true);
                     }
                 }

+ 79 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectManageRectifyBatchDo.java

@@ -0,0 +1,79 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 项目管理-整改批次
+ * </p>
+ *
+ * @author wm
+ * @since 2024-08-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("ZHCX_PROJECT_MANAGE_RECTIFY_BATCH")
+public class ZhcxProjectManageRectifyBatchDo extends BaseDo {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableField("ID")
+    private String id;
+    /**
+     * 租户ID
+     */
+    @TableField("TENANTID")
+    private String tenantid;
+    /**
+     * 扩展预留
+     */
+    @TableField("ROPTION")
+    private String roption;
+    /**
+     * 项目id
+     */
+    @TableField("PROJECTID")
+    private String projectid;
+    /**
+     * 项目工号
+     */
+    @TableField("PROJECTCODE")
+    private String projectcode;
+    /**
+     * 项目名称
+     */
+    @TableField("PROJECTNAME")
+    private String projectname;
+    /**
+     * 批次号
+     */
+    @TableField("BATCHCODE")
+    private String batchcode;
+    /**
+     * 机号id
+     */
+    @TableField("MACHINENOID")
+    private String machinenoid;
+    /**
+     * 机号
+     */
+    @TableField("MACHINENO")
+    private String machineno;
+    /**
+     * 整改文件
+     */
+    @TableField("SUMMARYFILES")
+    private String summaryfiles;
+
+
+}

+ 38 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/luckysheet/CoverageUpdateJsonDataRequest.java

@@ -0,0 +1,38 @@
+package com.rongwei.bsentity.dto.luckysheet;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.*;
+
+/**
+ * 覆盖更新参数
+ */
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class CoverageUpdateJsonDataRequest {
+
+    /**
+     * where条件,and连接
+     *
+     */
+    private JSONObject andWhereObj;
+
+    /**
+     * 路径
+     */
+    private String key;
+
+    /**
+     * 更新数组时使用
+     */
+    private String position;
+
+    /**
+     * 需要修改的值
+     *
+     */
+    private JSONObject value;
+
+}

+ 20 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/luckysheet/DataVerificationParamBo.java

@@ -0,0 +1,20 @@
+package com.rongwei.bsentity.dto.luckysheet;
+
+import lombok.*;
+
+import java.util.List;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class DataVerificationParamBo {
+
+
+    /**
+     * 部门
+     */
+    private List<String> departList;
+
+}

+ 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
      */

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

@@ -0,0 +1,18 @@
+package com.rongwei.bsentity.dto.project;
+
+import lombok.*;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class UpdateDataVerificationRequest {
+
+    private String projectId;
+
+    /**
+     * 批次id
+     */
+    private String batchId;
+}

+ 34 - 11
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxProjectManageController.java

@@ -1,14 +1,14 @@
 package com.rongwei.bsserver.controller;
 
 
-import cn.hutool.core.util.ObjectUtil;
-import com.rongwei.bscommon.sys.config.api.ResponseVO;
-import com.rongwei.bscommon.sys.feign.LuckySheetService;
 import com.rongwei.bscommon.sys.service.LuckysheetService;
+import com.rongwei.bscommon.sys.service.ZhcxProjectManageRectifyBatchService;
 import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
 import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
+import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
 import com.rongwei.bsentity.dto.project.ExportProjectSummaryDto;
 import com.rongwei.bsentity.dto.project.SavePorjectSummaryDto;
+import com.rongwei.bsentity.dto.project.UpdateDataVerificationRequest;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import io.swagger.annotations.Api;
@@ -42,21 +42,31 @@ public class ZhcxProjectManageController {
 
     @Autowired
     private LuckysheetService luckysheetService;
+
+    @Autowired
+    private ZhcxProjectManageRectifyBatchService projectManageRectifyBatchService;
     /**
-     * 复制新增
+     * 生成整改清单
      * @param projectManageDo
      * @return
      */
     @PostMapping("/genSummaryFiles")
     @ApiOperation("生成汇总文件")
     public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){
-        try {
-            String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
-            return R.ok(files);
-        } catch (Exception e) {
-            log.error("生成异常, {}", e);
-            return R.error("生成异常!");
-        }
+        String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
+        return R.ok(files);
+    }
+
+    /**
+     * 生成整改清单
+     * @param batch
+     * @return
+     */
+    @PostMapping("/genBatchSummaryFiles")
+    @ApiOperation("生成批次汇总文件")
+    public R genBatchSummaryFiles(@RequestBody ZhcxProjectManageRectifyBatchDo batch){
+        String files = projectManageRectifyBatchService.genProjectSummaryFiles(batch.getId());
+        return R.ok(files);
     }
 
     /**
@@ -80,6 +90,19 @@ public class ZhcxProjectManageController {
         return R.ok();
     }
 
+    /**
+     * 更新excel下拉框
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping("/updateDataVerification")
+    @ApiOperation("更新excel下拉框")
+    public R updateDataVerification(@RequestBody UpdateDataVerificationRequest req) {
+        luckysheetService.updateDataVerification(req);
+        return R.ok();
+    }
+
     @PostMapping("/getRectifyReportData")
     @ApiOperation("获取整改报表数据")
     public R getRectifyReportData(@RequestBody Map<String,Object> map) {

+ 2 - 2
business-server/src/main/resources/bootstrap.yml

@@ -116,7 +116,7 @@ sso:
 #redis通道名称
 redis.channel: luckysheet.channel
 #表格中块的大小,新增加时写入每一个sheet的第一个模块中
-row_size: 1500
-col_size: 1500
+row_size: 100
+col_size: 100
 #使用服务器类型
 servertype: tomcat