From 7a84f80e848a4337882042772ffd0237d6a40e8c57dc53cc9fcc9c3c4b858ef0 Mon Sep 17 00:00:00 2001 From: attiya <2413103649@qq.com> Date: Wed, 15 Oct 2025 16:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=8E=A7=E6=89=B9=E9=87=8F=E5=85=A5?= =?UTF-8?q?=E5=BA=93=EF=BC=9ASN=E4=B8=8E=E7=BC=96=E7=A0=81=E5=88=A4?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EbikeEcuInfoServiceImpl.java | 22 ++++++++++++++++++- .../impl/EbikeInventoryServiceImpl.java | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeEcuInfoServiceImpl.java b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeEcuInfoServiceImpl.java index c5e2d42..c8aff65 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeEcuInfoServiceImpl.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeEcuInfoServiceImpl.java @@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.StpUtil; import com.cdzy.common.ex.EbikeException; import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo; import com.cdzy.operations.model.vo.EbikeEcuInfoVo; +import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; import com.cdzy.operations.model.entity.EbikeEcuInfo; import com.cdzy.operations.mapper.EbikeEcuInfoMapper; @@ -14,6 +15,8 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +import static com.cdzy.operations.model.entity.table.EbikeEcuInfoTableDef.EBIKE_ECU_INFO; + /** * 中控基本信息 服务层实现。 * @@ -21,7 +24,7 @@ import java.util.List; * @since 2025-09-15 */ @Service -public class EbikeEcuInfoServiceImpl extends ServiceImpl implements EbikeEcuInfoService{ +public class EbikeEcuInfoServiceImpl extends ServiceImpl implements EbikeEcuInfoService { @Resource private EbikeEcuInfoMapper ebikeEcuInfoMapper; @@ -35,6 +38,13 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl list = new ArrayList<>(); for (int i = 0; i < ecuCodes.size(); i++) { EbikeEcuInfo ebikeEcuInfoEntity = EbikeEcuInfo.builder() @@ -58,6 +71,13 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl 0) { + throw new EbikeException("中控信息存在重复"); + } saveBatch(list); } } diff --git a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeInventoryServiceImpl.java b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeInventoryServiceImpl.java index de3270c..d2a8799 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeInventoryServiceImpl.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeInventoryServiceImpl.java @@ -64,7 +64,7 @@ public class EbikeInventoryServiceImpl extends ServiceImpl