diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/PartTypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/PartTypeServiceImpl.java index ac12c538..020d6d6c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/PartTypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/PartTypeServiceImpl.java @@ -87,7 +87,7 @@ public class PartTypeServiceImpl implements IPartTypeService } partType.setCreateTime(DateUtils.getNowDate()); partType.setCreateBy(SecurityUtils.getUserId().toString()); - partType.setParentId(partType.getId() != null ? partType.getId() : 0L); + partType.setParentId(partType.getId() != 0 ? partType.getId() : 0L); partType.setLevel(partType.getLevel() != null ? String.valueOf(Integer.valueOf(partType.getLevel()) + 1) : "1"); int result = partTypeMapper.insertPartType(partType); if (result > 0) {