Commit 29f1eb2c184bf7485734d8f869a236bab337fe25
1 parent
3f8fa6b1
✨ CRM:优化 CRM 跟进记录的实现
Showing
12 changed files
with
50 additions
and
84 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.java
| @@ -126,15 +126,6 @@ public class CrmBusinessController { | @@ -126,15 +126,6 @@ public class CrmBusinessController { | ||
| 126 | return businessVO; | 126 | return businessVO; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | - // TODO 芋艿:处理下 | ||
| 130 | - @GetMapping("/list-by-ids") | ||
| 131 | - @Operation(summary = "获得商机列表") | ||
| 132 | - @Parameter(name = "ids", description = "编号", required = true, example = "[1024]") | ||
| 133 | - @PreAuthorize("@ss.hasPermission('crm:business:query')") | ||
| 134 | - public CommonResult<List<CrmBusinessRespVO>> getContactListByIds(@RequestParam("ids") List<Long> ids) { | ||
| 135 | - return success(BeanUtils.toBean(businessService.getBusinessList(ids, getLoginUserId()), CrmBusinessRespVO.class)); | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | @GetMapping("/simple-all-list") | 129 | @GetMapping("/simple-all-list") |
| 139 | @Operation(summary = "获得联系人的精简列表") | 130 | @Operation(summary = "获得联系人的精简列表") |
| 140 | @PreAuthorize("@ss.hasPermission('crm:contact:query')") | 131 | @PreAuthorize("@ss.hasPermission('crm:contact:query')") |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
| @@ -105,15 +105,6 @@ public class CrmContactController { | @@ -105,15 +105,6 @@ public class CrmContactController { | ||
| 105 | return buildContactDetailList(singletonList(contact)).get(0); | 105 | return buildContactDetailList(singletonList(contact)).get(0); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | - @GetMapping("/list-by-ids") | ||
| 109 | - @Operation(summary = "获得联系人列表") | ||
| 110 | - @Parameter(name = "ids", description = "编号", required = true, example = "[1024]") | ||
| 111 | - @PreAuthorize("@ss.hasPermission('crm:contact:query')") | ||
| 112 | - public CommonResult<List<CrmContactRespVO>> getContactListByIds(@RequestParam("ids") List<Long> ids) { | ||
| 113 | - List<CrmContactDO> list = contactService.getContactListByIds(ids, getLoginUserId()); | ||
| 114 | - return success(BeanUtils.toBean(list, CrmContactRespVO.class)); | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | @GetMapping("/simple-all-list") | 108 | @GetMapping("/simple-all-list") |
| 118 | @Operation(summary = "获得联系人的精简列表") | 109 | @Operation(summary = "获得联系人的精简列表") |
| 119 | @PreAuthorize("@ss.hasPermission('crm:contact:query')") | 110 | @PreAuthorize("@ss.hasPermission('crm:contact:query')") |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
| @@ -187,8 +187,8 @@ public class CrmContractController { | @@ -187,8 +187,8 @@ public class CrmContractController { | ||
| 187 | Map<Long, CrmContactDO> contactMap = convertMap(contactService.getContactList(convertSet(contractList, | 187 | Map<Long, CrmContactDO> contactMap = convertMap(contactService.getContactList(convertSet(contractList, |
| 188 | CrmContractDO::getSignContactId)), CrmContactDO::getId); | 188 | CrmContractDO::getSignContactId)), CrmContactDO::getId); |
| 189 | // 1.4 获取商机 | 189 | // 1.4 获取商机 |
| 190 | - Map<Long, CrmBusinessDO> businessMap = convertMap(businessService.getBusinessList(convertSet(contractList, | ||
| 191 | - CrmContractDO::getBusinessId)), CrmBusinessDO::getId); | 190 | + Map<Long, CrmBusinessDO> businessMap = businessService.getBusinessMap( |
| 191 | + convertSet(contractList, CrmContractDO::getBusinessId)); | ||
| 192 | // 2. 拼接数据 | 192 | // 2. 拼接数据 |
| 193 | return BeanUtils.toBean(contractList, CrmContractRespVO.class, contractVO -> { | 193 | return BeanUtils.toBean(contractList, CrmContractRespVO.class, contractVO -> { |
| 194 | // 2.1 设置客户信息 | 194 | // 2.1 设置客户信息 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/CrmFollowUpRecordController.java
| @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessRespVO; | ||
| 7 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordPageReqVO; | 8 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordPageReqVO; |
| 8 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordRespVO; | 9 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordRespVO; |
| 9 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordSaveReqVO; | 10 | import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecordSaveReqVO; |
| @@ -13,6 +14,8 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | @@ -13,6 +14,8 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | ||
| 13 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; | 14 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; |
| 14 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; | 15 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; |
| 15 | import cn.iocoder.yudao.module.crm.service.followup.CrmFollowUpRecordService; | 16 | import cn.iocoder.yudao.module.crm.service.followup.CrmFollowUpRecordService; |
| 17 | +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | ||
| 18 | +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | ||
| 16 | import io.swagger.v3.oas.annotations.Operation; | 19 | import io.swagger.v3.oas.annotations.Operation; |
| 17 | import io.swagger.v3.oas.annotations.Parameter; | 20 | import io.swagger.v3.oas.annotations.Parameter; |
| 18 | import io.swagger.v3.oas.annotations.tags.Tag; | 21 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -26,7 +29,7 @@ import java.util.ArrayList; | @@ -26,7 +29,7 @@ import java.util.ArrayList; | ||
| 26 | import java.util.Map; | 29 | import java.util.Map; |
| 27 | 30 | ||
| 28 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 31 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 29 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | 32 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| 30 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap; | 33 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap; |
| 31 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 34 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 32 | 35 | ||
| @@ -44,6 +47,9 @@ public class CrmFollowUpRecordController { | @@ -44,6 +47,9 @@ public class CrmFollowUpRecordController { | ||
| 44 | @Resource | 47 | @Resource |
| 45 | private CrmBusinessService businessService; | 48 | private CrmBusinessService businessService; |
| 46 | 49 | ||
| 50 | + @Resource | ||
| 51 | + private AdminUserApi adminUserApi; | ||
| 52 | + | ||
| 47 | @PostMapping("/create") | 53 | @PostMapping("/create") |
| 48 | @Operation(summary = "创建跟进记录") | 54 | @Operation(summary = "创建跟进记录") |
| 49 | @PreAuthorize("@ss.hasPermission('crm:follow-up-record:create')") | 55 | @PreAuthorize("@ss.hasPermission('crm:follow-up-record:create')") |
| @@ -74,17 +80,24 @@ public class CrmFollowUpRecordController { | @@ -74,17 +80,24 @@ public class CrmFollowUpRecordController { | ||
| 74 | @PreAuthorize("@ss.hasPermission('crm:follow-up-record:query')") | 80 | @PreAuthorize("@ss.hasPermission('crm:follow-up-record:query')") |
| 75 | public CommonResult<PageResult<CrmFollowUpRecordRespVO>> getFollowUpRecordPage(@Valid CrmFollowUpRecordPageReqVO pageReqVO) { | 81 | public CommonResult<PageResult<CrmFollowUpRecordRespVO>> getFollowUpRecordPage(@Valid CrmFollowUpRecordPageReqVO pageReqVO) { |
| 76 | PageResult<CrmFollowUpRecordDO> pageResult = followUpRecordService.getFollowUpRecordPage(pageReqVO); | 82 | PageResult<CrmFollowUpRecordDO> pageResult = followUpRecordService.getFollowUpRecordPage(pageReqVO); |
| 77 | - /// 拼接数据 | ||
| 78 | - Map<Long, CrmContactDO> contactMap = convertMap(contactService.getContactList( | ||
| 79 | - convertSetByFlatMap(pageResult.getList(), item -> item.getContactIds().stream())), CrmContactDO::getId); | ||
| 80 | - Map<Long, CrmBusinessDO> businessMap = convertMap(businessService.getBusinessList( | ||
| 81 | - convertSetByFlatMap(pageResult.getList(), item -> item.getBusinessIds().stream())), CrmBusinessDO::getId); | 83 | + // 1.1 查询联系人和商机 |
| 84 | + Map<Long, CrmContactDO> contactMap = contactService.getContactMap( | ||
| 85 | + convertSetByFlatMap(pageResult.getList(), item -> item.getContactIds().stream())); | ||
| 86 | + Map<Long, CrmBusinessDO> businessMap = businessService.getBusinessMap( | ||
| 87 | + convertSetByFlatMap(pageResult.getList(), item -> item.getBusinessIds().stream())); | ||
| 88 | + // 1.2 查询用户 | ||
| 89 | + Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap( | ||
| 90 | + convertSet(pageResult.getList(), item -> Long.valueOf(item.getCreator()))); | ||
| 91 | + // 2. 拼接数据 | ||
| 82 | PageResult<CrmFollowUpRecordRespVO> voPageResult = BeanUtils.toBean(pageResult, CrmFollowUpRecordRespVO.class, record -> { | 92 | PageResult<CrmFollowUpRecordRespVO> voPageResult = BeanUtils.toBean(pageResult, CrmFollowUpRecordRespVO.class, record -> { |
| 83 | - record.setContactNames(new ArrayList<>()).setBusinessNames(new ArrayList<>()); | ||
| 84 | - record.getContactIds().forEach(id -> MapUtils.findAndThen(contactMap, id, | ||
| 85 | - contact -> record.getContactNames().add(contact.getName()))); | ||
| 86 | - record.getContactIds().forEach(id -> MapUtils.findAndThen(businessMap, id, | ||
| 87 | - business -> record.getBusinessNames().add(business.getName()))); | 93 | + // 2.1 设置联系人和商机信息 |
| 94 | + record.setBusinesses(new ArrayList<>()).setContacts(new ArrayList<>()); | ||
| 95 | + record.getContactIds().forEach(id -> MapUtils.findAndThen(contactMap, id, contact -> | ||
| 96 | + record.getContacts().add(new CrmBusinessRespVO().setId(contact.getId()).setName(contact.getName())))); | ||
| 97 | + record.getContactIds().forEach(id -> MapUtils.findAndThen(businessMap, id, business -> | ||
| 98 | + record.getBusinesses().add(new CrmBusinessRespVO().setId(business.getId()).setName(business.getName())))); | ||
| 99 | + // 2.2 设置用户信息 | ||
| 100 | + MapUtils.findAndThen(userMap, Long.valueOf(record.getCreator()), user -> record.setCreatorName(user.getNickname())); | ||
| 88 | }); | 101 | }); |
| 89 | return success(voPageResult); | 102 | return success(voPageResult); |
| 90 | } | 103 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/vo/CrmFollowUpRecordRespVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.followup.vo; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.followup.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessRespVO; | ||
| 4 | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 5 | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import com.alibaba.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 8 | import lombok.Data; |
| 7 | 9 | ||
| @@ -36,19 +38,26 @@ public class CrmFollowUpRecordRespVO { | @@ -36,19 +38,26 @@ public class CrmFollowUpRecordRespVO { | ||
| 36 | 38 | ||
| 37 | @Schema(description = "关联的商机编号数组") | 39 | @Schema(description = "关联的商机编号数组") |
| 38 | private List<Long> businessIds; | 40 | private List<Long> businessIds; |
| 39 | - @Schema(description = "关联的商机名称数组") | ||
| 40 | - private List<String> businessNames; | 41 | + @Schema(description = "关联的商机数组") |
| 42 | + private List<CrmBusinessRespVO> businesses; | ||
| 41 | 43 | ||
| 42 | @Schema(description = "关联的联系人编号数组") | 44 | @Schema(description = "关联的联系人编号数组") |
| 43 | private List<Long> contactIds; | 45 | private List<Long> contactIds; |
| 44 | @Schema(description = "关联的联系人名称数组") | 46 | @Schema(description = "关联的联系人名称数组") |
| 45 | - private List<String> contactNames; | 47 | + private List<CrmBusinessRespVO> contacts; |
| 46 | 48 | ||
| 47 | @Schema(description = "图片") | 49 | @Schema(description = "图片") |
| 48 | private List<String> picUrls; | 50 | private List<String> picUrls; |
| 49 | @Schema(description = "附件") | 51 | @Schema(description = "附件") |
| 50 | private List<String> fileUrls; | 52 | private List<String> fileUrls; |
| 51 | 53 | ||
| 54 | + @Schema(description = "创建人", example = "1024") | ||
| 55 | + @ExcelProperty("创建人") | ||
| 56 | + private String creator; | ||
| 57 | + @Schema(description = "创建人名字", example = "芋道源码") | ||
| 58 | + @ExcelProperty("创建人名字") | ||
| 59 | + private String creatorName; | ||
| 60 | + | ||
| 52 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | 61 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 53 | private LocalDateTime createTime; | 62 | private LocalDateTime createTime; |
| 54 | 63 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/business/CrmBusinessMapper.java
| @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 12 | import org.apache.ibatis.annotations.Mapper; | 12 | import org.apache.ibatis.annotations.Mapper; |
| 13 | 13 | ||
| 14 | import java.util.Collection; | 14 | import java.util.Collection; |
| 15 | -import java.util.List; | ||
| 16 | 15 | ||
| 17 | /** | 16 | /** |
| 18 | * 商机 Mapper | 17 | * 商机 Mapper |
| @@ -54,15 +53,6 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { | @@ -54,15 +53,6 @@ public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { | ||
| 54 | return selectJoinPage(pageReqVO, CrmBusinessDO.class, query); | 53 | return selectJoinPage(pageReqVO, CrmBusinessDO.class, query); |
| 55 | } | 54 | } |
| 56 | 55 | ||
| 57 | - default List<CrmBusinessDO> selectBatchIds(Collection<Long> ids, Long userId) { | ||
| 58 | - MPJLambdaWrapperX<CrmBusinessDO> query = new MPJLambdaWrapperX<>(); | ||
| 59 | - // 拼接数据权限的查询条件 | ||
| 60 | - CrmPermissionUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_BUSINESS.getType(), ids, userId); | ||
| 61 | - // 拼接自身的查询条件 | ||
| 62 | - query.selectAll(CrmBusinessDO.class).in(CrmBusinessDO::getId, ids).orderByDesc(CrmBusinessDO::getId); | ||
| 63 | - return selectJoinList(CrmBusinessDO.class, query); | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | default Long selectCountByStatusTypeId(Long statusTypeId) { | 56 | default Long selectCountByStatusTypeId(Long statusTypeId) { |
| 67 | return selectCount(CrmBusinessDO::getStatusTypeId, statusTypeId); | 57 | return selectCount(CrmBusinessDO::getStatusTypeId, statusTypeId); |
| 68 | } | 58 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contact/CrmContactMapper.java
| @@ -69,14 +69,6 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> { | @@ -69,14 +69,6 @@ public interface CrmContactMapper extends BaseMapperX<CrmContactDO> { | ||
| 69 | return selectJoinPage(pageReqVO, CrmContactDO.class, query); | 69 | return selectJoinPage(pageReqVO, CrmContactDO.class, query); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | - default List<CrmContactDO> selectBatchIds(Collection<Long> ids, Long ownerUserId) { | ||
| 73 | - MPJLambdaWrapperX<CrmContactDO> query = new MPJLambdaWrapperX<>(); | ||
| 74 | - // 拼接数据权限的查询条件 | ||
| 75 | - CrmPermissionUtils.appendPermissionCondition(query, CrmBizTypeEnum.CRM_CONTACT.getType(), ids, ownerUserId); | ||
| 76 | - query.selectAll(CrmContactDO.class).in(CrmContactDO::getId, ids).orderByDesc(CrmContactDO::getId); | ||
| 77 | - return selectJoinList(CrmContactDO.class, query); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | default List<CrmContactDO> selectListByCustomerId(Long customerId) { | 72 | default List<CrmContactDO> selectListByCustomerId(Long customerId) { |
| 81 | return selectList(CrmContactDO::getCustomerId, customerId); | 73 | return selectList(CrmContactDO::getCustomerId, customerId); |
| 82 | } | 74 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessService.java
| @@ -16,6 +16,9 @@ import jakarta.validation.Valid; | @@ -16,6 +16,9 @@ import jakarta.validation.Valid; | ||
| 16 | import java.time.LocalDateTime; | 16 | import java.time.LocalDateTime; |
| 17 | import java.util.Collection; | 17 | import java.util.Collection; |
| 18 | import java.util.List; | 18 | import java.util.List; |
| 19 | +import java.util.Map; | ||
| 20 | + | ||
| 21 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | ||
| 19 | 22 | ||
| 20 | /** | 23 | /** |
| 21 | * 商机 Service 接口 | 24 | * 商机 Service 接口 |
| @@ -101,15 +104,17 @@ public interface CrmBusinessService { | @@ -101,15 +104,17 @@ public interface CrmBusinessService { | ||
| 101 | * @param ids 编号 | 104 | * @param ids 编号 |
| 102 | * @return 商机列表 | 105 | * @return 商机列表 |
| 103 | */ | 106 | */ |
| 104 | - List<CrmBusinessDO> getBusinessList(Collection<Long> ids, Long userId); | 107 | + List<CrmBusinessDO> getBusinessList(Collection<Long> ids); |
| 105 | 108 | ||
| 106 | /** | 109 | /** |
| 107 | - * 获得商机列表 | 110 | + * 获得商机 Map |
| 108 | * | 111 | * |
| 109 | * @param ids 编号 | 112 | * @param ids 编号 |
| 110 | - * @return 商机列表 | 113 | + * @return 商机 Map |
| 111 | */ | 114 | */ |
| 112 | - List<CrmBusinessDO> getBusinessList(Collection<Long> ids); | 115 | + default Map<Long, CrmBusinessDO> getBusinessMap(Collection<Long> ids) { |
| 116 | + return convertMap(getBusinessList(ids), CrmBusinessDO::getId); | ||
| 117 | + } | ||
| 113 | 118 | ||
| 114 | /** | 119 | /** |
| 115 | * 获得指定商机编号的产品列表 | 120 | * 获得指定商机编号的产品列表 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
| @@ -323,14 +323,6 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | @@ -323,14 +323,6 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { | ||
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | @Override | 325 | @Override |
| 326 | - public List<CrmBusinessDO> getBusinessList(Collection<Long> ids, Long userId) { | ||
| 327 | - if (CollUtil.isEmpty(ids)) { | ||
| 328 | - return ListUtil.empty(); | ||
| 329 | - } | ||
| 330 | - return businessMapper.selectBatchIds(ids, userId); | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | - @Override | ||
| 334 | public List<CrmBusinessDO> getBusinessList(Collection<Long> ids) { | 326 | public List<CrmBusinessDO> getBusinessList(Collection<Long> ids) { |
| 335 | if (CollUtil.isEmpty(ids)) { | 327 | if (CollUtil.isEmpty(ids)) { |
| 336 | return ListUtil.empty(); | 328 | return ListUtil.empty(); |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java
| @@ -98,15 +98,6 @@ public interface CrmContactService { | @@ -98,15 +98,6 @@ public interface CrmContactService { | ||
| 98 | /** | 98 | /** |
| 99 | * 获得联系人列表 | 99 | * 获得联系人列表 |
| 100 | * | 100 | * |
| 101 | - * @param ids 编号 | ||
| 102 | - * @param userId 用户编号 | ||
| 103 | - * @return 联系人列表 | ||
| 104 | - */ | ||
| 105 | - List<CrmContactDO> getContactListByIds(Collection<Long> ids, Long userId); | ||
| 106 | - | ||
| 107 | - /** | ||
| 108 | - * 获得联系人列表 | ||
| 109 | - * | ||
| 110 | * @param ids 编号 | 101 | * @param ids 编号 |
| 111 | * @return 联系人列表 | 102 | * @return 联系人列表 |
| 112 | */ | 103 | */ |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactServiceImpl.java
| @@ -258,14 +258,6 @@ public class CrmContactServiceImpl implements CrmContactService { | @@ -258,14 +258,6 @@ public class CrmContactServiceImpl implements CrmContactService { | ||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | @Override | 260 | @Override |
| 261 | - public List<CrmContactDO> getContactListByIds(Collection<Long> ids, Long userId) { | ||
| 262 | - if (CollUtil.isEmpty(ids)) { | ||
| 263 | - return ListUtil.empty(); | ||
| 264 | - } | ||
| 265 | - return contactMapper.selectBatchIds(ids, userId); | ||
| 266 | - } | ||
| 267 | - | ||
| 268 | - @Override | ||
| 269 | public List<CrmContactDO> getContactList(Collection<Long> ids) { | 261 | public List<CrmContactDO> getContactList(Collection<Long> ids) { |
| 270 | if (CollUtil.isEmpty(ids)) { | 262 | if (CollUtil.isEmpty(ids)) { |
| 271 | return ListUtil.empty(); | 263 | return ListUtil.empty(); |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java
| @@ -69,6 +69,9 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { | @@ -69,6 +69,9 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { | ||
| 69 | crmFollowUpRecordMapper.insert(record); | 69 | crmFollowUpRecordMapper.insert(record); |
| 70 | 70 | ||
| 71 | // 2. 更新 bizId 对应的记录 | 71 | // 2. 更新 bizId 对应的记录 |
| 72 | + if (ObjUtil.equal(CrmBizTypeEnum.CRM_CUSTOMER.getType(), record.getBizType())) { // 更新客户跟进信息 | ||
| 73 | + customerService.updateCustomerFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); | ||
| 74 | + } | ||
| 72 | if (ObjUtil.equal(CrmBizTypeEnum.CRM_BUSINESS.getType(), record.getBizType())) { // 更新商机跟进信息 | 75 | if (ObjUtil.equal(CrmBizTypeEnum.CRM_BUSINESS.getType(), record.getBizType())) { // 更新商机跟进信息 |
| 73 | businessService.updateBusinessFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); | 76 | businessService.updateBusinessFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); |
| 74 | } | 77 | } |
| @@ -81,9 +84,6 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { | @@ -81,9 +84,6 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { | ||
| 81 | if (ObjUtil.equal(CrmBizTypeEnum.CRM_CONTRACT.getType(), record.getBizType())) { // 更新合同跟进信息 | 84 | if (ObjUtil.equal(CrmBizTypeEnum.CRM_CONTRACT.getType(), record.getBizType())) { // 更新合同跟进信息 |
| 82 | contractService.updateContractFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); | 85 | contractService.updateContractFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); |
| 83 | } | 86 | } |
| 84 | - if (ObjUtil.equal(CrmBizTypeEnum.CRM_CUSTOMER.getType(), record.getBizType())) { // 更新客户跟进信息 | ||
| 85 | - customerService.updateCustomerFollowUp(record.getBizId(), record.getNextTime(), record.getContent()); | ||
| 86 | - } | ||
| 87 | 87 | ||
| 88 | // 3.1 更新 contactIds 对应的记录,只更新 nextTime | 88 | // 3.1 更新 contactIds 对应的记录,只更新 nextTime |
| 89 | if (CollUtil.isNotEmpty(createReqVO.getContactIds())) { | 89 | if (CollUtil.isNotEmpty(createReqVO.getContactIds())) { |