From 31f3dcc7c566174cbdec4f41a9a96e58a1be9a4e Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 17 十二月 2024 16:20:12 +0800
Subject: [PATCH] 统计2.0+首页2.0+检验下单型号过滤修改

---
 inspect-server/src/main/java/com/yuanchu/mom/service/ReportService.java                       |    4 
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java |   31 ++-----
 inspect-server/src/main/resources/mapper/InsOrderMapper.xml                                   |    1 
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java        |   34 ++++----
 inspect-server/src/main/java/com/yuanchu/mom/controller/ReportController.java                 |    8 +-
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java              |  107 ++++++++++++++------------
 6 files changed, 91 insertions(+), 94 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/ReportController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/ReportController.java
index bc672bf..017d588 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/ReportController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/ReportController.java
@@ -56,14 +56,14 @@
     @ValueAuth
     @ApiOperation(value = "鍚勭珯鐐瑰伐鏃�")
     @PostMapping("/manHourByStation")
-    public Result manHourByStation(String startTime,String endTime){
-        return Result.success(reportService.manHourByStation(startTime,endTime));
+    public Result manHourByStation(String startTime,String endTime,String sonLaboratory){
+        return Result.success(reportService.manHourByStation(startTime,endTime,sonLaboratory));
     }
 
     @ValueAuth
     @ApiOperation(value = "鍚勭珯鐐瑰伐鏃舵瘡涓汉鎵�鍗犵櫨鍒嗘瘮")
     @PostMapping("/manHourByPerson")
-    public Result manHourByPerson(String startTime,String endTime){
-        return Result.success(reportService.manHourByPerson(startTime,endTime));
+    public Result manHourByPerson(String startTime,String endTime,String sonLaboratory){
+        return Result.success(reportService.manHourByPerson(startTime,endTime,sonLaboratory));
     }
 }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/ReportService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/ReportService.java
index c4bd75b..34a005c 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/ReportService.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/ReportService.java
@@ -24,8 +24,8 @@
     List<Schedule> ScheduleByMe(String date);
 
     //棣栭〉-->鍚勭珯鐐瑰伐鏃�
-    Map<String,Double> manHourByStation(String startTime,String endTime);
+    String manHourByStation(String startTime,String endTime,String sonLaboratory);
 
     //棣栭〉-->鍚勭珯鐐瑰伐鏃舵瘡涓汉鎵�鍗犵櫨鍒嗘瘮
-    Map<String, Map<String, Double>> manHourByPerson(String startTime, String endTime);
+    Map<Object, Double> manHourByPerson(String startTime, String endTime,String sonLaboratory);
 }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
index b3a28d5..21996f2 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -1179,22 +1179,6 @@
         info.setViewStatus(false);
         info.setJumpPath("b1-inspect-order-plan");
         informationNotificationService.addInformationNotification(info);
-        //  todo 浼佷笟寰俊娑堟伅鎺ㄩ�丂zss
-        HashMap<String, Object> map = new HashMap<>();
-        String account = userMapper.selectById(submitPlanDto.getVerifyUser()).getAccount();
-        map.put("touser", account);//鎺ユ敹娑堟伅鎴愬憳鐨勮处鍙�'ZT-031292'杩欑绫诲瀷(濡傛灉鏈夊涓敤'|'鍒嗛殧)
-        map.put("toparty", "");//鎺ユ敹閮ㄩ棬id
-        map.put("totag", "");//娑堟伅鏍囩id
-        map.put("msgtype", "text");//娑堟伅绫诲瀷 text:鏂囨湰
-        map.put("agentid", 1000517);//搴旂敤id
-        HashMap<String, Object> hashMap = new HashMap<>();
-        hashMap.put("content", "鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細" + insSample.getSample() +
-                ",璇峰墠寰�LIMS绯荤粺鏌ョ湅銆傝鐐瑰嚮<a href=\"https://ztwxlims.ztt.cn:7443/enter\">涓ぉ閫氫俊LIMS绯荤粺 </a>");
-        map.put("text", hashMap);//娑堟伅鍐呭
-        map.put("safe", 0);//鏄惁淇濆瘑娑堟伅.0鍚�
-        map.put("enable_id_trans", 0);//鏄惁寮�鍚痠d杞瘧.0鍚�
-        map.put("enable_duplicate_check", 0);//鏄惁寮�鍚噸澶嶆秷鎭鏌�.0鍚�
-        qywxApi.send(map);
         //澶嶆牳浜�--妫�楠屽崟鐩稿叧璐熻矗浜�
         InsSampleUser insSampleUser = new InsSampleUser();
         insSampleUser.setUserId(submitPlanDto.getVerifyUser());
@@ -1212,7 +1196,6 @@
                 throw new ErrorException("鐢佃矾璇曢獙鐨勭珯鐐规姤鍛婄敓鎴愭湁璇�,璇疯仈绯诲紑鍙戜汉鍛樿皟鏁�!");
             }
         }
-
         /*鐢熸垚浜ч噺宸ユ椂*/
         //鏍¢獙濡傛灉杩欎釜浜鸿繖涓娴嬮」鐩凡缁忔坊鍔犺繃浜嗗垯涓嶉渶瑕佸啀鏂板
         //棣栧厛鍒ゆ柇褰撳墠浜虹殑褰撳墠鏃堕棿鏄惁鏄帓鐝椂闂村唴,濡傛灉涓嶆槸灏辨槸鍔犵彮
@@ -1261,6 +1244,23 @@
                 }
             }
         }
+
+        //  todo 浼佷笟寰俊娑堟伅鎺ㄩ�丂zss
+        HashMap<String, Object> map = new HashMap<>();
+        String account = userMapper.selectById(submitPlanDto.getVerifyUser()).getAccount();
+        map.put("touser", account);//鎺ユ敹娑堟伅鎴愬憳鐨勮处鍙�'ZT-031292'杩欑绫诲瀷(濡傛灉鏈夊涓敤'|'鍒嗛殧)
+        map.put("toparty", "");//鎺ユ敹閮ㄩ棬id
+        map.put("totag", "");//娑堟伅鏍囩id
+        map.put("msgtype", "text");//娑堟伅绫诲瀷 text:鏂囨湰
+        map.put("agentid", 1000517);//搴旂敤id
+        HashMap<String, Object> hashMap = new HashMap<>();
+        hashMap.put("content", "鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細" + insSample.getSample() +
+                ",璇峰墠寰�LIMS绯荤粺鏌ョ湅銆傝鐐瑰嚮<a href=\"https://ztwxlims.ztt.cn:7443/enter\">涓ぉ閫氫俊LIMS绯荤粺 </a>");
+        map.put("text", hashMap);//娑堟伅鍐呭
+        map.put("safe", 0);//鏄惁淇濆瘑娑堟伅.0鍚�
+        map.put("enable_id_trans", 0);//鏄惁寮�鍚痠d杞瘧.0鍚�
+        map.put("enable_duplicate_check", 0);//鏄惁寮�鍚噸澶嶆秷鎭鏌�.0鍚�
+        qywxApi.send(map);
         return 1;
     }
 
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java
index 907fc32..fe35e81 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java
@@ -39,13 +39,13 @@
 
     //姣忔棩涓氬姟缁熻
     @Override
-    public Map<String, Object> businessStatisticsByDay(String startTime,String endTime,String type) {
+    public Map<String, Object> businessStatisticsByDay(String startTime, String endTime, String type) {
         DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDateTime start = LocalDate.parse(startTime, format).atStartOfDay();
         LocalDateTime end = LocalDate.parse(endTime, format).atTime(23, 59, 59);
-        LocalDateTime oldStart=start  ;
-        LocalDateTime oldEnd=end ;
-        switch (type){
+        LocalDateTime oldStart = start;
+        LocalDateTime oldEnd = end;
+        switch (type) {
             case "鍛�":
                 oldStart = start.minusDays(7);
                 oldEnd = end.minusDays(7);
@@ -101,23 +101,23 @@
         /*妫�娴嬭垂鐢�*/
         //浠婃棩妫�娴嬭垂鐢�
         QueryWrapper<CostStatisticsDto> costStatisticsDtoQueryWrappers = new QueryWrapper<>();
-        costStatisticsDtoQueryWrappers.between("create_time", start,end);
+        costStatisticsDtoQueryWrappers.between("create_time", start, end);
         IPage<CostStatisticsDto> page = new Page<>();
         page.setSize(-1);
         page.setCurrent(-1);
         IPage<CostStatisticsDto> iPage = insOrderMapper.selectCostStatistics(page, costStatisticsDtoQueryWrappers);
         BigDecimal price = BigDecimal.ZERO;
         for (CostStatisticsDto record : iPage.getRecords()) {
-            price.add(record.getPrice());
+            price = price.add(ObjectUtils.isNotEmpty(record.getPrice()) ? record.getPrice() : BigDecimal.ZERO);
         }
         map.put("PRICE", price);
         //鏄ㄦ棩妫�娴嬭垂鐢�
         QueryWrapper<CostStatisticsDto> costWrappers = new QueryWrapper<>();
-        costWrappers.between("create_time", oldStart,oldEnd);
+        costWrappers.between("create_time", oldStart, oldEnd);
         IPage<CostStatisticsDto> dtoIPage = insOrderMapper.selectCostStatistics(page, costWrappers);
         BigDecimal priced = BigDecimal.ZERO;
         for (CostStatisticsDto record : dtoIPage.getRecords()) {
-            priced.add(record.getPrice());
+            priced = priced.add(ObjectUtils.isNotEmpty(record.getPrice()) ? record.getPrice() : BigDecimal.ZERO);
         }
         //姣斾緥=(浠婃棩-鏄ㄦ棩)/鏄ㄦ棩
         BigDecimal priceRatio = (price.subtract(priced)).divide(priced.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ONE : priced, 2, BigDecimal.ROUND_HALF_UP);
@@ -127,13 +127,13 @@
         //浠婃棩妫�娴嬪伐鏃�
         Double cost = 0.0;
         for (CostStatisticsDto record : iPage.getRecords()) {
-            cost += record.getCost();
+            cost += ObjectUtils.isNotEmpty(record.getCost()) ? record.getCost() : 0.0;
         }
         map.put("COST", cost);
         //鏄ㄦ棩妫�娴嬪伐鏃�
         Double costed = 0.0;
         for (CostStatisticsDto record : dtoIPage.getRecords()) {
-            costed += record.getCost();
+            costed += ObjectUtils.isNotEmpty(record.getCost()) ? record.getCost() : 0.0;
         }
         //姣斾緥=(浠婃棩-鏄ㄦ棩)/鏄ㄦ棩
         BigDecimal costRatio = new BigDecimal(cost - costed).divide(new BigDecimal(costed == 0 ? 1 : costed), 2, BigDecimal.ROUND_HALF_UP);
@@ -158,18 +158,26 @@
         //鑾峰彇杩戝崄鏃ョ殑妯潗鏍�
         LocalDate startDate = LocalDate.parse(startTime, format);
         LocalDate endDate = LocalDate.parse(endTime, format);
-        List<LocalDate> lastTenDays = new ArrayList<>();
+        List<String> lastTenDays = new ArrayList<>();
         List<Long> receTenDays = new ArrayList<>();
         List<Long> finTenDays = new ArrayList<>();
         while (!startDate.isAfter(endDate)) {
-            lastTenDays.add(startDate);
+            if (type.equals("骞�")){
+                lastTenDays.add(startDate.format(format).substring(0,7));
+            }else {
+                lastTenDays.add(startDate.format(format));
+            }
             receTenDays.add(insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery()
                     .eq(InsOrder::getState, 1)
-                    .between(InsOrder::getCreateTime,startDate.atStartOfDay(),startDate.atTime(23,59,59))));
+                    .between(InsOrder::getCreateTime, startDate.atStartOfDay(), startDate.atTime(23, 59, 59))));
             finTenDays.add(insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery()
                     .eq(InsOrder::getState, 4)
-                    .between(InsOrder::getCreateTime,startDate.atStartOfDay(),startDate.atTime(23,59,59))));
-            startDate = startDate.plusDays(1);
+                    .between(InsOrder::getCreateTime, startDate.atStartOfDay(), startDate.atTime(23, 59, 59))));
+            if (type.equals("骞�")) {
+                startDate = startDate.plusMonths(1);
+            }else {
+                startDate=startDate.plusDays(1);
+            }
         }
         map.put("DAYS", lastTenDays);
         map.put("RECETENDAYS", receTenDays);
@@ -179,12 +187,12 @@
 
     //妫�娴嬮」鐩粺璁�
     @Override
-    public Map<String, Object> testProductByDay(String startTime,String endTime,String type) {
+    public Map<String, Object> testProductByDay(String startTime, String endTime, String type) {
         DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDateTime start = LocalDate.parse(startTime, format).atStartOfDay();
         LocalDateTime end = LocalDate.parse(endTime, format).atTime(23, 59, 59);
-        LocalDateTime oldStart=start  ;
-        LocalDateTime oldEnd=end ;
+        LocalDateTime oldStart = start;
+        LocalDateTime oldEnd = end;
         Map<String, Object> map = new HashMap<>();
         /*椤圭洰鎺ユ敹*/
         //浠婃棩椤圭洰鎺ユ敹閲�
@@ -230,7 +238,8 @@
         //浠婃棩瀹屾垚閲忎腑鐨勫悎鏍奸噺/浠婃棩瀹屾垚閲�
         Long accept = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery()
                 .eq(InsProduct::getState, 1)
-                .eq(InsProduct::getInsResult, 1)
+                .isNotNull(InsProduct::getInsResult)
+                .ne(InsProduct::getInsResult, 0)
                 .between(InsProduct::getCreateTime, start, end));
         map.put("ACCEPT", accept);
         BigDecimal acceptRate = new BigDecimal(accept).divide(new BigDecimal(finishe == 0 ? 1 : finishe), 2, BigDecimal.ROUND_HALF_UP);
@@ -250,19 +259,27 @@
         //鑾峰彇杩戝崄鏃ョ殑妯潗鏍�
         LocalDate startDate = LocalDate.parse(startTime, format);
         LocalDate endDate = LocalDate.parse(endTime, format);
-        List<LocalDate> lastTenDays = new ArrayList<>();
+        List<String> lastTenDays = new ArrayList<>();
         List<Long> receTenDays = new ArrayList<>();
         List<Long> finTenDays = new ArrayList<>();
-        while (!startDate.isAfter(endDate))  {
-            lastTenDays.add(startDate);
+        while (!startDate.isAfter(endDate)) {
+            if (type.equals("骞�")){
+                lastTenDays.add(startDate.format(format).substring(0,7));
+            }else {
+                lastTenDays.add(startDate.format(format));
+            }
             receTenDays.add(insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery()
                     .eq(InsProduct::getState, 1)
-                    .between(InsProduct::getCreateTime,startDate.atStartOfDay(),startDate.atTime(23,59,59))));
+                    .between(InsProduct::getCreateTime, startDate.atStartOfDay(), startDate.atTime(23, 59, 59))));
             finTenDays.add(insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery()
                     .eq(InsProduct::getState, 1)
                     .isNotNull(InsProduct::getInsResult)
-                    .between(InsProduct::getCreateTime,startDate.atStartOfDay(),startDate.atTime(23,59,59))));
-            startDate = startDate.plusDays(1);
+                    .between(InsProduct::getCreateTime, startDate.atStartOfDay(), startDate.atTime(23, 59, 59))));
+            if (type.equals("骞�")) {
+                startDate = startDate.plusMonths(1);
+            }else {
+                startDate=startDate.plusDays(1);
+            }
         }
         map.put("DAYS", lastTenDays);
         map.put("RECETENDAYS", receTenDays);
@@ -350,31 +367,24 @@
 
     //棣栭〉-->鍚勭珯鐐圭殑宸ユ椂
     @Override
-    public Map<String, Double> manHourByStation(String startTime, String endTime) {
+    public String manHourByStation(String startTime, String endTime, String sonLaboratory) {
         DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDateTime start = LocalDate.parse(startTime, format).atStartOfDay();
         LocalDateTime end = LocalDate.parse(endTime, format).atTime(23, 59, 59);
         //鏌ヨ杩欎釜鏃堕棿鍐呮墍鏈夌殑宸ユ椂
         List<AuxiliaryOutputWorkingHours> auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery()
                 .between(AuxiliaryOutputWorkingHours::getCreateTime, start, end));
-        //鏍规嵁妫�楠岄」鏌ュ嚭鏉ョ殑绔欑偣杩涜鍒嗙被
-        List<AuxiliaryOutputWorkingHoursDto> outputWorkingHoursDtos = auxiliaryOutputWorkingHours.stream().map(auxiliaryOutputWorkingHours1 -> {
-            AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto = new AuxiliaryOutputWorkingHoursDto();
-            BeanUtils.copyProperties(auxiliaryOutputWorkingHours1, auxiliaryOutputWorkingHoursDto);
-            InsProduct insProduct = insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId());
-            auxiliaryOutputWorkingHoursDto.setSonLaboratory(insProduct.getSonLaboratory());
-            return auxiliaryOutputWorkingHoursDto;
-        }).collect(Collectors.toList());
-        Map<String, Double> map = outputWorkingHoursDtos.stream()
-                .collect(Collectors.groupingBy(
-                        AuxiliaryOutputWorkingHoursDto::getSonLaboratory,
-                        Collectors.summingDouble(AuxiliaryOutputWorkingHours::getOutputWorkTime)));
-        return map;
+        double sum = auxiliaryOutputWorkingHours.stream()
+                .filter(auxiliaryOutputWorkingHours1 ->
+                        insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId()).getSonLaboratory().equals(sonLaboratory)
+                ).mapToDouble(AuxiliaryOutputWorkingHours::getOutputWorkTime).sum();
+        String num = String.format("%.2f", sum);
+        return num;
     }
 
     //棣栭〉-->鍚勭珯鐐瑰伐鏃舵瘡涓汉鎵�鍗犵櫨鍒嗘瘮
     @Override
-    public Map<String, Map<String, Double>> manHourByPerson(String startTime, String endTime) {
+    public Map<Object, Double> manHourByPerson(String startTime, String endTime, String sonLaboratory) {
         DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDateTime start = LocalDate.parse(startTime, format).atStartOfDay();
         LocalDateTime end = LocalDate.parse(endTime, format).atTime(23, 59, 59);
@@ -382,19 +392,14 @@
         List<AuxiliaryOutputWorkingHours> auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery()
                 .between(AuxiliaryOutputWorkingHours::getCreateTime, start, end));
         //鏍规嵁妫�楠岄」鏌ュ嚭鏉ョ殑绔欑偣杩涜鍒嗙被
-        List<AuxiliaryOutputWorkingHoursDto> outputWorkingHoursDtos = auxiliaryOutputWorkingHours.stream().map(auxiliaryOutputWorkingHours1 -> {
-            AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto = new AuxiliaryOutputWorkingHoursDto();
-            BeanUtils.copyProperties(auxiliaryOutputWorkingHours1, auxiliaryOutputWorkingHoursDto);
-            InsProduct insProduct = insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId());
-            auxiliaryOutputWorkingHoursDto.setSonLaboratory(insProduct.getSonLaboratory());
-            return auxiliaryOutputWorkingHoursDto;
-        }).collect(Collectors.toList());
-        Map<String, Map<String, Double>> mapMap = outputWorkingHoursDtos.stream()
+        List<AuxiliaryOutputWorkingHours> outputWorkingHours = auxiliaryOutputWorkingHours.stream()
+                .filter(auxiliaryOutputWorkingHours1 ->
+                        insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId()).getSonLaboratory().equals(sonLaboratory)
+                ).collect(Collectors.toList());
+        Map<Object, Double> mapMap = outputWorkingHours.stream()
                 .collect(Collectors.groupingBy(
-                        AuxiliaryOutputWorkingHoursDto::getSonLaboratory,
-                        Collectors.groupingBy(
                                 t -> userMapper.selectById(t.getCheck()).getName(),
-                                Collectors.summingDouble(AuxiliaryOutputWorkingHours::getOutputWorkTime))));
+                                Collectors.summingDouble(AuxiliaryOutputWorkingHours::getOutputWorkTime)));
 
         return mapMap;
     }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
index 7e017cc..8b37802 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -83,9 +83,9 @@
         //鍒ゆ柇闀垮害
         if (split1.length > 4) {
             if (ObjectUtils.isNotEmpty(split1[3])) {
-                list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample())&&Objects.equals(list1.getSample(),split1[3])).collect(Collectors.toList());
-            }else if (split1[3].equals("")) {
-                list = list.stream().filter(list1 ->  Objects.nonNull(list1.getSampleType())&&Objects.equals(list1.getSampleType(),split1[2])).collect(Collectors.toList());
+                list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample()) && Objects.equals(list1.getSample(), split1[3])).collect(Collectors.toList());
+            } else if (split1[3].equals("")) {
+                list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType()) && Objects.equals(list1.getSampleType(), split1[2])).collect(Collectors.toList());
             }
         }
         list = list.stream().filter(a -> {
@@ -103,16 +103,9 @@
                         } else {
                             if (sections.get(i).contains("&")) {
                                 String[] split = sections.get(i).split("&");
-                                isIf = getIsIf(split[0], models1[1]) && getIsIf(split[1], models[1].split(";")[0]);
+                                isIf = getIsIf(split[0], models1[1]);
                             } else {
-                                if (ObjectUtils.isNotEmpty(models[1].split(";")[0])){
-                                    isIf = getIsIf(sections.get(i), models[1].split(";")[0]);
-                                    if (!isIf) {
-                                        isIf = getIsIf(sections.get(i), models1[1]);
-                                    }
-                                }else {
-                                    isIf = getIsIf(sections.get(i), models1[1]);
-                                }
+                                isIf = getIsIf(sections.get(i), models1[1]);
                             }
                             if (isIf) {
                                 a.setSection(sections.get(i));
@@ -138,7 +131,7 @@
         //鎸夌収鐢佃矾璇曢獙--杈愬皠璇曢獙--娓╂箍搴﹁瘯楠�--鐜璇曢獙杩涜鎺掑簭
         // 瀹氫箟鑷畾涔夋帓搴忓櫒
         Comparator<StandardProductList> testTypeComparator = (o1, o2) -> {
-            String[] order = {"鐢佃矾璇曢獙", "杈愬皠璇曢獙", "娓╂箍搴﹁瘯楠�", "鐜璇曢獙","鍔熺巼璇曢獙"};
+            String[] order = {"鐢佃矾璇曢獙", "杈愬皠璇曢獙", "娓╂箍搴﹁瘯楠�", "鐜璇曢獙", "鍔熺巼璇曢獙"};
             int index1 = -1;
             int index2 = -1;
             // 鎵惧嚭涓や釜瀵硅薄 鍦ㄨ嚜瀹氫箟椤哄簭鏁扮粍涓殑浣嶇疆
@@ -186,8 +179,8 @@
         String model2 = "";
         if (matcher.find()) {
             model2 += matcher.group();
-        }else {
-            model2=model;
+        } else {
+            model2 = model;
         }
         if (str.contains("鈮�") || str.contains(">=")) {
             String param = str.replace("鈮�", "").replace(">=", "");
@@ -205,7 +198,7 @@
             String param = str.replace("=", "");
             if (matcher.find()) {
                 return new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0;
-            }else {
+            } else {
                 return model2.equals(param);
             }
         }
@@ -252,8 +245,7 @@
                 list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1]));
                 list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + standardTree2.getSample() + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1]));
             }
-        }
-        else if (trees.length == 4) {
+        } else if (trees.length == 4) {
             List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]));
             if (treeList.size() == 0) {
                 StandardTree standardTree = new StandardTree();
@@ -268,8 +260,7 @@
                 list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1]));
                 list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1]));
             }
-        }
-        else {
+        } else {
             list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1]));
             list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1]));
         }
diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 987d5ac..4b55e8b 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -201,6 +201,7 @@
         isa.sample,
         isa.model,
         ins_sample_id,
+        times cost,
         sum(c.price * times)                                   price,
         GROUP_CONCAT(distinct c.inspection_item SEPARATOR ',') inspection_item,
         i.company,

--
Gitblit v1.9.3