|
|
@ -169,7 +169,7 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl<GuideCategoryDao, |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(EditGuideCategoryFormDTO dto) { |
|
|
|
public GuideCategoryDTO save(EditGuideCategoryFormDTO dto) { |
|
|
|
if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), null) > 0) { |
|
|
|
throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); |
|
|
|
} |
|
|
@ -185,11 +185,12 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl<GuideCategoryDao, |
|
|
|
entity.setSort(currentMax == 0 ? currentMax : currentMax + 1); |
|
|
|
entity.setStatus(Constant.ENABLE); |
|
|
|
insert(entity); |
|
|
|
return ConvertUtils.sourceToTarget(entity,GuideCategoryDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(EditGuideCategoryFormDTO dto) { |
|
|
|
public GuideCategoryDTO update(EditGuideCategoryFormDTO dto) { |
|
|
|
if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), dto.getId()) > 0) { |
|
|
|
throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); |
|
|
|
} |
|
|
@ -201,6 +202,7 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl<GuideCategoryDao, |
|
|
|
origin.setCategoryCode(categoryCode); |
|
|
|
origin.setCategoryName(dto.getCategoryName()); |
|
|
|
updateById(origin); |
|
|
|
return ConvertUtils.sourceToTarget(origin,GuideCategoryDTO.class); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 删除分类,存在办事指南的不允许删除,给予提示 |
|
|
|