|
|
|
@ -299,34 +299,35 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
orderSplit.stream().forEach(splitEn -> { |
|
|
|
|
List<OrderItemInfo> orderItemInfo = splitEn.getOrderItemInfo(); |
|
|
|
|
orderItemInfo.stream().forEach(splitItem -> { |
|
|
|
|
List<OrderItemInfo> collect = commonOrderInfo.getOrderItemInfo().stream().filter(oi -> oi.getXmmc().equals(splitItem.getXmmc()) && |
|
|
|
|
((StrUtil.isBlank(oi.getGgxh()) && StrUtil.isBlank(splitItem.getGgxh())) || oi.getGgxh().equals(splitItem.getGgxh())) && |
|
|
|
|
((StrUtil.isBlank(oi.getXmdw()) && StrUtil.isBlank(splitItem.getXmdw())) || oi.getXmdw().equals(splitItem.getXmdw())) && |
|
|
|
|
((StrUtil.isBlank(oi.getSl()) && StrUtil.isBlank(splitItem.getSl())) || oi.getSl().equals(splitItem.getSl()))).collect(Collectors.toList()); |
|
|
|
|
if (collect.size() == 1) { |
|
|
|
|
List<RuleSplitEntity> ruleSplitEntityList = ruleSplitService.queryRuleSplit(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), pageInvoiceReq.getUserId()); |
|
|
|
|
log.info("税号:{},用户ID:{},查询的拆分限额信息结果:{}", commonOrderInfo.getOrderInfo().getXhfNsrsbh(), |
|
|
|
|
pageInvoiceReq.getUserId(), JsonUtils.getInstance().toJsonString(ruleSplitEntityList)); |
|
|
|
|
String djce = ConfigureConstant.STRING_0; |
|
|
|
|
if(ruleSplitEntityList.size() != 0){ |
|
|
|
|
djce = StrUtil.isBlank(ruleSplitEntityList.get(0).getDjce())?ConfigureConstant.STRING_0:ruleSplitEntityList.get(0).getDjce(); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtil.isNotNull(collect.get(0).getXmdj()) && StrUtil.isNotBlank(collect.get(0).getXmdj()) && |
|
|
|
|
ObjectUtil.isNotNull(splitItem.getXmdj()) && StrUtil.isNotBlank(splitItem.getXmdj())){ |
|
|
|
|
BigDecimal abs = new BigDecimal(collect.get(0).getXmdj()).subtract(new BigDecimal(splitItem.getXmdj())).abs(); |
|
|
|
|
if (abs.compareTo(new BigDecimal(djce)) > 0) { |
|
|
|
|
Map map = new HashMap(); |
|
|
|
|
map.put("ddh", commonOrderInfo.getOrderInfo().getDdh()); |
|
|
|
|
map.put("ghfMc", commonOrderInfo.getOrderInfo().getGhfMc()); |
|
|
|
|
map.put("xhfMc", commonOrderInfo.getOrderInfo().getXhfMc()); |
|
|
|
|
map.put("jshj", commonOrderInfo.getOrderInfo().getKphjje()); |
|
|
|
|
djOverflowList.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size()); |
|
|
|
|
throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细"); |
|
|
|
|
} |
|
|
|
|
// List<OrderItemInfo> collect = commonOrderInfo.getOrderItemInfo().stream().filter(oi -> oi.getXmmc().equals(splitItem.getXmmc()) &&
|
|
|
|
|
// ((StrUtil.isBlank(oi.getGgxh()) && StrUtil.isBlank(splitItem.getGgxh())) || oi.getGgxh().equals(splitItem.getGgxh())) &&
|
|
|
|
|
// ((StrUtil.isBlank(oi.getXmdw()) && StrUtil.isBlank(splitItem.getXmdw())) || oi.getXmdw().equals(splitItem.getXmdw())) &&
|
|
|
|
|
// ((StrUtil.isBlank(oi.getSl()) && StrUtil.isBlank(splitItem.getSl())) || oi.getSl().equals(splitItem.getSl()))).collect(Collectors.toList());
|
|
|
|
|
// if (collect.size() == 1) {
|
|
|
|
|
// List<RuleSplitEntity> ruleSplitEntityList = ruleSplitService.queryRuleSplit(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), pageInvoiceReq.getUserId());
|
|
|
|
|
// log.info("税号:{},用户ID:{},查询的拆分限额信息结果:{}", commonOrderInfo.getOrderInfo().getXhfNsrsbh(),
|
|
|
|
|
// pageInvoiceReq.getUserId(), JsonUtils.getInstance().toJsonString(ruleSplitEntityList));
|
|
|
|
|
// String djce = ConfigureConstant.STRING_0;
|
|
|
|
|
// if(ruleSplitEntityList.size() != 0){
|
|
|
|
|
// djce = StrUtil.isBlank(ruleSplitEntityList.get(0).getDjce())?ConfigureConstant.STRING_0:ruleSplitEntityList.get(0).getDjce();
|
|
|
|
|
// }
|
|
|
|
|
// if(ObjectUtil.isNotNull(collect.get(0).getXmdj()) && StrUtil.isNotBlank(collect.get(0).getXmdj()) &&
|
|
|
|
|
// ObjectUtil.isNotNull(splitItem.getXmdj()) && StrUtil.isNotBlank(splitItem.getXmdj())){
|
|
|
|
|
// BigDecimal abs = new BigDecimal(collect.get(0).getXmdj()).subtract(new BigDecimal(splitItem.getXmdj())).abs();
|
|
|
|
|
// if (abs.compareTo(new BigDecimal(djce)) > 0) {
|
|
|
|
|
// Map map = new HashMap();
|
|
|
|
|
// map.put("ddh", commonOrderInfo.getOrderInfo().getDdh());
|
|
|
|
|
// map.put("ghfMc", commonOrderInfo.getOrderInfo().getGhfMc());
|
|
|
|
|
// map.put("xhfMc", commonOrderInfo.getOrderInfo().getXhfMc());
|
|
|
|
|
// map.put("jshj", commonOrderInfo.getOrderInfo().getKphjje());
|
|
|
|
|
// djOverflowList.add(map);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size());
|
|
|
|
|
// throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
|
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|