Commit 68c9d563bc5a2187064bf2d4a898b80fa92907c9
1 parent
23cfbfe4
CRM-商机:新增获得商机公海分页接口
Showing
3 changed files
with
22 additions
and
1 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.java
| ... | ... | @@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 7 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; |
| 9 | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 10 | 11 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; |
| 11 | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | 13 | import io.swagger.v3.oas.annotations.Parameter; |
| ... | ... | @@ -75,6 +76,14 @@ public class CrmBusinessController { |
| 75 | 76 | return success(CrmBusinessConvert.INSTANCE.convertPage(pageResult)); |
| 76 | 77 | } |
| 77 | 78 | |
| 79 | + @GetMapping("/pool-page") | |
| 80 | + @Operation(summary = "获得商机公海分页") | |
| 81 | + @PreAuthorize("@ss.hasPermission('crm:business:query')") | |
| 82 | + public CommonResult<PageResult<CrmBusinessRespVO>> getBusinessPoolPage(@Valid CrmBusinessPageReqVO pageVO) { | |
| 83 | + PageResult<CrmBusinessDO> pageResult = businessService.getBusinessPage(pageVO, CrmPermissionDO.POOL_USER_ID); | |
| 84 | + return success(CrmBusinessConvert.INSTANCE.convertPage(pageResult)); | |
| 85 | + } | |
| 86 | + | |
| 78 | 87 | @GetMapping("/export-excel") |
| 79 | 88 | @Operation(summary = "导出商机 Excel") |
| 80 | 89 | @PreAuthorize("@ss.hasPermission('crm:business:export')") | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessService.java
| ... | ... | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.crm.service.business; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; |
| 5 | 5 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 6 | +import cn.iocoder.yudao.module.crm.framework.core.service.CrmPermissionValidateService; | |
| 6 | 7 | |
| 7 | 8 | import javax.validation.Valid; |
| 8 | 9 | import java.util.Collection; |
| ... | ... | @@ -13,7 +14,7 @@ import java.util.List; |
| 13 | 14 | * |
| 14 | 15 | * @author ljlleo |
| 15 | 16 | */ |
| 16 | -public interface CrmBusinessService { | |
| 17 | +public interface CrmBusinessService extends CrmPermissionValidateService { | |
| 17 | 18 | |
| 18 | 19 | /** |
| 19 | 20 | * 创建商机 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ 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.core.util.ObjUtil; | |
| 5 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; |
| 7 | 8 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; |
| ... | ... | @@ -133,4 +134,14 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { |
| 133 | 134 | // 3. TODO 记录转移日志 |
| 134 | 135 | } |
| 135 | 136 | |
| 137 | + @Override | |
| 138 | + public boolean validateBizIdExists(Integer bizType, Long bizId) { | |
| 139 | + // 1. 校验模块类型 | |
| 140 | + if (!ObjUtil.equal(CrmBizTypeEnum.CRM_BUSINESS.getType(), bizId)) { | |
| 141 | + return false; | |
| 142 | + } | |
| 143 | + // 2. 校验是否存在 | |
| 144 | + return businessMapper.selectById(bizId) != null; | |
| 145 | + } | |
| 146 | + | |
| 136 | 147 | } | ... | ... |