|
|
|
@ -1752,17 +1752,37 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int updateBillNumber(String bzdh,String orderInfoId,String fpqqlsh,String xhfNsrsbh){ |
|
|
|
|
OrderProcessInfo orderProcessInfo = new OrderProcessInfo(); |
|
|
|
|
orderProcessInfo.setBzdh(bzdh); |
|
|
|
|
orderProcessInfo.setOrderInfoId(orderInfoId); |
|
|
|
|
int i = orderProcessInfoMapper.updateOrderProcessInfoByFpqqlsh(orderProcessInfo, null); |
|
|
|
|
// if(i > 0) {
|
|
|
|
|
// Map map = new HashMap();
|
|
|
|
|
// map.put("ddqqlsh",fpqqlsh);
|
|
|
|
|
// map.put("xhfNsrsbh",xhfNsrsbh);
|
|
|
|
|
// invoiceDataService.manualPushInvoice(Arrays.asList(map));
|
|
|
|
|
// }
|
|
|
|
|
public int updateBillNumber(String bzdh,String orderInfoId,String fpqqlsh,String xhfNsrsbh) throws Exception{ |
|
|
|
|
//通过报账单查询订单,如果存在则删除
|
|
|
|
|
List<OrderProcessInfo> orderProcessInfos = orderProcessInfoMapper.queryOrderProcessInfoByBzdh(bzdh, Arrays.asList(xhfNsrsbh)); |
|
|
|
|
OrderProcessInfo orderProcessInfo = null; |
|
|
|
|
if(orderProcessInfos.size() > 1){ |
|
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_BZDH_MULTIPLE); |
|
|
|
|
} |
|
|
|
|
if(orderProcessInfos.size() == 1){ |
|
|
|
|
orderProcessInfo = orderProcessInfos.get(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(orderProcessInfo != null){ |
|
|
|
|
if(!OrderInfoEnum.ORDER_STATUS_0.getKey().equals(orderProcessInfo.getDdzt())){ |
|
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_BZDH_OPERATED); |
|
|
|
|
} |
|
|
|
|
OrderProcessInfo orderProcessInfo1 = new OrderProcessInfo(); |
|
|
|
|
orderProcessInfo1.setOrderStatus(OrderInfoEnum.ORDER_VALID_STATUS_1.getKey()); |
|
|
|
|
orderProcessInfo1.setOrderInfoId(orderProcessInfo.getId()); |
|
|
|
|
orderProcessInfoMapper.updateOrderProcessInfoByFpqqlsh(orderProcessInfo1, Arrays.asList(xhfNsrsbh)); |
|
|
|
|
} |
|
|
|
|
OrderProcessInfo orderProcessInfo2 = new OrderProcessInfo(); |
|
|
|
|
orderProcessInfo2.setBzdh(bzdh); |
|
|
|
|
orderProcessInfo2.setOrderInfoId(orderInfoId); |
|
|
|
|
orderProcessInfo2.setXtly(orderProcessInfo != null && StringUtils.isNotBlank(orderProcessInfo.getXtly()) ? orderProcessInfo.getXtly() : ""); |
|
|
|
|
int i = orderProcessInfoMapper.updateOrderProcessInfoByFpqqlsh(orderProcessInfo2, Arrays.asList(xhfNsrsbh)); |
|
|
|
|
if(i > 0) { |
|
|
|
|
Map map = new HashMap(); |
|
|
|
|
map.put("ddqqlsh",fpqqlsh); |
|
|
|
|
map.put("xhfNsrsbh",xhfNsrsbh); |
|
|
|
|
invoiceDataService.manualPushInvoice(Arrays.asList(map)); |
|
|
|
|
} |
|
|
|
|
return i; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|