deslrey
2 天以前 4f258638d62ccaae0050f1ed6c7231941b66fb50
【物料属性】的回显及查询
已修改8个文件
443 ■■■■■ 文件已修改
basic-server/src/main/resources/mapper/StandardTreeMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsReportMapper.xml 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsSampleMapper.xml 184 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -330,6 +330,7 @@
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="getIfsByOver" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto">
        select * from (<include refid="getIfsOrder"/>
        <where>
@@ -343,6 +344,7 @@
        </if>
        order by send_time desc
    </select>
    <select id="getIfsByOverList" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto">
        select * from (<include refid="getIfsOrder"/>
            <where>
inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java
@@ -1,12 +1,13 @@
package com.ruoyi.inspect.dto;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class InsOrderPlanDTO implements Serializable {
public class InsOrderPlanDTO extends IfsInventoryQuantity implements Serializable  {
    @ApiModelProperty("检验任务主键id")
    private Long insSampleId;
inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java
@@ -24,6 +24,9 @@
    @ApiModelProperty(value = "下单类别")
    private Integer typeSource;
    @ApiModelProperty(value = "物料属性")
    private String materialProp;
    @ApiModelProperty(value = "检验类别")
    private String orderType;
inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java
@@ -18,21 +18,22 @@
import java.util.Map;
/**
* @author Administrator
* @description 针对表【ins_sample(检验样品)】的数据库操作Mapper
* @createDate 2024-03-14 17:14:57
* @Entity com.yuanchu.mom.pojo.InsSample
*/
 * @author Administrator
 * @description 针对表【ins_sample(检验样品)】的数据库操作Mapper
 * @createDate 2024-03-14 17:14:57
 * @Entity com.yuanchu.mom.pojo.InsSample
 */
@Mapper
public interface InsSampleMapper extends BaseMapper<InsSample> {
    IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page,
                                                @Param("ew") QueryWrapper<InsOrderPlanDTO> ew,
                                                @Param("userName") String userName ,
                                                @Param("userName") String userName,
                                                @Param("userId") Integer userId,
                                                @Param("sonLaboratory") String sonLaboratory,
                                                @Param("laboratory") String laboratory,
                                                @Param("isCheck") Integer isCheck);
                                                @Param("isCheck") Integer isCheck,
                                                @Param("materialProp") String materialProp);
    IPage<InsOrderPlanTaskSwitchVo> inspectionOrderDetailsTaskSwitching(Page page, @Param("ew") QueryWrapper<InsOrderPlanDTO> ew, @Param("userId") Integer userId, @Param("sonLaboratory") String sonLaboratory, @Param("laboratory") String laboratory);
@@ -40,7 +41,7 @@
    List<SampleProductDto> selectSampleProductListByOrderId2(@Param("id") Integer id);
    Map<String,Object> selectInsOrder(@Param("id") Integer id);
    Map<String, Object> selectInsOrder(@Param("id") Integer id);
    List<SampleProductDto> getInsOrderAndSample(@Param("id") Integer id, @Param("laboratory") String laboratory);
@@ -48,6 +49,7 @@
    /**
     * 可能没有产品直接就是对象
     *
     * @param sample
     * @return
     */
@@ -55,6 +57,7 @@
    /**
     * 样品
     *
     * @param id
     * @param laboratory
     * @return
@@ -64,6 +67,7 @@
    /**
     * 原材料
     *
     * @param id
     * @param laboratory
     * @param rawMaterialTag
@@ -77,6 +81,7 @@
    /**
     * 电缆配置查看配置标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -85,6 +90,7 @@
    /**
     * 原材料查看配置标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -93,6 +99,7 @@
    /**
     * 查看重复标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -104,6 +111,7 @@
    /**
     * 查询厂家密度(有型号)
     *
     * @param sample
     * @param production
     * @return
@@ -112,6 +120,7 @@
    /**
     * 查询厂家密度(没型号)
     *
     * @param sample
     * @param production
     * @return
@@ -121,6 +130,7 @@
    /**
     * 查询检验项检验结果
     *
     * @param itemIds
     * @return
     */
@@ -128,6 +138,7 @@
    /**
     * 根据订单id查询样品
     *
     * @param insOrderId
     * @return
     */
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -177,13 +177,17 @@
        Integer isCheck = insOrderPlanDTO.getIsCheck();
        insOrderPlanDTO.setIsCheck(null);
        String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室
        // 数据置空,防止反射生成重复数据
        String materialProp = insOrderPlanDTO.getMaterialProp();
        insOrderPlanDTO.setMaterialProp(null);
        IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page,
                QueryWrappers.queryWrappers(insOrderPlanDTO),
                userName,
                userId,
                sonLaboratory,
                laboratory,
                isCheck);
                isCheck,
                materialProp);
        return insOrderPage;
    }
@@ -274,7 +278,7 @@
    }
    @Override
    public Map<String,Object> checkSubmitPlan(Integer orderId, String laboratory) {
    public Map<String, Object> checkSubmitPlan(Integer orderId, String laboratory) {
        Map<String, Object> map = new HashMap<>();
        List<String> collect = new ArrayList<>();
        List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId));
@@ -304,15 +308,15 @@
        //查询ifs拆分订单是否有已下单但是未检完的单子
        long count = 0L;
        InsOrder insOrder = insOrderMapper.selectById(orderId);
        if(Objects.nonNull(insOrder.getIfsInventoryId())){
        if (Objects.nonNull(insOrder.getIfsInventoryId())) {
            IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId());
            //过滤出不合格或未提交的单子
            count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(),one.getLineNo(),one.getReleaseNo(),one.getReceiptNo(),one.getOrderNo())
            count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo())
                    .stream()
                    .filter(f->(Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(),orderId)) && (Objects.isNull(f.getInsResult()) || 0==f.getInsResult())).count();
                    .filter(f -> (Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(), orderId)) && (Objects.isNull(f.getInsResult()) || 0 == f.getInsResult())).count();
        }
        map.put("errorMsg",collect);
        map.put("unInsOrderCount",count);
        map.put("errorMsg", collect);
        map.put("unInsOrderCount", count);
        return map;
    }
@@ -620,6 +624,7 @@
    /**
     * 查询模板内容
     *
     * @param order
     * @param insProducts
     */
@@ -684,6 +689,7 @@
    /**
     * todo: 原始记录模板清除没有使用的检验项(暂时有bug无法使用)
     *
     * @param sheet
     * @param itemNameList
     */
@@ -756,6 +762,7 @@
    /**
     * 坐标拼接
     *
     * @param r 横坐标
     * @param c 纵坐标
     * @return
@@ -768,7 +775,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults) {
    public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode, Boolean registerInsResults) {
        InsOrder order = insOrderMapper.selectById(orderId);
        // 1. 判断是否有重复编号, 有重复编号做提醒
        Long codeCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery()
@@ -807,7 +814,7 @@
            int count = 0;
            for (InsProduct product : insProducts) {
                count++;
                str +=  (count != 0 ? "\n" : "") + count + ":" +
                str += (count != 0 ? "\n" : "") + count + ":" +
                        product.getInspectionItemClass() + " " +
                        product.getInspectionItem() + " " +
                        product.getInspectionItemSubclass();
@@ -937,7 +944,7 @@
            // 登记检验结果
            // 判断是否有不合格, 有不合格不能移库
            // todo: ifs移库
            insReportService.isRawMaterial(order,registerInsResults,false);
            insReportService.isRawMaterial(order, registerInsResults, false);
            // 15 判断当前样品是否为原材料, 原材料需要进行数据分析, 判断之前10条数据同一个供应商, 同一个检验项的偏差是否超过10%
            // 查询ifs信息获取获取前10个供应商一样的, 检验项一样信息
@@ -964,6 +971,7 @@
    /**
     * *****添加分析数据******
     *
     * @param productList
     * @param ifsInventoryQuantity
     * @param order
@@ -1054,6 +1062,7 @@
    /**
     * *****计算偏差****
     *
     * @param data
     * @param targetStr
     * @return
@@ -1079,11 +1088,12 @@
    /**
     * *****计算偏差****
     *
     * @param targetStr
     * @return
     */
    public static double isDeviationOverTenPercentByAsked(String asked, String targetStr) {
        if(!isNumeric(asked)) return 0;
        if (!isNumeric(asked)) return 0;
        double average = Double.parseDouble(asked);
        double target = Double.parseDouble(targetStr);
@@ -1097,6 +1107,7 @@
    /**
     * ******原始记录模板复制*****
     *
     * @param orderId
     * @param ids
     */
@@ -1130,6 +1141,7 @@
    /**
     * 检验任务复核
     *
     * @param orderId
     * @param laboratory
     * @param type
@@ -1259,6 +1271,7 @@
    /**
     * 生成报告
     *
     * @param orderId
     */
    private void generateReport(Integer orderId) {
@@ -1298,6 +1311,7 @@
    /**
     * 电缆配置, 查看配置标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -1309,6 +1323,7 @@
    /**
     * 原材料查看标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -1320,6 +1335,7 @@
    /**
     * 查看重复标识
     *
     * @param id
     * @param laboratory
     * @return
@@ -1331,6 +1347,7 @@
    /**
     * 新增不合格复测内容
     *
     * @return
     */
    @Override
@@ -1527,6 +1544,7 @@
    /**
     * 查询进货原始记录
     *
     * @param insOrderId
     * @return
     */
@@ -1582,6 +1600,7 @@
    /**
     * 保存原材料进货验证
     *
     * @param factoryVerify
     * @return
     */
@@ -1633,13 +1652,14 @@
    /**
     * 设置表格样式
     *
     * @param max 标识最大个数
     * @return
     */
    private TableStyle setTableStyle(int max){
    private TableStyle setTableStyle(int max) {
        //设置样式
        TableStyle tableStyle = new TableStyle();
        if(max<=5){
        if (max <= 5) {
            for (int i = 1; i <= max; i++) {
                // 根据检验结果个数修改长度
                switch (i) {
@@ -1677,30 +1697,31 @@
    /**
     * 处理有电缆颜色标识的检测项
     * @param cableTags 电缆颜色标识
     * @param collect   检测项列表
     *
     * @param cableTags  电缆颜色标识
     * @param collect    检测项列表
     * @param startIndex 起始下标
     * @param endIndex   结束下标
     * @return
     */
    private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags,Map<String, List<SampleProductExportDto>> collect,int startIndex,int endIndex){
    private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags, Map<String, List<SampleProductExportDto>> collect, int startIndex, int endIndex) {
        List<SampleProductExportDto> sampleProductExportDtos = new ArrayList<>();
        for (String s : collect.keySet()) {
            List<String> lastValueList = new ArrayList<>();
            SampleProductExportDto dto = new SampleProductExportDto();
            BeanUtil.copyProperties(collect.get(s).get(0),dto);
            BeanUtil.copyProperties(collect.get(s).get(0), dto);
            Set<String> tellSet = new HashSet<>();
            for (int i = startIndex; i < endIndex; i++) {
                String cableTag = cableTags.get(i);
                for (SampleProductExportDto sDto : collect.get(s)) {
                    tellSet.add(sDto.getTell());
                    if(sDto.getCableTag().equals(cableTag)){
                    if (sDto.getCableTag().equals(cableTag)) {
                        lastValueList.add(sDto.getLastValue());
                    }
                }
            }
            //切割电缆配置项
            dto.setTell(String.join("\n",tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList())));
            dto.setTell(String.join("\n", tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList())));
            dto.setLastValueList(lastValueList);
            sampleProductExportDtos.add(dto);
        }
@@ -1709,10 +1730,11 @@
    /**
     * 检测项排序
     *
     * @param sourceMap
     * @param targetMap
     */
    private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap,Map<String, List<SampleProductExportDto>> targetMap){
    private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap, Map<String, List<SampleProductExportDto>> targetMap) {
        List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sourceMap.entrySet());
        entries.sort(Comparator.comparingInt(o -> (o.getValue().get(0).getSort() == null ? 0 : o.getValue().get(0).getSort())));
        for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) {
@@ -1722,6 +1744,7 @@
    /**
     * 小报告生成
     *
     * @param orderId
     * @param insOrder
     * @param insSamples
@@ -1741,7 +1764,7 @@
        //查询零件属性
        IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery()
                .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId()));
        if(Objects.nonNull(ifsPartPropsRecord)){
        if (Objects.nonNull(ifsPartPropsRecord)) {
            enterFactoryReport.setOuterColor(ifsPartPropsRecord.getOuterColor());
        }
        enterFactoryReport.setQtyArrived(ifsInventoryQuantity.getQtyArrived() == null ? "" :
@@ -1766,7 +1789,7 @@
        List<RowRenderData> rows = new ArrayList<>();
        List<TextRenderData> text = new ArrayList<>();
        RowRenderData rowRenderData = null;
        List<Map<String,Object>> cableTagEnclosureTables = new ArrayList<>();
        List<Map<String, Object>> cableTagEnclosureTables = new ArrayList<>();
        // 查询检验内容
        List<SampleProductExportDto> sampleProductDto2s = insOrderMapper.selectSampleBySampleId(insSamples.stream()
@@ -1779,14 +1802,14 @@
        Integer max = insSamples.stream().mapToInt(InsSample::getQuantity).sum();
        TableRenderData tableRenderData = new TableRenderData();
        String templateName;
        if(StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){
        if (StringUtils.equals(OrderType.WG.getValue(), ifsInventoryQuantity.getOrderType())) {
            //过滤不判定的检测项
            List<SampleProductExportDto> filterItems = sampleProductDto2s.stream().filter(f -> f.getInsResult() != 3).collect(Collectors.toList());
            int maxCableTag = 5;//单个表格,电缆颜色标识最大个数
            templateName = "/static/small-wg-report-template.docx";
            //查询检验单消息
            InsSampleUserVO insSampleUser = insSampleUserMapper.selectUserNameByOrderId(orderId);
            if(Objects.nonNull(insSampleUser)){
            if (Objects.nonNull(insSampleUser)) {
                enterFactoryReport.setPartDesc(insSampleUser.getModel());
                enterFactoryReport.setInspector(insSampleUser.getInspector());
                enterFactoryReport.setInspectDate(insSampleUser.getInspectDate());
@@ -1798,7 +1821,7 @@
            AtomicInteger finalIndex = new AtomicInteger(1);
            List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId());
            max = Math.max(cableTags.size(),1);
            max = Math.max(cableTags.size(), 1);
            //处理电缆配置检测项
            Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>();
            Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>();
@@ -1810,41 +1833,41 @@
                List<SampleProductExportDto> sampleProductExportDtos2;
                //处理电缆配置项
                Map<String, List<SampleProductExportDto>> collect = listMap2.get(key).stream().collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItemSubclass));
                if(cableTags.size()>maxCableTag){
                    sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,maxCableTag);
                    sampleProductExportDtos2 = transformSampleProduct(cableTags,collect,maxCableTag,cableTags.size());
                    tempMap2.put(key,sampleProductExportDtos2);
                }else{
                    sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,cableTags.size());
                if (cableTags.size() > maxCableTag) {
                    sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, maxCableTag);
                    sampleProductExportDtos2 = transformSampleProduct(cableTags, collect, maxCableTag, cableTags.size());
                    tempMap2.put(key, sampleProductExportDtos2);
                } else {
                    sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, cableTags.size());
                }
                cableTagItem.put(key,sampleProductExportDtos);
                cableTagItem.put(key, sampleProductExportDtos);
            }
            //处理非电缆配置检测项
            Map<String, List<SampleProductExportDto>> listMap = filterItems.stream()
                    .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem()))
                    .collect(Collectors.groupingBy(s->s.getInspectionItem()+"&"));
                    .collect(Collectors.groupingBy(s -> s.getInspectionItem() + "&"));
            //合并检测项列表
            tempMap.putAll(cableTagItem);
            tempMap.putAll(listMap);
            sortSampleProduct(tempMap,totalItem);
            int tagNum = Math.min(max,maxCableTag);
            List<String> tagList = cableTags.isEmpty()?new ArrayList<>():cableTags.subList(0,tagNum);
            handlerSampleItems(OrderType.WG.getValue(),totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true);
            sortSampleProduct(tempMap, totalItem);
            int tagNum = Math.min(max, maxCableTag);
            List<String> tagList = cableTags.isEmpty() ? new ArrayList<>() : cableTags.subList(0, tagNum);
            handlerSampleItems(OrderType.WG.getValue(), totalItem, finalIndex, sampleList, tagNum, text, rows, rowRenderData, resultCh, tagList, true);
            if(CollectionUtil.isNotEmpty(tempMap2)){
                sortSampleProduct(tempMap2,cableTagEnclosureItem);
            if (CollectionUtil.isNotEmpty(tempMap2)) {
                sortSampleProduct(tempMap2, cableTagEnclosureItem);
                //生成附件电缆表格
                TableRenderData tableRenderData2 = new TableRenderData();
                List<String> newCableTags = cableTags.subList(maxCableTag,cableTags.size());
                List<String> newCableTags = cableTags.subList(maxCableTag, cableTags.size());
                AtomicInteger finalIndex2 = new AtomicInteger(1);
                List<TextRenderData> newText = new ArrayList<TextRenderData>();
                List<RowRenderData> newRows = new ArrayList<>();
                RowRenderData newRowRenderData = null;
                handlerSampleItems(OrderType.WG.getValue(),cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true);
                handlerSampleItems(OrderType.WG.getValue(), cableTagEnclosureItem, finalIndex2, new ArrayList<>(), newCableTags.size(), newText, newRows, newRowRenderData, resultCh, newCableTags, true);
                tableRenderData2.setRows(newRows);
                tableRenderData2.setTableStyle(setTableStyle(newCableTags.size()));
                HashMap<String, Object> tableMap = new HashMap<>();
                tableMap.put("enclosureTable",tableRenderData2);
                tableMap.put("enclosureTable", tableRenderData2);
                tableMap.put("resultCh", resultCh);
                tableMap.put("writeUrl", null);
                tableMap.put("examineUrl", null);
@@ -1864,7 +1887,7 @@
                resultCh.set("本产品符合相关标准要求,经检验合格准予出厂(盖章有效)");
            }
        }else{
        } else {
            templateName = "/static/small-report-template.docx";
            // 转成Mpa进行排序
            Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream()
@@ -1872,11 +1895,11 @@
                    .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem));
//            // 创建一个 LinkedHashMap 来保持插入顺序
            Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>();
            sortSampleProduct(sortedMap,item);
            sortSampleProduct(sortedMap, item);
            AtomicInteger finalIndex = new AtomicInteger(1);
            handlerSampleItems(OrderType.RAW.getValue(), item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true);
            handlerSampleItems(OrderType.RAW.getValue(), item, finalIndex, sampleList, max, text, rows, rowRenderData, resultCh, null, true);
            tableRenderData.setRows(rows);
            tableRenderData.setTableStyle(setTableStyle(max));
@@ -1897,7 +1920,7 @@
                    put("standardMethod", standardMethod2.toString().equals("null") ? "" : standardMethod2);
                    put("orderType", orderType);
                    put("table", tableRenderData);
                    put("enclosureTables", cableTagEnclosureTables.isEmpty()?null:cableTagEnclosureTables);
                    put("enclosureTables", cableTagEnclosureTables.isEmpty() ? null : cableTagEnclosureTables);
                    put("resultCh", resultCh);
                    put("writeUrl", null);
                    put("examineUrl", null);
@@ -1928,6 +1951,7 @@
    /**
     * 处理常规检测项
     *
     * @param item
     * @param finalIndex
     * @param sampleList
@@ -1937,7 +1961,7 @@
     * @param rowRenderData
     * @param resultCh
     */
    private static void handlerSampleItems(String orderType,Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){
    private static void handlerSampleItems(String orderType, Map<String, List<SampleProductExportDto>> item, AtomicInteger finalIndex, List<SampleProductExportDto> sampleList, Integer max, List<TextRenderData> text, List<RowRenderData> rows, RowRenderData rowRenderData, AtomicReference<String> resultCh, List<String> cableTagList, Boolean hasAddHead) {
        item.forEach((s, sampleProductDtoInside) -> {
            // 添加检验项
            SampleProductExportDto dto2 = new SampleProductExportDto();
@@ -1953,7 +1977,7 @@
                    String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag();
                    if (map.containsKey(productName)) {
                        // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                        if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) {
                            map.get(productName)
                                    .getLastValueList()
                                    .add(productDto2.getLastValue());
@@ -1963,7 +1987,7 @@
                                .add(productDto2.getInsResult());
                    } else {
                        // 如果名称不存在,直接放入 map
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                        if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) {
                            productDto2.setLastValueList(new ArrayList<>()); // 检验内容
                            productDto2.getLastValueList().add(productDto2.getLastValue());
                        }
@@ -1998,7 +2022,7 @@
                    String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag();
                    if (map.containsKey(productName)) {
                        // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表
                        if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                        if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) {
                            map.get(productName)
                                    .getLastValueList()
                                    .add(productDto2.getLastValue());
@@ -2008,7 +2032,7 @@
                                .add(productDto2.getInsResult());
                    } else {
                        // 如果名称不存在,直接放入 map
                        if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){
                        if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) {
                            productDto2.setLastValueList(new ArrayList<>()); // 检验内容
                            productDto2.getLastValueList().add(productDto2.getLastValue());
                        }
@@ -2029,8 +2053,8 @@
        });
        // 添加小报告表头
        if(hasAddHead){
            text = addSmallHead(text, max, rows,cableTagList);
        if (hasAddHead) {
            text = addSmallHead(text, max, rows, cableTagList);
        }
        // 中间检测值添加
@@ -2049,8 +2073,8 @@
            // 检验项目
            TextRenderData middleRenderData2 = new TextRenderData();
            String[] split = sample.getInspectionName().split("&");
            String itemName = split.length>0?split[0]:sample.getInspectionName();
            middleRenderData2.setText(itemName+"∑"+itemName+i+"_"+finalIndex);
            String itemName = split.length > 0 ? split[0] : sample.getInspectionName();
            middleRenderData2.setText(itemName + "∑" + itemName + i + "_" + finalIndex);
            Style middleStyle2 = new Style();
            middleStyle2.setFontFamily("宋体");
            middleStyle2.setColor("000000");
@@ -2137,7 +2161,7 @@
                    TextRenderData middleRenderData6 = new TextRenderData();
                    middleRenderData6.setText((StringUtils.isNotEmpty(sample.getLastValue()) ?
                            sample.getLastValue() : "")
                            + "∑" + (finalIndex.get() +"_"+ i));
                            + "∑" + (finalIndex.get() + "_" + i));
                    Style middleStyle6 = new Style();
                    middleStyle6.setFontFamily("宋体");
                    middleStyle6.setColor("000000");
@@ -2220,12 +2244,13 @@
    /**
     * 添加小报告表头
     *
     * @param text
     * @param max
     * @param rows
     * @return
     */
    private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows,List<String> cableTagList) {
    private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows, List<String> cableTagList) {
        RowRenderData rowRenderData;
//        // 头
        TextRenderData headRenderData1 = new TextRenderData();
@@ -2339,7 +2364,7 @@
            text = new ArrayList<>();
        }
        //如果有电缆颜色,生成颜色标识行
        if(CollectionUtil.isNotEmpty(cableTagList)){
        if (CollectionUtil.isNotEmpty(cableTagList)) {
            TextRenderData tagRenderData1 = new TextRenderData();
            tagRenderData1.setText("");
            Style tagStyle1 = new Style();
@@ -2402,6 +2427,7 @@
    /**
     * 创建大报告
     *
     * @param orderId
     * @param insOrder
     * @param
@@ -2827,6 +2853,7 @@
    /**
     * 调整高度
     *
     * @param row
     * @param rowHeight
     * @return
@@ -3058,12 +3085,13 @@
    /**
     * 添加报告表头
     *
     * @param sample
     * @param text
     * @param rowRenderData
     * @param rows
     * @param max
     * @param cableTags 线芯颜色
     * @param cableTags     线芯颜色
     */
    private static void addHead(SampleProductDto sample, List<TextRenderData> text, RowRenderData rowRenderData, List<RowRenderData> rows, int max, List<String> cableTags) {
        // 第一行
@@ -3281,16 +3309,17 @@
    /**
     * 添加检测值
     * @param a   当前样品
     *
     * @param a             当前样品
     * @param text
     * @param rowRenderData
     * @param rows
     * @param max  检验数量
     * @param max           检验数量
     * @param resultChList  不符合信息中文
     * @param resultEhList  不符合信息英文
     * @param insSamples
     * @param cableTags 线芯颜色
     * @param isOneSample 判断是否是只有一个样品
     * @param cableTags     线芯颜色
     * @param isOneSample   判断是否是只有一个样品
     */
    private int addTestValue(SampleProductDto a,
                             List<TextRenderData> text,
@@ -3969,6 +3998,7 @@
    /**
     * 添加报告结论中英文
     *
     * @param sample
     * @param itemCh
     * @param itemEn
@@ -4028,6 +4058,7 @@
    /**
     * 格式化修改检验项
     *
     * @param sampleProductDto2s
     */
    private void formatProducts(List<SampleProductExportDto> sampleProductDto2s) {
@@ -4097,6 +4128,7 @@
    /**
     * 添加结尾
     *
     * @param text
     * @param rowRenderData
     * @param rows
@@ -4128,6 +4160,7 @@
    /**
     * 判断当前内容是否是科学计数法
     *
     * @param str
     * @return
     */
@@ -4144,6 +4177,7 @@
    /**
     * 修改要求描述的科学计数法
     *
     * @param input
     */
    public static String convertToScientificNotation(String input) {
@@ -4173,6 +4207,7 @@
    /**
     * 展示成科学计数法
     *
     * @param number
     * @return
     */
@@ -4269,6 +4304,7 @@
    /**
     * 根据要求描述保留结果小数点位数
     *
     * @param reference
     * @param value
     * @return
@@ -4337,6 +4373,7 @@
    /**
     * 保留位数, 如果等于0 返回找到的一个非0位数
     *
     * @param number 当前数字
     * @param scale  原本保留的位数
     * @return
@@ -4375,9 +4412,10 @@
    /**
     * *****保存元此阿里进货验证原始记录*****
     * @param insOrderId 订单Id
     * @param examineUserId  复核人Id
     * @param writeUserId  检验员Id
     *
     * @param insOrderId    订单Id
     * @param examineUserId 复核人Id
     * @param writeUserId   检验员Id
     */
    private void reportFactoryVerify(Integer insOrderId, Integer examineUserId, Integer writeUserId) {
        // 查询进货验证原始记录
@@ -4530,6 +4568,7 @@
    /**
     * ***格式化进厂验证内容****
     *
     * @param basicType
     * @return
     */
@@ -4559,6 +4598,7 @@
    /**
     * ***word转换pdf***
     *
     * @param path
     * @return
     */
@@ -4607,6 +4647,7 @@
    /**
     * *****修改成品抽样状态******
     *
     * @param insSamples
     * @param order
     */
@@ -4644,6 +4685,7 @@
    /**
     * 添加工时
     *
     * @param userId
     * @param insProduct
     * @param insOrder
inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java
@@ -4,7 +4,7 @@
import lombok.Data;
@Data
public class InsOrderPlanVO{
public class InsOrderPlanVO {
    private Integer id;
@@ -15,6 +15,9 @@
    @ApiModelProperty("样品名称")
    private String sample;
    @ApiModelProperty("物料属性")
    private String materialProp;
    @ApiModelProperty("零件描述")
    private String partDesc;
inspect-server/src/main/resources/mapper/InsReportMapper.xml
@@ -18,6 +18,7 @@
        io.laboratory,
        io.ifs_inventory_id,
        iiq.is_copper,
        iiq.material_prop,
        ip.son_laboratory,
        iiq.update_batch_no,
        iiq.part_desc,
@@ -32,23 +33,21 @@
        left join ins_product ip on ip.ins_sample_id = is2.id
        where 1=1
        and ir.is_pass = 1
        <if test="createOrderUser != null and createOrderUser != ''">
            and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = #{createOrderUser})
        <if test="createOrderUser != null">
            and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id =
            #{createOrderUser})
        </if>
        <if test="laboratory!=null and laboratory!=''">
           and  laboratory=#{laboratory}
            and io.laboratory=#{laboratory}
        </if>
        <if test="queryStatus != null and queryStatus != ''">
            <!-- 待提交-->
            <if test='queryStatus == 0'>
            <if test='queryStatus == "0"'>
                and ir.state = 0
            </if>
            <!-- 待审批-->
            <if test='queryStatus == 1'>
            <if test='queryStatus == "1"'>
                and ir.state = 1 and (ir.is_examine != 1 or ir.is_examine is null)
            </if>
            <!-- 待批准-->
            <if test='queryStatus == 2'>
            <if test='queryStatus == "2"'>
                and ir.state = 1 and ir.is_examine = 1 and (ir.is_ratify != 1 or ir.is_ratify is null)
            </if>
        </if>
@@ -59,11 +58,14 @@
        </if>
        ORDER BY a.create_time DESC
    </select>
    <select id="getLaboratoryByName" resultType="java.lang.String">
        select s.address from seal s
        left join laboratory l on s.lab_id = l.id
        select s.address
        from seal s
                 left join laboratory l on s.lab_id = l.id
        where l.laboratory_name = #{name}
        and s.type = #{type}
          and s.type = #{type}
        order by s.create_time desc
        limit 1
    </select>
@@ -71,24 +73,24 @@
    <!-- 报告报表导出 -->
    <select id="reportAllExport" resultType="com.ruoyi.inspect.dto.InsReportExport">
        select code,
        case when type_source = 0 then '成品下单' else '原材料下单' end                    type_source,
        case when type_source = 0 then '成品下单' else '原材料下单' end type_source,
        case
        when order_type = '抽检' then '抽检'
        when order_type = 'Customer-ordered test' then '委托检验'
        when order_type = '进厂检验' then '进厂检验'
        when order_type = 'Quarterly inspection' then '季度检验'
        else '' end                                                                    order_type,
        DATE_FORMAT(create_Time, '%Y-%m-%d %H:%i:%s')                                      create_Time,
        else '' end order_type,
        DATE_FORMAT(create_Time, '%Y-%m-%d %H:%i:%s') create_Time,
        write_user_name,
        DATE_FORMAT(write_time, '%Y-%m-%d %H:%i:%s')                                       write_time,
        case when state = 0 then '待提交' when state = 1 then '已提交' else '' end         state,
        DATE_FORMAT(write_time, '%Y-%m-%d %H:%i:%s') write_time,
        case when state = 0 then '待提交' when state = 1 then '已提交' else '' end state,
        examine_user,
        DATE_FORMAT(examine_time, '%Y-%m-%d %H:%i:%s')                                     examine_time,
        DATE_FORMAT(examine_time, '%Y-%m-%d %H:%i:%s') examine_time,
        case when is_examine = 0 then '不通过' when is_examine = 1 then '通过' else '' end is_examine,
        examine_tell,
        ratify_user,
        DATE_FORMAT(ratify_time, '%Y-%m-%d %H:%i:%s')                                      ratify_time,
        case when is_ratify = 0 then '不批准' when is_ratify = 1 then '批准' else '' end   is_ratify,
        DATE_FORMAT(ratify_time, '%Y-%m-%d %H:%i:%s') ratify_time,
        case when is_ratify = 0 then '不批准' when is_ratify = 1 then '批准' else '' end is_ratify,
        ratify_tell
        from (
        select
@@ -114,7 +116,8 @@
        where 1=1
        and ir.is_pass = 1
        <if test="createOrderUser != null and createOrderUser != ''">
            and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id = #{createOrderUser})
            and (ir.write_user_id = #{createOrderUser} or ir.examine_user_id = #{createOrderUser} or ir.ratify_user_id =
            #{createOrderUser})
        </if>
        <if test="queryStatus != null and queryStatus != ''">
            <!-- 待提交-->
inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -162,13 +162,15 @@
               ip.structure_item_parameter_id
    </sql>
    <select id="findInsSampleAndOrder" resultType="com.ruoyi.inspect.vo.InsOrderPlanVO">
        select * from(select * from(
        SELECT * FROM (
        SELECT * FROM (
        SELECT
        a.*,ios.ins_state,ios.verify_tell,verify_user
        FROM
        (
        a.*,
        ios.ins_state,
        ios.verify_tell,
        verify_user
        FROM (
        SELECT
        io.id,
        io.entrust_code,
@@ -176,10 +178,7 @@
        io.appointed,
        io.send_time,
        io.order_type,
        case when
            io.type_source = 0
            then io.sample_view
            else io.sample end sample,
        CASE WHEN io.type_source = 0 THEN io.sample_view ELSE io.sample END AS sample,
        GROUP_CONCAT(DISTINCT isa.model SEPARATOR ' ') AS sample_model,
        userName,
        checkName,
@@ -188,54 +187,65 @@
        io.laboratory,
        io.type_source,
        io.ifs_inventory_id,
        ira.id ins_report_id,
        ira.id AS ins_report_id,
        ira.url,
        ira.url_s,
        ira.temp_url_pdf,
        iiq.is_copper,
        iiq.is_split_order,
        iiq.update_batch_no,
        iiq.part_desc
        iiq.part_desc,
        iiq.material_prop AS material_prop
        FROM
        ins_order io
        LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
        LEFT JOIN ins_report ira ON ira.ins_order_id = io.id
        LEFT JOIN ifs_inventory_quantity iiq ON iiq.id = io.ifs_inventory_id
        LEFT JOIN (
        SELECT ins_sample_id,GROUP_CONCAT( DISTINCT uu.name SEPARATOR ',') AS userName
        FROM ins_sample_user u LEFT JOIN  user uu ON u.user_id = uu.id
        WHERE u.state=0
        <if test="sonLaboratory!= null and sonLaboratory != ''">
           and son_laboratory=#{sonLaboratory}
        SELECT
        ins_sample_id,
        GROUP_CONCAT(DISTINCT uu.name SEPARATOR ',') AS userName
        FROM ins_sample_user u
        LEFT JOIN user uu ON u.user_id = uu.id
        WHERE u.state = 0
        <if test="sonLaboratory != null and sonLaboratory != ''">
            AND son_laboratory = #{sonLaboratory}
        </if>
        GROUP BY ins_sample_id
        ORDER BY ins_sample_id
        ) isu ON isu.ins_sample_id = io.id
        LEFT JOIN (
        SELECT ins_sample_id,uu.name checkName
        FROM ins_sample_user u LEFT JOIN  user uu ON u.user_id = uu.id
        WHERE u.state=1
        <if test="sonLaboratory!= null and sonLaboratory != ''">
            and son_laboratory=#{sonLaboratory}
        SELECT
        ins_sample_id,
        uu.name AS checkName
        FROM ins_sample_user u
        LEFT JOIN user uu ON u.user_id = uu.id
        WHERE u.state = 1
        <if test="sonLaboratory != null and sonLaboratory != ''">
            AND son_laboratory = #{sonLaboratory}
        </if>
        GROUP BY ins_sample_id
        ORDER BY ins_sample_id
        )isu2 ON isu2.ins_sample_id = io.id
        ) isu2 ON isu2.ins_sample_id = io.id
        LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id
        WHERE io.state = 1 and send_time is not null
        WHERE io.state = 1
        AND io.send_time IS NOT NULL
        <if test="materialProp != null and materialProp != ''">
            AND iiq.material_prop LIKE CONCAT('%', #{materialProp}, '%')
        </if>
        <if test="sonLaboratory != null and sonLaboratory != ''">
            AND ip.son_laboratory = #{sonLaboratory}
        </if>
        <if test="isCheck != null">
            <if test="userName !=null and userName!=''">
                and checkName like CONCAT ('%', #{userName},'%')
            <if test="userName != null and userName != ''">
                AND checkName LIKE CONCAT('%', #{userName}, '%')
            </if>
        </if>
        <if test="isCheck == null">
            <if test="userName !=null and userName!=''">
                and userName like CONCAT ('%', #{userName},'%')
            <if test="userName != null and userName != ''">
                AND userName LIKE CONCAT('%', #{userName}, '%')
            </if>
        </if>
        <if test="sonLaboratory!= null and sonLaboratory != ''">
            and ip.son_laboratory = #{sonLaboratory}
        </if>
        GROUP BY
        ip.son_laboratory,
        io.id
@@ -245,17 +255,117 @@
        a.type DESC,
        a.id
        ) b
        where ins_state is not null
        <if test="laboratory!=null and laboratory!=''">
            and laboratory=#{laboratory}
        WHERE ins_state IS NOT NULL
        <if test="laboratory != null and laboratory != ''">
            AND laboratory = #{laboratory}
        </if>
        )A
        ) A
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
        ORDER BY send_time asc
        ORDER BY send_time ASC
    </select>
<!--    <select id="findInsSampleAndOrder" resultType="com.ruoyi.inspect.vo.InsOrderPlanVO">-->
<!--        select * from(select * from(-->
<!--        SELECT-->
<!--        a.*,ios.ins_state,ios.verify_tell,verify_user-->
<!--        FROM-->
<!--        (-->
<!--        SELECT-->
<!--        io.id,-->
<!--        io.entrust_code,-->
<!--        io.type,-->
<!--        io.appointed,-->
<!--        io.send_time,-->
<!--        io.order_type,-->
<!--        case when-->
<!--        io.type_source = 0-->
<!--        then io.sample_view-->
<!--        else io.sample end sample,-->
<!--        GROUP_CONCAT(DISTINCT isa.model SEPARATOR ' ') AS sample_model,-->
<!--        userName,-->
<!--        checkName,-->
<!--        ip.son_laboratory,-->
<!--        io.ins_time,-->
<!--        io.laboratory,-->
<!--        io.type_source,-->
<!--        io.ifs_inventory_id,-->
<!--        ira.id ins_report_id,-->
<!--        ira.url,-->
<!--        ira.url_s,-->
<!--        ira.temp_url_pdf,-->
<!--        iiq.is_copper,-->
<!--        iiq.is_split_order,-->
<!--        iiq.update_batch_no,-->
<!--        iiq.part_desc,-->
<!--        iiq.material_prop AS material_prop-->
<!--        FROM-->
<!--        ins_order io-->
<!--        LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id-->
<!--        LEFT JOIN ins_report ira ON ira.ins_order_id = io.id-->
<!--        LEFT JOIN ifs_inventory_quantity iiq-->
<!--        ON iiq.id = io.ifs_inventory_id-->
<!--        <if test="materialProp != null and materialProp != ''">-->
<!--            AND iiq.material_prop LIKE CONCAT('%', #{materialProp}, '%')-->
<!--        </if>-->
<!--        LEFT JOIN (-->
<!--        SELECT ins_sample_id,GROUP_CONCAT( DISTINCT uu.name SEPARATOR ',') AS userName-->
<!--        FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id-->
<!--        WHERE u.state=0-->
<!--        <if test="sonLaboratory!= null and sonLaboratory != ''">-->
<!--            and son_laboratory=#{sonLaboratory}-->
<!--        </if>-->
<!--        GROUP BY ins_sample_id-->
<!--        ORDER BY ins_sample_id-->
<!--        ) isu ON isu.ins_sample_id = io.id-->
<!--        LEFT JOIN (-->
<!--        SELECT ins_sample_id,uu.name checkName-->
<!--        FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id-->
<!--        WHERE u.state=1-->
<!--        <if test="sonLaboratory!= null and sonLaboratory != ''">-->
<!--            and son_laboratory=#{sonLaboratory}-->
<!--        </if>-->
<!--        GROUP BY ins_sample_id-->
<!--        ORDER BY ins_sample_id-->
<!--        )isu2 ON isu2.ins_sample_id = io.id-->
<!--        LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id-->
<!--        WHERE io.state = 1 and send_time is not null-->
<!--        <if test="isCheck != null">-->
<!--            <if test="userName !=null and userName!=''">-->
<!--                and checkName like CONCAT ('%', #{userName},'%')-->
<!--            </if>-->
<!--        </if>-->
<!--        <if test="isCheck == null">-->
<!--            <if test="userName !=null and userName!=''">-->
<!--                and userName like CONCAT ('%', #{userName},'%')-->
<!--            </if>-->
<!--        </if>-->
<!--        <if test="sonLaboratory!= null and sonLaboratory != ''">-->
<!--            and ip.son_laboratory = #{sonLaboratory}-->
<!--        </if>-->
<!--        GROUP BY-->
<!--        ip.son_laboratory,-->
<!--        io.id-->
<!--        ) a-->
<!--        LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory-->
<!--        ORDER BY-->
<!--        a.type DESC,-->
<!--        a.id-->
<!--        ) b-->
<!--        where ins_state is not null-->
<!--        <if test="laboratory!=null and laboratory!=''">-->
<!--            and laboratory=#{laboratory}-->
<!--        </if>-->
<!--        )A-->
<!--        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">-->
<!--            ${ew.customSqlSegment}-->
<!--        </if>-->
<!--        ORDER BY send_time asc-->
<!--    </select>-->
    <select id="inspectionOrderDetailsTaskSwitching" resultType="com.ruoyi.inspect.vo.InsOrderPlanTaskSwitchVo">
        select * from(
        SELECT