📖 CRM:【还款】code review 还款的代码,补全对应的 todo list

This commit is contained in:
YunaiV 2024-01-04 09:41:58 +08:00
parent c6a9751511
commit a974d055b6
6 changed files with 24 additions and 20 deletions

View File

@ -1,4 +0,0 @@
/**
* 商机销售机会
*/
package cn.iocoder.yudao.module.crm.service.business;

View File

@ -1,4 +0,0 @@
/**
* 线索
*/
package cn.iocoder.yudao.module.crm.service.clue;

View File

@ -1,4 +0,0 @@
/**
* 产品表
*/
package cn.iocoder.yudao.module.crm.service.product;

View File

@ -52,7 +52,10 @@ public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
private CrmPermissionService crmPermissionService;
@Override
// TODO @puhui999操作日志
public Long createReceivablePlan(CrmReceivablePlanCreateReqVO createReqVO, Long userId) {
// TODO @liuhongfeng第几期的计算基于是 contractId + contractDO 的第几个还款
// TODO @liuhongfeng contractId校验合同是否存在
// 插入
CrmReceivablePlanDO receivablePlan = CrmReceivablePlanConvert.INSTANCE.convert(createReqVO);
receivablePlan.setFinishStatus(false);
@ -87,7 +90,9 @@ public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
@Override
@CrmPermission(bizType = CrmBizTypeEnum.CRM_RECEIVABLE_PLAN, bizId = "#updateReqVO.id", level = CrmPermissionLevelEnum.WRITE)
// TODO @puhui999操作日志
public void updateReceivablePlan(CrmReceivablePlanUpdateReqVO updateReqVO) {
// TODO @liuhongfeng如果已经有对应的还款则不允许编辑
// 校验存在
validateReceivablePlanExists(updateReqVO.getId());
@ -136,6 +141,7 @@ public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
return receivablePlanMapper.selectPageByCustomerId(pageReqVO);
}
// TODO @puhui999这个没有 transfer 接口可能是的哈
@Override
public void transferReceivablePlan(CrmReceivablePlanTransferReqVO reqVO, Long userId) {
// 1 校验回款计划是否存在

View File

@ -53,10 +53,10 @@ public class CrmReceivableServiceImpl implements CrmReceivableService {
@Resource
private CrmPermissionService crmPermissionService;
// TODO @liuhongfeng创建还款后是不是什么时候要更新 plan
@Override
// TODO @puhui999操作日志
public Long createReceivable(CrmReceivableCreateReqVO createReqVO) {
// 插入
// 插入还款
CrmReceivableDO receivable = CrmReceivableConvert.INSTANCE.convert(createReqVO);
if (ObjectUtil.isNull(receivable.getAuditStatus())) {
receivable.setAuditStatus(CommonStatusEnum.ENABLE.getStatus());
@ -64,15 +64,17 @@ public class CrmReceivableServiceImpl implements CrmReceivableService {
receivable.setAuditStatus(CrmAuditStatusEnum.DRAFT.getStatus());
// TODO @liuhongfeng一般来说逻辑的写法是要先检查后操作 db所以你这个 check 应该放到 CrmReceivableDO receivable 之前
// 校验
checkReceivable(receivable);
receivableMapper.insert(receivable);
// TODO @liuhongfeng需要更新关联的 plan
return receivable.getId();
}
// TODO @liuhongfeng这里的括号要注意排版
private void checkReceivable(CrmReceivableDO receivable) {
// TODO @liuhongfeng校验 no 的唯一性
// TODO @liuhongfeng这个放在参数校验合适
if (ObjectUtil.isNull(receivable.getContractId())) {
throw exception(CONTRACT_NOT_EXISTS);
@ -96,17 +98,29 @@ public class CrmReceivableServiceImpl implements CrmReceivableService {
}
@Override
// TODO @puhui999操作日志
// TODO @puhui999权限校验
public void updateReceivable(CrmReceivableUpdateReqVO updateReqVO) {
// 校验存在
validateReceivableExists(updateReqVO.getId());
// TODO @liuhongfeng只有在草稿审核中可以提交修改
// 更新
// 更新还款
CrmReceivableDO updateObj = CrmReceivableConvert.INSTANCE.convert(updateReqVO);
receivableMapper.updateById(updateObj);
// TODO @liuhongfeng需要更新关联的 plan
}
// TODO @liuhongfeng缺一个取消合同的接口只有草稿审批中可以取消CrmAuditStatusEnum
// TODO @liuhongfeng缺一个发起审批的接口只有草稿可以发起审批CrmAuditStatusEnum
@Override
// TODO @puhui999操作日志
// TODO @puhui999权限校验
public void deleteReceivable(Long id) {
// TODO @liuhongfeng如果被 CrmReceivablePlanDO 所使用则不允许删除
// 校验存在
validateReceivableExists(id);
// 删除

View File

@ -1,4 +0,0 @@
/**
* 回款
*/
package cn.iocoder.yudao.module.crm.service.receivable;