diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/mapper/PartLeaseMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/mapper/PartLeaseMapper.java index cf05a843..7de90069 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/mapper/PartLeaseMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/mapper/PartLeaseMapper.java @@ -154,10 +154,10 @@ public interface PartLeaseMapper { /** * 查询配件库管员配置 - * @param typeId + * @param typeKeepers * @return */ - List selectTypeKeeperByTypeId(Long typeId); + List selectTypeKeeperByTypeId(MaPartTypeKeeper typeKeepers); /** * 查询配件库管关系 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/service/impl/PartLeaseServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/service/impl/PartLeaseServiceImpl.java index 13a7660c..8744482c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/service/impl/PartLeaseServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/part/service/impl/PartLeaseServiceImpl.java @@ -429,14 +429,13 @@ public class PartLeaseServiceImpl implements PartLeaseService { if (!CollectionUtils.isEmpty(typeKeepers.getTypeIds())) { for (Long typeId : typeKeepers.getTypeIds()) { // 先根据typeId查询库管员配置是否已经存在,存在则先删除 - List list = partLeaseMapper.selectTypeKeeperByTypeId(typeId); + typeKeepers.setTypeId(typeId); + List list = partLeaseMapper.selectTypeKeeperByTypeId(typeKeepers); if (!CollectionUtils.isEmpty(list)) { for (MaPartTypeKeeper typeKeeper : list) { partLeaseMapper.deleteTypeKeeper(typeKeeper); } } - typeKeepers.setTypeId(typeId); - typeKeepers.setUserId(typeKeepers.getUserId()); typeKeepers.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); typeKeepers.setCreateTime(DateUtils.getNowDate()); int res = partLeaseMapper.insertTypeKeeper(typeKeepers); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/part/PartLeaseMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/part/PartLeaseMapper.xml index ec02edb8..8280c03e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/part/PartLeaseMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/part/PartLeaseMapper.xml @@ -203,6 +203,7 @@ ma_part_type_keeper WHERE type_id = #{typeId} + AND user_id = #{userId}