From 0e2e829f10a5e5b239d6583d6be3afbcaed0dcc0 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期三, 31 七月 2024 17:58:30 +0800 Subject: [PATCH] PK8000处理调试+各种bug调试优化 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 27 ++++++++++++++++++--------- 1 files changed, 18 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 b2f303d..4d0eb38 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 @@ -227,9 +227,12 @@ // 闃叉鍥炵幆鍦板潃鍙樹负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()); - if (ObjectUtils.isNotEmpty(devices) && (ObjectUtils.isNotEmpty(devices.get("file_type")) || ObjectUtils.isNotEmpty(devices.get("collect_url")))) { + 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")); @@ -241,6 +244,7 @@ listValue.add(hashMapValue); insProductResult.setEquipName(JSON.toJSON(list).toString()); insProductResult.setEquipValue(JSON.toJSON(listValue).toString()); + i.setInsProductResult(insProductResult); } }); return insProducts; @@ -395,7 +399,7 @@ ProductVo productVo = new ProductVo(); productVo.setCode(insFiber.getCode()); productVo.setColor(fiber.getColor()); - productVo.setBushColor(fiber.getBushColor()); + productVo.setBushColor(insBushing.getColor()); if (ObjectUtils.isNotEmpty(insProductResult)) { insProduct.setInsProductResult(insProductResult); } @@ -428,7 +432,7 @@ for (InsProduct insProduct : insProducts) { InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); ProductVo productVo = new ProductVo(); - productVo.setCode("/"); + productVo.setCode("-"); productVo.setColor(fiber.getColor()); productVo.setBushColor(fiber.getBushColor()); insProduct.setInsProductResult(insProductResult); @@ -646,7 +650,7 @@ auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ auxiliaryOutputWorkingHours.setCheck(userId);//妫�娴嬩汉 } - if (ObjectUtils.isEmpty(insProductResult) || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()))) { + if (ObjectUtils.isEmpty(insProductResult) && !result.getInsValue().equals("[]") || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()) && !insProductResult.getInsValue().equals("[]"))) { auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); } } @@ -1752,7 +1756,7 @@ } catch (Exception e) { throw new ErrorException("鎵句笉鍒版楠屼汉鐨勭鍚�"); } - if (signatureUrl.equals("")) { + if (ObjectUtils.isEmpty(signatureUrl) || signatureUrl.equals("")) { throw new ErrorException("鎵句笉鍒版楠屼汉鐨勭鍚�"); } //Custom custom = customMapper.selectById(user.get("company")); @@ -3443,6 +3447,11 @@ throw new RuntimeException(e); } } + else { + //澶嶆牳涓嶉�氳繃灏嗘妸澶嶆牳鐨勮礋璐d汉鍘绘帀 + Integer id = insSampleUserMapper.selectOne(Wrappers.<InsSampleUser>lambdaQuery().eq(InsSampleUser::getInsSampleId, orderId).orderByDesc(InsSampleUser::getId).last("limit 1")).getId(); + insSampleUserMapper.deleteById(id); + } return 1; } @@ -3473,7 +3482,7 @@ } @Override - public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode, String sampleCode) { + public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode) { List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() @@ -3563,8 +3572,8 @@ return null; }); // 鍒犻櫎鏁伴噰閲囬泦娆℃暟 - String key = "frequency" + ":" + entrustCode + ":" + sampleCode; - RedisUtil.del(key); + String key = "frequency" + ":" + entrustCode + ":*"; + RedisUtil.delsLike(key); return 1; } -- Gitblit v1.9.3