refactor: 简化应付单生成条件的代码判断逻辑

优化了OmsInventoryInnerServiceImpl中应付单生成的条件判断,将原本拆分的两个布尔变量合并为直接的条件判断,提升代码可读性。
dev_1.0.3
kangwenjing 2026-09-23 09:04:29 +08:00
parent 86fe86d72d
commit a14993e1b8
8 changed files with 4 additions and 4 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@ -36,6 +36,7 @@ dist/
nbdist/ nbdist/
.nb-gradle/ .nb-gradle/
.DS_Store .DS_Store
*.png
###################################################################### ######################################################################
# Others # Others

View File

@ -197,10 +197,9 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
OmsPayableBill payableBill = new OmsPayableBill(); OmsPayableBill payableBill = new OmsPayableBill();
VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorCode(vendorCode); VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorCode(vendorCode);
boolean innerPay = vendorInfo != null && VendorInfo.PayTypeEnum.INNER_PAY.getCode().equals(vendorInfo.getPayType()); //入库付款厂商(INNER_PAY)或非标准品(服务/维保)在入库时生成应付单,金额按本次入库量计算
boolean notStandard = !Arrays.asList("1", "2").contains(omsInventoryInner.getProductType()); if ((vendorInfo != null && VendorInfo.PayTypeEnum.INNER_PAY.getCode().equals(vendorInfo.getPayType()))
//每次入库均生成应付单,金额按本次入库量计算 || !Arrays.asList("1", "2").contains(omsInventoryInner.getProductType())) {
if (innerPay || notStandard) {
BigDecimal reduce = inventoryInfoList.stream().map(InventoryInfo::getInnerPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal reduce = inventoryInfoList.stream().map(InventoryInfo::getInnerPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
//服务金额为单价*数量 没有具体的详情 //服务金额为单价*数量 没有具体的详情
BigDecimal totalPriceWithTax = Arrays.asList("3", "22").contains(omsInventoryInner.getProductType()) ? BigDecimal totalPriceWithTax = Arrays.asList("3", "22").contains(omsInventoryInner.getProductType()) ?