master:修改档口年费及会员费调优;

pull/1121/head
liujiang 2025-11-16 20:09:02 +08:00
parent 75c3ce60ed
commit 4c1544fde9
1 changed files with 8 additions and 0 deletions

View File

@ -578,6 +578,14 @@ public class StoreServiceImpl implements IStoreService {
}
if (ObjectUtils.isNotEmpty(specialDTO.getMemberAmount())) {
store.setMemberAmount(specialDTO.getMemberAmount());
// 若档口为正式使用,则需要判断 会员金额 是否大于年费金额
if (Objects.equals(store.getStoreStatus(), StoreStatus.FORMAL_USE.getValue())) {
BigDecimal serviceAmount = ObjectUtils.defaultIfNull(store.getServiceAmount(), Constants.STORE_ANNUAL_AMOUNT);
BigDecimal memberAmount = ObjectUtils.defaultIfNull(store.getMemberAmount(), Constants.STORE_MEMBER_AMOUNT);
if (memberAmount.compareTo(serviceAmount) <= 0) {
throw new ServiceException("会员价不能等于或低于年费价! 年费价:" + serviceAmount + ",会员价:" + memberAmount, HttpStatus.ERROR);
}
}
}
return this.storeMapper.updateById(store);
}