Commit 0043d02d0a10027ba0151a6e7ff4aef51c55e64c
1 parent
89fc83c4
fix:商机 api 文档生成不对的问题
Showing
2 changed files
with
6 additions
and
8 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/business/CrmBusinessSaveReqVO.java
| ... | ... | @@ -66,13 +66,13 @@ public class CrmBusinessSaveReqVO { |
| 66 | 66 | private Long contactId; // 使用场景,在【联系人详情】添加商机时,如果需要关联两者,需要传递 contactId 字段 |
| 67 | 67 | |
| 68 | 68 | @Schema(description = "产品列表") |
| 69 | - private List<Product> products; | |
| 69 | + private List<BusinessProduct> businessProducts; | |
| 70 | 70 | |
| 71 | 71 | @Schema(description = "产品列表") |
| 72 | 72 | @Data |
| 73 | 73 | @NoArgsConstructor |
| 74 | 74 | @AllArgsConstructor |
| 75 | - public static class Product { | |
| 75 | + public static class BusinessProduct { | |
| 76 | 76 | |
| 77 | 77 | @Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20529") |
| 78 | 78 | @NotNull(message = "产品编号不能为空") | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
| ... | ... | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.crm.service.business; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.collection.ListUtil; |
| 5 | -import cn.hutool.extra.spring.SpringUtil; | |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 6 | import cn.iocoder.yudao.framework.common.util.number.MoneyUtils; |
| 8 | 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| ... | ... | @@ -24,7 +23,6 @@ import cn.iocoder.yudao.module.crm.service.contact.CrmContactBusinessService; |
| 24 | 23 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; |
| 25 | 24 | import cn.iocoder.yudao.module.crm.service.contract.CrmContractService; |
| 26 | 25 | import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; |
| 27 | -import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerServiceImpl; | |
| 28 | 26 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 29 | 27 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 30 | 28 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionTransferReqBO; |
| ... | ... | @@ -90,7 +88,7 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { |
| 90 | 88 | success = CRM_BUSINESS_CREATE_SUCCESS) |
| 91 | 89 | public Long createBusiness(CrmBusinessSaveReqVO createReqVO, Long userId) { |
| 92 | 90 | // 1.1 校验产品项的有效性 |
| 93 | - List<CrmBusinessProductDO> businessProducts = validateBusinessProducts(createReqVO.getProducts()); | |
| 91 | + List<CrmBusinessProductDO> businessProducts = validateBusinessProducts(createReqVO.getBusinessProducts()); | |
| 94 | 92 | // 1.2 校验关联字段 |
| 95 | 93 | validateRelationDataExists(createReqVO); |
| 96 | 94 | |
| ... | ... | @@ -131,7 +129,7 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { |
| 131 | 129 | // 1.1 校验存在 |
| 132 | 130 | CrmBusinessDO oldBusiness = validateBusinessExists(updateReqVO.getId()); |
| 133 | 131 | // 1.2 校验产品项的有效性 |
| 134 | - List<CrmBusinessProductDO> businessProducts = validateBusinessProducts(updateReqVO.getProducts()); | |
| 132 | + List<CrmBusinessProductDO> businessProducts = validateBusinessProducts(updateReqVO.getBusinessProducts()); | |
| 135 | 133 | // 1.3 校验关联字段 |
| 136 | 134 | validateRelationDataExists(updateReqVO); |
| 137 | 135 | |
| ... | ... | @@ -204,9 +202,9 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { |
| 204 | 202 | } |
| 205 | 203 | } |
| 206 | 204 | |
| 207 | - private List<CrmBusinessProductDO> validateBusinessProducts(List<CrmBusinessSaveReqVO.Product> list) { | |
| 205 | + private List<CrmBusinessProductDO> validateBusinessProducts(List<CrmBusinessSaveReqVO.BusinessProduct> list) { | |
| 208 | 206 | // 1. 校验产品存在 |
| 209 | - productService.validProductList(convertSet(list, CrmBusinessSaveReqVO.Product::getProductId)); | |
| 207 | + productService.validProductList(convertSet(list, CrmBusinessSaveReqVO.BusinessProduct::getProductId)); | |
| 210 | 208 | // 2. 转化为 CrmBusinessProductDO 列表 |
| 211 | 209 | return convertList(list, o -> BeanUtils.toBean(o, CrmBusinessProductDO.class, |
| 212 | 210 | item -> item.setTotalPrice(MoneyUtils.priceMultiply(item.getBusinessPrice(), item.getCount())))); | ... | ... |