|
|
@ -152,9 +152,10 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
//存储成品油和非成品油不是混开的结算单
|
|
|
|
//存储成品油和非成品油不是混开的结算单
|
|
|
|
List<CommonOrderInfo> commonOrderInfoList=new ArrayList<CommonOrderInfo>(); |
|
|
|
List<CommonOrderInfo> commonOrderInfoList=new ArrayList<CommonOrderInfo>(); |
|
|
|
//存储成品油和非成品油混开的结算单
|
|
|
|
//存储成品油和非成品油混开的结算单
|
|
|
|
List<PageCommonOrderInfo> mixCommonOrderInfoList=new ArrayList<>(); |
|
|
|
List<List<PageCommonOrderInfo>> lists=new ArrayList<>(); |
|
|
|
//购方是否为空、税编是否为空校验、成品油校验
|
|
|
|
//购方是否为空、税编是否为空校验、成品油校验
|
|
|
|
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){ |
|
|
|
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){ |
|
|
|
|
|
|
|
List<PageCommonOrderInfo> mixCommonOrderInfoList=new ArrayList<>(); |
|
|
|
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ |
|
|
|
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ |
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); |
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -222,12 +223,15 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
if(cpyOrderItems.size()>ConfigureConstant.INT_8){ |
|
|
|
if(cpyOrderItems.size()>ConfigureConstant.INT_8){ |
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"是成品油发票,明细行数不能超过8行,请先进行手动拆分!"); |
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"是成品油发票,明细行数不能超过8行,请先进行手动拆分!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
lists.add(mixCommonOrderInfoList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//如果是混开的 走明细拆分
|
|
|
|
//如果是混开的 走明细拆分
|
|
|
|
if(!CollectionUtils.isEmpty(mixCommonOrderInfoList)){ |
|
|
|
if(!CollectionUtils.isEmpty(lists)){ |
|
|
|
try { |
|
|
|
try { |
|
|
|
orderSplitService.saveOrderSplitOrder(mixCommonOrderInfoList); |
|
|
|
for (List<PageCommonOrderInfo> list : lists) { |
|
|
|
|
|
|
|
orderSplitService.saveOrderSplitOrder(list); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e.getMessage()); |
|
|
|
throw new RuntimeException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|