From a89ea8169fe90934d1ebbec6f3f619895efb7e55 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期四, 05 十二月 2024 14:58:10 +0800
Subject: [PATCH] 1、fixbug:开始工程后防止同一个工程原片信息重复插入原片信息表内 2、中空调度开关漏题代码

---
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
index 0923dd2..ae9625e 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
@@ -1,5 +1,6 @@
 package com.mes.uppattenusage.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -99,7 +100,14 @@
 
     @Override
     public void saveUpPattenUsage(List<UpPattenUsage> upPattenUsage) {
-        this.saveBatch(upPattenUsage);
+        if (CollectionUtil.isEmpty(upPattenUsage)){
+            return;
+        }
+        String engineerId = upPattenUsage.get(0).getEngineeringId();
+        int count = this.count(new LambdaQueryWrapper<UpPattenUsage>().eq(UpPattenUsage::getEngineeringId, engineerId));
+        if (count <=0){
+            this.saveBatch(upPattenUsage);
+        }
         //淇濆瓨鍘熺墖浣跨敤璇︽儏琛�
     }
 

--
Gitblit v1.8.0