master:现金客户不可编辑;

pull/1121/head
liujiang 2025-10-23 11:33:17 +08:00
parent fbc7b8c22e
commit 1c9b90d3d9
1 changed files with 4 additions and 0 deletions

View File

@ -137,6 +137,10 @@ public class StoreCustomerServiceImpl implements IStoreCustomerService {
StoreCustomer storeCus = Optional.ofNullable(this.storeCusMapper.selectOne(new LambdaQueryWrapper<StoreCustomer>()
.eq(StoreCustomer::getId, storeCusDTO.getStoreCusId()).eq(StoreCustomer::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("档口客户不存在!"));
// 不允许删现金客户
if (Objects.equals(storeCus.getCusName(), Constants.STORE_CUS_CASH)) {
throw new ServiceException("请勿编辑现金客户!", HttpStatus.ERROR);
}
if (StringUtils.isNotBlank(storeCusDTO.getPhone())) {
final String regex = "^1[3-9]\\d{9}$";
if (!Pattern.matches(regex, storeCusDTO.getPhone().trim())) {