From 08b66ff0fdff211873c7b1e34d138bd63256ee37 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 31 Oct 2024 19:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E7=AE=A1=E5=91=98=E6=9C=BA=E5=85=B7?= =?UTF-8?q?=E5=85=B3=E8=81=94=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/ma/service/impl/TypeKeeperServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java index 5bff4228..8e7b2163 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeKeeperServiceImpl.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Service; import com.bonus.material.ma.mapper.TypeKeeperMapper; import com.bonus.material.ma.domain.TypeKeeper; import com.bonus.material.ma.service.ITypeKeeperService; +import org.springframework.util.CollectionUtils; /** * 库管员配置Service业务层处理 @@ -59,7 +60,11 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService { */ @Override public int insertTypeKeeper(List typeKeepers) { + if (CollectionUtils.isEmpty(typeKeepers)) { + return 0; + } typeKeepers.forEach(typeKeeper -> typeKeeper.setCreateTime(DateUtils.getNowDate())); + typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeepers); return typeKeeperMapper.insertTypeKeeper(typeKeepers); } @@ -106,6 +111,9 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService { */ @Override public int deleteTypeKeeperByUserIdAndTypeId(List typeKeepers) { + if (CollectionUtils.isEmpty(typeKeepers)) { + return 0; + } return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeepers); } }