Crunchy
2024-08-03 12ecef99059f411e802c6fbc6f9a641c422b1747
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -238,8 +238,6 @@
                insProducts = insSampleMapper.getInsProduct3(id);
                break;
        }
        // 数采新增
        getDeviceMessage(insProducts, request);
        Set<Integer> set = new HashSet<>();
        Map<Integer, String> map2 = new HashMap<>();
@@ -248,33 +246,6 @@
        return insProducts;
    }
    private List<InsProduct> getDeviceMessage(List<InsProduct> insProducts, HttpServletRequest request) {
        String ipAddress = request.getRemoteAddr();
        // 防止回环地址变为IPv6
        String ip =  ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress;
        insProducts.forEach(i -> {
            Map<String, Object> devices = baseMapper.getDeviceMessage(ip, i.getInspectionItem(), i.getInspectionItemSubclass(), i.getSampleType());
            if (ObjectUtils.isNotEmpty(devices) && ObjectUtils.isNotEmpty(devices.get("file_type")) && ObjectUtils.isNotEmpty(devices.get("collect_url"))) {
                InsProductResult insProductResult = i.getInsProductResult();
                if (ObjectUtils.isEmpty(insProductResult)) {
                    insProductResult = new InsProductResult();
                }
                List<Object> list = new ArrayList<>();
                Map<Object, Object> hashMap = new HashMap<>();
                hashMap.put("v", devices.get("device_name"));
                list.add(hashMap);
                insProductResult.setEquipName(JSON.toJSON(list).toString());
                List<Object> listValue = new ArrayList<>();
                Map<Object, Object> hashMapValue = new HashMap<>();
                hashMapValue.put("v", devices.get("management_number"));
                listValue.add(hashMapValue);
                insProductResult.setEquipName(JSON.toJSON(list).toString());
                insProductResult.setEquipValue(JSON.toJSON(listValue).toString());
                i.setInsProductResult(insProductResult);
            }
        });
        return insProducts;
    }
    @Override
    public List<String> checkSubmitPlan(Integer orderId, String laboratory) {
        List<String> collect = new ArrayList<>();
@@ -624,7 +595,14 @@
                        LocalTime startTime = LocalTime.parse(shiftTime.getStartTime(), forma);
                        LocalTime endTime = LocalTime.parse(shiftTime.getEndTime(), forma);
                        // 检查当前时间是否在范围内(包括边界)
                        boolean isWithinRange = !now.isBefore(startTime) && !now.isAfter(endTime);
                        boolean isWithinRange;
                        if (endTime.isAfter(startTime)) {
                            // 不跨天的情况
                            isWithinRange = !now.isBefore(startTime) && !now.isAfter(endTime);
                        } else {
                            // 跨天的情况
                            isWithinRange = !now.isBefore(startTime) || !now.isAfter(endTime);
                        }
                        //加班
                        AuxiliaryOutputWorkingHours count1 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery()
                                .eq(AuxiliaryOutputWorkingHours::getCheck, userId)