mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
✨ 2.0.1 版本发布准备
This commit is contained in:
parent
20f8cb1606
commit
169c1e4907
@ -17,7 +17,7 @@ public class ErpWebConfiguration {
|
|||||||
* erp 模块的 API 分组
|
* erp 模块的 API 分组
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public GroupedOpenApi tradeGroupedOpenApi() {
|
public GroupedOpenApi erpGroupedOpenApi() {
|
||||||
return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("erp");
|
return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("erp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
|||||||
public class ErpProductCategoryServiceImpl implements ErpProductCategoryService {
|
public class ErpProductCategoryServiceImpl implements ErpProductCategoryService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ErpProductCategoryMapper productCategoryMapper;
|
private ErpProductCategoryMapper erpProductCategoryMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@Lazy // 延迟加载,避免循环依赖
|
@Lazy // 延迟加载,避免循环依赖
|
||||||
@ -42,7 +42,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
|
|
||||||
// 插入
|
// 插入
|
||||||
ErpProductCategoryDO category = BeanUtils.toBean(createReqVO, ErpProductCategoryDO.class);
|
ErpProductCategoryDO category = BeanUtils.toBean(createReqVO, ErpProductCategoryDO.class);
|
||||||
productCategoryMapper.insert(category);
|
erpProductCategoryMapper.insert(category);
|
||||||
// 返回
|
// 返回
|
||||||
return category.getId();
|
return category.getId();
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
ErpProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, ErpProductCategoryDO.class);
|
ErpProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, ErpProductCategoryDO.class);
|
||||||
productCategoryMapper.updateById(updateObj);
|
erpProductCategoryMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -66,7 +66,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
// 1.1 校验存在
|
// 1.1 校验存在
|
||||||
validateProductCategoryExists(id);
|
validateProductCategoryExists(id);
|
||||||
// 1.2 校验是否有子产品分类
|
// 1.2 校验是否有子产品分类
|
||||||
if (productCategoryMapper.selectCountByParentId(id) > 0) {
|
if (erpProductCategoryMapper.selectCountByParentId(id) > 0) {
|
||||||
throw exception(PRODUCT_CATEGORY_EXITS_CHILDREN);
|
throw exception(PRODUCT_CATEGORY_EXITS_CHILDREN);
|
||||||
}
|
}
|
||||||
// 1.3 校验是否有产品
|
// 1.3 校验是否有产品
|
||||||
@ -74,11 +74,11 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
throw exception(PRODUCT_CATEGORY_EXITS_PRODUCT);
|
throw exception(PRODUCT_CATEGORY_EXITS_PRODUCT);
|
||||||
}
|
}
|
||||||
// 2. 删除
|
// 2. 删除
|
||||||
productCategoryMapper.deleteById(id);
|
erpProductCategoryMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateProductCategoryExists(Long id) {
|
private void validateProductCategoryExists(Long id) {
|
||||||
if (productCategoryMapper.selectById(id) == null) {
|
if (erpProductCategoryMapper.selectById(id) == null) {
|
||||||
throw exception(PRODUCT_CATEGORY_NOT_EXISTS);
|
throw exception(PRODUCT_CATEGORY_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
throw exception(PRODUCT_CATEGORY_PARENT_ERROR);
|
throw exception(PRODUCT_CATEGORY_PARENT_ERROR);
|
||||||
}
|
}
|
||||||
// 2. 父产品分类不存在
|
// 2. 父产品分类不存在
|
||||||
ErpProductCategoryDO parentCategory = productCategoryMapper.selectById(parentId);
|
ErpProductCategoryDO parentCategory = erpProductCategoryMapper.selectById(parentId);
|
||||||
if (parentCategory == null) {
|
if (parentCategory == null) {
|
||||||
throw exception(PRODUCT_CATEGORY_PARENT_NOT_EXITS);
|
throw exception(PRODUCT_CATEGORY_PARENT_NOT_EXITS);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
if (parentId == null || ErpProductCategoryDO.PARENT_ID_ROOT.equals(parentId)) {
|
if (parentId == null || ErpProductCategoryDO.PARENT_ID_ROOT.equals(parentId)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
parentCategory = productCategoryMapper.selectById(parentId);
|
parentCategory = erpProductCategoryMapper.selectById(parentId);
|
||||||
if (parentCategory == null) {
|
if (parentCategory == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void validateProductCategoryNameUnique(Long id, Long parentId, String name) {
|
private void validateProductCategoryNameUnique(Long id, Long parentId, String name) {
|
||||||
ErpProductCategoryDO productCategory = productCategoryMapper.selectByParentIdAndName(parentId, name);
|
ErpProductCategoryDO productCategory = erpProductCategoryMapper.selectByParentIdAndName(parentId, name);
|
||||||
if (productCategory == null) {
|
if (productCategory == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -133,17 +133,17 @@ public class ErpProductCategoryServiceImpl implements ErpProductCategoryService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ErpProductCategoryDO getProductCategory(Long id) {
|
public ErpProductCategoryDO getProductCategory(Long id) {
|
||||||
return productCategoryMapper.selectById(id);
|
return erpProductCategoryMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ErpProductCategoryDO> getProductCategoryList(ErpProductCategoryListReqVO listReqVO) {
|
public List<ErpProductCategoryDO> getProductCategoryList(ErpProductCategoryListReqVO listReqVO) {
|
||||||
return productCategoryMapper.selectList(listReqVO);
|
return erpProductCategoryMapper.selectList(listReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ErpProductCategoryDO> getProductCategoryList(Collection<Long> ids) {
|
public List<ErpProductCategoryDO> getProductCategoryList(Collection<Long> ids) {
|
||||||
return productCategoryMapper.selectBatchIds(ids);
|
return erpProductCategoryMapper.selectBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user