fix 缴费金额限制

This commit is contained in:
shuo.wang
2025-06-06 10:51:58 +08:00
parent 431929338a
commit b90c325c1a

View File

@@ -52,6 +52,7 @@ import java.math.BigDecimal;
import java.text.MessageFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.cool.store.utils.poi.DateUtils.SPECIAL_DATE_START;
@@ -166,8 +167,12 @@ public class LinePayServiceImpl implements LinePayService {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
//判断付款人最多2人可重复
List<LinePayDO> list = linePayDAO.getFranchiseFeePayInfoByShopId(request.getShopId());
Map<Long, LinePayDO> payIdMap = list.stream().collect(Collectors.toMap(LinePayDO::getId, Function.identity()));
if (request.getId()!=null){
payIdMap.remove(request.getId());
}
//判断缴费金额不能大于未缴费金额
BigDecimal total = list.stream()
BigDecimal total = payIdMap.values().stream()
.map(LinePayDO::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
//应缴金额