|
|
|
@ -5041,11 +5041,20 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem |
|
|
|
public Result changeCategory(ItemChangeCategoryDTO dto) { |
|
|
|
ItemEntity itemEntity = baseDao.selectById(dto.getItemId()); |
|
|
|
if (itemEntity!=null){ |
|
|
|
itemEntity.setCategoryCode(dto.getCategoryId()); |
|
|
|
itemEntity.setCategoryFullCode(dto.getCategoryFullId()); |
|
|
|
if (StringUtils.isNotBlank(dto.getCategoryLabel())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getCategoryId())){ |
|
|
|
itemEntity.setCategoryCode(dto.getCategoryId()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getCategoryFullId())) { |
|
|
|
itemEntity.setCategoryFullCode(dto.getCategoryFullId()); |
|
|
|
}else{ |
|
|
|
itemEntity.setCategoryFullCode(null); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getCategoryLabel())) { |
|
|
|
itemEntity.setCategoryFullName(dto.getCategoryLabel()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getFistCategoryId())) { |
|
|
|
itemEntity.setFirstCategoryCode(dto.getFistCategoryId()); |
|
|
|
} |
|
|
|
baseDao.updateById(itemEntity); |
|
|
|
}else { |
|
|
|
throw new RenException("该item不存在" + dto.getItemId()); |
|
|
|
|