Explorar o código

Merge remote-tracking branch 'origin/master'

wangbo hai 10 meses
pai
achega
67807e35ee
Modificáronse 16 ficheiros con 671 adicións e 21 borrados
  1. 21 0
      business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxCommissionCheckBaseInfoDetailDao.java
  2. 40 0
      business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxCommissionCheckDetailDao.java
  3. 19 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxCommissionCheckBaseInfoDetailService.java
  4. 11 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxCommissionCheckService.java
  5. 30 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxCommissionCheckBaseInfoDetailServiceImpl.java
  6. 226 10
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxCommissionCheckServiceImpl.java
  7. 2 0
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxPersistentManageServiceImpl.java
  8. 5 1
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java
  9. 12 9
      business-common/src/main/resources/mybatis/business/ZhcxCommissionCheckDao.xml
  10. 18 0
      business-common/src/main/resources/mybatis/business/zhcxCommissionCheckBaseInfoDetailDao.xml
  11. 185 0
      business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxCommissionCheckBaseInfoDetailDo.java
  12. 1 1
      business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectRectifyDo.java
  13. 12 0
      business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectRectifyMachineDo.java
  14. 39 0
      business-entity/src/main/java/com/rongwei/bsentity/vo/ZhcxCommissionCheckDetailWordVO.java
  15. 36 0
      business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxCommissionCheckBaseInfoDetailController.java
  16. 14 0
      business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxCommissionCheckController.java

+ 21 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxCommissionCheckBaseInfoDetailDao.java

@@ -0,0 +1,21 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckBaseInfoDetailDo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 试车检查标准库子表 Mapper 接口
+ * </p>
+ *
+ * @author wm
+ * @since 2024-10-11
+ */
+@Mapper
+public interface ZhcxCommissionCheckBaseInfoDetailDao extends BaseMapper<ZhcxCommissionCheckBaseInfoDetailDo> {
+
+    void batchUpdate(List<ZhcxCommissionCheckBaseInfoDetailDo> list);
+}

+ 40 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxCommissionCheckDetailDao.java

@@ -1,7 +1,14 @@
 package com.rongwei.bscommon.sys.dao;
 
+import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bsentity.domain.ZhcxCommissionCheckDetailDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.ZhcxPersistentManageDo;
+import com.rongwei.bsentity.vo.ZhcxCommissionCheckDetailWordVO;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +20,37 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ZhcxCommissionCheckDetailDao extends BaseMapper<ZhcxCommissionCheckDetailDo> {
 
+    @Select("SELECT\n" +
+            "\t*\n" +
+            "FROM\n" +
+            "\tZHCX_COMMISSION_CHECK_DETAIL\n" +
+            "WHERE\n" +
+            "\tDELETED = 0\n" +
+            "\tAND PID = #{checkId}")
+    List<ZhcxCommissionCheckDetailDo> listData(Map<String, Object> map);
+
+    @Select("SELECT\n" +
+            "\t*\n" +
+            "FROM\n" +
+            "\tZHCX_COMMISSION_CHECK_DETAIL\n" +
+            "WHERE\n" +
+            "\tDELETED = 0\n" +
+            "\tAND ONELEVELCLASSIFICATION = #{onelevelclassification}\n" +
+            "\tAND PID = #{checkId}")
+    List<ZhcxCommissionCheckDetailWordVO> listWordData(Map detailMap);
+
+    /**
+     * 整改组织
+     *
+     * @return
+     */
+    @Select("SELECT " +
+            " NAME, " +
+            " VALUE " +
+            "FROM " +
+            " SYS_DICT " +
+            " WHERE " +
+            " DICTTYPE = 'test_drive_inspection_standard_subtable_debug_result' " +
+            " AND DELETED = '0'")
+    List<JSONObject> getResultDictList();
 }

+ 19 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxCommissionCheckBaseInfoDetailService.java

@@ -0,0 +1,19 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckBaseInfoDetailDo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 试车检查标准库子表 服务类
+ * </p>
+ *
+ * @author wm
+ * @since 2024-10-11
+ */
+public interface ZhcxCommissionCheckBaseInfoDetailService extends IService<ZhcxCommissionCheckBaseInfoDetailDo> {
+
+    void batchUpdate(List<ZhcxCommissionCheckBaseInfoDetailDo> list);
+}

+ 11 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxCommissionCheckService.java

@@ -6,6 +6,9 @@ import com.rongwei.bsentity.dto.CheckDetailDTO;
 import com.rongwei.bsentity.dto.CommissionCheckDTO;
 import com.rongwei.rwcommon.base.R;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
 /**
  * <p>
  * 试车检查表 服务类
@@ -25,4 +28,12 @@ public interface ZhcxCommissionCheckService extends IService<ZhcxCommissionCheck
 
 
     R updateSynchronizationDetail(CheckDetailDTO detailDTO);
+
+    /**
+     * 试车报告导出
+     * @param map
+     * @param response
+     * @return
+     */
+    int wordExport(Map<String, Object> map, HttpServletResponse response);
 }

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

@@ -0,0 +1,30 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckBaseInfoDetailDo;
+import com.rongwei.bscommon.sys.dao.ZhcxCommissionCheckBaseInfoDetailDao;
+import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckBaseInfoDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 试车检查标准库子表 服务实现类
+ * </p>
+ *
+ * @author wm
+ * @since 2024-10-11
+ */
+@Service
+public class ZhcxCommissionCheckBaseInfoDetailServiceImpl extends ServiceImpl<ZhcxCommissionCheckBaseInfoDetailDao, ZhcxCommissionCheckBaseInfoDetailDo> implements ZhcxCommissionCheckBaseInfoDetailService {
+
+    @Autowired
+    private ZhcxCommissionCheckBaseInfoDetailDao dao;
+
+    @Override
+    public void batchUpdate(List<ZhcxCommissionCheckBaseInfoDetailDo> list) {
+        dao.batchUpdate(list);
+    }
+}

+ 226 - 10
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxCommissionCheckServiceImpl.java

@@ -1,28 +1,46 @@
 package com.rongwei.bscommon.sys.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.aspose.words.Document;
+import com.aspose.words.ImportFormatMode;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckDetailService;
-import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckParameterSetDetalService;
-import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckParameterSetService;
-import com.rongwei.bsentity.domain.ZhcxCommissionCheckDetailDo;
-import com.rongwei.bsentity.domain.ZhcxCommissionCheckDo;
+import com.rongwei.bscommon.sys.dao.ZhcxCommissionCheckDetailDao;
+import com.rongwei.bscommon.sys.service.*;
+import com.rongwei.bsentity.domain.*;
 import com.rongwei.bscommon.sys.dao.ZhcxCommissionCheckDao;
-import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bsentity.domain.ZhcxCommissionCheckParameterSetDetalDo;
 import com.rongwei.bsentity.domain.ZhcxCommissionCheckParameterSetDo;
 import com.rongwei.bsentity.dto.CheckDetailDTO;
 import com.rongwei.bsentity.dto.CommissionCheckDTO;
+import com.rongwei.bsentity.vo.FormDataVO;
+import com.rongwei.bsentity.vo.ZhcxCommissionCheckDetailWordVO;
+import com.rongwei.bsentity.vo.ZhcxPersistentWordVO;
+import com.rongwei.rwadmincommon.system.domain.SysDictDo;
+import com.rongwei.rwadmincommon.system.service.SysDictService;
 import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.base.exception.CustomException;
+import com.rongwei.rwcommon.utils.DateUtils;
 import com.rongwei.rwcommon.utils.SecurityUtil;
+import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.rwcommoncomponent.excel.aspose.ExcelUtils;
+import com.rongwei.rwcommoncomponent.excel.utils.WordHelpUtils;
+import com.rongwei.rwcommoncomponent.excel.vo.FormData;
+import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
+import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import com.rongwei.rwcommoncomponent.excel.aspose.ExcelExportUtil;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * <p>
@@ -33,6 +51,7 @@ import java.util.Objects;
  * @since 2024-09-24
  */
 @Service
+@Slf4j
 public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCheckDao, ZhcxCommissionCheckDo> implements ZhcxCommissionCheckService {
 
     @Autowired
@@ -44,6 +63,21 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
     @Autowired
     private ZhcxCommissionCheckParameterSetDetalService commissionCheckParameterSetDetalService;
 
+    @Autowired
+    private ZhcxCommissionCheckDetailDao zhcxCommissionCheckDetailDao;
+
+    @Autowired
+    private ZhcxProjectManageService zhcxProjectManageService;
+
+    @Autowired
+    private SysFileItemService sysFileItemService;
+
+    @Autowired
+    private SysDictService sysDictService;
+
+    @Autowired
+    private ExcelUtils excelUtils;
+
 
     @Transactional(rollbackFor = {java. lang. Exception.class})
     @Override
@@ -280,4 +314,186 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
             commissionCheckParameterSetDetalService.updateById(detalDo);
         }
     }
+
+    @Override
+    public int wordExport(Map<String, Object> map, HttpServletResponse response) {
+        Object projectObj = map.get("projectId");
+        Object machineNoObj = map.get("machineNo");
+        String day = DateUtils.format(new Date());
+        String projectId = (String) projectObj;
+        String machineNo = (String) machineNoObj;
+        ZhcxProjectManageDo projectManageDo = zhcxProjectManageService.getById(projectId);
+        List<ZhcxCommissionCheckDetailDo> list = zhcxCommissionCheckDetailDao.listData(map);
+        if(list.size() == 0){
+            return 1;
+        }else {
+            //根据分类分组
+            Map<String, List<ZhcxCommissionCheckDetailDo>> groupList = list.stream()
+                    .collect(Collectors.groupingBy(ZhcxCommissionCheckDetailDo::getOnelevelclassification));
+            SysFileItemDo fileItemDo = sysFileItemService.getById("d1b3271ce2ec45c2915f2dbcd819f45a");
+            final Document[] doc = {WordHelpUtils.getDoc(fileItemDo.getFullpath())};
+            AtomicInteger i = new AtomicInteger();
+            FormData formData = new FormData();
+            List<Map<String,Object>> mainDataList = new ArrayList<>();
+            Map<String,Object> mainMap = new HashMap<>(16);
+            String projectEnName = "";
+            if (StringUtils.isNotBlank(projectManageDo.getProjectEnName())){
+                projectEnName = projectManageDo.getProjectEnName();
+            }
+            mainMap.put("projectNames",projectManageDo.getProjectName()+projectEnName);
+            mainMap.put("projectCode",projectManageDo.getProjectCode());
+            mainMap.put("currentDate",day);
+            mainMap.put("machineNo",machineNo);
+            mainDataList.add(mainMap);
+            formData.setMainDataList(mainDataList);
+            doc[0] = ExcelExportUtil.fillWordDataByMap(fileItemDo.getFullpath(), formData);
+            List<JSONObject> resultType = zhcxCommissionCheckDetailDao.getResultDictList();
+            groupList.forEach((k, v) -> {
+                List<ZhcxCommissionCheckDetailWordVO> detailWordVOList = new ArrayList<>();
+                List<ZhcxCommissionCheckDetailDo> detailDos = v;
+                for (ZhcxCommissionCheckDetailDo detailDo:detailDos){
+                    ZhcxCommissionCheckDetailWordVO checkDetailWordVO = new ZhcxCommissionCheckDetailWordVO();
+                    checkDetailWordVO.setChapterno(detailDo.getChapterno());
+                    String chtestcontent = "";
+                    String entitle = "";
+                    if (StringUtils.isNotBlank(detailDo.getChtestcontent())){
+                        chtestcontent = detailDo.getChtestcontent();
+                    }
+                    if (StringUtils.isNotBlank(detailDo.getEntitle())){
+                        entitle = detailDo.getEntitle();
+                    }
+                    checkDetailWordVO.setContent(chtestcontent+entitle);
+                    String testresult = "";
+                    String testdata = "";
+                    if (StringUtils.isNotBlank(detailDo.getTestresult())){
+                        testresult = resultType.stream().filter(dictDo -> detailDo.getTestresult().contains(dictDo.getString("VALUE"))).findFirst().get().getString("NAME").toString();
+                    }
+                    if (StringUtils.isNotBlank(detailDo.getTestdata())){
+                        testdata = detailDo.getTestdata();
+                    }
+                    checkDetailWordVO.setResult(testresult+testdata);
+                    String testnotes = "";
+                    if (StringUtils.isNotBlank(detailDo.getTestnotes())){
+                        testnotes = detailDo.getTestnotes();
+                    }
+                    checkDetailWordVO.setTestnotes(testnotes);
+                    detailWordVOList.add(checkDetailWordVO);
+                }
+                List<List<Map<String,Object>>> slaveTableDataList = new ArrayList<>();
+                List<Map<String, Object>> maps = convertNewList(detailWordVOList, ZhcxCommissionCheckDetailWordVO.class);
+                slaveTableDataList.add(maps);
+                FormDataVO formDataVo = new FormDataVO();
+                Map<String,Object> mainDetailMap = new HashMap<>(16);
+                List<Map<String,Object>> mainDetailDataList = new ArrayList<>();
+                mainDetailMap.put("chtitle",k);
+                mainDetailMap.put("entitle",v.get(0).getEntitle());
+                mainDetailDataList.add(mainDetailMap);
+                formDataVo.setMainDataList(mainDetailDataList);
+                formDataVo.setSlaveTableDataList(slaveTableDataList);
+                try {
+                    SysFileItemDo fileTemp = sysFileItemService.getById("b199958d6ce64d4a9d36e9e9ac20ab59");
+                    Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
+                    doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
+                } catch (Exception e) {
+                    log.info("导出word失败:"+e);
+                }
+            });
+            try {
+                doc[0].updateFields();
+                response.setContentType("application/octet-stream;charset=ISO8859-1");
+                response.setHeader("Content-Disposition", "attachment;filename=");
+                doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
+            } catch (Exception e) {
+                log.info("导出word失败:"+e);
+                return 1;
+            }
+        }
+        return 1;
+    }
+
+
+    private <T> List<Map<String, Object>> convertNewList(List<T> objectList, Class<T> clazz) {
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        int index = 0;
+        for (T obj : objectList) {
+            Map<String, Object> map = new HashMap<>();
+
+            // 获取对象的所有字段并将其转换为Map
+            Class<? super T> superclass = clazz.getSuperclass();
+            Field[] declaredFields = superclass.getDeclaredFields();
+            Field[] fields = clazz.getDeclaredFields();
+            Field[] fields1 = Stream.concat(Arrays.stream(fields), Arrays.stream(declaredFields))
+                    .toArray(Field[]::new);
+            for (Field field : fields1) {
+                field.setAccessible(true); // 设置字段可访问
+                String fieldName = field.getName();
+                Object value;
+                try {
+                    value = field.get(obj);
+                    map.put(fieldName, value);
+                    if(fieldName == "sitepic"){
+                        if(value != null){
+                            String value1 = (String) value;
+                            if(StringUtils.isNotBlank(value1)){
+                                String[] split = value1.split("\\^_\\^");
+                                map.put(fieldName, split[0]);
+                            }
+                        }
+                    }else if(fieldName == "rectifystatus"){
+                        if(!"已整改".equals(value)){
+                            map.put(fieldName, "/");
+                        }
+                    }else if(fieldName == "rectifystatus"){
+                        if(!"已整改".equals(value)){
+                            map.put(fieldName, "/");
+                        }
+                    }
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                }
+            }
+            index++;
+            map.put("index",index);
+            mapList.add(map);
+        }
+
+        return mapList;
+    }
+
+    /**
+     * 填充 word 模板(map数据格式)
+     * @param file word二进制
+     * @param formData 填充表单数据
+     */
+    private Document fillWordDataByMap(String file, FormDataVO formData){
+        //获取word文档
+        Document doc = WordHelpUtils.getDoc(file);
+        //初始化设置
+        WordHelpUtils.initDoc(doc);
+
+        //填充表单数据
+        fillFormData(doc, formData);
+        WordHelpUtils.mergeAfter(doc);
+        return doc;
+    }
+
+    private Document fillFormData(Document doc, FormDataVO formData) {
+
+        if(ObjectUtil.isNotEmpty(formData.getMainDataList())) {
+            for(Map<String,Object> map : formData.getMainDataList()) {
+                //填充主表数据
+                WordHelpUtils.fillData(doc, map);
+            }
+        }
+
+        //填充多个从表格数据
+        if(ObjectUtil.isNotEmpty(formData.getSlaveTableDataList())) {
+            int i=0;
+            for(List<Map<String,Object>> list :formData.getSlaveTableDataList()) {
+                i++;
+                WordHelpUtils.fillData(doc, list, "List" + i);
+            }
+        }
+        return doc;
+    }
 }

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

@@ -529,6 +529,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
             String content = staf.getContent()== null ?"":staf.getContent();
             String baseinfonum = staf.getBaseinfonum()== null ?"":staf.getBaseinfonum();
             String subcontractename = staf.getSubcontractename() == null ? "" : staf.getSubcontractename();
+            String remark = staf.getRemark() == null ? "" : staf.getRemark();
             BigDecimal amount = staf.getAmount();
             String rectifystatus = staf.getRectifystatus();
             if(StringUtils.isNotBlank(sitepic)){
@@ -569,6 +570,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
             range.replace("pic", "");
             range.replace("content",projectcode+projectename+content);
             range.replace("code", baseinfonum);
+            range.replace("remark", remark);
             if (amount != null) {
                 range.replace("amount", String.valueOf(amount));
             }else{

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

@@ -879,7 +879,8 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
             main.setMainstatus(LuckySheet4SummaryHelp.getCommonStatus(status));
             main.setReqdate(LuckySheet4SummaryHelp.getDateDefaultNull(row, "提出日期"));
             main.setRequser(row.getString("提出者"));
-            main.setRectifydate(LuckySheet4SummaryHelp.getDateDefaultNull(row, "整改日期"));
+//            main.setRectifydate(LuckySheet4SummaryHelp.getDateDefaultNull(row, "整改期限"));
+            main.setRectifydate(row.getString("整改期限"));
             main.setRemark1(row.getString("备注1"));
             main.setRemark2(row.getString("备注2"));
 
@@ -910,6 +911,9 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                 String mochineStatus = machineObj.getString("状态");
                 machine.setStatus(LuckySheet4SummaryHelp.getCommonStatus(mochineStatus));
 
+                machine.setSubcontractorname(machineObj.getString("施工分包商/班组"));
+                machine.setDutysubcontractorname(machineObj.getString("责任分包商/班组"));
+
                 Map<String, JSONObject> orgMap = summaryDataBo.getOrgMap();
                 Map<String, JSONObject> orgIdMap = summaryDataBo.getOrgIdMap();
 

+ 12 - 9
business-common/src/main/resources/mybatis/business/ZhcxCommissionCheckDao.xml

@@ -28,18 +28,21 @@
                     SELECT c.PROJECTCODE FROM INCONTROL.ZHCX_COMMISSION_CHECK c WHERE c.DELETED = '0' AND c.ID = #{masterId}
                 ) AND batch.SAVESTATUS = 'save' AND batch.DATASTATUS = '10'
             ),
-                 split_table AS (
-                     SELECT REGEXP_SUBSTR(t.MACHINENOID, '[^,]+', 1, LEVEL) AS split_item
-                     FROM temp_table t
-        CONNECT BY REGEXP_SUBSTR(t.MACHINENOID, '[^,]+', 1, LEVEL) IS NOT NULL
+            split_table AS (
+                SELECT REGEXP_SUBSTR(t.MACHINENOID, '[^,]+', 1, LEVEL) AS split_item
+                FROM temp_table t
+                CONNECT BY REGEXP_SUBSTR(t.MACHINENOID, '[^,]+', 1, LEVEL) IS NOT NULL
             ),
             combined_table AS (
-              SELECT LISTAGG(DISTINCT split_item, ',') WITHIN GROUP (ORDER BY split_item) AS combined_result
-              FROM split_table
+                SELECT LISTAGG(DISTINCT split_item, ',') WITHIN GROUP (ORDER BY split_item) AS combined_result
+                FROM split_table
+            ),
+            final_result AS (
+                SELECT COALESCE(REGEXP_SUBSTR(c.combined_result, '[^,]+', 1, LEVEL), '99999999999999') AS split_result
+                FROM combined_table c
+                CONNECT BY REGEXP_SUBSTR(c.combined_result, '[^,]+', 1, LEVEL) IS NOT NULL
             )
-        SELECT REGEXP_SUBSTR(c.combined_result, '[^,]+', 1, LEVEL) AS split_result
-        FROM combined_table c
-            CONNECT BY REGEXP_SUBSTR(c.combined_result, '[^,]+', 1, LEVEL) IS NOT NULL
+            SELECT split_result FROM final_result
         )
     </select>
 

+ 18 - 0
business-common/src/main/resources/mybatis/business/zhcxCommissionCheckBaseInfoDetailDao.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.rongwei.bscommon.sys.dao.ZhcxCommissionCheckBaseInfoDetailDao">
+
+    <update id="batchUpdate" parameterType="java.util.List">
+        update ZHCX_COMMISSION_CHECK_BASE_INFO_DETAIL
+        set CHAPTERNO = case
+        <foreach collection="list" item="item" index="index">
+            when id=#{item.id} then #{item.chapterno}
+        </foreach>
+        end
+        where id in
+        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
+            #{item.id}
+        </foreach>
+    </update>
+</mapper>

+ 185 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxCommissionCheckBaseInfoDetailDo.java

@@ -0,0 +1,185 @@
+package com.rongwei.bsentity.domain;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 试车检查标准库子表
+ * </p>
+ *
+ * @author wm
+ * @since 2024-10-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("ZHCX_COMMISSION_CHECK_BASE_INFO_DETAIL")
+public class ZhcxCommissionCheckBaseInfoDetailDo extends BaseDo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableField("ID")
+    private String id;
+    /**
+     * 租户id
+     */
+    @TableField("TENANTID")
+    private String tenantid;
+    /**
+     * 扩展json格式配置
+     */
+    @TableField("ROPTION")
+    private String roption;
+    /**
+     * 通用
+     */
+    @TableField("CURRENCY")
+    private String currency;
+    /**
+     * 小车形式
+     */
+    @TableField("CARCATEGORY")
+    private String carcategory;
+    /**
+     * 起升形式
+     */
+    @TableField("LIFTINGCATEGORY")
+    private String liftingcategory;
+    /**
+     * 上架吊具
+     */
+    @TableField("SHELVESSPREADER")
+    private String shelvesspreader;
+    /**
+     * 大梁防撞
+     */
+    @TableField("GIRDERANTICOLLISION")
+    private String girderanticollision;
+    /**
+     * 大梁锚定
+     */
+    @TableField("GIRDERANCHOR")
+    private String girderanchor;
+    /**
+     * 消防系统
+     */
+    @TableField("FAS")
+    private String fas;
+    /**
+     * 其他配置
+     */
+    @TableField("OTHERSETTING")
+    private String othersetting;
+    /**
+     * 章节号
+     */
+    @TableField("CHAPTERNO")
+    private String chapterno;
+    /**
+     * 模式1
+     */
+    @TableField("CLASSIFICATION")
+    private String classification;
+    /**
+     * 模式2
+     */
+    @TableField("CLASSIFICATIONTWO")
+    private String classificationtwo;
+    /**
+     * 标题中文
+     */
+    @TableField("CHTITLE")
+    private String chtitle;
+    /**
+     * 标题英文
+     */
+    @TableField("ENTITLE")
+    private String entitle;
+    /**
+     * 测试内容中文
+     */
+    @TableField("CHTESTCONTENT")
+    private String chtestcontent;
+    /**
+     * 测试内容英文
+     */
+    @TableField("ENTESTCONTENT")
+    private String entestcontent;
+    /**
+     * 标准测试方法
+     */
+    @TableField("TESTMETHOD")
+    private String testmethod;
+    /**
+     * 标准测试时间
+     */
+    @TableField("TESTTIME")
+    private BigDecimal testtime;
+    /**
+     * 状态
+     */
+    @TableField("STATUS")
+    private String status;
+    /**
+     * 父id
+     */
+    @TableField("PID")
+    private String pid;
+    /**
+     * 模式3
+     */
+    @TableField("CLASSIFICATIONTHREE")
+    private String classificationthree;
+    /**
+     * 模式4
+     */
+    @TableField("CLASSIFICATIONFOUR")
+    private String classificationfour;
+    /**
+     * 模式5
+     */
+    @TableField("CLASSIFICATIONFIVE")
+    private String classificationfive;
+    /**
+     * 模式6
+     */
+    @TableField("CLASSIFICATIONSIX")
+    private String classificationsix;
+    /**
+     * 一级分类
+     */
+    @TableField("ONELEVELCLASSIFICATION")
+    private String onelevelclassification;
+    /**
+     * 二级分类
+     */
+    @TableField("SECONDLEVELCLASSIFICATION")
+    private String secondlevelclassification;
+    /**
+     * 三级分类
+     */
+    @TableField("THREELEVELCLASSIFICATION")
+    private String threelevelclassification;
+    /**
+     * 四级分类
+     */
+    @TableField("FOURONELEVELCLASSIFICATION")
+    private String fouronelevelclassification;
+    /**
+     * 标题标志位
+     */
+    @TableField("ISTITLE")
+    private String istitle;
+
+
+}

+ 1 - 1
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectRectifyDo.java

@@ -93,7 +93,7 @@ public class ZhcxProjectRectifyDo extends BaseDo {
      * 整改日期
      */
     @TableField("RECTIFYDATE")
-    private Date rectifydate;
+    private String rectifydate;
     /**
      * 备注1
      */

+ 12 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxProjectRectifyMachineDo.java

@@ -140,4 +140,16 @@ public class ZhcxProjectRectifyMachineDo extends BaseDo {
     @TableField("DUTYIFOUTSIDEBASE")
     private String dutyifoutsidebase;
 
+    /**
+     * 施工分包商/班组
+     */
+    @TableField("SUBCONTRACTORNAME")
+    private String subcontractorname;
+
+    /**
+     * 怎忍分包商/班组
+     */
+    @TableField("DUTYSUBCONTRACTORNAME")
+    private String dutysubcontractorname;
+
 }

+ 39 - 0
business-entity/src/main/java/com/rongwei/bsentity/vo/ZhcxCommissionCheckDetailWordVO.java

@@ -0,0 +1,39 @@
+package com.rongwei.bsentity.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 试车检查子表
+ * </p>
+ *
+ * @author xuan
+ * @since 2024-09-24
+ */
+@Data
+public class ZhcxCommissionCheckDetailWordVO{
+
+    /**
+     * 序号
+     */
+    private String chapterno;
+
+    /**
+     * 测试内容中文
+     * 测试内容英文
+     */
+    private String content;
+
+    /**
+     * 测试结果
+     * 试车结果
+     */
+    private String result;
+
+    /**
+     * 试车问题
+     */
+    private String testnotes;
+}

+ 36 - 0
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxCommissionCheckBaseInfoDetailController.java

@@ -0,0 +1,36 @@
+package com.rongwei.bsserver.controller;
+
+
+import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckBaseInfoDetailService;
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckBaseInfoDetailDo;
+import com.rongwei.rwcommon.base.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 试车检查标准库子表 前端控制器
+ * </p>
+ *
+ * @author wm
+ * @since 2024-10-11
+ */
+@RestController
+@RequestMapping("/zhcxCommissionCheckBaseInfoDetail")
+public class ZhcxCommissionCheckBaseInfoDetailController {
+
+    @Autowired
+    private ZhcxCommissionCheckBaseInfoDetailService service;
+
+    @PostMapping("/updateChapterNo")
+    public R updateChapterNo(@RequestBody List<ZhcxCommissionCheckBaseInfoDetailDo> list){
+        service.batchUpdate(list);
+        return R.ok();
+    }
+}
+

+ 14 - 0
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxCommissionCheckController.java

@@ -5,10 +5,13 @@ import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckService;
 import com.rongwei.bsentity.dto.CheckDetailDTO;
 import com.rongwei.bsentity.dto.CommissionCheckDTO;
 import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.base.exception.CustomException;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 /**
@@ -58,5 +61,16 @@ public class ZhcxCommissionCheckController {
             return R.error("试车报告新增异常");
         }
     }
+
+    @PostMapping("wordExport")
+    @ApiOperation("word导出")
+    public void wordExport(@RequestBody Map<String,Object> map, HttpServletResponse response){
+        int i = commissionCheckService.wordExport(map,response);
+        if(i == 0){
+            throw new CustomException("导出失败");
+        }else if(i == 1){
+            throw new CustomException("检查内容暂无数据");
+        }
+    }
 }