mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 02:28:03 +08:00 
			
		
		
		
	📖 CRM:code review CRM 产品分类
This commit is contained in:
		| @ -60,6 +60,7 @@ public interface LogRecordConstants { | |||||||
|  |  | ||||||
|     // ======================= CRM_PRODUCT 产品 ======================= |     // ======================= CRM_PRODUCT 产品 ======================= | ||||||
|  |  | ||||||
|  |     // TODO @hao:可以把 CRM 产品、和 CRM 产品分类分开哈,量程两个 type; | ||||||
|     String CRM_PRODUCT_TYPE = "CRM 产品"; |     String CRM_PRODUCT_TYPE = "CRM 产品"; | ||||||
|     String CRM_PRODUCT_CREATE_SUB_TYPE = "创建产品"; |     String CRM_PRODUCT_CREATE_SUB_TYPE = "创建产品"; | ||||||
|     String CRM_PRODUCT_CREATE_SUCCESS = "创建了产品【{{#createReqVO.name}}】"; |     String CRM_PRODUCT_CREATE_SUCCESS = "创建了产品【{{#createReqVO.name}}】"; | ||||||
|  | |||||||
| @ -42,12 +42,14 @@ public class CrmProductCategoryServiceImpl implements CrmProductCategoryService | |||||||
|     @Override |     @Override | ||||||
|     @LogRecord(type = CRM_PRODUCT_CATEGORY_TYPE, subType = CRM_PRODUCT_CATEGORY_CREATE_SUB_TYPE, bizNo = "{{#createReqVO.id}}", |     @LogRecord(type = CRM_PRODUCT_CATEGORY_TYPE, subType = CRM_PRODUCT_CATEGORY_CREATE_SUB_TYPE, bizNo = "{{#createReqVO.id}}", | ||||||
|             success = CRM_PRODUCT_CATEGORY_CREATE_SUCCESS) |             success = CRM_PRODUCT_CATEGORY_CREATE_SUCCESS) | ||||||
|  |     // TODO @hao:产品分类,应该没数据权限。可以删除下哈; | ||||||
|     @CrmPermission(bizType = CrmBizTypeEnum.CRM_PRODUCT, bizId = "#createReqVO.id", level = CrmPermissionLevelEnum.WRITE) |     @CrmPermission(bizType = CrmBizTypeEnum.CRM_PRODUCT, bizId = "#createReqVO.id", level = CrmPermissionLevelEnum.WRITE) | ||||||
|     public Long createProductCategory(CrmProductCategoryCreateReqVO createReqVO) { |     public Long createProductCategory(CrmProductCategoryCreateReqVO createReqVO) { | ||||||
|         // 1.1 校验父分类存在 |         // 1.1 校验父分类存在 | ||||||
|         validateParentProductCategory(createReqVO.getParentId()); |         validateParentProductCategory(createReqVO.getParentId()); | ||||||
|         // 1.2 分类名称是否存在 |         // 1.2 分类名称是否存在 | ||||||
|         validateProductNameExists(null, createReqVO.getParentId(), createReqVO.getName()); |         validateProductNameExists(null, createReqVO.getParentId(), createReqVO.getName()); | ||||||
|  |  | ||||||
|         // 2. 插入分类 |         // 2. 插入分类 | ||||||
|         CrmProductCategoryDO category = BeanUtils.toBean(createReqVO, CrmProductCategoryDO.class); |         CrmProductCategoryDO category = BeanUtils.toBean(createReqVO, CrmProductCategoryDO.class); | ||||||
|         productCategoryMapper.insert(category); |         productCategoryMapper.insert(category); | ||||||
| @ -65,6 +67,7 @@ public class CrmProductCategoryServiceImpl implements CrmProductCategoryService | |||||||
|         validateParentProductCategory(updateReqVO.getParentId()); |         validateParentProductCategory(updateReqVO.getParentId()); | ||||||
|         // 1.3 分类名称是否存在 |         // 1.3 分类名称是否存在 | ||||||
|         validateProductNameExists(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName()); |         validateProductNameExists(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName()); | ||||||
|  |  | ||||||
|         // 2. 更新分类 |         // 2. 更新分类 | ||||||
|         CrmProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, CrmProductCategoryDO.class); |         CrmProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, CrmProductCategoryDO.class); | ||||||
|         productCategoryMapper.updateById(updateObj); |         productCategoryMapper.updateById(updateObj); | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo; | |||||||
| import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||||
| import cn.iocoder.yudao.module.promotion.enums.common.PromotionConditionTypeEnum; | import cn.iocoder.yudao.module.promotion.enums.common.PromotionConditionTypeEnum; | ||||||
|  | import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum; | ||||||
| import com.fasterxml.jackson.annotation.JsonIgnore; | import com.fasterxml.jackson.annotation.JsonIgnore; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| @ -50,7 +51,7 @@ public class RewardActivityBaseVO { | |||||||
|  |  | ||||||
|     @Schema(description = "商品范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |     @Schema(description = "商品范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||||||
|     @NotNull(message = "商品范围不能为空") |     @NotNull(message = "商品范围不能为空") | ||||||
|     @InEnum(value = PromotionConditionTypeEnum.class, message = "商品范围必须是 {value}") |     @InEnum(value = PromotionProductScopeEnum.class, message = "商品范围必须是 {value}") | ||||||
|     private Integer productScope; |     private Integer productScope; | ||||||
|  |  | ||||||
|     @Schema(description = "商品 SPU 编号的数组", example = "1,2,3") |     @Schema(description = "商品 SPU 编号的数组", example = "1,2,3") | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV