From e07e8d4ccd220af0cb6d51cde68bff6434a6e623 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期四, 08 八月 2024 20:57:07 +0800 Subject: [PATCH] 光纤配置在光纤试验室显示 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 56 ++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 40 insertions(+), 16 deletions(-) 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 6e738c0..217085a 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 @@ -162,6 +162,7 @@ insOrderPlanDTO.setUserId(null); } String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//璇曢獙瀹� + insOrderPlanDTO.setSonLaboratory(null); IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userName, sonLaboratory, laboratory); map.put("body", insOrderPage); return map; @@ -249,6 +250,12 @@ break; } + //濡傛灉鏄ぇ鏍峰搧涓嬬殑椤圭洰涓虹┖,閭d箞鏌ヨ绗竴涓厜绾ょ殑椤圭洰 + if (ObjectUtils.isEmpty(insProducts) && type==0){ + //鏌ヨ绗竴涓厜绾ょ殑id + List<InsFiber> insFibers = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, id)).get(0).getId())); + insProducts = insSampleMapper.getInsProduct3(insFibers.get(0).getId()); + } Set<Integer> set = new HashSet<>(); Map<Integer, String> map2 = new HashMap<>(); if (BeanUtil.isEmpty(insProducts)) return null; @@ -336,7 +343,7 @@ for (InsFibers insFiber : insFibers) { List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFibersId, insFiber.getId())); List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) - .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); + .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); if (insProducts.size() == collect.size()) { insFiber.setState(1);//宸叉楠� } else { @@ -349,7 +356,7 @@ for (InsFiber insFiber : fiberList) { List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) - .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); + .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); if (insProducts.size() == collect.size()) { insFiber.setState(1);//宸叉楠� } else { @@ -363,7 +370,7 @@ for (InsFiber insFiber : insFiberList) { List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) - .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); + .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); if (insProducts.size() == collect.size()) { insFiber.setState(1);//宸叉楠� } else { @@ -378,7 +385,7 @@ .eq(InsProduct::getInsBushId, insBushing.getId())); List<Integer> collect = insProducts.stream() .map(InsProduct::getInsResult) - .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); + .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); if (insProducts.size() == collect.size()) { insBushing.setState(1);//宸叉楠� } else { @@ -516,6 +523,7 @@ insProduct.setId(Integer.parseInt(k)); List<InsProductResult> results = insProductResultMapper.selectList(Wrappers.<InsProductResult>lambdaQuery() .eq(InsProductResult::getInsProductId, insProduct.getId())); + InsProduct product = insProductMapper.selectById(insProduct.getId()); InsProductResult result; if (CollectionUtils.isEmpty(results)) { result = new InsProductResult(); @@ -621,7 +629,7 @@ /*濡傛灉鏄涓�娆¢�夋嫨璁惧淇℃伅,涓旇繕鏈夊叾浣欐牱鍝佷篃鏈夊悓涓�涓粡楠岄」鐩�,閭d箞鎵�鏈夋牱鍝佺殑璇ラ」鐩兘鐢ㄨ繖涓澶囦俊鎭�*/ //鍏堟煡璇㈡槸鍚﹁繕鏈夊叾浣欐牱鍝� - InsProduct product = insProductMapper.selectById(insProduct.getId()); + Integer insSampleId = product.getInsSampleId(); List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, insSampleMapper.selectById(insSampleId).getInsOrderId())); if (insSamples.size() > 1 && !product.getInspectionItemType().equals("1")) { @@ -636,9 +644,9 @@ .eq(InsProduct::getInspectionItemSubclassEn, product.getInspectionItemSubclassEn()) .eq(InsProduct::getTemplateId, product.getTemplateId()) .eq(InsProduct::getStandardMethodListId, product.getStandardMethodListId()) - .eq(InsProduct::getInsBushId,product.getInsBushId()) - .eq(InsProduct::getInsFibersId,product.getInsFibersId()) - .eq(InsProduct::getInsFiberId,product.getInsFiberId()) + .eq(InsProduct::getInsBushId, product.getInsBushId()) + .eq(InsProduct::getInsFibersId, product.getInsFibersId()) + .eq(InsProduct::getInsFiberId, product.getInsFiberId()) ); if (ObjectUtils.isNotEmpty(product1)) { //濡傛灉瀛樺湪椤圭洰,鏌ヨ鏄惁鏈夎〃 @@ -698,18 +706,30 @@ isWithinRange = !now.isBefore(startTime) || !now.isAfter(endTime); } //鍔犵彮 - AuxiliaryOutputWorkingHours count1 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() + List<AuxiliaryOutputWorkingHours> count1s = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() .eq(AuxiliaryOutputWorkingHours::getCheck, userId) .eq(AuxiliaryOutputWorkingHours::getInspectionItem, insProduct.getInspectionItem()) .eq(AuxiliaryOutputWorkingHours::getInspectionItemSubclass, insProduct.getInspectionItemSubclass()) - .eq(AuxiliaryOutputWorkingHours::getOvertimeOrderNo, insOrder.getEntrustCode())); + .eq(AuxiliaryOutputWorkingHours::getOvertimeOrderNo, insOrder.getEntrustCode()) + .eq(AuxiliaryOutputWorkingHours::getSample, insSampleMapper.selectById(insProduct.getInsSampleId()).getSampleCode())); + if (count1s.size() > 1) { + for (int i = 1; i < count1s.size(); i++) { + auxiliaryOutputWorkingHoursMapper.deleteById(count1s.get(i)); + } + } //闈炲姞鐝� - AuxiliaryOutputWorkingHours count2 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() + List<AuxiliaryOutputWorkingHours> count2s = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() .eq(AuxiliaryOutputWorkingHours::getCheck, userId) .eq(AuxiliaryOutputWorkingHours::getInspectionItem, insProduct.getInspectionItem()) .eq(AuxiliaryOutputWorkingHours::getInspectionItemSubclass, insProduct.getInspectionItemSubclass()) - .eq(AuxiliaryOutputWorkingHours::getOrderNo, insOrder.getEntrustCode())); - if (ObjectUtils.isNotEmpty(insProduct.getManHour()) && ObjectUtils.isEmpty(count2) && ObjectUtils.isEmpty(count1)) { + .eq(AuxiliaryOutputWorkingHours::getOrderNo, insOrder.getEntrustCode()) + .eq(AuxiliaryOutputWorkingHours::getSample, insSampleMapper.selectById(insProduct.getInsSampleId()).getSampleCode())); + if (count2s.size() > 1) { + for (int i = 1; i < count2s.size(); i++) { + auxiliaryOutputWorkingHoursMapper.deleteById(count2s.get(i)); + } + } + if (ObjectUtils.isNotEmpty(insProduct.getManHour()) && CollectionUtils.isEmpty(count2s) && CollectionUtils.isEmpty(count1s)) { AuxiliaryOutputWorkingHours auxiliaryOutputWorkingHours = new AuxiliaryOutputWorkingHours(); if (isWithinRange) { //鍦ㄦ椂闂村唴灏辨槸姝e父涓婄彮 @@ -748,8 +768,12 @@ auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ auxiliaryOutputWorkingHours.setCheck(userId);//妫�娴嬩汉 } - if (ObjectUtils.isEmpty(insProductResult) && !result.getInsValue().equals("[]") || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()) && !insProductResult.getInsValue().equals("[]"))) { - auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); + try { + if (ObjectUtils.isEmpty(insProductResult) && !result.getInsValue().equals("[]") || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()) && !insProductResult.getInsValue().equals("[]"))) { + auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); + } + }catch (Exception e){ + System.out.println("宸ユ椂鏂板涓嶆垚鍔�!!!"); } } } @@ -3472,7 +3496,7 @@ put("createTime", now.format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�"))); put("createTimeEn", monthNames[now.getMonthValue() - 1] + " " + now.getDayOfMonth() + ", " + now.getYear()); put("insTime", insOrder.getInsTime().format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�"))); - put("insTimeEn", monthNames[insOrder.getInsTime().getMonthValue() - 1] + " " + now.getDayOfMonth() + ", " + now.getYear()); + put("insTimeEn", monthNames[insOrder.getInsTime().getMonthValue() - 1] + " " + insOrder.getInsTime().getDayOfMonth() + ", " + insOrder.getInsTime().getYear()); put("writeUrl", null); put("insUrl", Pictures.ofLocal(imgUrl + "/" + signatureUrl).create()); put("images", images); -- Gitblit v1.9.3