From 4f258638d62ccaae0050f1ed6c7231941b66fb50 Mon Sep 17 00:00:00 2001
From: deslrey <deslre0381@gmail.com>
Date: 星期六, 10 一月 2026 11:29:04 +0800
Subject: [PATCH] 【物料属性】的回显及查询

---
 basic-server/src/main/resources/mapper/StandardTreeMapper.xml                            |    2 
 inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java                    |    3 
 inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java                    |    5 
 inspect-server/src/main/resources/mapper/InsReportMapper.xml                             |   45 +++--
 inspect-server/src/main/resources/mapper/InsSampleMapper.xml                             |  184 ++++++++++++++++++----
 inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java               |   27 ++-
 inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java                  |    3 
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java |  174 +++++++++++++--------
 8 files changed, 309 insertions(+), 134 deletions(-)

diff --git a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
index 4060428..a3a7abf 100644
--- a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
+++ b/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>
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java b/inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java
index f61b0eb..8bae295 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/dto/InsOrderPlanDTO.java
+++ b/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("妫�楠屼换鍔′富閿甶d")
     private Long insSampleId;
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java b/inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java
index f5096eb..554854b 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/dto/ReportPageDto.java
+++ b/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;
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java
index 8907546..64fd59d 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleMapper.java
@@ -18,21 +18,22 @@
 import java.util.Map;
 
 /**
-* @author Administrator
-* @description 閽堝琛ㄣ�恑ns_sample(妫�楠屾牱鍝�)銆戠殑鏁版嵁搴撴搷浣淢apper
-* @createDate 2024-03-14 17:14:57
-* @Entity com.yuanchu.mom.pojo.InsSample
-*/
+ * @author Administrator
+ * @description 閽堝琛ㄣ�恑ns_sample(妫�楠屾牱鍝�)銆戠殑鏁版嵁搴撴搷浣淢apper
+ * @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
      */
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index 727c34b..ad03024 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/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: 鍘熷璁板綍妯℃澘娓呴櫎娌℃湁浣跨敤鐨勬楠岄」(鏆傛椂鏈塨ug鏃犳硶浣跨敤)
+     *
      * @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  澶嶆牳浜篒d
-     * @param writeUserId  妫�楠屽憳Id
+     *
+     * @param insOrderId    璁㈠崟Id
+     * @param examineUserId 澶嶆牳浜篒d
+     * @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
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java b/inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java
index 9755c40..65b020d 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java
+++ b/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;
 
diff --git a/inspect-server/src/main/resources/mapper/InsReportMapper.xml b/inspect-server/src/main/resources/mapper/InsReportMapper.xml
index 5014f27..a5bc457 100644
--- a/inspect-server/src/main/resources/mapper/InsReportMapper.xml
+++ b/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 '瀛e害妫�楠�'
-        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 != ''">
             <!-- 寰呮彁浜�-->
diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
index cf45ff2..2d4f4b6 100644
--- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
+++ b/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

--
Gitblit v1.9.3