|
|
|
@ -187,9 +187,6 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
}else { |
|
|
|
|
//封装成品油
|
|
|
|
|
PageCommonOrderInfo cpyPageCommonOrderInfo = new PageCommonOrderInfo(); |
|
|
|
|
//拼接自动按照明细行拆分所需要的数据
|
|
|
|
|
log.info("cpyOrderItems》》》》》》》》"+JSON.toJSONString(cpyOrderItems)); |
|
|
|
|
log.info("nocpyOrderItems》》》》》》》》"+JSON.toJSONString(nocpyOrderItems)); |
|
|
|
|
//成品油和非成品油混合
|
|
|
|
|
PageOrderInfo cpyPageOrderInfo = new PageOrderInfo(); |
|
|
|
|
BeanUtils.copyProperties(commonOrderInfo.getOrderInfo(),cpyPageOrderInfo); |
|
|
|
@ -236,11 +233,6 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
throw new RuntimeException(e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<String> collected = commonOrderInfos.stream().map(v -> v.getOrderInfo().getDdh()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
if(collected.stream().filter(s -> s.startsWith("700000")).count() >0){ |
|
|
|
|
throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细____"); |
|
|
|
|
} |
|
|
|
|
//如果不是混开的 走原来的逻辑
|
|
|
|
|
if(CollectionUtils.isEmpty(commonOrderInfoList)){ |
|
|
|
|
return R.ok("生成预制发票成功,请到【发票处理中心】页面查看"); |
|
|
|
@ -317,20 +309,16 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size()); |
|
|
|
|
// R.error("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
|
|
|
|
|
throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if(consumerList.size()>0){ |
|
|
|
|
// return R.error(ConfigureConstant.STRING_9001, "以下结算单中客户的状态为“冻结”状态,不能进行开票。",consumerList);
|
|
|
|
|
throw new RuntimeException(String.format("以下结算单中%s客户的状态为“冻结”状态,不能进行开票。",consumerList)); |
|
|
|
|
}else if((StrUtil.isBlank(pageInvoiceReq.getConfirmZnfm()) || !ConfigureConstant.STRING_0.equals(pageInvoiceReq.getConfirmZnfm())) && confirmList.size()>0){ |
|
|
|
|
// return R.error(ConfigureConstant.STRING_9002,"请确认以下物料税收分类编码是否准确",confirmList);
|
|
|
|
|
throw new RuntimeException(String.format("请确认以下物料税收分类编码是否准确",confirmList)); |
|
|
|
|
}else if(djOverflowList.size() > 0){ |
|
|
|
|
// return R.error(ConfigureConstant.STRING_9003, "以下订单自动拆分时单价超过设定范围,请手动拆分",djOverflowList);
|
|
|
|
|
throw new RuntimeException(String.format("以下订单自动拆分时单价超过设定范围,请手动拆分",djOverflowList)); |
|
|
|
|
}else { |
|
|
|
|
for (CommonOrderInfo f : commonOrderInfoList) { |
|
|
|
@ -370,9 +358,6 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(collected.stream().filter(s -> s.startsWith("800000")).count() >0){ |
|
|
|
|
throw new RuntimeException("以下订单自动拆分时单价超过设定范围,请手动拆分_____"); |
|
|
|
|
} |
|
|
|
|
return R.ok("生成预制发票成功,请到【发票处理中心】页面查看"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|