From bc3313efa51f00e128b6d9483becfd71df4e659d Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 09 八月 2024 18:14:51 +0800 Subject: [PATCH] 检验单审核添加对应试验室bug解决 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 39 ++++++++++++++++++++++++++++++--------- 1 files changed, 30 insertions(+), 9 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 cc30704..6102381 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; @@ -532,7 +539,7 @@ insProductResultMapper.deleteById(insProductResultss.get(i)); } } - InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k))); + //InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k))); //妫�楠屽�� if (jo.get("insValue") != null) { JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue"))); @@ -625,6 +632,7 @@ 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")) { //瀛樺湪鍏朵綑鏍峰搧,鏌ヨ鏄惁鏈夊悓涓�绉嶆楠岄」鐩� for (InsSample sample : insSamples.stream().filter(insSample -> !insSample.getId().equals(insSampleId)).collect(Collectors.toList())) { @@ -666,8 +674,6 @@ } } - - insProduct.setUpdateUser(userId); insProductMapper.updateById(insProduct); insProductUserMapper.insert(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); @@ -761,8 +767,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 (CollectionUtils.isEmpty(insProductResultss) && !result.getInsValue().equals("[]") || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getInsValue().equals(result.getInsValue()) && !insProductResultss.get(0).getInsValue().equals("[]"))) { + auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); + } + }catch (Exception e){ + System.out.println("宸ユ椂鏂板涓嶆垚鍔�!!!"); } } } @@ -775,9 +785,9 @@ Long l1 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() .eq(InsProduct::getInsSampleId, insSample.getId()) .and(wrapper -> wrapper - .isNull(InsProduct::getInsResult) + .isNotNull(InsProduct::getInsResult) .or() - .eq(InsProduct::getInsResult, 2) + .ne(InsProduct::getInsResult, 2) )); if (l == l1) { insSample.setInsState(2); @@ -1128,8 +1138,19 @@ textRenderData.setText("鉁�"); break; case 0: - resultCh.set(resultCh.get() + "銆�" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass())); - resultEn.set(resultEn.get() + "銆�" + p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn())); + Set<String> uniqueItems1 = new HashSet<>(); + Set<String> uniqueItems2 = new HashSet<>(); + + String item1 = p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass()); + if (uniqueItems1.add(item1)) { + resultCh.set(resultCh.get() + "銆�" + item1); + } + //resultCh.set(resultCh.get() + "銆�" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass())); + String item2 = p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn()); + if (uniqueItems2.add(item2)) { + resultEn.set(resultEn.get() + "銆�" + item2); + } + //resultEn.set(resultEn.get() + "銆�" + ); textRenderData.setText("鉁�"); break; default: -- Gitblit v1.9.3