Commit 7914423c66b8f1960d7c4bbf014e9db5399c2fb7
1 parent
fea84dec
CRM: 完善跟进 TODO
Showing
26 changed files
with
143 additions
and
415 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/business/CrmBusinessConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.convert.business; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessRespVO; |
| 6 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; |
| ... | ... | @@ -8,6 +9,7 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 8 | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessStatusDO; |
| 9 | 10 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessStatusTypeDO; |
| 10 | 11 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 12 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 11 | 13 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionTransferReqBO; |
| 12 | 14 | import org.mapstruct.Mapper; |
| 13 | 15 | import org.mapstruct.Mapping; |
| ... | ... | @@ -45,4 +47,11 @@ public interface CrmBusinessConvert { |
| 45 | 47 | return voPageResult; |
| 46 | 48 | } |
| 47 | 49 | |
| 50 | + @Mapping(target = "id", source = "reqBO.bizId") | |
| 51 | + CrmBusinessDO convert(CrmUpdateFollowUpReqBO reqBO); | |
| 52 | + | |
| 53 | + default List<CrmBusinessDO> convertList(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 54 | + return CollectionUtils.convertList(updateFollowUpReqBOList, INSTANCE::convert); | |
| 55 | + } | |
| 56 | + | |
| 48 | 57 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/contact/CrmContactConvert.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.CrmContactRespVO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.CrmContactTransferReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; |
| 10 | 10 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 11 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 11 | 12 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionTransferReqBO; |
| 12 | 13 | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| 13 | 14 | import org.mapstruct.Mapper; |
| ... | ... | @@ -66,4 +67,11 @@ public interface CrmContactConvert { |
| 66 | 67 | findAndThen(userMap, Long.parseLong(contactRespVO.getCreator()), user -> contactRespVO.setCreatorName(user.getNickname())); |
| 67 | 68 | } |
| 68 | 69 | |
| 70 | + @Mapping(target = "id", source = "reqBO.bizId") | |
| 71 | + CrmContactDO convert(CrmUpdateFollowUpReqBO reqBO); | |
| 72 | + | |
| 73 | + default List<CrmContactDO> convertList(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 74 | + return CollectionUtils.convertList(updateFollowUpReqBOList, INSTANCE::convert); | |
| 75 | + } | |
| 76 | + | |
| 69 | 77 | } | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessService.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusi |
| 7 | 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; |
| 9 | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 10 | -import cn.iocoder.yudao.module.crm.service.business.bo.CrmBusinessUpdateFollowUpReqBO; | |
| 10 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 11 | 11 | import jakarta.validation.Valid; |
| 12 | 12 | |
| 13 | 13 | import java.util.Collection; |
| ... | ... | @@ -41,7 +41,7 @@ public interface CrmBusinessService { |
| 41 | 41 | * |
| 42 | 42 | * @param updateFollowUpReqBOList 跟进信息 |
| 43 | 43 | */ |
| 44 | - void updateContactFollowUpBatch(List<CrmBusinessUpdateFollowUpReqBO> updateFollowUpReqBOList); | |
| 44 | + void updateBusinessFollowUpBatch(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList); | |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * 删除商机 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
| ... | ... | @@ -21,8 +21,8 @@ import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; |
| 21 | 21 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 22 | 22 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 23 | 23 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 24 | -import cn.iocoder.yudao.module.crm.service.business.bo.CrmBusinessUpdateFollowUpReqBO; | |
| 25 | 24 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactBusinessService; |
| 25 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 26 | 26 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 27 | 27 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 28 | 28 | import com.mzt.logapi.context.LogRecordContext; |
| ... | ... | @@ -172,8 +172,8 @@ public class CrmBusinessServiceImpl implements CrmBusinessService { |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | @Override |
| 175 | - public void updateContactFollowUpBatch(List<CrmBusinessUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 176 | - businessMapper.updateBatch(BeanUtils.toBean(updateFollowUpReqBOList, CrmBusinessDO.class)); | |
| 175 | + public void updateBusinessFollowUpBatch(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 176 | + businessMapper.updateBatch(CrmBusinessConvert.INSTANCE.convertList(updateFollowUpReqBOList)); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | @Override | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueService.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueSaveReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueTransferReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueTransformReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; |
| 9 | -import cn.iocoder.yudao.module.crm.service.clue.bo.CrmClueUpdateFollowUpReqBO; | |
| 9 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 10 | 10 | import jakarta.validation.Valid; |
| 11 | 11 | |
| 12 | 12 | import java.util.Collection; |
| ... | ... | @@ -39,7 +39,7 @@ public interface CrmClueService { |
| 39 | 39 | * |
| 40 | 40 | * @param clueUpdateFollowUpReqBO 信息 |
| 41 | 41 | */ |
| 42 | - void updateClueFollowUp(CrmClueUpdateFollowUpReqBO clueUpdateFollowUpReqBO); | |
| 42 | + void updateClueFollowUp(CrmUpdateFollowUpReqBO clueUpdateFollowUpReqBO); | |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * 删除线索 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImpl.java
| ... | ... | @@ -16,8 +16,8 @@ import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper; |
| 16 | 16 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 17 | 17 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 18 | 18 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 19 | -import cn.iocoder.yudao.module.crm.service.clue.bo.CrmClueUpdateFollowUpReqBO; | |
| 20 | 19 | import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; |
| 20 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 21 | 21 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 22 | 22 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 23 | 23 | import jakarta.annotation.Resource; |
| ... | ... | @@ -84,8 +84,8 @@ public class CrmClueServiceImpl implements CrmClueService { |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | @Override |
| 87 | - public void updateClueFollowUp(CrmClueUpdateFollowUpReqBO clueUpdateFollowUpReqBO) { | |
| 88 | - clueMapper.updateById(BeanUtils.toBean(clueUpdateFollowUpReqBO, CrmClueDO.class)); | |
| 87 | + public void updateClueFollowUp(CrmUpdateFollowUpReqBO clueUpdateFollowUpReqBO) { | |
| 88 | + clueMapper.updateById(BeanUtils.toBean(clueUpdateFollowUpReqBO, CrmClueDO.class).setId(clueUpdateFollowUpReqBO.getBizId())); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | @Override | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/bo/CrmClueUpdateFollowUpReqBO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.clue.bo; | |
| 2 | - | |
| 3 | -import com.mzt.logapi.starter.annotation.DiffLogField; | |
| 4 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | -import jakarta.validation.constraints.NotNull; | |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | -import java.time.LocalDateTime; | |
| 9 | - | |
| 10 | -// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 | |
| 11 | -/** | |
| 12 | - * 线索跟进信息 Update Req BO | |
| 13 | - * | |
| 14 | - * @author HUIHUI | |
| 15 | - */ | |
| 16 | -@Data | |
| 17 | -public class CrmClueUpdateFollowUpReqBO { | |
| 18 | - | |
| 19 | - @Schema(description = "线索编号", example = "3167") | |
| 20 | - @NotNull(message = "线索编号不能为空") | |
| 21 | - private Long id; | |
| 22 | - | |
| 23 | - @Schema(description = "最后跟进时间") | |
| 24 | - @DiffLogField(name = "最后跟进时间") | |
| 25 | - @NotNull(message = "最后跟进时间不能为空") | |
| 26 | - private LocalDateTime contactLastTime; | |
| 27 | - | |
| 28 | - @Schema(description = "下次联系时间") | |
| 29 | - @DiffLogField(name = "下次联系时间") | |
| 30 | - @NotNull(message = "下次联系时间不能为空") | |
| 31 | - private LocalDateTime contactNextTime; | |
| 32 | - | |
| 33 | - @Schema(description = "最后更进内容") | |
| 34 | - @DiffLogField(name = "最后更进内容") | |
| 35 | - @NotNull(message = "最后更进内容不能为空") | |
| 36 | - private String contactLastContent; | |
| 37 | - | |
| 38 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactService.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.CrmContactSaveReq |
| 6 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.CrmContactTransferReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 9 | -import cn.iocoder.yudao.module.crm.service.contact.bo.CrmContactUpdateFollowUpReqBO; | |
| 9 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 10 | 10 | import jakarta.validation.Valid; |
| 11 | 11 | |
| 12 | 12 | import java.util.Collection; |
| ... | ... | @@ -63,7 +63,7 @@ public interface CrmContactService { |
| 63 | 63 | * |
| 64 | 64 | * @param updateFollowUpReqBOList 跟进信息 |
| 65 | 65 | */ |
| 66 | - void updateContactFollowUpBatch(List<CrmContactUpdateFollowUpReqBO> updateFollowUpReqBOList); | |
| 66 | + void updateContactFollowUpBatch(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList); | |
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * 获得联系人 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactServiceImpl.java
| ... | ... | @@ -15,9 +15,9 @@ import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 15 | 15 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 16 | 16 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 17 | 17 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; |
| 18 | -import cn.iocoder.yudao.module.crm.service.contact.bo.CrmContactUpdateFollowUpReqBO; | |
| 19 | 18 | import cn.iocoder.yudao.module.crm.service.contract.CrmContractService; |
| 20 | 19 | import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; |
| 20 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 21 | 21 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 22 | 22 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 23 | 23 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| ... | ... | @@ -195,8 +195,8 @@ public class CrmContactServiceImpl implements CrmContactService { |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | @Override |
| 198 | - public void updateContactFollowUpBatch(List<CrmContactUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 199 | - contactMapper.updateBatch(BeanUtils.toBean(updateFollowUpReqBOList, CrmContactDO.class)); | |
| 198 | + public void updateContactFollowUpBatch(List<CrmUpdateFollowUpReqBO> updateFollowUpReqBOList) { | |
| 199 | + contactMapper.updateBatch(CrmContactConvert.INSTANCE.convertList(updateFollowUpReqBOList)); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | //======================= 查询相关 ======================= | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/bo/CrmContactUpdateFollowUpReqBO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.contact.bo; | |
| 2 | - | |
| 3 | -import com.mzt.logapi.starter.annotation.DiffLogField; | |
| 4 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | -import jakarta.validation.constraints.NotNull; | |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | -import java.time.LocalDateTime; | |
| 9 | - | |
| 10 | -// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 | |
| 11 | -/** | |
| 12 | - * 联系人跟进信息 Update Req BO | |
| 13 | - * | |
| 14 | - * @author HUIHUI | |
| 15 | - */ | |
| 16 | -@Data | |
| 17 | -public class CrmContactUpdateFollowUpReqBO { | |
| 18 | - | |
| 19 | - @Schema(description = "联系人编号", example = "3167") | |
| 20 | - @NotNull(message = "联系人编号不能为空") | |
| 21 | - private Long id; | |
| 22 | - | |
| 23 | - @Schema(description = "最后跟进时间") | |
| 24 | - @DiffLogField(name = "最后跟进时间") | |
| 25 | - @NotNull(message = "最后跟进时间不能为空") | |
| 26 | - private LocalDateTime contactLastTime; | |
| 27 | - | |
| 28 | - @Schema(description = "下次联系时间") | |
| 29 | - @DiffLogField(name = "下次联系时间") | |
| 30 | - @NotNull(message = "下次联系时间不能为空") | |
| 31 | - private LocalDateTime contactNextTime; | |
| 32 | - | |
| 33 | - @Schema(description = "最后更进内容") | |
| 34 | - @DiffLogField(name = "最后更进内容") | |
| 35 | - @NotNull(message = "最后更进内容不能为空") | |
| 36 | - private String contactLastContent; | |
| 37 | - | |
| 38 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractService.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractSaveR |
| 6 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 9 | -import cn.iocoder.yudao.module.crm.service.contract.bo.CrmContractUpdateFollowUpReqBO; | |
| 9 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 10 | 10 | import jakarta.validation.Valid; |
| 11 | 11 | |
| 12 | 12 | import java.util.Collection; |
| ... | ... | @@ -55,7 +55,7 @@ public interface CrmContractService { |
| 55 | 55 | * |
| 56 | 56 | * @param contractUpdateFollowUpReqBO 信息 |
| 57 | 57 | */ |
| 58 | - void updateContractFollowUp(CrmContractUpdateFollowUpReqBO contractUpdateFollowUpReqBO); | |
| 58 | + void updateContractFollowUp(CrmUpdateFollowUpReqBO contractUpdateFollowUpReqBO); | |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * 获得合同 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
| ... | ... | @@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; |
| 13 | 13 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 14 | 14 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 15 | 15 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 16 | -import cn.iocoder.yudao.module.crm.service.contract.bo.CrmContractUpdateFollowUpReqBO; | |
| 16 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 17 | 17 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 18 | 18 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 19 | 19 | import com.mzt.logapi.context.LogRecordContext; |
| ... | ... | @@ -137,8 +137,8 @@ public class CrmContractServiceImpl implements CrmContractService { |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | @Override |
| 140 | - public void updateContractFollowUp(CrmContractUpdateFollowUpReqBO contractUpdateFollowUpReqBO) { | |
| 141 | - contractMapper.updateById(BeanUtils.toBean(contractUpdateFollowUpReqBO, CrmContractDO.class)); | |
| 140 | + public void updateContractFollowUp(CrmUpdateFollowUpReqBO contractUpdateFollowUpReqBO) { | |
| 141 | + contractMapper.updateById(BeanUtils.toBean(contractUpdateFollowUpReqBO, CrmContractDO.class).setId(contractUpdateFollowUpReqBO.getBizId())); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | //======================= 查询相关 ======================= | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/bo/CrmContractUpdateFollowUpReqBO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.contract.bo; | |
| 2 | - | |
| 3 | -import com.mzt.logapi.starter.annotation.DiffLogField; | |
| 4 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | -import jakarta.validation.constraints.NotNull; | |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | -import java.time.LocalDateTime; | |
| 9 | - | |
| 10 | -// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 | |
| 11 | -/** | |
| 12 | - * 合同跟进信息 Update Req BO | |
| 13 | - * | |
| 14 | - * @author HUIHUI | |
| 15 | - */ | |
| 16 | -@Data | |
| 17 | -public class CrmContractUpdateFollowUpReqBO { | |
| 18 | - | |
| 19 | - @Schema(description = "合同编号", example = "3167") | |
| 20 | - @NotNull(message = "合同编号不能为空") | |
| 21 | - private Long id; | |
| 22 | - | |
| 23 | - @Schema(description = "最后跟进时间") | |
| 24 | - @DiffLogField(name = "最后跟进时间") | |
| 25 | - @NotNull(message = "最后跟进时间不能为空") | |
| 26 | - private LocalDateTime contactLastTime; | |
| 27 | - | |
| 28 | - @Schema(description = "下次联系时间") | |
| 29 | - @DiffLogField(name = "下次联系时间") | |
| 30 | - @NotNull(message = "下次联系时间不能为空") | |
| 31 | - private LocalDateTime contactNextTime; | |
| 32 | - | |
| 33 | - @Schema(description = "最后更进内容") | |
| 34 | - @DiffLogField(name = "最后更进内容") | |
| 35 | - @NotNull(message = "最后更进内容不能为空") | |
| 36 | - private String contactLastContent; | |
| 37 | - | |
| 38 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java
| ... | ... | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPageR |
| 6 | 6 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerSaveReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerTransferReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; |
| 9 | -import cn.iocoder.yudao.module.crm.service.customer.bo.CrmCustomerUpdateFollowUpReqBO; | |
| 9 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 10 | 10 | import jakarta.validation.Valid; |
| 11 | 11 | |
| 12 | 12 | import java.util.Collection; |
| ... | ... | @@ -96,7 +96,7 @@ public interface CrmCustomerService { |
| 96 | 96 | * |
| 97 | 97 | * @param customerUpdateFollowUpReqBO 请求 |
| 98 | 98 | */ |
| 99 | - void updateCustomerFollowUp(CrmCustomerUpdateFollowUpReqBO customerUpdateFollowUpReqBO); | |
| 99 | + void updateCustomerFollowUp(CrmUpdateFollowUpReqBO customerUpdateFollowUpReqBO); | |
| 100 | 100 | |
| 101 | 101 | // ==================== 公海相关操作 ==================== |
| 102 | 102 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
| ... | ... | @@ -21,7 +21,7 @@ import cn.iocoder.yudao.module.crm.framework.permission.core.util.CrmPermissionU |
| 21 | 21 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; |
| 22 | 22 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; |
| 23 | 23 | import cn.iocoder.yudao.module.crm.service.contract.CrmContractService; |
| 24 | -import cn.iocoder.yudao.module.crm.service.customer.bo.CrmCustomerUpdateFollowUpReqBO; | |
| 24 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 25 | 25 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 26 | 26 | import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO; |
| 27 | 27 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| ... | ... | @@ -205,8 +205,8 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | @Override |
| 208 | - public void updateCustomerFollowUp(CrmCustomerUpdateFollowUpReqBO customerUpdateFollowUpReqBO) { | |
| 209 | - customerMapper.updateById(BeanUtils.toBean(customerUpdateFollowUpReqBO, CrmCustomerDO.class)); | |
| 208 | + public void updateCustomerFollowUp(CrmUpdateFollowUpReqBO customerUpdateFollowUpReqBO) { | |
| 209 | + customerMapper.updateById(BeanUtils.toBean(customerUpdateFollowUpReqBO, CrmCustomerDO.class).setId(customerUpdateFollowUpReqBO.getBizId())); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | // ==================== 公海相关操作 ==================== | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/bo/CrmCustomerUpdateFollowUpReqBO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.customer.bo; | |
| 2 | - | |
| 3 | -import com.mzt.logapi.starter.annotation.DiffLogField; | |
| 4 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | -import lombok.Data; | |
| 6 | - | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | - | |
| 9 | -// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 | |
| 10 | -/** | |
| 11 | - * 跟进信息 Update Req BO | |
| 12 | - * | |
| 13 | - * @author HUIHUI | |
| 14 | - */ | |
| 15 | -@Data | |
| 16 | -public class CrmCustomerUpdateFollowUpReqBO { | |
| 17 | - | |
| 18 | - @Schema(description = "主键", example = "3167") | |
| 19 | - private Long id; | |
| 20 | - | |
| 21 | - @Schema(description = "最后跟进时间") | |
| 22 | - @DiffLogField(name = "最后跟进时间") | |
| 23 | - private LocalDateTime contactLastTime; | |
| 24 | - | |
| 25 | - @Schema(description = "下次联系时间") | |
| 26 | - @DiffLogField(name = "下次联系时间") | |
| 27 | - private LocalDateTime contactNextTime; | |
| 28 | - | |
| 29 | - @Schema(description = "最后更进内容") | |
| 30 | - @DiffLogField(name = "最后更进内容") | |
| 31 | - private String contactLastContent; | |
| 32 | - | |
| 33 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/CrmFollowUpRecordServiceImpl.java
| ... | ... | @@ -9,19 +9,22 @@ import cn.iocoder.yudao.module.crm.controller.admin.followup.vo.CrmFollowUpRecor |
| 9 | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; |
| 10 | 10 | import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; |
| 11 | 11 | import cn.iocoder.yudao.module.crm.dal.mysql.followup.CrmFollowUpRecordMapper; |
| 12 | +import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 12 | 13 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 13 | 14 | import cn.iocoder.yudao.module.crm.framework.permission.core.annotations.CrmPermission; |
| 14 | 15 | import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; |
| 15 | -import cn.iocoder.yudao.module.crm.service.business.bo.CrmBusinessUpdateFollowUpReqBO; | |
| 16 | +import cn.iocoder.yudao.module.crm.service.clue.CrmClueService; | |
| 16 | 17 | import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; |
| 17 | -import cn.iocoder.yudao.module.crm.service.contact.bo.CrmContactUpdateFollowUpReqBO; | |
| 18 | -import cn.iocoder.yudao.module.crm.service.followup.handle.CrmFollowUpHandler; | |
| 18 | +import cn.iocoder.yudao.module.crm.service.contract.CrmContractService; | |
| 19 | +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; | |
| 20 | +import cn.iocoder.yudao.module.crm.service.followup.bo.CrmUpdateFollowUpReqBO; | |
| 19 | 21 | import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; |
| 20 | 22 | import jakarta.annotation.Resource; |
| 21 | 23 | import org.springframework.stereotype.Service; |
| 22 | 24 | import org.springframework.validation.annotation.Validated; |
| 23 | 25 | |
| 24 | 26 | import java.time.LocalDateTime; |
| 27 | +import java.util.Collections; | |
| 25 | 28 | import java.util.List; |
| 26 | 29 | |
| 27 | 30 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| ... | ... | @@ -45,11 +48,15 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { |
| 45 | 48 | @Resource |
| 46 | 49 | private CrmPermissionService permissionService; |
| 47 | 50 | @Resource |
| 48 | - private List<CrmFollowUpHandler> followUpHandlers; | |
| 49 | - @Resource | |
| 50 | 51 | private CrmBusinessService businessService; |
| 51 | 52 | @Resource |
| 53 | + private CrmClueService clueService; | |
| 54 | + @Resource | |
| 52 | 55 | private CrmContactService contactService; |
| 56 | + @Resource | |
| 57 | + private CrmContractService contractService; | |
| 58 | + @Resource | |
| 59 | + private CrmCustomerService customerService; | |
| 53 | 60 | |
| 54 | 61 | @Override |
| 55 | 62 | @CrmPermission(bizTypeValue = "#createReqVO.bizType", bizId = "#createReqVO.bizId", level = CrmPermissionLevelEnum.WRITE) |
| ... | ... | @@ -60,29 +67,88 @@ public class CrmFollowUpRecordServiceImpl implements CrmFollowUpRecordService { |
| 60 | 67 | |
| 61 | 68 | LocalDateTime now = LocalDateTime.now(); |
| 62 | 69 | // 2. 更新 bizId 对应的记录; |
| 63 | - followUpHandlers.forEach(handler -> handler.execute(followUpRecord, now)); | |
| 70 | + updateBizTypeFollowUp(followUpRecord, now); | |
| 64 | 71 | // 3.1 更新 contactIds 对应的记录 |
| 65 | 72 | if (CollUtil.isNotEmpty(createReqVO.getContactIds())) { |
| 66 | - // TODO @puhui999:可以用链式设置哈 | |
| 67 | - contactService.updateContactFollowUpBatch(convertList(createReqVO.getContactIds(), contactId -> { | |
| 68 | - CrmContactUpdateFollowUpReqBO crmContactUpdateFollowUpReqBO = new CrmContactUpdateFollowUpReqBO(); | |
| 69 | - crmContactUpdateFollowUpReqBO.setId(contactId).setContactNextTime(followUpRecord.getNextTime()) | |
| 70 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 71 | - return crmContactUpdateFollowUpReqBO; | |
| 72 | - })); | |
| 73 | + contactService.updateContactFollowUpBatch(convertList(createReqVO.getContactIds(), contactId -> | |
| 74 | + new CrmUpdateFollowUpReqBO().setBizId(contactId).setContactNextTime(followUpRecord.getNextTime()) | |
| 75 | + .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()))); | |
| 73 | 76 | } |
| 74 | 77 | // 3.2 需要更新 businessIds、contactIds 对应的记录 |
| 75 | 78 | if (CollUtil.isNotEmpty(createReqVO.getBusinessIds())) { |
| 76 | - businessService.updateContactFollowUpBatch(convertList(createReqVO.getBusinessIds(), businessId -> { | |
| 77 | - CrmBusinessUpdateFollowUpReqBO crmBusinessUpdateFollowUpReqBO = new CrmBusinessUpdateFollowUpReqBO(); | |
| 78 | - crmBusinessUpdateFollowUpReqBO.setId(businessId).setContactNextTime(followUpRecord.getNextTime()) | |
| 79 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 80 | - return crmBusinessUpdateFollowUpReqBO; | |
| 81 | - })); | |
| 79 | + businessService.updateBusinessFollowUpBatch(convertList(createReqVO.getBusinessIds(), businessId -> | |
| 80 | + new CrmUpdateFollowUpReqBO().setBizId(businessId).setContactNextTime(followUpRecord.getNextTime()) | |
| 81 | + .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()))); | |
| 82 | 82 | } |
| 83 | 83 | return followUpRecord.getId(); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | + /** | |
| 87 | + * 执行更新 | |
| 88 | + * | |
| 89 | + * @param followUpRecord 跟进记录 | |
| 90 | + * @param now 跟进时间 | |
| 91 | + */ | |
| 92 | + private void updateBizTypeFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 93 | + updateBusinessFollowUp(followUpRecord, now); | |
| 94 | + updateClueFollowUp(followUpRecord, now); | |
| 95 | + updateContactFollowUp(followUpRecord, now); | |
| 96 | + updateContractFollowUp(followUpRecord, now); | |
| 97 | + updateCustomerFollowUp(followUpRecord, now); | |
| 98 | + } | |
| 99 | + | |
| 100 | + private void updateBusinessFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 101 | + if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_BUSINESS.getType(), followUpRecord.getBizType())) { | |
| 102 | + return; | |
| 103 | + } | |
| 104 | + | |
| 105 | + // 更新商机跟进信息 | |
| 106 | + businessService.updateBusinessFollowUpBatch(Collections.singletonList(new CrmUpdateFollowUpReqBO() | |
| 107 | + .setBizId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()).setContactLastTime(now) | |
| 108 | + .setContactLastContent(followUpRecord.getContent()))); | |
| 109 | + } | |
| 110 | + | |
| 111 | + private void updateClueFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 112 | + if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_LEADS.getType(), followUpRecord.getBizType())) { | |
| 113 | + return; | |
| 114 | + } | |
| 115 | + | |
| 116 | + // 更新线索跟进信息 | |
| 117 | + clueService.updateClueFollowUp(new CrmUpdateFollowUpReqBO().setBizId(followUpRecord.getBizId()).setContactLastTime(now) | |
| 118 | + .setContactNextTime(followUpRecord.getNextTime()).setContactLastContent(followUpRecord.getContent())); | |
| 119 | + } | |
| 120 | + | |
| 121 | + private void updateContactFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 122 | + if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CONTACT.getType(), followUpRecord.getBizType())) { | |
| 123 | + return; | |
| 124 | + } | |
| 125 | + | |
| 126 | + // 更新联系人跟进信息 | |
| 127 | + contactService.updateContactFollowUpBatch(Collections.singletonList(new CrmUpdateFollowUpReqBO() | |
| 128 | + .setBizId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()).setContactLastTime(now) | |
| 129 | + .setContactLastContent(followUpRecord.getContent()))); | |
| 130 | + } | |
| 131 | + | |
| 132 | + private void updateContractFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 133 | + if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CONTRACT.getType(), followUpRecord.getBizType())) { | |
| 134 | + return; | |
| 135 | + } | |
| 136 | + | |
| 137 | + // 更新合同跟进信息 | |
| 138 | + contractService.updateContractFollowUp(new CrmUpdateFollowUpReqBO().setBizId(followUpRecord.getBizId()).setContactLastTime(now) | |
| 139 | + .setContactNextTime(followUpRecord.getNextTime()).setContactLastContent(followUpRecord.getContent())); | |
| 140 | + } | |
| 141 | + | |
| 142 | + private void updateCustomerFollowUp(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 143 | + if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CUSTOMER.getType(), followUpRecord.getBizType())) { | |
| 144 | + return; | |
| 145 | + } | |
| 146 | + | |
| 147 | + // 更新客户跟进信息 | |
| 148 | + customerService.updateCustomerFollowUp(new CrmUpdateFollowUpReqBO().setBizId(followUpRecord.getBizId()).setContactLastTime(now) | |
| 149 | + .setContactNextTime(followUpRecord.getNextTime()).setContactLastContent(followUpRecord.getContent())); | |
| 150 | + } | |
| 151 | + | |
| 86 | 152 | @Override |
| 87 | 153 | public void deleteFollowUpRecord(Long id, Long userId) { |
| 88 | 154 | // 校验存在 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/bo/CrmBusinessUpdateFollowUpReqBO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/bo/CrmUpdateFollowUpReqBO.java
| 1 | -package cn.iocoder.yudao.module.crm.service.business.bo; | |
| 1 | +package cn.iocoder.yudao.module.crm.service.followup.bo; | |
| 2 | 2 | |
| 3 | 3 | import com.mzt.logapi.starter.annotation.DiffLogField; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| ... | ... | @@ -7,18 +7,18 @@ import lombok.Data; |
| 7 | 7 | |
| 8 | 8 | import java.time.LocalDateTime; |
| 9 | 9 | |
| 10 | -// TODO @puhui999:是不是搞个通用的 ReqBO 就好了 | |
| 10 | + | |
| 11 | 11 | /** |
| 12 | - * 商机跟进信息 Update Req BO | |
| 12 | + * 跟进信息 Update Req BO | |
| 13 | 13 | * |
| 14 | 14 | * @author HUIHUI |
| 15 | 15 | */ |
| 16 | 16 | @Data |
| 17 | -public class CrmBusinessUpdateFollowUpReqBO { | |
| 17 | +public class CrmUpdateFollowUpReqBO { | |
| 18 | 18 | |
| 19 | - @Schema(description = "商机编号", example = "3167") | |
| 20 | - @NotNull(message = "商机编号不能为空") | |
| 21 | - private Long id; | |
| 19 | + @Schema(description = "数据编号", example = "3167") | |
| 20 | + @NotNull(message = "数据编号不能为空") | |
| 21 | + private Long bizId; | |
| 22 | 22 | |
| 23 | 23 | @Schema(description = "最后跟进时间") |
| 24 | 24 | @DiffLogField(name = "最后跟进时间") |
| ... | ... | @@ -27,7 +27,6 @@ public class CrmBusinessUpdateFollowUpReqBO { |
| 27 | 27 | |
| 28 | 28 | @Schema(description = "下次联系时间") |
| 29 | 29 | @DiffLogField(name = "下次联系时间") |
| 30 | - @NotNull(message = "下次联系时间不能为空") | |
| 31 | 30 | private LocalDateTime contactNextTime; |
| 32 | 31 | |
| 33 | 32 | @Schema(description = "最后更进内容") | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmBusinessFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.hutool.core.util.ObjUtil; | |
| 4 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 5 | -import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 6 | -import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService; | |
| 7 | -import cn.iocoder.yudao.module.crm.service.business.bo.CrmBusinessUpdateFollowUpReqBO; | |
| 8 | -import jakarta.annotation.Resource; | |
| 9 | -import org.springframework.stereotype.Component; | |
| 10 | - | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | -import java.util.Collections; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * CRM 商机的 {@link CrmFollowUpHandler} 实现类 | |
| 16 | - * | |
| 17 | - * @author HUIHUI | |
| 18 | - */ | |
| 19 | -@Component | |
| 20 | -public class CrmBusinessFollowUpHandler implements CrmFollowUpHandler { | |
| 21 | - | |
| 22 | - @Resource | |
| 23 | - private CrmBusinessService businessService; | |
| 24 | - | |
| 25 | - @Override | |
| 26 | - public void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 27 | - if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_BUSINESS.getType(), followUpRecord.getBizType())) { | |
| 28 | - return; | |
| 29 | - } | |
| 30 | - | |
| 31 | - // 更新商机跟进信息 | |
| 32 | - CrmBusinessUpdateFollowUpReqBO businessUpdateFollowUpReqBO = new CrmBusinessUpdateFollowUpReqBO(); | |
| 33 | - businessUpdateFollowUpReqBO.setId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()) | |
| 34 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 35 | - businessService.updateContactFollowUpBatch(Collections.singletonList(businessUpdateFollowUpReqBO)); | |
| 36 | - } | |
| 37 | - | |
| 38 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmClueFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.hutool.core.util.ObjUtil; | |
| 4 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 5 | -import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 6 | -import cn.iocoder.yudao.module.crm.service.clue.CrmClueService; | |
| 7 | -import cn.iocoder.yudao.module.crm.service.clue.bo.CrmClueUpdateFollowUpReqBO; | |
| 8 | -import jakarta.annotation.Resource; | |
| 9 | -import org.springframework.stereotype.Component; | |
| 10 | - | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * CRM 线索的 {@link CrmFollowUpHandler} 实现类 | |
| 15 | - * | |
| 16 | - * @author HUIHUI | |
| 17 | - */ | |
| 18 | -@Component | |
| 19 | -public class CrmClueFollowUpHandler implements CrmFollowUpHandler { | |
| 20 | - | |
| 21 | - @Resource | |
| 22 | - private CrmClueService clueService; | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - public void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 26 | - if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_LEADS.getType(), followUpRecord.getBizType())) { | |
| 27 | - return; | |
| 28 | - } | |
| 29 | - | |
| 30 | - // 更新线索跟进信息 | |
| 31 | - CrmClueUpdateFollowUpReqBO clueUpdateFollowUpReqBO = new CrmClueUpdateFollowUpReqBO(); | |
| 32 | - clueUpdateFollowUpReqBO.setId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()) | |
| 33 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 34 | - clueService.updateClueFollowUp(clueUpdateFollowUpReqBO); | |
| 35 | - } | |
| 36 | - | |
| 37 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmContactFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.hutool.core.util.ObjUtil; | |
| 4 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 5 | -import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 6 | -import cn.iocoder.yudao.module.crm.service.contact.CrmContactService; | |
| 7 | -import cn.iocoder.yudao.module.crm.service.contact.bo.CrmContactUpdateFollowUpReqBO; | |
| 8 | -import jakarta.annotation.Resource; | |
| 9 | -import org.springframework.stereotype.Component; | |
| 10 | - | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | -import java.util.Collections; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * CRM 联系人的 {@link CrmFollowUpHandler} 实现类 | |
| 16 | - * | |
| 17 | - * @author HUIHUI | |
| 18 | - */ | |
| 19 | -@Component | |
| 20 | -public class CrmContactFollowUpHandler implements CrmFollowUpHandler { | |
| 21 | - | |
| 22 | - @Resource | |
| 23 | - private CrmContactService contactService; | |
| 24 | - | |
| 25 | - @Override | |
| 26 | - public void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 27 | - if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CONTACT.getType(), followUpRecord.getBizType())) { | |
| 28 | - return; | |
| 29 | - } | |
| 30 | - | |
| 31 | - // 更新联系人跟进信息 | |
| 32 | - CrmContactUpdateFollowUpReqBO contactUpdateFollowUpReqBO = new CrmContactUpdateFollowUpReqBO(); | |
| 33 | - contactUpdateFollowUpReqBO.setId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()) | |
| 34 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 35 | - contactService.updateContactFollowUpBatch(Collections.singletonList(contactUpdateFollowUpReqBO)); | |
| 36 | - } | |
| 37 | - | |
| 38 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmContractFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.hutool.core.util.ObjUtil; | |
| 4 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 5 | -import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 6 | -import cn.iocoder.yudao.module.crm.service.contract.CrmContractService; | |
| 7 | -import cn.iocoder.yudao.module.crm.service.contract.bo.CrmContractUpdateFollowUpReqBO; | |
| 8 | -import jakarta.annotation.Resource; | |
| 9 | -import org.springframework.stereotype.Component; | |
| 10 | - | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * CRM 合同的 {@link CrmFollowUpHandler} 实现类 | |
| 15 | - * | |
| 16 | - * @author HUIHUI | |
| 17 | - */ | |
| 18 | -@Component | |
| 19 | -public class CrmContractFollowUpHandler implements CrmFollowUpHandler { | |
| 20 | - | |
| 21 | - @Resource | |
| 22 | - private CrmContractService contractService; | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - public void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 26 | - if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CONTRACT.getType(), followUpRecord.getBizType())) { | |
| 27 | - return; | |
| 28 | - } | |
| 29 | - | |
| 30 | - // 更新合同跟进信息 | |
| 31 | - CrmContractUpdateFollowUpReqBO contractUpdateFollowUpReqBO = new CrmContractUpdateFollowUpReqBO(); | |
| 32 | - contractUpdateFollowUpReqBO.setId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()) | |
| 33 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 34 | - contractService.updateContractFollowUp(contractUpdateFollowUpReqBO); | |
| 35 | - } | |
| 36 | - | |
| 37 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmCustomerFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.hutool.core.util.ObjUtil; | |
| 4 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 5 | -import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | |
| 6 | -import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; | |
| 7 | -import cn.iocoder.yudao.module.crm.service.customer.bo.CrmCustomerUpdateFollowUpReqBO; | |
| 8 | -import jakarta.annotation.Resource; | |
| 9 | -import org.springframework.stereotype.Component; | |
| 10 | - | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * CRM 客户的 {@link CrmFollowUpHandler} 实现类 | |
| 15 | - * | |
| 16 | - * @author HUIHUI | |
| 17 | - */ | |
| 18 | -@Component | |
| 19 | -public class CrmCustomerFollowUpHandler implements CrmFollowUpHandler { | |
| 20 | - | |
| 21 | - @Resource | |
| 22 | - private CrmCustomerService customerService; | |
| 23 | - | |
| 24 | - @Override | |
| 25 | - public void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now) { | |
| 26 | - if (ObjUtil.notEqual(CrmBizTypeEnum.CRM_CUSTOMER.getType(), followUpRecord.getBizType())) { | |
| 27 | - return; | |
| 28 | - } | |
| 29 | - | |
| 30 | - // 更新客户跟进信息 | |
| 31 | - CrmCustomerUpdateFollowUpReqBO customerUpdateFollowUpReqBO = new CrmCustomerUpdateFollowUpReqBO(); | |
| 32 | - customerUpdateFollowUpReqBO.setId(followUpRecord.getBizId()).setContactNextTime(followUpRecord.getNextTime()) | |
| 33 | - .setContactLastTime(now).setContactLastContent(followUpRecord.getContent()); | |
| 34 | - customerService.updateCustomerFollowUp(customerUpdateFollowUpReqBO); | |
| 35 | - } | |
| 36 | - | |
| 37 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/followup/handle/CrmFollowUpHandler.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.service.followup.handle; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.crm.dal.dataobject.followup.CrmFollowUpRecordDO; | |
| 4 | - | |
| 5 | -import java.time.LocalDateTime; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * CRM 跟进信息处理器 handler 接口 | |
| 9 | - * | |
| 10 | - * @author HUIHUI | |
| 11 | - */ | |
| 12 | -public interface CrmFollowUpHandler { | |
| 13 | - | |
| 14 | - // TODO @puhui999:需要考虑,下次联系时间为空; | |
| 15 | - /** | |
| 16 | - * 执行更新 | |
| 17 | - * | |
| 18 | - * @param followUpRecord 跟进记录 | |
| 19 | - * @param now 跟进时间 | |
| 20 | - */ | |
| 21 | - void execute(CrmFollowUpRecordDO followUpRecord, LocalDateTime now); | |
| 22 | - | |
| 23 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/comment/ProductCommentConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.product.convert.comment; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 4 | 5 | import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 5 | 6 | import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO; |
| 6 | 7 | import cn.iocoder.yudao.module.product.controller.admin.comment.vo.ProductCommentCreateReqVO; |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.comment.vo.ProductCommentRespVO; | |
| 7 | 9 | import cn.iocoder.yudao.module.product.dal.dataobject.comment.ProductCommentDO; |
| 8 | 10 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| 9 | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; |
| ... | ... | @@ -59,4 +61,6 @@ public interface ProductCommentConvert { |
| 59 | 61 | return divide.intValue(); |
| 60 | 62 | } |
| 61 | 63 | |
| 64 | + PageResult<ProductCommentRespVO> convertPage(PageResult<ProductCommentDO> productCommentDOPageResult); | |
| 65 | + | |
| 62 | 66 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java
| ... | ... | @@ -9,20 +9,19 @@ import cn.iocoder.yudao.module.product.controller.admin.comment.vo.ProductCommen |
| 9 | 9 | import cn.iocoder.yudao.module.product.controller.admin.comment.vo.ProductCommentRespVO; |
| 10 | 10 | import cn.iocoder.yudao.module.product.controller.admin.comment.vo.ProductCommentUpdateVisibleReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.product.controller.app.comment.vo.AppCommentPageReqVO; |
| 12 | -import cn.iocoder.yudao.module.product.controller.app.comment.vo.AppCommentStatisticsRespVO; | |
| 13 | 12 | import cn.iocoder.yudao.module.product.convert.comment.ProductCommentConvert; |
| 14 | 13 | import cn.iocoder.yudao.module.product.dal.dataobject.comment.ProductCommentDO; |
| 15 | 14 | import cn.iocoder.yudao.module.product.dal.mysql.comment.ProductCommentMapper; |
| 16 | 15 | import cn.iocoder.yudao.module.product.enums.comment.ProductCommentScoresEnum; |
| 17 | 16 | import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; |
| 18 | 17 | import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; |
| 18 | +import jakarta.annotation.Resource; | |
| 19 | 19 | import org.junit.jupiter.api.Disabled; |
| 20 | 20 | import org.junit.jupiter.api.Test; |
| 21 | 21 | import org.springframework.boot.test.mock.mockito.MockBean; |
| 22 | 22 | import org.springframework.context.annotation.Import; |
| 23 | 23 | import org.springframework.context.annotation.Lazy; |
| 24 | 24 | |
| 25 | -import jakarta.annotation.Resource; | |
| 26 | 25 | import java.time.LocalDateTime; |
| 27 | 26 | import java.util.Date; |
| 28 | 27 | |
| ... | ... | @@ -148,10 +147,10 @@ public class ProductCommentServiceImplTest extends BaseDbUnitTest { |
| 148 | 147 | assertEquals(2, result3.getTotal()); |
| 149 | 148 | |
| 150 | 149 | // 测试分页 tab count |
| 151 | - AppCommentStatisticsRespVO tabsCount = productCommentService.getCommentStatistics(spuId, Boolean.TRUE); | |
| 152 | - assertEquals(4, tabsCount.getGoodCount()); | |
| 153 | - assertEquals(2, tabsCount.getMediocreCount()); | |
| 154 | - assertEquals(0, tabsCount.getNegativeCount()); | |
| 150 | + //AppCommentStatisticsRespVO tabsCount = productCommentService.getCommentStatistics(spuId, Boolean.TRUE); | |
| 151 | + //assertEquals(4, tabsCount.getGoodCount()); | |
| 152 | + //assertEquals(2, tabsCount.getMediocreCount()); | |
| 153 | + //assertEquals(0, tabsCount.getNegativeCount()); | |
| 155 | 154 | |
| 156 | 155 | } |
| 157 | 156 | ... | ... |