diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index f7c218ca..ef3db5a8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -257,12 +257,14 @@ public class TypeServiceImpl implements ITypeService { type.setCreateTime(DateUtils.getNowDate()); type.setCreateBy(SecurityUtils.getUserId().toString()); int count = typeMapper.insertType(type); - long newTypeId = type.getTypeId(); - // 插入wh_house_set,建立仓库和type的关系 - WhHouseSet whHouseSet = new WhHouseSet(); - whHouseSet.setHouseId(type.getHouseId()); - whHouseSet.setTypeId(newTypeId); - houseSetService.insertWhHouseSet(whHouseSet); + if ((type.getParentId()).equals(0L)) { + // 插入wh_house_set,建立仓库和type的关系 + long newTypeId = type.getTypeId(); + WhHouseSet whHouseSet = new WhHouseSet(); + whHouseSet.setHouseId(type.getHouseId()); + whHouseSet.setTypeId(newTypeId); + houseSetService.insertWhHouseSet(whHouseSet); + } return count; }