From 5da2c5431b2663141a278afd2858101a2e98f814 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 15 八月 2024 15:41:59 +0800
Subject: [PATCH] 一机一档注册率、档案考核比
---
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
index 53ad1af..020946c 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
@@ -80,6 +80,9 @@
workOrderList.stream().filter(item -> {
return StringUtils.hasText(item.getSerialNumber()) && Objects.nonNull(item.getStatus()) && StringUtils.hasText(item.getErrorType());
});
+ if (CollectionUtils.isEmpty(workOrderList)) {
+ return Boolean.TRUE;
+ }
List<String> serialNumberList = workOrderList.stream().map(WorkOrder::getSerialNumber).collect(Collectors.toList());
// 鏌ュ嚭鏁版嵁搴撲腑鍥芥爣鐮佸搴旂殑鏈畬鎴愮殑宸ュ崟
List<WorkOrder> inDatabaseWorkOrderList = new LambdaQueryChainWrapper<>(baseMapper)
@@ -122,9 +125,14 @@
// 鏌ュ嚭閲嶇偣鐐逛綅銆佹櫘閫氱偣浣嶇殑澶勭悊鏃堕棿
SysConfig important = configMapper.checkConfigKeyUnique("important.wordkorder.time");
SysConfig normal = configMapper.checkConfigKeyUnique("normal.wordkorder.alarm.time");
+ // 濡傛灉鍗冲皢鐢熸垚宸ュ崟锛屼絾鏄澶囧浗鏍囩爜鏌ヤ笉鍒扮偣浣嶏紝鍒欎笉娣诲姞锛�
+ List<WorkOrder> notAddList = new ArrayList<>();
for (WorkOrder workOrder : waitAddList) {
- //TODO锛歱oint涓虹┖
YwPoint point = pointMapping.get(workOrder.getSerialNumber());
+ if (Objects.isNull(point)) {
+ notAddList.add(workOrder);
+ continue;
+ }
workOrder.setWorkOrderNo(IdUtils.timeAddRandomNO(5));
workOrder.setUnitId(Math.toIntExact(point.getUnitId()));
if (point.getImportantTag() || point.getImportantCommandImageTag()) {
@@ -133,6 +141,10 @@
workOrder.setProcessingPeriod(Integer.valueOf(normal.getConfigValue()));
}
}
+ waitAddList.removeAll(notAddList);
+ if (CollectionUtils.isEmpty(waitAddList)) {
+ return Boolean.TRUE;
+ }
this.saveBatch(waitAddList);
// 濡傛灉鏄洿鎺ヤ笅鍙戯紝娣诲姞涓嬪彂璁板綍
if (WorkOrderStatusEnum.DISTRIBUTED.equals(waitAddList.get(0).getStatus())) {
--
Gitblit v1.8.0