From 84bbab4689ea2690055ee89b4d5090ee74924309 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 15 七月 2024 14:35:12 +0800
Subject: [PATCH] 海康api
---
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 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 745e24a..67a558c 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
@@ -30,6 +30,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
+import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
@@ -128,14 +129,24 @@
@Override
@Transactional(rollbackFor = Exception.class)
public Result batchAuditing(WorkOrderBatchAuditingForm form) {
+ // 鏍规嵁鏁呴殰绫诲瀷鑾峰彇鍒楄〃
+ List<WorkOrder> list = new LambdaQueryChainWrapper<>(baseMapper)
+ .in(WorkOrder::getStatus, WorkOrderStatusEnum.YW_HANDLE.getValue())
+ .eq(WorkOrder::getErrorType, form.getErrorType())
+ .select(WorkOrder::getId, WorkOrder::getUnitId, WorkOrder::getWorkOrderNo)
+ .list();
+ if (list.isEmpty()) {
+ return Result.error("娌℃湁宸ュ崟鍙互瀹℃牳");
+ }
+ List<Integer> ids = list.stream().map(WorkOrder::getId).collect(Collectors.toList());
// 宸ュ崟鐘舵��
LambdaUpdateWrapper<WorkOrder> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
- lambdaUpdateWrapper.in(WorkOrder::getId, form.getIds());
+ lambdaUpdateWrapper.in(WorkOrder::getId, ids);
lambdaUpdateWrapper.set(WorkOrder::getStatus, form.getAuditingResult());
baseMapper.update(lambdaUpdateWrapper);
// 娣诲姞澶氭潯瀹℃牳璁板綍
List<WorkOrderAuditingRecord> workOrderAuditingRecords = new ArrayList<>();
- for (Integer id : form.getIds()) {
+ for (Integer id : ids) {
WorkOrderAuditingRecord workOrderAuditingRecord = new WorkOrderAuditingRecord();
workOrderAuditingRecord.setWorkOrderId(id);
workOrderAuditingRecord.setAuditingUser(SecurityUtils.getLoginUser().getUserId().intValue());
@@ -145,7 +156,6 @@
}
workOrderAuditingRecordService.saveBatch(workOrderAuditingRecords);
// 娣诲姞鏂伴�氱煡
- List<WorkOrder> list = new LambdaQueryChainWrapper<>(baseMapper).in(WorkOrder::getId, form.getIds()).select(WorkOrder::getUnitId, WorkOrder::getWorkOrderNo).list();
List<Notify> notifies = new ArrayList<>();
for (WorkOrder workOrder : list) {
Notify notify = Notify.genEntityByUnit(NotifyTypeEnum.WORK_ORDER,
--
Gitblit v1.8.0