From bc87772c260999177dc59551ea89e6e7745b0993 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 06 十二月 2024 14:10:30 +0800
Subject: [PATCH] 报告部分修改
---
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 88 ++++++++++++++++++++++++--------------------
1 files changed, 48 insertions(+), 40 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 9f01917..e1187dd 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
@@ -185,6 +185,12 @@
if (BeanUtil.isEmpty(order.getInsTime())) {
insOrder.setInsTime(LocalDateTime.now());//璁㈠崟鐨勬楠屾椂闂�
insOrderMapper.updateById(insOrder);
+ }
+ InsOrderState orderState = insOrderStateMapper.selectOne(Wrappers.<InsOrderState>lambdaQuery()
+ .eq(InsOrderState::getInsOrderId, insSample.getInsOrderId())
+ .eq(InsOrderState::getInsSampleId, sampleId)
+ .eq(InsOrderState::getLaboratory, laboratory));
+ if (ObjectUtils.isEmpty(orderState.getInsTime())) {
//鏇存柊妫�楠屼换鍔¤〃鐨勬楠屾椂闂�
insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate()
.eq(InsOrderState::getInsOrderId, insSample.getInsOrderId())
@@ -298,7 +304,7 @@
sampleId = insOrderFile.getInsSampleId();
insOrderFile.setInsSampleId(null);
}
- IPage<InsOrderFile> insOrderFileIPage = insOrderFileMapper.getFileList(page, QueryWrappers.queryWrappers(insOrderFile), insOrderId, sonLaboratory,sampleId);
+ IPage<InsOrderFile> insOrderFileIPage = insOrderFileMapper.getFileList(page, QueryWrappers.queryWrappers(insOrderFile), insOrderId, sonLaboratory, sampleId);
map.put("body", insOrderFileIPage);
return map;
}
@@ -333,21 +339,17 @@
if (!realpath.exists()) {
realpath.mkdirs();
}
- pathName = UUID.randomUUID() + "_"+file.getOriginalFilename().replace("#", "&");
+ pathName = UUID.randomUUID() + "_" + file.getOriginalFilename().replace("#", "&");
urlString = realpath + "/" + pathName;
file.transferTo(new File(urlString));
insOrderFile.setFileUrl(pathName);
insOrderFileMapper.insert(insOrderFile);
//濡傛灉鏄緪灏勮瘯楠�(杩戝満/杩滅▼涓婁紶鐨刢sv鏂囦欢)
String[] split = filename.split("\\.");
- if (ObjectUtils.isNotEmpty(sonLaboratory) && (sonLaboratory.equals("杩戝満") || sonLaboratory.equals("杩滃満")) &&
- split[split.length - 1].equals("csv")) {
- //鍒ゆ柇鏄摢绉峜sv鏂囦欢,鏄惁鏈夆�斺��
- if (sonLaboratory.equals("杩戝満")) {
- fuSheUtils.getFuSheWord1(sonLaboratory, insOrderFile);
- } else {
- fuSheUtils.getFuSheWord2(sonLaboratory, insOrderFile);
- }
+ if (ObjectUtils.isNotEmpty(sonLaboratory) && sonLaboratory.equals("杩戝満") && split[split.length - 1].equals("csv")) {
+ fuSheUtils.getFuSheWord1(sonLaboratory, insOrderFile);
+ } else if (ObjectUtils.isNotEmpty(sonLaboratory) && sonLaboratory.equals("杩滃満") && split[split.length - 1].equals("xlsx")) {
+ fuSheUtils.getFuSheWord2(sonLaboratory, insOrderFile);
}
} catch (Exception e) {
System.err.println("闄勪欢涓婁紶閿欒");
@@ -374,12 +376,15 @@
//鎵爜鎶ユ
@Override
- public int scanInsOrderState(String sonLaboratory, String sampleCode, String trees) {
+ public int scanInsOrderState(String sonLaboratory, String sampleCode, String trees, String entrustCode) {
/*鏍峰搧鍏ュ簱*/
- warehouseService.inWarehouse(trees, sampleCode);
+ warehouseService.inWarehouse(trees, sampleCode, entrustCode);
/*鏂板妫�楠屼换鍔�*/
//鍏堝垽鏂鏍峰搧鏄惁鏈夎繖涓珯鐐圭殑椤圭洰
- InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, sampleCode));
+ List<InsOrder> insOrders = insOrderMapper.selectList(Wrappers.<InsOrder>lambdaQuery().eq(InsOrder::getEntrustCode, entrustCode));
+ InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery()
+ .eq(InsSample::getSampleCode, sampleCode)
+ .eq(InsSample::getInsOrderId, insOrders.get(0).getId()));
List<String> collect = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery()
.eq(InsProduct::getState, 1)
.eq(InsProduct::getInsSampleId, insSample.getId())).stream().map(InsProduct::getSonLaboratory).collect(Collectors.toList());
@@ -418,10 +423,13 @@
//鎵爜鍑哄簱
@Override
- public int outInsOrderState(String sonLaboratory, String sampleCode) {
+ public int outInsOrderState(String sonLaboratory, String sampleCode, String entrustCode) {
//鍒ゆ柇璇ユ牱鍝佺殑妫�楠屼换鍔℃槸鍚﹀凡缁忕粨鏉�(缁х画璇曢獙鎴栬�呮槸缁撴潫璇曢獙)
//鍏堝垽鏂鏍峰搧鏄惁鏈夎繖涓珯鐐圭殑椤圭洰
- InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, sampleCode));
+ List<InsOrder> insOrders = insOrderMapper.selectList(Wrappers.<InsOrder>lambdaQuery().eq(InsOrder::getEntrustCode, entrustCode));
+ InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery()
+ .eq(InsSample::getSampleCode, sampleCode)
+ .eq(InsSample::getInsOrderId, insOrders.get(0).getId()));
List<String> collect = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery()
.eq(InsProduct::getState, 1)
.eq(InsProduct::getInsSampleId, insSample.getId())).stream().map(InsProduct::getSonLaboratory).collect(Collectors.toList());
@@ -443,7 +451,7 @@
}
}
boolean a = true;
- warehouseService.outWarehouse(sampleCode, a);
+ warehouseService.outWarehouse(sampleCode, a, entrustCode);
return 0;
}
@@ -789,7 +797,7 @@
//缁撹
int ressult = 1;
String valueStr = insProductResult2.getValue();
- String regex ="[\u4e00-\u9fa5]";
+ String regex = "[\u4e00-\u9fa5]";
if (!insProduct.getAsk().contains(",")) {
if (insProduct.getAsk().equals("/") || Pattern.compile(regex).matcher(insProduct.getAsk()).find()) {
ressult = 3; //涓嶅垽瀹�
@@ -1034,7 +1042,7 @@
if (insOrder.getFormType().equals("鍘熺悊鏍锋満")) {
//鍑哄簱
try {
- outInsOrderState(laboratory, insSample.getSampleCode());
+ outInsOrderState(laboratory, insSample.getSampleCode(), insOrder.getEntrustCode());
} catch (Exception e) {
}
@@ -1143,7 +1151,7 @@
info.setCreateUser(insProductMapper.selectUserById(userId).get("name"));
info.setMessageType("2");
info.setTheme("澶嶆牳閫氱煡");
- info.setContent("鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細"+insSample.getSample());
+ info.setContent("鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細" + insSample.getSample());
info.setSenderId(userId);
info.setConsigneeId(submitPlanDto.getVerifyUser());
info.setViewStatus(false);
@@ -1158,7 +1166,7 @@
map.put("msgtype", "text");//娑堟伅绫诲瀷 text:鏂囨湰
map.put("agentid", 1000517);//搴旂敤id
HashMap<String, Object> hashMap = new HashMap<>();
- hashMap.put("content", "鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細"+insSample.getSample()+
+ hashMap.put("content", "鎮ㄦ湁涓�鏉℃楠屼换鍔″緟澶嶆牳娑堟伅,璁㈠崟鍙锋槸锛�" + insOrder.getEntrustCode() + ",鏍峰搧鍚嶇О涓猴細" + insSample.getSample() +
",璇峰墠寰�LIMS绯荤粺鏌ョ湅銆傝鐐瑰嚮<a href=\"https://ztwxlims.ztt.cn:7443/enter\">涓ぉ閫氫俊LIMS绯荤粺 </a>");
map.put("text", hashMap);//娑堟伅鍐呭
map.put("safe", 0);//鏄惁淇濆瘑娑堟伅.0鍚�
@@ -1208,26 +1216,26 @@
}
for (AuxiliaryOutputWorkingHours auxiliaryOutputWorkingHours : submitPlanDto.getAuxiliaryOutputWorkingHoursList()) {
InsProduct insProduct = insProductMapper.selectById(auxiliaryOutputWorkingHours.getInsProductId());
- if (isWithinRange) {
- //鍦ㄦ椂闂村唴灏辨槸姝e父涓婄彮
- auxiliaryOutputWorkingHours.setOrderNo(insOrder.getEntrustCode());//闈炲姞鐝鎵樺崟鍙�
- auxiliaryOutputWorkingHours.setWorkTime(auxiliaryOutputWorkingHours.getOutputWorkTime());//闈炲姞鐝伐鏃�
- auxiliaryOutputWorkingHours.setAmount(1);//闈炲姞鐝暟閲�
- } else {
- //鍔犵彮
- auxiliaryOutputWorkingHours.setOvertimeOrderNo(insOrder.getEntrustCode());//鍔犵彮濮旀墭鍗曞彿
- auxiliaryOutputWorkingHours.setOvertimeWorkTime(auxiliaryOutputWorkingHours.getOutputWorkTime());//鍔犵彮宸ユ椂
- auxiliaryOutputWorkingHours.setOvertimeAmount(1);//鍔犵彮鏁伴噺
- }
- auxiliaryOutputWorkingHours.setManHourGroup(insProduct.getManHourGroup());//宸ユ椂鍒嗙粍
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
- DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
- auxiliaryOutputWorkingHours.setDateTime(LocalDateTime.now().toLocalDate().atStartOfDay().format(formatters));//鏃ユ湡
- LocalDateTime localDateTime = LocalDateTime.now();
- DateTime parse = DateUtil.parse(localDateTime.format(formatter));
- auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//鏄熸湡
- auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ
- auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours);
+ if (isWithinRange) {
+ //鍦ㄦ椂闂村唴灏辨槸姝e父涓婄彮
+ auxiliaryOutputWorkingHours.setOrderNo(insOrder.getEntrustCode());//闈炲姞鐝鎵樺崟鍙�
+ auxiliaryOutputWorkingHours.setWorkTime(auxiliaryOutputWorkingHours.getOutputWorkTime());//闈炲姞鐝伐鏃�
+ auxiliaryOutputWorkingHours.setAmount(1);//闈炲姞鐝暟閲�
+ } else {
+ //鍔犵彮
+ auxiliaryOutputWorkingHours.setOvertimeOrderNo(insOrder.getEntrustCode());//鍔犵彮濮旀墭鍗曞彿
+ auxiliaryOutputWorkingHours.setOvertimeWorkTime(auxiliaryOutputWorkingHours.getOutputWorkTime());//鍔犵彮宸ユ椂
+ auxiliaryOutputWorkingHours.setOvertimeAmount(1);//鍔犵彮鏁伴噺
+ }
+ auxiliaryOutputWorkingHours.setManHourGroup(insProduct.getManHourGroup());//宸ユ椂鍒嗙粍
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+ auxiliaryOutputWorkingHours.setDateTime(LocalDateTime.now().toLocalDate().atStartOfDay().format(formatters));//鏃ユ湡
+ LocalDateTime localDateTime = LocalDateTime.now();
+ DateTime parse = DateUtil.parse(localDateTime.format(formatter));
+ auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//鏄熸湡
+ auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ
+ auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours);
}
}
}
--
Gitblit v1.9.3