Ver código fonte

修复分类修改报错的BUG

liude 1 ano atrás
pai
commit
4713ca43f5

+ 3 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/CategoryServiceImpl.java

@@ -71,6 +71,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
     public void updateCategory(@NonNull Long id, @NonNull CategoryModifyParam param) {
         Category category = AssertUtils.available(this.getById(id), "分类不存在");
         CategoryCopier.INSTANCE.copying(param, category);
+        if(StringUtils.isEmpty(category.getParentId())){
+            category.setParentId(0L);
+        }
         this.updateById(category);
     }