diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/CrmMessageController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/CrmMessageController.java index 7e003e66f..32a0eb6ca 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/CrmMessageController.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/CrmMessageController.java @@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RestController; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; - @Tag(name = "管理后台 - CRM消息") @RestController @RequestMapping("/crm/message") @@ -30,7 +29,8 @@ public class CrmMessageController { @Resource private CrmMessageService crmMessageService; - @GetMapping("/todayCustomer") + // TODO 芋艿:未来可能合并到 CrmCustomerController + @GetMapping("/todayCustomer") // TODO @dbh52:【优先级低】url 使用中划线,项目规范。然后叫 today-customer-page,通过 page 体现出它是个分页接口 @Operation(summary = "今日需联系客户") @PreAuthorize("@ss.hasPermission('crm:message:todayCustomer')") public CommonResult> getTodayCustomerPage(@Valid CrmTodayCustomerPageReqVO pageReqVO) { diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/vo/CrmTodayCustomerPageReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/vo/CrmTodayCustomerPageReqVO.java index 3a14104c6..f47dfb468 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/vo/CrmTodayCustomerPageReqVO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/message/vo/CrmTodayCustomerPageReqVO.java @@ -15,6 +15,8 @@ import lombok.ToString; @ToString(callSuper = true) public class CrmTodayCustomerPageReqVO extends PageParam { + // TODO @dbh52:CrmContactStatusEnum 可以直接枚举三个 Integer;一般来说,枚举类尽量给数据模型用,这样枚举类少,更聚焦;这里的枚举,更多是专门给这个接口用的哈 + @Schema(description = "联系状态", example = "1") @InEnum(CrmContactStatusEnum.class) private Integer contactStatus; diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java index bf68e64ee..125249d14 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java @@ -85,6 +85,7 @@ public interface CrmCustomerMapper extends BaseMapperX { .eq(CrmFollowUpRecordDO::getType, CrmBizTypeEnum.CRM_CUSTOMER.getType()); // 拼接自身的查询条件 + // TODO @dbh52:这里不仅仅要获得 today、tomorrow。而是 today 要获取今天的 00:00:00 这种; LocalDate today = LocalDate.now(); LocalDate tomorrow = today.plusDays(1); LocalDate yesterday = today.minusDays(1); @@ -93,12 +94,14 @@ public interface CrmCustomerMapper extends BaseMapperX { // 1.【客户】的【下一次联系时间】 是【今天】 // 2. 无法找到【今天】创建的【跟进】记录 query.between(CrmCustomerDO::getContactNextTime, today, tomorrow) + // TODO @dbh52:是不是查询 CrmCustomerDO::contactLastTime < today?因为今天联系过,应该会更新该字段,减少链表查询; .between(CrmFollowUpRecordDO::getCreateTime, today, tomorrow) .isNull(CrmFollowUpRecordDO::getId); } else if (pageReqVO.getContactStatus().equals(CrmContactStatusEnum.EXPIRED.getType())) { // 已逾期: // 1. 【客户】的【下一次联系时间】 <= 【昨天】 // 2. 无法找到【今天】创建的【跟进】记录 + // TODO @dbh52:是不是 contactNextTime 在当前时间之前,且 contactLastTime < contactNextTime?说白了,就是下次联系时间超过当前时间,且最后联系时间没去联系; query.le(CrmCustomerDO::getContactNextTime, yesterday) .between(CrmFollowUpRecordDO::getCreateTime, today, tomorrow) .isNull(CrmFollowUpRecordDO::getId); @@ -107,10 +110,11 @@ public interface CrmCustomerMapper extends BaseMapperX { // 1.【客户】的【下一次联系时间】 是【今天】 // 2. 找到【今天】创建的【跟进】记录 query.between(CrmCustomerDO::getContactNextTime, today, tomorrow) + // TODO @dbh52:contactLastTime 是今天 .between(CrmFollowUpRecordDO::getCreateTime, today, tomorrow) .isNotNull(CrmFollowUpRecordDO::getId); } else { - // TODO: 参数错误,是不是要兜一下底 + // TODO: 参数错误,是不是要兜一下底;直接抛出异常就好啦; } return selectJoinPage(pageReqVO, CrmCustomerDO.class, query); diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageService.java index 803b3ef15..c0bdb42e8 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageService.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageService.java @@ -13,6 +13,7 @@ import jakarta.validation.Valid; public interface CrmMessageService { /** + * TODO @dbh52:注释要写下 * * @param pageReqVO * @return diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageServiceImpl.java index 86cc22faa..523a64671 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageServiceImpl.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/message/CrmMessageServiceImpl.java @@ -8,7 +8,7 @@ import jakarta.annotation.Resource; import org.springframework.stereotype.Component; import org.springframework.validation.annotation.Validated; - +// TODO @dbh52:注释要写下 @Component @Validated public class CrmMessageServiceImpl implements CrmMessageService { diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java index 537d03ebe..9986c7e61 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java @@ -168,6 +168,7 @@ public class ProductSpuServiceImpl implements ProductSpuService { if (ObjectUtil.notEqual(spuDO.getStatus(), ProductSpuStatusEnum.RECYCLE.getStatus())) { throw exception(SPU_NOT_RECYCLE); } + // TODO 芋艿:【可选】参与活动中的商品,不允许删除??? // 删除 SPU productSpuMapper.deleteById(id); @@ -235,6 +236,7 @@ public class ProductSpuServiceImpl implements ProductSpuService { public void updateSpuStatus(ProductSpuUpdateStatusReqVO updateReqVO) { // 校验存在 validateSpuExists(updateReqVO.getId()); + // TODO 芋艿:【可选】参与活动中的商品,不允许下架??? // 更新状态 ProductSpuDO productSpuDO = productSpuMapper.selectById(updateReqVO.getId()).setStatus(updateReqVO.getStatus());