Commit b13531448272b2c6012bd0b5c55740c50968d5b6
Committed by
Gitee
!890 修复:CRM 更新回款报错、待办事项中即将到期的合同查询报错、新增商机产品不显示
Merge pull request !890 from 李占宏/develop
Showing
5 changed files
with
18 additions
and
5 deletions
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/product/CrmProductStatusEnum.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.enums.product; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.util.ObjUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.core.IntArrayValuable; |
| 4 | 5 | import lombok.AllArgsConstructor; |
| 5 | 6 | import lombok.Getter; |
| ... | ... | @@ -35,4 +36,12 @@ public enum CrmProductStatusEnum implements IntArrayValuable { |
| 35 | 36 | return ARRAYS; |
| 36 | 37 | } |
| 37 | 38 | |
| 39 | + public static boolean isEnable(Integer status) { | |
| 40 | + return ObjUtil.equal(ENABLE.status, status); | |
| 41 | + } | |
| 42 | + | |
| 43 | + public static boolean isDisable(Integer status) { | |
| 44 | + return ObjUtil.equal(DISABLE.status, status); | |
| 45 | + } | |
| 46 | + | |
| 38 | 47 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/product/CrmProductController.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.controller.admin.product; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 5 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -14,6 +13,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.product.vo.product.CrmProduc |
| 14 | 13 | import cn.iocoder.yudao.module.crm.controller.admin.product.vo.product.CrmProductSaveReqVO; |
| 15 | 14 | import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductCategoryDO; |
| 16 | 15 | import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductDO; |
| 16 | +import cn.iocoder.yudao.module.crm.enums.product.CrmProductStatusEnum; | |
| 17 | 17 | import cn.iocoder.yudao.module.crm.service.product.CrmProductCategoryService; |
| 18 | 18 | import cn.iocoder.yudao.module.crm.service.product.CrmProductService; |
| 19 | 19 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| ... | ... | @@ -96,7 +96,7 @@ public class CrmProductController { |
| 96 | 96 | @GetMapping("/simple-list") |
| 97 | 97 | @Operation(summary = "获得产品精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项") |
| 98 | 98 | public CommonResult<List<CrmProductRespVO>> getProductSimpleList() { |
| 99 | - List<CrmProductDO> list = productService.getProductListByStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 99 | + List<CrmProductDO> list = productService.getProductListByStatus(CrmProductStatusEnum.ENABLE.getStatus()); | |
| 100 | 100 | return success(convertList(list, product -> new CrmProductRespVO().setId(product.getId()).setName(product.getName()) |
| 101 | 101 | .setUnit(product.getUnit()).setNo(product.getNo()).setPrice(product.getPrice()))); |
| 102 | 102 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.crm.service.contract; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.collection.ListUtil; |
| 5 | 5 | import cn.hutool.core.lang.Assert; |
| 6 | +import cn.hutool.core.lang.Validator; | |
| 6 | 7 | import cn.hutool.core.util.ObjUtil; |
| 7 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 9 | import cn.iocoder.yudao.framework.common.util.number.MoneyUtils; |
| ... | ... | @@ -345,6 +346,9 @@ public class CrmContractServiceImpl implements CrmContractService { |
| 345 | 346 | if (config != null && Boolean.FALSE.equals(config.getNotifyEnabled())) { |
| 346 | 347 | config = null; |
| 347 | 348 | } |
| 349 | + if(Validator.isNull(config)){ | |
| 350 | + return new PageResult<>(); | |
| 351 | + } | |
| 348 | 352 | } |
| 349 | 353 | // 2. 查询分页 |
| 350 | 354 | return contractMapper.selectPage(pageReqVO, userId, config); | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/CrmProductServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.service.product; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 5 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.product.vo.product.CrmProductPageReqVO; |
| ... | ... | @@ -11,6 +10,7 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductDO; |
| 11 | 10 | import cn.iocoder.yudao.module.crm.dal.mysql.product.CrmProductMapper; |
| 12 | 11 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 13 | 12 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 13 | +import cn.iocoder.yudao.module.crm.enums.product.CrmProductStatusEnum; | |
| 14 | 14 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 15 | 15 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 16 | 16 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| ... | ... | @@ -165,7 +165,7 @@ public class CrmProductServiceImpl implements CrmProductService { |
| 165 | 165 | if (productMap.get(id) == null) { |
| 166 | 166 | throw exception(PRODUCT_NOT_EXISTS); |
| 167 | 167 | } |
| 168 | - if (CommonStatusEnum.isDisable(product.getStatus())) { | |
| 168 | + if (CrmProductStatusEnum.isDisable(product.getStatus())) { | |
| 169 | 169 | throw exception(PRODUCT_NOT_ENABLE, product.getName()); |
| 170 | 170 | } |
| 171 | 171 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java
| ... | ... | @@ -164,9 +164,9 @@ public class CrmReceivableServiceImpl implements CrmReceivableService { |
| 164 | 164 | @CrmPermission(bizType = CrmBizTypeEnum.CRM_RECEIVABLE, bizId = "#updateReqVO.id", level = CrmPermissionLevelEnum.WRITE) |
| 165 | 165 | public void updateReceivable(CrmReceivableSaveReqVO updateReqVO) { |
| 166 | 166 | Assert.notNull(updateReqVO.getId(), "回款编号不能为空"); |
| 167 | - updateReqVO.setOwnerUserId(null).setCustomerId(null).setContractId(null).setPlanId(null); // 不允许修改的字段 | |
| 168 | 167 | // 1.1 校验可回款金额超过上限 |
| 169 | 168 | validateReceivablePriceExceedsLimit(updateReqVO); |
| 169 | + updateReqVO.setOwnerUserId(null).setCustomerId(null).setContractId(null).setPlanId(null); // 不允许修改的字段 | |
| 170 | 170 | // 1.2 校验存在 |
| 171 | 171 | CrmReceivableDO receivable = validateReceivableExists(updateReqVO.getId()); |
| 172 | 172 | // 1.3 只有草稿、审批中,可以编辑; | ... | ... |