mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
code review:客户锁定的逻辑
This commit is contained in:
parent
9a007de947
commit
acdfc28ee6
@ -95,8 +95,9 @@ public class CrmCustomerController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// TODO @Joey:单独建一个属于自己业务的 ReqVO;因为前端如果模拟请求,是不是可以更新其它字段了;
|
||||
@PutMapping("/lock")
|
||||
@Operation(summary = "锁定/解锁")
|
||||
@Operation(summary = "锁定/解锁客户")
|
||||
@PreAuthorize("@ss.hasPermission('crm:customer:update')")
|
||||
public CommonResult<Boolean> lockCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) {
|
||||
customerService.lockCustomer(updateReqVO);
|
||||
|
@ -87,7 +87,7 @@ public interface CrmCustomerService {
|
||||
void transferCustomer(CrmCustomerTransferReqVO reqVO, Long userId);
|
||||
|
||||
/**
|
||||
* 锁定客户 解锁客户
|
||||
* 锁定/解锁客户
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
|
@ -146,6 +146,9 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
|
||||
public void lockCustomer(CrmCustomerUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCustomerExists(updateReqVO.getId());
|
||||
// TODO @Joey:可以校验下,如果已经对应的锁定状态,报个业务异常;原因是:后续这个业务会记录操作日志,会记录多了;
|
||||
// TODO @芋艿:业务完善,增加锁定上限;
|
||||
|
||||
// 更新
|
||||
CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO);
|
||||
customerMapper.updateById(updateObj);
|
||||
|
Loading…
Reference in New Issue
Block a user