Commit 7c54affb16fea44111b4ea4f14defe786e0cfff0
1 parent
f69a18fd
CRM-合同:完善数据权限,新增权限关联、场景分页查询,新增权限关联批量查询
Showing
16 changed files
with
100 additions
and
60 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.java
| @@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | @@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 9 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.*; | 9 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.*; |
| 10 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.status.CrmBusinessStatusQueryVO; | 10 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.status.CrmBusinessStatusQueryVO; |
| 11 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.type.CrmBusinessStatusTypeQueryVO; | 11 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.type.CrmBusinessStatusTypeQueryVO; |
| 12 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 13 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; | 12 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; |
| 14 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | 13 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 15 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessStatusDO; | 14 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessStatusDO; |
| @@ -121,9 +120,9 @@ public class CrmBusinessController { | @@ -121,9 +120,9 @@ public class CrmBusinessController { | ||
| 121 | 120 | ||
| 122 | @GetMapping("/page-by-customer") | 121 | @GetMapping("/page-by-customer") |
| 123 | @Operation(summary = "获得商机分页,基于指定客户") | 122 | @Operation(summary = "获得商机分页,基于指定客户") |
| 124 | - public CommonResult<PageResult<CrmBusinessRespVO>> getBusinessPageByCustomer(@Valid CrmContractPageReqVO pageReqVO) { | 123 | + public CommonResult<PageResult<CrmBusinessRespVO>> getBusinessPageByCustomer(@Valid CrmBusinessPageReqVO pageReqVO) { |
| 125 | Assert.notNull(pageReqVO.getCustomerId(), "客户编号不能为空"); | 124 | Assert.notNull(pageReqVO.getCustomerId(), "客户编号不能为空"); |
| 126 | - PageResult<CrmBusinessDO> pageResult = businessService.getBusinessPageByCustomer(pageReqVO); | 125 | + PageResult<CrmBusinessDO> pageResult = businessService.getBusinessPageByCustomer(pageReqVO, getLoginUserId()); |
| 127 | // 处理客户名称回显 | 126 | // 处理客户名称回显 |
| 128 | // TODO @ljlleo:可以使用 CollectionUtils.convertSet 替代常用的 stream 操作,更简洁一点;下面几个也是哈; | 127 | // TODO @ljlleo:可以使用 CollectionUtils.convertSet 替代常用的 stream 操作,更简洁一点;下面几个也是哈; |
| 129 | Set<Long> customerIds = pageResult.getList().stream() | 128 | Set<Long> customerIds = pageResult.getList().stream() |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
| @@ -125,7 +125,7 @@ public class CrmContactController { | @@ -125,7 +125,7 @@ public class CrmContactController { | ||
| 125 | @Operation(summary = "获得联系人分页,基于指定客户") | 125 | @Operation(summary = "获得联系人分页,基于指定客户") |
| 126 | public CommonResult<PageResult<CrmContactRespVO>> getContactPageByCustomer(@Valid CrmContactPageReqVO pageVO) { | 126 | public CommonResult<PageResult<CrmContactRespVO>> getContactPageByCustomer(@Valid CrmContactPageReqVO pageVO) { |
| 127 | Assert.notNull(pageVO.getCustomerId(), "客户编号不能为空"); | 127 | Assert.notNull(pageVO.getCustomerId(), "客户编号不能为空"); |
| 128 | - PageResult<CrmContactDO> pageResult = contactService.getContactPage(pageVO, getLoginUserId()); | 128 | + PageResult<CrmContactDO> pageResult = contactService.getContactPageByCustomerId(pageVO, getLoginUserId()); |
| 129 | return success(convertDetailContactPage(pageResult)); | 129 | return success(convertDetailContactPage(pageResult)); |
| 130 | } | 130 | } |
| 131 | 131 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
| @@ -87,7 +87,7 @@ public class CrmContractController { | @@ -87,7 +87,7 @@ public class CrmContractController { | ||
| 87 | @Operation(summary = "获得合同分页") | 87 | @Operation(summary = "获得合同分页") |
| 88 | @PreAuthorize("@ss.hasPermission('crm:contract:query')") | 88 | @PreAuthorize("@ss.hasPermission('crm:contract:query')") |
| 89 | public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid CrmContractPageReqVO pageVO) { | 89 | public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid CrmContractPageReqVO pageVO) { |
| 90 | - PageResult<CrmContractDO> pageResult = contractService.getContractPage(pageVO); | 90 | + PageResult<CrmContractDO> pageResult = contractService.getContractPage(pageVO, getLoginUserId()); |
| 91 | return success(convertDetailContractPage(pageResult)); | 91 | return success(convertDetailContractPage(pageResult)); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| @@ -95,7 +95,7 @@ public class CrmContractController { | @@ -95,7 +95,7 @@ public class CrmContractController { | ||
| 95 | @Operation(summary = "获得联系人分页,基于指定客户") | 95 | @Operation(summary = "获得联系人分页,基于指定客户") |
| 96 | public CommonResult<PageResult<ContractRespVO>> getContractPageByCustomer(@Valid CrmContractPageReqVO pageVO) { | 96 | public CommonResult<PageResult<ContractRespVO>> getContractPageByCustomer(@Valid CrmContractPageReqVO pageVO) { |
| 97 | Assert.notNull(pageVO.getCustomerId(), "客户编号不能为空"); | 97 | Assert.notNull(pageVO.getCustomerId(), "客户编号不能为空"); |
| 98 | - PageResult<CrmContractDO> pageResult = contractService.getContractPageByCustomer(pageVO); | 98 | + PageResult<CrmContractDO> pageResult = contractService.getContractPageByCustomer(pageVO, getLoginUserId()); |
| 99 | return success(convertDetailContractPage(pageResult)); | 99 | return success(convertDetailContractPage(pageResult)); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| @@ -105,7 +105,7 @@ public class CrmContractController { | @@ -105,7 +105,7 @@ public class CrmContractController { | ||
| 105 | @OperateLog(type = EXPORT) | 105 | @OperateLog(type = EXPORT) |
| 106 | public void exportContractExcel(@Valid CrmContractPageReqVO exportReqVO, | 106 | public void exportContractExcel(@Valid CrmContractPageReqVO exportReqVO, |
| 107 | HttpServletResponse response) throws IOException { | 107 | HttpServletResponse response) throws IOException { |
| 108 | - PageResult<CrmContractDO> pageResult = contractService.getContractPage(exportReqVO); | 108 | + PageResult<CrmContractDO> pageResult = contractService.getContractPage(exportReqVO, getLoginUserId()); |
| 109 | // 导出 Excel | 109 | // 导出 Excel |
| 110 | ExcelUtils.write(response, "合同.xls", "数据", CrmContractExcelVO.class, | 110 | ExcelUtils.write(response, "合同.xls", "数据", CrmContractExcelVO.class, |
| 111 | ContractConvert.INSTANCE.convertList02(pageResult.getList())); | 111 | ContractConvert.INSTANCE.convertList02(pageResult.getList())); |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/business/CrmBusinessMapper.java
| @@ -33,7 +33,7 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { | @@ -33,7 +33,7 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { | ||
| 33 | CrmQueryWrapperUtils.builderPageQuery(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_BUSINESS.getType(), CrmBusinessDO::getId, | 33 | CrmQueryWrapperUtils.builderPageQuery(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_BUSINESS.getType(), CrmBusinessDO::getId, |
| 34 | userId, pageReqVO.getSceneType(), pageReqVO.getPool()); | 34 | userId, pageReqVO.getSceneType(), pageReqVO.getPool()); |
| 35 | mpjLambdaWrapperX.selectAll(CrmBusinessDO.class) | 35 | mpjLambdaWrapperX.selectAll(CrmBusinessDO.class) |
| 36 | - .eq(CrmBusinessDO::getCustomerId, pageReqVO.getCustomerId()) // 必须传递 | 36 | + .eqIfPresent(CrmBusinessDO::getCustomerId, pageReqVO.getCustomerId()) // 指定客户编号 |
| 37 | .likeIfPresent(CrmBusinessDO::getName, pageReqVO.getName()) | 37 | .likeIfPresent(CrmBusinessDO::getName, pageReqVO.getName()) |
| 38 | .orderByDesc(CrmBusinessDO::getId); | 38 | .orderByDesc(CrmBusinessDO::getId); |
| 39 | return selectJoinPage(pageReqVO, CrmBusinessDO.class, mpjLambdaWrapperX); | 39 | return selectJoinPage(pageReqVO, CrmBusinessDO.class, mpjLambdaWrapperX); |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contact/CrmContactMapper.java
| @@ -33,7 +33,7 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> { | @@ -33,7 +33,7 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> { | ||
| 33 | CrmQueryWrapperUtils.builderPageQuery(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_CONTACT.getType(), CrmContactDO::getId, | 33 | CrmQueryWrapperUtils.builderPageQuery(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_CONTACT.getType(), CrmContactDO::getId, |
| 34 | userId, pageReqVO.getSceneType(), pageReqVO.getPool()); | 34 | userId, pageReqVO.getSceneType(), pageReqVO.getPool()); |
| 35 | mpjLambdaWrapperX.selectAll(CrmContactDO.class) | 35 | mpjLambdaWrapperX.selectAll(CrmContactDO.class) |
| 36 | - .eq(CrmContactDO::getCustomerId, pageReqVO.getCustomerId()) // 必须传递 | 36 | + .eqIfPresent(CrmContactDO::getCustomerId, pageReqVO.getCustomerId()) // 指定客户编号 |
| 37 | .likeIfPresent(CrmContactDO::getName, pageReqVO.getName()) | 37 | .likeIfPresent(CrmContactDO::getName, pageReqVO.getName()) |
| 38 | .eqIfPresent(CrmContactDO::getMobile, pageReqVO.getMobile()) | 38 | .eqIfPresent(CrmContactDO::getMobile, pageReqVO.getMobile()) |
| 39 | .eqIfPresent(CrmContactDO::getTelephone, pageReqVO.getTelephone()) | 39 | .eqIfPresent(CrmContactDO::getTelephone, pageReqVO.getTelephone()) |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
| @@ -2,11 +2,17 @@ package cn.iocoder.yudao.module.crm.dal.mysql.contract; | @@ -2,11 +2,17 @@ package cn.iocoder.yudao.module.crm.dal.mysql.contract; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX; |
| 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; |
| 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 8 | +import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | ||
| 9 | +import cn.iocoder.yudao.module.crm.util.CrmQueryWrapperUtils; | ||
| 10 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 8 | import org.apache.ibatis.annotations.Mapper; | 11 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 12 | ||
| 13 | +import java.util.Collection; | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 10 | /** | 16 | /** |
| 11 | * CRM 合同 Mapper | 17 | * CRM 合同 Mapper |
| 12 | * | 18 | * |
| @@ -15,22 +21,32 @@ import org.apache.ibatis.annotations.Mapper; | @@ -15,22 +21,32 @@ import org.apache.ibatis.annotations.Mapper; | ||
| 15 | @Mapper | 21 | @Mapper |
| 16 | public interface CrmContractMapper extends BaseMapperX<CrmContractDO> { | 22 | public interface CrmContractMapper extends BaseMapperX<CrmContractDO> { |
| 17 | 23 | ||
| 18 | - default PageResult<CrmContractDO> selectPage(CrmContractPageReqVO reqVO) { | ||
| 19 | - return selectPage(reqVO, new LambdaQueryWrapperX<CrmContractDO>() | ||
| 20 | - .likeIfPresent(CrmContractDO::getNo, reqVO.getNo()) | ||
| 21 | - .likeIfPresent(CrmContractDO::getName, reqVO.getName()) | ||
| 22 | - .eqIfPresent(CrmContractDO::getCustomerId, reqVO.getCustomerId()) | ||
| 23 | - .eqIfPresent(CrmContractDO::getBusinessId, reqVO.getBusinessId()) | ||
| 24 | - .orderByDesc(CrmContractDO::getId)); | 24 | + default int updateOwnerUserIdById(Long id, Long ownerUserId) { |
| 25 | + return update(new LambdaUpdateWrapper<CrmContractDO>() | ||
| 26 | + .eq(CrmContractDO::getId, id) | ||
| 27 | + .set(CrmContractDO::getOwnerUserId, ownerUserId)); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + default PageResult<CrmContractDO> selectPage(CrmContractPageReqVO pageReqVO, Long userId) { | ||
| 31 | + MPJLambdaWrapperX<CrmContractDO> mpjLambdaWrapperX = new MPJLambdaWrapperX<>(); | ||
| 32 | + // 构建数据权限连表条件 | ||
| 33 | + CrmQueryWrapperUtils.builderPageQuery(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_CONTACT.getType(), CrmContractDO::getId, | ||
| 34 | + userId, pageReqVO.getSceneType(), pageReqVO.getPool()); | ||
| 35 | + mpjLambdaWrapperX.selectAll(CrmContractDO.class) | ||
| 36 | + .eqIfPresent(CrmContractDO::getCustomerId, pageReqVO.getCustomerId()) | ||
| 37 | + .likeIfPresent(CrmContractDO::getNo, pageReqVO.getNo()) | ||
| 38 | + .likeIfPresent(CrmContractDO::getName, pageReqVO.getName()) | ||
| 39 | + .eqIfPresent(CrmContractDO::getCustomerId, pageReqVO.getCustomerId()) | ||
| 40 | + .eqIfPresent(CrmContractDO::getBusinessId, pageReqVO.getBusinessId()) | ||
| 41 | + .orderByDesc(CrmContractDO::getId); | ||
| 42 | + return selectJoinPage(pageReqVO, CrmContractDO.class, mpjLambdaWrapperX); | ||
| 25 | } | 43 | } |
| 26 | 44 | ||
| 27 | - default PageResult<CrmContractDO> selectPageByCustomer(CrmContractPageReqVO reqVO) { | ||
| 28 | - return selectPage(reqVO, new LambdaQueryWrapperX<CrmContractDO>() | ||
| 29 | - .eq(CrmContractDO::getCustomerId, reqVO.getCustomerId()) // 必须传递 | ||
| 30 | - .likeIfPresent(CrmContractDO::getNo, reqVO.getNo()) | ||
| 31 | - .likeIfPresent(CrmContractDO::getName, reqVO.getName()) | ||
| 32 | - .eqIfPresent(CrmContractDO::getBusinessId, reqVO.getBusinessId()) | ||
| 33 | - .orderByDesc(CrmContractDO::getId)); | 45 | + default List<CrmContractDO> selectBatchIds(Collection<Long> ids, Long userId) { |
| 46 | + MPJLambdaWrapperX<CrmContractDO> mpjLambdaWrapperX = new MPJLambdaWrapperX<>(); | ||
| 47 | + // 构建数据权限连表条件 | ||
| 48 | + CrmQueryWrapperUtils.builderListQueryBatch(mpjLambdaWrapperX, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, userId); | ||
| 49 | + return selectJoinList(CrmContractDO.class, mpjLambdaWrapperX); | ||
| 34 | } | 50 | } |
| 35 | 51 | ||
| 36 | } | 52 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessService.java
| @@ -5,7 +5,6 @@ import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusi | @@ -5,7 +5,6 @@ import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusi | ||
| 5 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessPageReqVO; | 5 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessPageReqVO; |
| 6 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; | 6 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; |
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessUpdateReqVO; | 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessUpdateReqVO; |
| 8 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 10 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 11 | import jakarta.validation.Valid; | 10 | import jakarta.validation.Valid; |
| @@ -76,9 +75,10 @@ public interface CrmBusinessService { | @@ -76,9 +75,10 @@ public interface CrmBusinessService { | ||
| 76 | * 数据权限:基于 {@link CrmCustomerDO} 读取 | 75 | * 数据权限:基于 {@link CrmCustomerDO} 读取 |
| 77 | * | 76 | * |
| 78 | * @param pageReqVO 分页查询 | 77 | * @param pageReqVO 分页查询 |
| 78 | + * @param userId 用户编号 | ||
| 79 | * @return 联系人分页 | 79 | * @return 联系人分页 |
| 80 | */ | 80 | */ |
| 81 | - PageResult<CrmBusinessDO> getBusinessPageByCustomer(CrmContractPageReqVO pageReqVO); | 81 | + PageResult<CrmBusinessDO> getBusinessPageByCustomer(CrmBusinessPageReqVO pageReqVO, Long userId); |
| 82 | 82 | ||
| 83 | /** | 83 | /** |
| 84 | * 商机转移 | 84 | * 商机转移 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
| @@ -7,13 +7,13 @@ import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusi | @@ -7,13 +7,13 @@ import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusi | ||
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessPageReqVO; | 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessPageReqVO; |
| 8 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; | 8 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; |
| 9 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessUpdateReqVO; | 9 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessUpdateReqVO; |
| 10 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 11 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; | 10 | import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; |
| 12 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | 11 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 13 | import cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessMapper; | 12 | import cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessMapper; |
| 14 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | 13 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 15 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; | 14 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 16 | import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | 15 | import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; |
| 16 | +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; | ||
| 17 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | 17 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 18 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; | 18 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 19 | import jakarta.annotation.Resource; | 19 | import jakarta.annotation.Resource; |
| @@ -38,6 +38,8 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | @@ -38,6 +38,8 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | ||
| 38 | 38 | ||
| 39 | @Resource | 39 | @Resource |
| 40 | private CrmBusinessMapper businessMapper; | 40 | private CrmBusinessMapper businessMapper; |
| 41 | + @Resource | ||
| 42 | + private CrmCustomerService customerService; | ||
| 41 | 43 | ||
| 42 | @Resource | 44 | @Resource |
| 43 | private CrmPermissionService crmPermissionService; | 45 | private CrmPermissionService crmPermissionService; |
| @@ -109,10 +111,11 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | @@ -109,10 +111,11 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | ||
| 109 | } | 111 | } |
| 110 | 112 | ||
| 111 | @Override | 113 | @Override |
| 112 | - @CrmPermission(bizType = CrmBizTypeEnum.CRM_CUSTOMER, bizId = "#pageReqVO.customerId", level = CrmPermissionLevelEnum.READ) | ||
| 113 | - public PageResult<CrmBusinessDO> getBusinessPageByCustomer(CrmContractPageReqVO pageReqVO) { | ||
| 114 | - //return businessMapper.selectPageByCustomer(pageReqVO); | ||
| 115 | - return null; // TODO puhui999: 可以跟分页合并吗? | 114 | + public PageResult<CrmBusinessDO> getBusinessPageByCustomer(CrmBusinessPageReqVO pageReqVO, Long userId) { |
| 115 | + // 校验客户存在 | ||
| 116 | + customerService.validateCustomer(pageReqVO.getCustomerId()); | ||
| 117 | + | ||
| 118 | + return businessMapper.selectPage(pageReqVO, userId); | ||
| 116 | } | 119 | } |
| 117 | 120 | ||
| 118 | @Override | 121 | @Override |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java
| @@ -68,4 +68,15 @@ public interface CrmContactService { | @@ -68,4 +68,15 @@ public interface CrmContactService { | ||
| 68 | */ | 68 | */ |
| 69 | PageResult<CrmContactDO> getContactPage(CrmContactPageReqVO pageReqVO, Long userId); | 69 | PageResult<CrmContactDO> getContactPage(CrmContactPageReqVO pageReqVO, Long userId); |
| 70 | 70 | ||
| 71 | + /** | ||
| 72 | + * 获得联系人分页 | ||
| 73 | + * | ||
| 74 | + * 数据权限:基于 {@link CrmContactDO} | ||
| 75 | + * | ||
| 76 | + * @param pageVO 分页查询 | ||
| 77 | + * @param userId 用户编号 | ||
| 78 | + * @return 联系人分页 | ||
| 79 | + */ | ||
| 80 | + PageResult<CrmContactDO> getContactPageByCustomerId(CrmContactPageReqVO pageVO, Long userId); | ||
| 81 | + | ||
| 71 | } | 82 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactServiceImpl.java
| @@ -133,4 +133,12 @@ public class CrmContactServiceImpl implements CrmContactService { | @@ -133,4 +133,12 @@ public class CrmContactServiceImpl implements CrmContactService { | ||
| 133 | return contactMapper.selectPage(pageReqVO, userId); | 133 | return contactMapper.selectPage(pageReqVO, userId); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | + @Override | ||
| 137 | + public PageResult<CrmContactDO> getContactPageByCustomerId(CrmContactPageReqVO pageVO, Long userId) { | ||
| 138 | + // 校验用户存在 | ||
| 139 | + customerService.validateCustomer(pageVO.getCustomerId()); | ||
| 140 | + | ||
| 141 | + return contactMapper.selectPage(pageVO, userId); | ||
| 142 | + } | ||
| 143 | + | ||
| 136 | } | 144 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractService.java
| @@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.crm.service.contract; | @@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.crm.service.contract; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractCreateReqVO; | 4 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractCreateReqVO; |
| 5 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | 5 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; |
| 6 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; | ||
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; | 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; | ||
| 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 10 | - | ||
| 11 | import jakarta.validation.Valid; | 10 | import jakarta.validation.Valid; |
| 11 | + | ||
| 12 | import java.util.Collection; | 12 | import java.util.Collection; |
| 13 | import java.util.List; | 13 | import java.util.List; |
| 14 | 14 | ||
| @@ -64,9 +64,10 @@ public interface CrmContractService { | @@ -64,9 +64,10 @@ public interface CrmContractService { | ||
| 64 | * 数据权限:基于 {@link CrmContractDO} 读取 | 64 | * 数据权限:基于 {@link CrmContractDO} 读取 |
| 65 | * | 65 | * |
| 66 | * @param pageReqVO 分页查询 | 66 | * @param pageReqVO 分页查询 |
| 67 | + * @param userId 用户编号 | ||
| 67 | * @return 合同分页 | 68 | * @return 合同分页 |
| 68 | */ | 69 | */ |
| 69 | - PageResult<CrmContractDO> getContractPage(CrmContractPageReqVO pageReqVO); | 70 | + PageResult<CrmContractDO> getContractPage(CrmContractPageReqVO pageReqVO, Long userId); |
| 70 | 71 | ||
| 71 | /** | 72 | /** |
| 72 | * 获得合同分页,基于指定客户 | 73 | * 获得合同分页,基于指定客户 |
| @@ -74,9 +75,12 @@ public interface CrmContractService { | @@ -74,9 +75,12 @@ public interface CrmContractService { | ||
| 74 | * 数据权限:基于 {@link CrmCustomerDO} 读取 | 75 | * 数据权限:基于 {@link CrmCustomerDO} 读取 |
| 75 | * | 76 | * |
| 76 | * @param pageReqVO 分页查询 | 77 | * @param pageReqVO 分页查询 |
| 78 | + * @param userId 用户编号 | ||
| 77 | * @return 联系人分页 | 79 | * @return 联系人分页 |
| 78 | */ | 80 | */ |
| 79 | - PageResult<CrmContractDO> getContractPageByCustomer(CrmContractPageReqVO pageReqVO); | 81 | + default PageResult<CrmContractDO> getContractPageByCustomer(CrmContractPageReqVO pageReqVO, Long userId) { |
| 82 | + return getContractPage(pageReqVO, userId); | ||
| 83 | + } | ||
| 80 | 84 | ||
| 81 | /** | 85 | /** |
| 82 | * 合同转移 | 86 | * 合同转移 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
| @@ -5,8 +5,8 @@ import cn.hutool.core.collection.ListUtil; | @@ -5,8 +5,8 @@ import cn.hutool.core.collection.ListUtil; | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractCreateReqVO; | 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractCreateReqVO; |
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | 7 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; |
| 8 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; | ||
| 9 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; | 8 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; | ||
| 10 | import cn.iocoder.yudao.module.crm.convert.contract.ContractConvert; | 10 | import cn.iocoder.yudao.module.crm.convert.contract.ContractConvert; |
| 11 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 11 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 12 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; | 12 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; |
| @@ -15,11 +15,11 @@ import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; | @@ -15,11 +15,11 @@ import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; | ||
| 15 | import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | 15 | import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; |
| 16 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | 16 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 17 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; | 17 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 18 | +import jakarta.annotation.Resource; | ||
| 18 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
| 19 | import org.springframework.transaction.annotation.Transactional; | 20 | import org.springframework.transaction.annotation.Transactional; |
| 20 | import org.springframework.validation.annotation.Validated; | 21 | import org.springframework.validation.annotation.Validated; |
| 21 | 22 | ||
| 22 | -import jakarta.annotation.Resource; | ||
| 23 | import java.util.Collection; | 23 | import java.util.Collection; |
| 24 | import java.util.List; | 24 | import java.util.List; |
| 25 | 25 | ||
| @@ -56,7 +56,7 @@ public class CrmContractServiceImpl implements CrmContractService { | @@ -56,7 +56,7 @@ public class CrmContractServiceImpl implements CrmContractService { | ||
| 56 | 56 | ||
| 57 | @Override | 57 | @Override |
| 58 | @Transactional(rollbackFor = Exception.class) | 58 | @Transactional(rollbackFor = Exception.class) |
| 59 | - @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, level = CrmPermissionLevelEnum.WRITE) | 59 | + @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, bizId = "#updateReqVO.id", level = CrmPermissionLevelEnum.WRITE) |
| 60 | public void updateContract(CrmContractUpdateReqVO updateReqVO) { | 60 | public void updateContract(CrmContractUpdateReqVO updateReqVO) { |
| 61 | // 校验存在 | 61 | // 校验存在 |
| 62 | validateContractExists(updateReqVO.getId()); | 62 | validateContractExists(updateReqVO.getId()); |
| @@ -67,12 +67,14 @@ public class CrmContractServiceImpl implements CrmContractService { | @@ -67,12 +67,14 @@ public class CrmContractServiceImpl implements CrmContractService { | ||
| 67 | 67 | ||
| 68 | @Override | 68 | @Override |
| 69 | @Transactional(rollbackFor = Exception.class) | 69 | @Transactional(rollbackFor = Exception.class) |
| 70 | - @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, bizId = "#id", level = CrmPermissionLevelEnum.WRITE) | 70 | + @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, bizId = "#id", level = CrmPermissionLevelEnum.OWNER) |
| 71 | public void deleteContract(Long id) { | 71 | public void deleteContract(Long id) { |
| 72 | // 校验存在 | 72 | // 校验存在 |
| 73 | validateContractExists(id); | 73 | validateContractExists(id); |
| 74 | // 删除 | 74 | // 删除 |
| 75 | contractMapper.deleteById(id); | 75 | contractMapper.deleteById(id); |
| 76 | + // 删除数据权限 | ||
| 77 | + crmPermissionService.deletePermission(CrmBizTypeEnum.CRM_CONTRACT.getType(), id); | ||
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | private CrmContractDO validateContractExists(Long id) { | 80 | private CrmContractDO validateContractExists(Long id) { |
| @@ -83,7 +85,6 @@ public class CrmContractServiceImpl implements CrmContractService { | @@ -83,7 +85,6 @@ public class CrmContractServiceImpl implements CrmContractService { | ||
| 83 | return contract; | 85 | return contract; |
| 84 | } | 86 | } |
| 85 | 87 | ||
| 86 | - // TODO 芋艿:是否要做数据权限的校验??? | ||
| 87 | @Override | 88 | @Override |
| 88 | @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, bizId = "#id", level = CrmPermissionLevelEnum.READ) | 89 | @CrmPermission(bizType = CrmBizTypeEnum.CRM_CONTRACT, bizId = "#id", level = CrmPermissionLevelEnum.READ) |
| 89 | public CrmContractDO getContract(Long id) { | 90 | public CrmContractDO getContract(Long id) { |
| @@ -99,27 +100,24 @@ public class CrmContractServiceImpl implements CrmContractService { | @@ -99,27 +100,24 @@ public class CrmContractServiceImpl implements CrmContractService { | ||
| 99 | } | 100 | } |
| 100 | 101 | ||
| 101 | @Override | 102 | @Override |
| 102 | - public PageResult<CrmContractDO> getContractPage(CrmContractPageReqVO pageReqVO) { | ||
| 103 | - return contractMapper.selectPage(pageReqVO); | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - @Override | ||
| 107 | - @CrmPermission(bizType = CrmBizTypeEnum.CRM_CUSTOMER, bizId = "#pageReqVO.customerId", level = CrmPermissionLevelEnum.READ) | ||
| 108 | - public PageResult<CrmContractDO> getContractPageByCustomer(CrmContractPageReqVO pageReqVO) { | ||
| 109 | - return contractMapper.selectPageByCustomer(pageReqVO); | 103 | + public PageResult<CrmContractDO> getContractPage(CrmContractPageReqVO pageReqVO, Long userId) { |
| 104 | + return contractMapper.selectPage(pageReqVO, userId); | ||
| 110 | } | 105 | } |
| 111 | 106 | ||
| 112 | @Override | 107 | @Override |
| 113 | @Transactional(rollbackFor = Exception.class) | 108 | @Transactional(rollbackFor = Exception.class) |
| 114 | public void transferContract(CrmContractTransferReqVO reqVO, Long userId) { | 109 | public void transferContract(CrmContractTransferReqVO reqVO, Long userId) { |
| 115 | - // 1 校验合同是否存在 | 110 | + // 1. 校验合同是否存在 |
| 116 | validateContractExists(reqVO.getId()); | 111 | validateContractExists(reqVO.getId()); |
| 117 | 112 | ||
| 118 | - // 2. 数据权限转移 | 113 | + // 2.1 数据权限转移 |
| 119 | crmPermissionService.transferPermission( | 114 | crmPermissionService.transferPermission( |
| 120 | ContractConvert.INSTANCE.convert(reqVO, userId).setBizType(CrmBizTypeEnum.CRM_CONTRACT.getType())); | 115 | ContractConvert.INSTANCE.convert(reqVO, userId).setBizType(CrmBizTypeEnum.CRM_CONTRACT.getType())); |
| 116 | + // 2.2 设置负责人 | ||
| 117 | + contractMapper.updateOwnerUserIdById(reqVO.getId(), reqVO.getNewOwnerUserId()); | ||
| 121 | 118 | ||
| 122 | // 3. TODO 记录转移日志 | 119 | // 3. TODO 记录转移日志 |
| 120 | + | ||
| 123 | } | 121 | } |
| 124 | 122 | ||
| 125 | } | 123 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java
| @@ -71,9 +71,8 @@ public interface CrmCustomerService { | @@ -71,9 +71,8 @@ public interface CrmCustomerService { | ||
| 71 | * 校验客户是否存在 | 71 | * 校验客户是否存在 |
| 72 | * | 72 | * |
| 73 | * @param customerId 客户 id | 73 | * @param customerId 客户 id |
| 74 | - * @return 客户 | ||
| 75 | */ | 74 | */ |
| 76 | - CrmCustomerDO validateCustomer(Long customerId); | 75 | + void validateCustomer(Long customerId); |
| 77 | 76 | ||
| 78 | /** | 77 | /** |
| 79 | * 客户转移 | 78 | * 客户转移 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
| @@ -111,15 +111,18 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { | @@ -111,15 +111,18 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { | ||
| 111 | * 校验客户是否存在 | 111 | * 校验客户是否存在 |
| 112 | * | 112 | * |
| 113 | * @param customerId 客户 id | 113 | * @param customerId 客户 id |
| 114 | - * @return 客户 | ||
| 115 | */ | 114 | */ |
| 116 | @Override | 115 | @Override |
| 117 | - public CrmCustomerDO validateCustomer(Long customerId) { | ||
| 118 | - CrmCustomerDO customer = getCustomer(customerId); | 116 | + public void validateCustomer(Long customerId) { |
| 117 | + // TODO puhui999: 不返回客户不走校验应该可行 | ||
| 118 | + // 校验客户是否存在 | ||
| 119 | + if (customerId == null) { | ||
| 120 | + throw exception(CUSTOMER_NOT_EXISTS); | ||
| 121 | + } | ||
| 122 | + CrmCustomerDO customer = customerMapper.selectById(customerId); | ||
| 119 | if (Objects.isNull(customer)) { | 123 | if (Objects.isNull(customer)) { |
| 120 | throw exception(CUSTOMER_NOT_EXISTS); | 124 | throw exception(CUSTOMER_NOT_EXISTS); |
| 121 | } | 125 | } |
| 122 | - return customer; | ||
| 123 | } | 126 | } |
| 124 | 127 | ||
| 125 | @Override | 128 | @Override |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImplTest.java
| @@ -147,7 +147,7 @@ public class CrmClueServiceImplTest extends BaseDbUnitTest { | @@ -147,7 +147,7 @@ public class CrmClueServiceImplTest extends BaseDbUnitTest { | ||
| 147 | reqVO.setMobile(null); | 147 | reqVO.setMobile(null); |
| 148 | 148 | ||
| 149 | // 调用 | 149 | // 调用 |
| 150 | - PageResult<CrmClueDO> pageResult = clueService.getCluePage(reqVO, getLoginUserId()); | 150 | + PageResult<CrmClueDO> pageResult = clueService.getCluePage(reqVO, 1L); |
| 151 | // 断言 | 151 | // 断言 |
| 152 | assertEquals(1, pageResult.getTotal()); | 152 | assertEquals(1, pageResult.getTotal()); |
| 153 | assertEquals(1, pageResult.getList().size()); | 153 | assertEquals(1, pageResult.getList().size()); |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/contract/ContractServiceImplTest.java
| @@ -7,12 +7,11 @@ import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageR | @@ -7,12 +7,11 @@ import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageR | ||
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; | 7 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractUpdateReqVO; |
| 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 9 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; | 9 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; |
| 10 | +import jakarta.annotation.Resource; | ||
| 10 | import org.junit.jupiter.api.Disabled; | 11 | import org.junit.jupiter.api.Disabled; |
| 11 | import org.junit.jupiter.api.Test; | 12 | import org.junit.jupiter.api.Test; |
| 12 | import org.springframework.context.annotation.Import; | 13 | import org.springframework.context.annotation.Import; |
| 13 | 14 | ||
| 14 | -import jakarta.annotation.Resource; | ||
| 15 | - | ||
| 16 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | 15 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 17 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 16 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 18 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | 17 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| @@ -127,7 +126,7 @@ public class ContractServiceImplTest extends BaseDbUnitTest { | @@ -127,7 +126,7 @@ public class ContractServiceImplTest extends BaseDbUnitTest { | ||
| 127 | reqVO.setNo(null); | 126 | reqVO.setNo(null); |
| 128 | 127 | ||
| 129 | // 调用 | 128 | // 调用 |
| 130 | - PageResult<CrmContractDO> pageResult = contractService.getContractPage(reqVO); | 129 | + PageResult<CrmContractDO> pageResult = contractService.getContractPage(reqVO, getLoginUserId()); |
| 131 | // 断言 | 130 | // 断言 |
| 132 | assertEquals(1, pageResult.getTotal()); | 131 | assertEquals(1, pageResult.getTotal()); |
| 133 | assertEquals(1, pageResult.getList().size()); | 132 | assertEquals(1, pageResult.getList().size()); |