Merge remote-tracking branch 'origin/beta-prop-all' into beta-prop-all

jianshui-ui
dongxiaoke 1 year ago
commit 8ba3fc3be4
  1. 12
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/adapter/request/AisinoInvoiceRequestAdapterImpl.java

@ -223,33 +223,33 @@ public class AisinoInvoiceRequestAdapterImpl implements IInvoiceRequestService {
if (shList.contains(billInfo.getSellerTaxnum())){
List<BillDetail> billDetailList = billInfo.getBillDetailList();
if (billInfo.getTaxfreeamt() != null && billInfo.getTaxfreeamt().compareTo(new BigDecimal("10"))>0){
throw new RuntimeException("发票金额不能大于10元");
throw new JianshuiParamErrorException("发票金额不能大于10元",companyservice,"invoice");
}
if (billInfo.getTaxamt() != null && billInfo.getTaxamt().compareTo(new BigDecimal("12"))>0){
throw new RuntimeException("发票金额不能大于10元");
throw new JianshuiParamErrorException("发票金额不能大于10元",companyservice,"invoice");
}
if (billInfo.getTaxfreeamt() == null && billInfo.getTaxamt() == null && billDetailList != null){
BigDecimal taxAmount = new BigDecimal("0");
if ("1".equals(billInfo.getHsbz())){
billDetailList.forEach(e->taxAmount.add(e.getTaxfreeamt()==null?new BigDecimal("0"):e.getTaxfreeamt()));
if (taxAmount.compareTo(new BigDecimal("10"))>0){
throw new RuntimeException("发票金额不能大于10元");
throw new JianshuiParamErrorException("发票金额不能大于10元",companyservice,"invoice");
}
}else {
billDetailList.forEach(e->taxAmount.add(e.getTaxamt()==null?new BigDecimal("0"):e.getTaxamt()));
if (taxAmount.compareTo(new BigDecimal("12"))>0){
throw new RuntimeException("发票金额不能大于10元");
throw new JianshuiParamErrorException("发票金额不能大于10元",companyservice,"invoice");
}
}
}
if (StringUtils.isNoneBlank(billInfo.getInvoiceType()) && !environment.getProperty("billing.limit.invoiceType").equals(billInfo.getInvoiceType())){
throw new RuntimeException("所开发票不是普票,请选择发票种类为普票");
throw new JianshuiParamErrorException("所开发票不是普票,请选择发票种类为普票",companyservice,"invoice");
}
if (billDetailList != null && billDetailList.size() > 0){
List<BillDetail> mxList = billDetailList.stream().filter(e -> !e.getGoodName().contains(environment.getProperty("billing.limit.xmmc"))).collect(Collectors.toList());
if (mxList != null && mxList.size() > 0){
throw new RuntimeException("发票明细中包含非" + environment.getProperty("billing.limit.xmmc") + ",请删除后重试");
throw new JianshuiParamErrorException("发票明细中包含非" + environment.getProperty("billing.limit.xmmc") + ",请删除后重试",companyservice,"invoice");
}
}
}

Loading…
Cancel
Save