线索与客户领取增加已经被领取判断

This commit is contained in:
hupeng
2026-03-13 17:20:39 +08:00
parent 4b000c738e
commit 75558969f6
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package co.yixiang.yshop.module.crm.service.crmclues;
import co.yixiang.yshop.framework.common.enums.ShopCommonEnum;
import co.yixiang.yshop.framework.common.exception.ErrorCode;
import co.yixiang.yshop.framework.security.core.util.SecurityFrameworkUtils;
import co.yixiang.yshop.module.crm.controller.admin.crmcustomer.vo.CrmCustomerSaveReqVO;
import co.yixiang.yshop.module.crm.dal.dataobject.crmcustomer.CrmCustomerDO;
@ -122,6 +123,9 @@ public class CrmCluesServiceImpl implements CrmCluesService {
@Override
public void receiveClues(Long id) {
CrmCluesDO crmCluesDO = cluesMapper.selectById(id);
if(crmCluesDO.getOwnerUserId() > 0){
throw exception(new ErrorCode(202603130, "线索已领取"));
}
if (crmCluesDO == null) {
throw exception(CLUES_NOT_EXISTS);
}

View File

@ -137,6 +137,9 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
@Transactional(rollbackFor = Exception.class)
public void receiveCustomer(Long id) {
CrmCustomerDO customerDO = customerMapper.selectById(id);
if(customerDO.getOwnerUserId() > 0){
throw exception(new ErrorCode(202603131, "客户已领取"));
}
if(customerDO == null){
throw exception(CUSTOMER_NOT_EXISTS);
}