From d589bf94e8f1863336d23fdd951049622b64db68 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 22 十一月 2024 16:36:43 +0800 Subject: [PATCH] csv文件调整 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 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 eef9505..10f3b2b 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 @@ -312,7 +312,7 @@ String contentType = file.getContentType(); InsOrderFile insOrderFile = new InsOrderFile(); insOrderFile.setInsOrderId(orderId); - insOrderFile.setFileName(filename); + if (contentType != null && contentType.startsWith("image/")) { // 鏄浘鐗� path = imgUrl; @@ -331,6 +331,7 @@ urlString = realpath + "/" + pathName; file.transferTo(new File(urlString)); insOrderFile.setFileUrl(pathName); + insOrderFile.setFileName(pathName); if (ObjectUtils.isNotEmpty(sonLaboratory)) { insOrderFile.setSonLaboratory(sonLaboratory); //鍒犻櫎閲嶅鐨勬暟鎹� @@ -355,7 +356,7 @@ if (ObjectUtils.isNotEmpty(sonLaboratory) && (sonLaboratory.equals("杩戝満") || sonLaboratory.equals("杩滃満")) && split[split.length - 1].equals("csv")) { //鍒ゆ柇鏄摢绉峜sv鏂囦欢,鏄惁鏈夆�斺�� - if (!file.getOriginalFilename().contains("鈥斺��")) { + if (sonLaboratory.equals("杩戝満")) { fuSheUtils.getFuSheWord1(sonLaboratory, insOrderFile); } else { fuSheUtils.getFuSheWord2(sonLaboratory, insOrderFile); @@ -749,8 +750,9 @@ //缁撹 int ressult = 1; String valueStr = insProductResult2.getValue(); + String regex ="[\u4e00-\u9fa5]"; if (!insProduct.getAsk().contains(",")) { - if (insProduct.getAsk().equals("/")) { + if (insProduct.getAsk().equals("/") || Pattern.compile(regex).matcher(insProduct.getAsk()).find()) { ressult = 3; //涓嶅垽瀹� } else if (!isValueValid(valueStr, new String[]{insProduct.getAsk()})) { ressult = 0; //涓嶅悎鏍� @@ -884,7 +886,7 @@ if (ObjectUtils.isEmpty(s)) { continue; } - double numericValue = Double.parseDouble(s); + double numericValue = Math.abs(Double.parseDouble(s)); boolean valid = Arrays.stream(valuesToCheck) .allMatch(v -> getResult(numericValue, v)); if (!valid) { @@ -997,9 +999,9 @@ } } - insOrder.setState(4); - insOrderMapper.updateById(insOrder); } + insOrder.setState(4); + insOrderMapper.updateById(insOrder); break; } } @@ -1196,7 +1198,7 @@ DateTime parse = DateUtil.parse(localDateTime.format(formatter)); auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//鏄熸湡 auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ - auxiliaryOutputWorkingHours.setCheck(userId);//妫�娴嬩汉 + auxiliaryOutputWorkingHours.setCheck(userId);//todo 妫�娴嬩汉(鍚庨潰瑕佸幓鎺夌敱鍓嶇浼犲叆) auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); } } -- Gitblit v1.9.3