|
|
@ -183,7 +183,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
//请求参数非空校验
|
|
|
|
//请求参数非空校验
|
|
|
|
DdpcxxRspBO ddpcxxRsp = checkRequestParamNonNull(ddpcxxReq); |
|
|
|
DdpcxxRspBO ddpcxxRsp = checkRequestParamNonNull(ddpcxxReq); |
|
|
|
if(!ConfigureConstant.STRING_0000.equals(ddpcxxRsp.getZTDM())){ |
|
|
|
if (!ConfigureConstant.STRING_0000.equals(ddpcxxRsp.getZTDM())) { |
|
|
|
log.error("{}开票接口请求参数非空校验,状态代码:{},状态信息:{}", LOGGER_MSG, |
|
|
|
log.error("{}开票接口请求参数非空校验,状态代码:{},状态信息:{}", LOGGER_MSG, |
|
|
|
ddpcxxRsp.getZTDM(), ddpcxxRsp.getZTXX()); |
|
|
|
ddpcxxRsp.getZTDM(), ddpcxxRsp.getZTXX()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
@ -192,10 +192,10 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
//根据税号查询税控设备
|
|
|
|
//根据税号查询税控设备
|
|
|
|
String nsrsbh = ddpcxxReq.getDDPCXX().getNSRSBH(); |
|
|
|
String nsrsbh = ddpcxxReq.getDDPCXX().getNSRSBH(); |
|
|
|
String entId = ddpcxxReq.getDDPCXX().getENTID(); |
|
|
|
String entId = ddpcxxReq.getDDPCXX().getENTID(); |
|
|
|
TaxEquipmentInfo taxEquipmentInfo = simsBackService.queryTaxEquipment(nsrsbh,entId); |
|
|
|
TaxEquipmentInfo taxEquipmentInfo = simsBackService.queryTaxEquipment(nsrsbh, entId); |
|
|
|
if (ObjectUtil.isNull(taxEquipmentInfo) || StringUtils.isBlank(taxEquipmentInfo.getSksbCode())) { |
|
|
|
if (ObjectUtil.isNull(taxEquipmentInfo) || StringUtils.isBlank(taxEquipmentInfo.getSksbCode())) { |
|
|
|
log.warn("{}企业未配置税控设备,税号:{}", LOGGER_MSG, nsrsbh); |
|
|
|
log.warn("{}企业未配置税控设备,税号:{}", LOGGER_MSG, nsrsbh); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.COMMON_ERROR.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.COMMON_ERROR.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
@ -203,15 +203,15 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
String qdfwlx = taxEquipmentInfo.getQdfwlx(); |
|
|
|
String qdfwlx = taxEquipmentInfo.getQdfwlx(); |
|
|
|
|
|
|
|
|
|
|
|
//如果传递的为空,补全entId
|
|
|
|
//如果传递的为空,补全entId
|
|
|
|
if(StringUtils.isBlank(entId)){ |
|
|
|
if (StringUtils.isBlank(entId)) { |
|
|
|
ddpcxxReq.getDDPCXX().setENTID(taxEquipmentInfo.getQyId()); |
|
|
|
ddpcxxReq.getDDPCXX().setENTID(taxEquipmentInfo.getQyId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//销方企业全电业务校验
|
|
|
|
//销方企业全电业务校验
|
|
|
|
if(CommonUtils.judgeIsQdfp("", ddpcxxReq.getDDPCXX().getFPLXDM()) |
|
|
|
if (CommonUtils.judgeIsQdfp("", ddpcxxReq.getDDPCXX().getFPLXDM()) |
|
|
|
&& !unifyService.queryQdfwktzt(nsrsbh, taxEquipmentInfo)){ |
|
|
|
&& !unifyService.queryQdfwktzt(nsrsbh, taxEquipmentInfo)) { |
|
|
|
log.warn("{} 销方税号:{}, {}", LOGGER_MSG, nsrsbh, "销方企业未开通全电业务,请联系运维人员"); |
|
|
|
log.warn("{} 销方税号:{}, {}", LOGGER_MSG, nsrsbh, "销方企业未开通全电业务,请联系运维人员"); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.QD_FW_ERROR.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.QD_FW_ERROR.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.QD_FW_ERROR.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.QD_FW_ERROR.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
@ -229,7 +229,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//最大订单条数限制校验
|
|
|
|
//最大订单条数限制校验
|
|
|
|
if(ConfigureConstant.PC_MAX_ITEM_LENGTH <= ddpcxxReq.getDDZXX().size()){ |
|
|
|
if (ConfigureConstant.PC_MAX_ITEM_LENGTH <= ddpcxxReq.getDDZXX().size()) { |
|
|
|
log.error("{}开具发票数量超过1000限额", LOGGER_MSG); |
|
|
|
log.error("{}开具发票数量超过1000限额", LOGGER_MSG); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_107130.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_107130.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_107130.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_107130.getMessage()); |
|
|
@ -254,7 +254,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e.getMessage()); |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e.getMessage()); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
@ -270,12 +270,12 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX("发票开票请求数据异常"); |
|
|
|
ddpcxxRsp.setZTXX("发票开票请求数据异常"); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
@ -432,7 +432,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
//如果是开票中的数据允许再次请求底层开票,直到变更状态
|
|
|
|
//如果是开票中的数据允许再次请求底层开票,直到变更状态
|
|
|
|
if (Objects.nonNull(taxEquipmentInfo) && ConfigureConstant.STRING_1.equals(taxEquipmentInfo.getFlag())) { |
|
|
|
if (Objects.nonNull(taxEquipmentInfo) && ConfigureConstant.STRING_1.equals(taxEquipmentInfo.getFlag())) { |
|
|
|
log.warn("{}当前企业开票状态为暂停开票,税号为:{},暂停code:{},暂停msg:{}", LOGGER_MSG, nsrsbh, |
|
|
|
log.warn("{}当前企业开票状态为暂停开票,税号为:{},暂停code:{},暂停msg:{}", LOGGER_MSG, nsrsbh, |
|
|
|
taxEquipmentInfo.getFlagCode(),taxEquipmentInfo.getFlagBz()); |
|
|
|
taxEquipmentInfo.getFlagCode(), taxEquipmentInfo.getFlagBz()); |
|
|
|
pauseInvoice = true; |
|
|
|
pauseInvoice = true; |
|
|
|
pauseInvoiceCode = taxEquipmentInfo.getFlagCode(); |
|
|
|
pauseInvoiceCode = taxEquipmentInfo.getFlagCode(); |
|
|
|
pauseInvoiceMsg = taxEquipmentInfo.getFlagBz(); |
|
|
|
pauseInvoiceMsg = taxEquipmentInfo.getFlagBz(); |
|
|
@ -440,7 +440,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
if (flag) { |
|
|
|
if (flag) { |
|
|
|
//开票中或开票失败处理
|
|
|
|
//开票中或开票失败处理
|
|
|
|
if(pauseInvoice){ |
|
|
|
if (pauseInvoice) { |
|
|
|
log.warn("{}当前企业开票状态为暂停开票,不进行异常流处理,税号为:{}", LOGGER_MSG, nsrsbh); |
|
|
|
log.warn("{}当前企业开票状态为暂停开票,不进行异常流处理,税号为:{}", LOGGER_MSG, nsrsbh); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -474,16 +474,16 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
//判断开票方式,如果开票方式为非自动开票.需要修改订单处理表状态为初始化.
|
|
|
|
//判断开票方式,如果开票方式为非自动开票.需要修改订单处理表状态为初始化.
|
|
|
|
boolean kpz = StringUtils.isNotBlank(kpfs) |
|
|
|
boolean kpz = StringUtils.isNotBlank(kpfs) |
|
|
|
&& (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) |
|
|
|
&& (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) |
|
|
|
|| OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)); |
|
|
|
|| OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)); |
|
|
|
if (kpz) { |
|
|
|
if (kpz) { |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_4.getKey()); |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_4.getKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//如果为暂停开票,并且不是手动开票的,需要更新为失败状态
|
|
|
|
//如果为暂停开票,并且不是手动开票的,需要更新为失败状态
|
|
|
|
if(pauseInvoice && kpz){ |
|
|
|
if (pauseInvoice && kpz) { |
|
|
|
if(OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(orderInfo.getKplx())){ |
|
|
|
if (OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(orderInfo.getKplx())) { |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_8.getKey()); |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_8.getKey()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_6.getKey()); |
|
|
|
orderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_6.getKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
orderProcessInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
orderProcessInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
@ -492,7 +492,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
orderInvoiceInfo.setSbdm(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getKey()); |
|
|
|
orderInvoiceInfo.setSbdm(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getKey()); |
|
|
|
orderInvoiceInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
orderInvoiceInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(pauseInvoiceCode) && StringUtils.isNotBlank(pauseInvoiceMsg)){ |
|
|
|
if (StringUtils.isNotBlank(pauseInvoiceCode) && StringUtils.isNotBlank(pauseInvoiceMsg)) { |
|
|
|
orderProcessInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderProcessInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderInvoiceInfo.setSbdm(pauseInvoiceCode); |
|
|
|
orderInvoiceInfo.setSbdm(pauseInvoiceCode); |
|
|
|
orderInvoiceInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderInvoiceInfo.setSbyy(pauseInvoiceMsg); |
|
|
@ -562,7 +562,6 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
insertProcessInfo.add(orderProcessInfo); |
|
|
|
insertProcessInfo.add(orderProcessInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//原始数据放入插入数组中
|
|
|
|
//原始数据放入插入数组中
|
|
|
|
insertOrder.add(orderInfo); |
|
|
|
insertOrder.add(orderInfo); |
|
|
|
|
|
|
|
|
|
|
@ -627,7 +626,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
OrderInfoQd splitOrderInfoQd = new OrderInfoQd(); |
|
|
|
OrderInfoQd splitOrderInfoQd = new OrderInfoQd(); |
|
|
|
|
|
|
|
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())){ |
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())) { |
|
|
|
BeanUtils.copyProperties(orderInfoQd, splitOrderInfoQd); |
|
|
|
BeanUtils.copyProperties(orderInfoQd, splitOrderInfoQd); |
|
|
|
commonInterfaceService.buildInsertOrderData(splitOrderInfo, splitCommonOrderInfo.getOrderItemInfo(), |
|
|
|
commonInterfaceService.buildInsertOrderData(splitOrderInfo, splitCommonOrderInfo.getOrderItemInfo(), |
|
|
|
splitOrderProcessInfo, splitOrderInvoiceInfo, null, null, splitOrderInfoQd, terminalCode, qdfwlx); |
|
|
|
splitOrderProcessInfo, splitOrderInvoiceInfo, null, null, splitOrderInfoQd, terminalCode, qdfwlx); |
|
|
@ -656,10 +655,10 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//如果为暂停开票,并且不是手动开票的,需要更新为失败状态
|
|
|
|
//如果为暂停开票,并且不是手动开票的,需要更新为失败状态
|
|
|
|
if(pauseInvoice && kpz){ |
|
|
|
if (pauseInvoice && kpz) { |
|
|
|
if(OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(splitOrderInfo.getKplx())){ |
|
|
|
if (OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(splitOrderInfo.getKplx())) { |
|
|
|
splitOrderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_8.getKey()); |
|
|
|
splitOrderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_8.getKey()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
splitOrderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_6.getKey()); |
|
|
|
splitOrderProcessInfo.setDdzt(OrderInfoEnum.ORDER_STATUS_6.getKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
splitOrderProcessInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
splitOrderProcessInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
@ -667,7 +666,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
splitOrderInvoiceInfo.setKpzt(OrderInfoEnum.INVOICE_STATUS_3.getKey()); |
|
|
|
splitOrderInvoiceInfo.setKpzt(OrderInfoEnum.INVOICE_STATUS_3.getKey()); |
|
|
|
splitOrderInvoiceInfo.setSbdm(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getKey()); |
|
|
|
splitOrderInvoiceInfo.setSbdm(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getKey()); |
|
|
|
splitOrderInvoiceInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
splitOrderInvoiceInfo.setSbyy(OrderInfoContentEnum.INVOICE_ERROR_CODE_202008_V3.getMessage()); |
|
|
|
if(StringUtils.isNotBlank(pauseInvoiceCode) && StringUtils.isNotBlank(pauseInvoiceMsg)){ |
|
|
|
if (StringUtils.isNotBlank(pauseInvoiceCode) && StringUtils.isNotBlank(pauseInvoiceMsg)) { |
|
|
|
orderProcessInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderProcessInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderInvoiceInfo.setSbdm(pauseInvoiceCode); |
|
|
|
orderInvoiceInfo.setSbdm(pauseInvoiceCode); |
|
|
|
orderInvoiceInfo.setSbyy(pauseInvoiceMsg); |
|
|
|
orderInvoiceInfo.setSbyy(pauseInvoiceMsg); |
|
|
@ -712,7 +711,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
insertOrder.add(splitOrderInfo); |
|
|
|
insertOrder.add(splitOrderInfo); |
|
|
|
|
|
|
|
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())){ |
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())) { |
|
|
|
insertOrderQd.add(splitOrderInfoQd); |
|
|
|
insertOrderQd.add(splitOrderInfoQd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -750,7 +749,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
ddkzxxBOList.add(splietDdkzxxBO); |
|
|
|
ddkzxxBOList.add(splietDdkzxxBO); |
|
|
|
|
|
|
|
|
|
|
|
//如果为暂停开票,不放入开票队列
|
|
|
|
//如果为暂停开票,不放入开票队列
|
|
|
|
if(!pauseInvoice){ |
|
|
|
if (!pauseInvoice) { |
|
|
|
//数据放入开票队列
|
|
|
|
//数据放入开票队列
|
|
|
|
FpkjMqData fpkjMqData = new FpkjMqData(); |
|
|
|
FpkjMqData fpkjMqData = new FpkjMqData(); |
|
|
|
fpkjMqData.setFpqqlsh(splitOrderInfo.getFpqqlsh()); |
|
|
|
fpkjMqData.setFpqqlsh(splitOrderInfo.getFpqqlsh()); |
|
|
@ -773,7 +772,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
insertOrderEsc.add(orderInfoEsc); |
|
|
|
insertOrderEsc.add(orderInfoEsc); |
|
|
|
} |
|
|
|
} |
|
|
|
//全电发票信息
|
|
|
|
//全电发票信息
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())){ |
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())) { |
|
|
|
insertOrderQd.add(orderInfoQd); |
|
|
|
insertOrderQd.add(orderInfoQd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -804,7 +803,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
insertBatchItem.add(invoiceBatchRequestItems); |
|
|
|
insertBatchItem.add(invoiceBatchRequestItems); |
|
|
|
|
|
|
|
|
|
|
|
//如果为暂停开票,不放入开票队列
|
|
|
|
//如果为暂停开票,不放入开票队列
|
|
|
|
if(!pauseInvoice){ |
|
|
|
if (!pauseInvoice) { |
|
|
|
//数据放入开票队列
|
|
|
|
//数据放入开票队列
|
|
|
|
FpkjMqData fpkjMqData = new FpkjMqData(); |
|
|
|
FpkjMqData fpkjMqData = new FpkjMqData(); |
|
|
|
fpkjMqData.setFpqqlsh(orderInfo.getFpqqlsh()); |
|
|
|
fpkjMqData.setFpqqlsh(orderInfo.getFpqqlsh()); |
|
|
@ -832,7 +831,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
String registCodeByRedis = ""; |
|
|
|
String registCodeByRedis = ""; |
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,nsrsbh)) { |
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, nsrsbh)) { |
|
|
|
log.info("终端号为{}时,消息放入redis中", terminalCode); |
|
|
|
log.info("终端号为{}时,消息放入redis中", terminalCode); |
|
|
|
registCodeByRedis = fangGeService.getRegisterCodeByRedis(nsrsbh, sldid); |
|
|
|
registCodeByRedis = fangGeService.getRegisterCodeByRedis(nsrsbh, sldid); |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
@ -846,20 +845,20 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
DdtxxBO ddtxx = ddpcxxReq.getDDZXX().get(0).getDDTXX(); |
|
|
|
DdtxxBO ddtxx = ddpcxxReq.getDDZXX().get(0).getDDTXX(); |
|
|
|
List<DdmxxxBO> ddmxxx = ddpcxxReq.getDDZXX().get(0).getDDMXXX(); |
|
|
|
List<DdmxxxBO> ddmxxx = ddpcxxReq.getDDZXX().get(0).getDDMXXX(); |
|
|
|
|
|
|
|
|
|
|
|
for(OrderProcessInfo processInfo:insertProcessInfo){ |
|
|
|
for (OrderProcessInfo processInfo : insertProcessInfo) { |
|
|
|
processInfo.setBzdh(ddtxx.getBZDH()); |
|
|
|
processInfo.setBzdh(ddtxx.getBZDH()); |
|
|
|
processInfo.setXtly(ddtxx.getXTLY()); |
|
|
|
processInfo.setXtly(ddtxx.getXTLY()); |
|
|
|
processInfo.setGsdm(ddtxx.getGSDM()); |
|
|
|
processInfo.setGsdm(ddtxx.getGSDM()); |
|
|
|
processInfo.setBhzt(ddtxx.getBHZT()); |
|
|
|
processInfo.setBhzt(ddtxx.getBHZT()); |
|
|
|
processInfo.setYgxm(ddtxx.getYGXM()); |
|
|
|
processInfo.setYgxm(ddtxx.getYGXM()); |
|
|
|
processInfo.setKppzh(ddtxx.getKPPZH()); |
|
|
|
processInfo.setKppzh(ddtxx.getKPPZH()); |
|
|
|
processInfo.setPzgzrq(DateUtil.parse(ddtxx.getPZGZRQ(),"yyyy-MM-dd")); |
|
|
|
processInfo.setPzgzrq(DateUtil.parse(ddtxx.getPZGZRQ(), "yyyy-MM-dd")); |
|
|
|
processInfo.setYzfp(ddtxx.getYZFP()); |
|
|
|
processInfo.setYzfp(ddtxx.getYZFP()); |
|
|
|
processInfo.setOriginDdh(ddtxx.getDDH()); |
|
|
|
processInfo.setOriginDdh(ddtxx.getDDH()); |
|
|
|
processInfo.setOriginOrderId(processInfo.getOrderInfoId()); |
|
|
|
processInfo.setOriginOrderId(processInfo.getOrderInfoId()); |
|
|
|
processInfo.setKb(insertOrderItem.get(0).get(0).getKb()); |
|
|
|
processInfo.setKb(insertOrderItem.get(0).get(0).getKb()); |
|
|
|
} |
|
|
|
} |
|
|
|
for(OrderItemInfo itemInfo:insertOrderItem.get(0)){ |
|
|
|
for (OrderItemInfo itemInfo : insertOrderItem.get(0)) { |
|
|
|
itemInfo.setPh(ddmxxx.get(0).getPH()); |
|
|
|
itemInfo.setPh(ddmxxx.get(0).getPH()); |
|
|
|
itemInfo.setKb(ddmxxx.get(0).getKB()); |
|
|
|
itemInfo.setKb(ddmxxx.get(0).getKB()); |
|
|
|
//TODO lfl 这两在哪赋值?
|
|
|
|
//TODO lfl 这两在哪赋值?
|
|
|
@ -871,21 +870,21 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
invoiceRemarkSet.setGsbm(insertProcessInfo.get(0).getGsdm()); |
|
|
|
invoiceRemarkSet.setGsbm(insertProcessInfo.get(0).getGsdm()); |
|
|
|
invoiceRemarkSet.setStatus(ConfigureConstant.STRING_1); |
|
|
|
invoiceRemarkSet.setStatus(ConfigureConstant.STRING_1); |
|
|
|
List<InvoiceRemarkSet> invoiceRemarkSets = invoiceRemarkSetService.queryRemarkSet(invoiceRemarkSet); |
|
|
|
List<InvoiceRemarkSet> invoiceRemarkSets = invoiceRemarkSetService.queryRemarkSet(invoiceRemarkSet); |
|
|
|
if(invoiceRemarkSets.size()>0){ |
|
|
|
if (invoiceRemarkSets.size() > 0) { |
|
|
|
InvoiceRemarkSet en = invoiceRemarkSets.get(0); |
|
|
|
InvoiceRemarkSet en = invoiceRemarkSets.get(0); |
|
|
|
log.info("{}结算单:{}查询到备注设置:{}",LOGGER_MSG,insertOrder.get(0).getDdh(),JsonUtils.getInstance().toJsonString(en)); |
|
|
|
log.info("{}结算单:{}查询到备注设置:{}", LOGGER_MSG, insertOrder.get(0).getDdh(), JsonUtils.getInstance().toJsonString(en)); |
|
|
|
String mbnr = en.getMbnr(); |
|
|
|
String mbnr = en.getMbnr(); |
|
|
|
List<String> mbnrList = Arrays.asList(mbnr.split("、")); |
|
|
|
List<String> mbnrList = Arrays.asList(mbnr.split("、")); |
|
|
|
for(int i =0;i<mbnrList.size();i++){ |
|
|
|
for (int i = 0; i < mbnrList.size(); i++) { |
|
|
|
String s = mbnrList.get(i); |
|
|
|
String s = mbnrList.get(i); |
|
|
|
if(OrderInfoEnum.INVOICE_REMARK_SET_BZDH.getValue().equals(s)){ |
|
|
|
if (OrderInfoEnum.INVOICE_REMARK_SET_BZDH.getValue().equals(s)) { |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz()+OrderInfoEnum.INVOICE_REMARK_SET_BZDH.getValue()+":"+insertProcessInfo.get(0).getBzdh()+(i==mbnrList.size()-1?"":",")); |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz() + OrderInfoEnum.INVOICE_REMARK_SET_BZDH.getValue() + ":" + insertProcessInfo.get(0).getBzdh() + (i == mbnrList.size() - 1 ? "" : ",")); |
|
|
|
} |
|
|
|
} |
|
|
|
if(OrderInfoEnum.INVOICE_REMARK_SET_JSDH.getValue().equals(s)){ |
|
|
|
if (OrderInfoEnum.INVOICE_REMARK_SET_JSDH.getValue().equals(s)) { |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz()+OrderInfoEnum.INVOICE_REMARK_SET_JSDH.getValue()+":"+insertProcessInfo.get(0).getDdh()+(i==mbnrList.size()-1?"":",")); |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz() + OrderInfoEnum.INVOICE_REMARK_SET_JSDH.getValue() + ":" + insertProcessInfo.get(0).getDdh() + (i == mbnrList.size() - 1 ? "" : ",")); |
|
|
|
} |
|
|
|
} |
|
|
|
if(OrderInfoEnum.INVOICE_REMARK_SET_KB.getValue().equals(s)){ |
|
|
|
if (OrderInfoEnum.INVOICE_REMARK_SET_KB.getValue().equals(s)) { |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz()+OrderInfoEnum.INVOICE_REMARK_SET_KB.getValue()+":"+insertProcessInfo.get(0).getKb()+(i==mbnrList.size()-1?"":",")); |
|
|
|
insertOrder.get(0).setBz(insertOrder.get(0).getBz() + OrderInfoEnum.INVOICE_REMARK_SET_KB.getValue() + ":" + insertProcessInfo.get(0).getKb() + (i == mbnrList.size() - 1 ? "" : ",")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -905,7 +904,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
|
//如果为调用税控版本的方格,需要调用税控接口,如果为订单的需要发送指令
|
|
|
|
//如果为调用税控版本的方格,需要调用税控接口,如果为订单的需要发送指令
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,nsrsbh)) { |
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, nsrsbh)) { |
|
|
|
|
|
|
|
|
|
|
|
//批量存放redis队列,用于发送mqtt消息
|
|
|
|
//批量存放redis队列,用于发送mqtt消息
|
|
|
|
if (insertBatchItem.size() > 0) { |
|
|
|
if (insertBatchItem.size() > 0) { |
|
|
@ -918,7 +917,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
RegistrationCode registrationCode = JsonUtils.getInstance().parseObject(registCodeByRedis, RegistrationCode.class); |
|
|
|
RegistrationCode registrationCode = JsonUtils.getInstance().parseObject(registCodeByRedis, RegistrationCode.class); |
|
|
|
|
|
|
|
|
|
|
|
//存放开票信息到redis队列
|
|
|
|
//存放开票信息到redis队列
|
|
|
|
fangGeService.saveMqttToRedis(nsrsbh, registrationCode.getJqbh(), OrderInfoEnum.FANGGE_INTERFACE_TYPE_1.getKey(), batchRequestItem.getFpqqlsh(),false); |
|
|
|
fangGeService.saveMqttToRedis(nsrsbh, registrationCode.getJqbh(), OrderInfoEnum.FANGGE_INTERFACE_TYPE_1.getKey(), batchRequestItem.getFpqqlsh(), false); |
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(batchRequestItem.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", registrationCode.getJqbh(), registrationCode.getJqbh(), registrationCode.getJqbh(), shList); |
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(batchRequestItem.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", registrationCode.getJqbh(), registrationCode.getJqbh(), registrationCode.getJqbh(), shList); |
|
|
|
if (isSuccess) { |
|
|
|
if (isSuccess) { |
|
|
@ -933,7 +932,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
for (FpkjMqData fpkjMqData : fpkjMqDataList) { |
|
|
|
for (FpkjMqData fpkjMqData : fpkjMqDataList) { |
|
|
|
String jsonString = JsonUtils.getInstance().toJsonString(fpkjMqData); |
|
|
|
String jsonString = JsonUtils.getInstance().toJsonString(fpkjMqData); |
|
|
|
log.debug("{}放入mq的数据:{}", LOGGER_MSG, jsonString); |
|
|
|
log.debug("{}放入mq的数据:{}", LOGGER_MSG, jsonString); |
|
|
|
openInvoiceService.openAnInvoice(jsonString, fpkjMqData.getEntId(), fpkjMqData.getNsrsbh(),fpkjMqData.getCreateTime(), fpkjMqData.getFpqqlsh()); |
|
|
|
openInvoiceService.openAnInvoice(jsonString, fpkjMqData.getEntId(), fpkjMqData.getNsrsbh(), fpkjMqData.getCreateTime(), fpkjMqData.getFpqqlsh()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(updatePchList)) { |
|
|
|
if (ObjectUtil.isNotEmpty(updatePchList)) { |
|
|
|
for (OrderProcessInfo orderProcessInfo : updatePchList) { |
|
|
|
for (OrderProcessInfo orderProcessInfo : updatePchList) { |
|
|
@ -945,13 +944,13 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
ddqqlshKeyList.forEach(ddqqlshKey -> redisService.del(ddqqlshKey)); |
|
|
|
ddqqlshKeyList.forEach(ddqqlshKey -> redisService.del(ddqqlshKey)); |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e.getMessage()); |
|
|
|
log.error("{}开票接口接收数据异常:{}", LOGGER_MSG, e.getMessage()); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(e.getCode(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
ddqqlshKeyList.forEach(ddqqlshKey -> redisService.del(ddqqlshKey)); |
|
|
|
ddqqlshKeyList.forEach(ddqqlshKey -> redisService.del(ddqqlshKey)); |
|
|
|
log.error("{}开票接口保存数据异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}开票接口保存数据异常:{}", LOGGER_MSG, e); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(e.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
@ -967,16 +966,17 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 接口开票请求参数非空校验 |
|
|
|
* 接口开票请求参数非空校验 |
|
|
|
|
|
|
|
* |
|
|
|
* @param ddpcxxReq 请求参数 |
|
|
|
* @param ddpcxxReq 请求参数 |
|
|
|
* @return 非空校验结果 |
|
|
|
* @return 非空校验结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private DdpcxxRspBO checkRequestParamNonNull(DdpcxxReqBO ddpcxxReq){ |
|
|
|
private DdpcxxRspBO checkRequestParamNonNull(DdpcxxReqBO ddpcxxReq) { |
|
|
|
DdpcxxRspBO ddpcxxRsp = new DdpcxxRspBO(); |
|
|
|
DdpcxxRspBO ddpcxxRsp = new DdpcxxRspBO(); |
|
|
|
ddpcxxRsp.setZTDM( OrderInfoContentEnum.SUCCESS.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.SUCCESS.getKey()); |
|
|
|
ddpcxxRsp.setZTXX( OrderInfoContentEnum.SUCCESS.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.SUCCESS.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
if(Objects.isNull(ddpcxxReq) |
|
|
|
if (Objects.isNull(ddpcxxReq) |
|
|
|
|| Objects.isNull(ddpcxxReq.getDDPCXX())){ |
|
|
|
|| Objects.isNull(ddpcxxReq.getDDPCXX())) { |
|
|
|
log.error("{}批量订单请求批次数据为空", LOGGER_MSG); |
|
|
|
log.error("{}批量订单请求批次数据为空", LOGGER_MSG); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202008.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202008.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202008.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202008.getMessage()); |
|
|
@ -984,31 +984,31 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
String ddqqpch = ddpcxxReq.getDDPCXX().getDDQQPCH(); |
|
|
|
String ddqqpch = ddpcxxReq.getDDPCXX().getDDQQPCH(); |
|
|
|
ddpcxxRsp.setDDQQPCH(ddqqpch); |
|
|
|
ddpcxxRsp.setDDQQPCH(ddqqpch); |
|
|
|
if(StringUtils.isBlank(ddqqpch)){ |
|
|
|
if (StringUtils.isBlank(ddqqpch)) { |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中订单请求批次号不能为空"); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中订单请求批次号不能为空"); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
String nsrsbh = ddpcxxReq.getDDPCXX().getNSRSBH(); |
|
|
|
String nsrsbh = ddpcxxReq.getDDPCXX().getNSRSBH(); |
|
|
|
if(StringUtils.isBlank(nsrsbh)){ |
|
|
|
if (StringUtils.isBlank(nsrsbh)) { |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中纳税人识别号不能为空"); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中纳税人识别号不能为空"); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
String fplxdm = ddpcxxReq.getDDPCXX().getFPLXDM(); |
|
|
|
String fplxdm = ddpcxxReq.getDDPCXX().getFPLXDM(); |
|
|
|
if(StringUtils.isBlank(fplxdm)){ |
|
|
|
if (StringUtils.isBlank(fplxdm)) { |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.RECEIVE_FAILD.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中发票类型代码不能为空"); |
|
|
|
ddpcxxRsp.setZTXX("批次信息中发票类型代码不能为空"); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
if (CommonUtils.checkFpzldm(fplxdm)) { |
|
|
|
if (CommonUtils.checkFpzldm(fplxdm)) { |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.CHECK_ISS7PRI_107013.getKey(),6,"0")); |
|
|
|
ddpcxxRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.CHECK_ISS7PRI_107013.getKey(), 6, "0")); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_107013.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_107013.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<DdzxxBO> ddzxxBOList = ddpcxxReq.getDDZXX(); |
|
|
|
List<DdzxxBO> ddzxxBOList = ddpcxxReq.getDDZXX(); |
|
|
|
if(CollectionUtil.isEmpty(ddzxxBOList)){ |
|
|
|
if (CollectionUtil.isEmpty(ddzxxBOList)) { |
|
|
|
log.error("{}批量订单请求数据为空", LOGGER_MSG); |
|
|
|
log.error("{}批量订单请求数据为空", LOGGER_MSG); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202004.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202004.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202004.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202004.getMessage()); |
|
|
@ -1016,24 +1016,24 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
String fpzldm = CommonUtils.transFpzldm(fplxdm); |
|
|
|
String fpzldm = CommonUtils.transFpzldm(fplxdm); |
|
|
|
for (DdzxxBO ddzxxBO : ddzxxBOList) { |
|
|
|
for (DdzxxBO ddzxxBO : ddzxxBOList) { |
|
|
|
if(Objects.isNull(ddzxxBO.getDDTXX())){ |
|
|
|
if (Objects.isNull(ddzxxBO.getDDTXX())) { |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202004.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202004.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202004.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202004.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
if(CollectionUtil.isEmpty(ddzxxBO.getDDMXXX())){ |
|
|
|
if (CollectionUtil.isEmpty(ddzxxBO.getDDMXXX())) { |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202009.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202009.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202009.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202009.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
if(OrderInfoEnum.ORDER_INVOICE_TYPE_12.getKey().equals(fpzldm) |
|
|
|
if (OrderInfoEnum.ORDER_INVOICE_TYPE_12.getKey().equals(fpzldm) |
|
|
|
&& Objects.isNull(ddzxxBO.getJDCTXX())){ |
|
|
|
&& Objects.isNull(ddzxxBO.getJDCTXX())) { |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202011.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202011.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202011.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202011.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
|
} |
|
|
|
} |
|
|
|
if(OrderInfoEnum.ORDER_INVOICE_TYPE_42.getKey().equals(fpzldm) |
|
|
|
if (OrderInfoEnum.ORDER_INVOICE_TYPE_42.getKey().equals(fpzldm) |
|
|
|
&& Objects.isNull(ddzxxBO.getESCTXX())){ |
|
|
|
&& Objects.isNull(ddzxxBO.getESCTXX())) { |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202012.getKey()); |
|
|
|
ddpcxxRsp.setZTDM(OrderInfoContentEnum.HANDLE_ISSUE_202012.getKey()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202012.getMessage()); |
|
|
|
ddpcxxRsp.setZTXX(OrderInfoContentEnum.HANDLE_ISSUE_202012.getMessage()); |
|
|
|
return ddpcxxRsp; |
|
|
|
return ddpcxxRsp; |
|
|
@ -1057,9 +1057,10 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 补全订单批次信息 |
|
|
|
* 补全订单批次信息 |
|
|
|
|
|
|
|
* |
|
|
|
* @param orderBatchRequest 订单批次信息 |
|
|
|
* @param orderBatchRequest 订单批次信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void completeOrderBatchRequest(OrderBatchRequest orderBatchRequest){ |
|
|
|
private void completeOrderBatchRequest(OrderBatchRequest orderBatchRequest) { |
|
|
|
//如果开票方式为空,设置开票方式为自动开票
|
|
|
|
//如果开票方式为空,设置开票方式为自动开票
|
|
|
|
if (StringUtils.isBlank(orderBatchRequest.getKpfs())) { |
|
|
|
if (StringUtils.isBlank(orderBatchRequest.getKpfs())) { |
|
|
|
orderBatchRequest.setKpfs(OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey()); |
|
|
|
orderBatchRequest.setKpfs(OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey()); |
|
|
@ -1072,9 +1073,10 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 补全订单业务数据 |
|
|
|
* 补全订单业务数据 |
|
|
|
|
|
|
|
* |
|
|
|
* @param commonOrderInfo 订单信息 |
|
|
|
* @param commonOrderInfo 订单信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void completeCommonOrderInfo(OrderBatchRequest orderBatchRequest, CommonOrderInfo commonOrderInfo, TaxEquipmentInfo taxEquipmentInfo) throws OrderReceiveException{ |
|
|
|
private void completeCommonOrderInfo(OrderBatchRequest orderBatchRequest, CommonOrderInfo commonOrderInfo, TaxEquipmentInfo taxEquipmentInfo) throws OrderReceiveException { |
|
|
|
String terminalCode = taxEquipmentInfo.getSksbCode(); |
|
|
|
String terminalCode = taxEquipmentInfo.getSksbCode(); |
|
|
|
String fpzldm = CommonUtils.transFpzldm(orderBatchRequest.getFpzldm()); |
|
|
|
String fpzldm = CommonUtils.transFpzldm(orderBatchRequest.getFpzldm()); |
|
|
|
String nsrsbh = orderBatchRequest.getXhfNsrsbh(); |
|
|
|
String nsrsbh = orderBatchRequest.getXhfNsrsbh(); |
|
|
@ -1092,9 +1094,9 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
commonOrderInfo.getOrderInfo().setBbmBbh(baseServiceConfig.configBmbbbh()); |
|
|
|
commonOrderInfo.getOrderInfo().setBbmBbh(baseServiceConfig.configBmbbbh()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!CommonUtils.judgeIsQdfp("", fpzldm)){ |
|
|
|
if (!CommonUtils.judgeIsQdfp("", fpzldm)) { |
|
|
|
//如果税率开具理由为空,默认为3 (全电发票不做处理)
|
|
|
|
//如果税率开具理由为空,默认为3 (全电发票不做处理)
|
|
|
|
taxSpecialPolicyUtil.setDefaultValueToSlkjly(commonOrderInfo,terminalCode); |
|
|
|
taxSpecialPolicyUtil.setDefaultValueToSlkjly(commonOrderInfo, terminalCode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//判断是否需要补全销方信息
|
|
|
|
//判断是否需要补全销方信息
|
|
|
@ -1106,22 +1108,22 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
PageKpzzglRsp pageKpzzglRsp = queryKpzzgl(pageKpzzglReq); |
|
|
|
PageKpzzglRsp pageKpzzglRsp = queryKpzzgl(pageKpzzglReq); |
|
|
|
|
|
|
|
|
|
|
|
boolean isNUll = true; |
|
|
|
boolean isNUll = true; |
|
|
|
if(ObjectUtil.isNotNull(pageKpzzglRsp) && ConfigureConstant.STRING_0000.equals(pageKpzzglRsp.getZTDM())){ |
|
|
|
if (ObjectUtil.isNotNull(pageKpzzglRsp) && ConfigureConstant.STRING_0000.equals(pageKpzzglRsp.getZTDM())) { |
|
|
|
//选出为默认项的销方信息
|
|
|
|
//选出为默认项的销方信息
|
|
|
|
List<PageXfxx> pageXfxxList = pageKpzzglRsp.getPageXfxxList(); |
|
|
|
List<PageXfxx> pageXfxxList = pageKpzzglRsp.getPageXfxxList(); |
|
|
|
if(CollectionUtil.isNotEmpty(pageXfxxList)){ |
|
|
|
if (CollectionUtil.isNotEmpty(pageXfxxList)) { |
|
|
|
PageXfxx pageXfxx1 = pageXfxxList.stream() |
|
|
|
PageXfxx pageXfxx1 = pageXfxxList.stream() |
|
|
|
.filter(pageXfxx -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(pageXfxx.getDefaultItem())) |
|
|
|
.filter(pageXfxx -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(pageXfxx.getDefaultItem())) |
|
|
|
.findFirst() |
|
|
|
.findFirst() |
|
|
|
.orElse(null); |
|
|
|
.orElse(null); |
|
|
|
if(Objects.nonNull(pageXfxx1)){ |
|
|
|
if (Objects.nonNull(pageXfxx1)) { |
|
|
|
BeanTransitionUtils.completeOrderSellerInfo(commonOrderInfo, pageXfxx1); |
|
|
|
BeanTransitionUtils.completeOrderSellerInfo(commonOrderInfo, pageXfxx1); |
|
|
|
isNUll = false; |
|
|
|
isNUll = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(isNUll){ |
|
|
|
if (isNUll) { |
|
|
|
DeptEntity sysDeptEntity = userInfoService.querySysDeptEntityFromUrl(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), commonOrderInfo.getOrderInfo().getXhfMc(), taxEquipmentInfo.getEnterpriseNumbers()); |
|
|
|
DeptEntity sysDeptEntity = userInfoService.querySysDeptEntityFromUrl(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), commonOrderInfo.getOrderInfo().getXhfMc(), taxEquipmentInfo.getEnterpriseNumbers()); |
|
|
|
if (ObjectUtil.isNotNull(sysDeptEntity)) { |
|
|
|
if (ObjectUtil.isNotNull(sysDeptEntity)) { |
|
|
|
BeanTransitionUtils.transitionOrderSellerInfo(commonOrderInfo, sysDeptEntity); |
|
|
|
BeanTransitionUtils.transitionOrderSellerInfo(commonOrderInfo, sysDeptEntity); |
|
|
@ -1129,7 +1131,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(isNUll){ |
|
|
|
if (isNUll) { |
|
|
|
log.error("{}补全企业信息异常,获取到的企业信息为空", LOGGER_MSG); |
|
|
|
log.error("{}补全企业信息异常,获取到的企业信息为空", LOGGER_MSG); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010008_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010008_V3); |
|
|
|
} |
|
|
|
} |
|
|
@ -1157,10 +1159,10 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
//补全商品信息
|
|
|
|
//补全商品信息
|
|
|
|
commonInterfaceService.dealOrderItem(commonOrderInfo.getOrderItemInfo(), nsrsbh, commonOrderInfo.getOrderInfo().getQdBz(), |
|
|
|
commonInterfaceService.dealOrderItem(commonOrderInfo.getOrderItemInfo(), nsrsbh, commonOrderInfo.getOrderInfo().getQdBz(), |
|
|
|
commonOrderInfo.getOrderInfo().getFpzlDm(), terminalCode, ConfigureConstant.STRING_1); |
|
|
|
commonOrderInfo.getOrderInfo().getFpzlDm(), terminalCode, ConfigureConstant.STRING_1, commonOrderInfo.getEntId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PageKpzzglRsp queryKpzzgl(PageKpzzglReq pageKpzzglReq){ |
|
|
|
public PageKpzzglRsp queryKpzzgl(PageKpzzglReq pageKpzzglReq) { |
|
|
|
GroupManagementQuery groupManagementQuery = new GroupManagementQuery(); |
|
|
|
GroupManagementQuery groupManagementQuery = new GroupManagementQuery(); |
|
|
|
groupManagementQuery.setGroupId(pageKpzzglReq.getGroupId()); |
|
|
|
groupManagementQuery.setGroupId(pageKpzzglReq.getGroupId()); |
|
|
|
groupManagementQuery.setXhfNsrsbh(pageKpzzglReq.getXhfNsrsbh()); |
|
|
|
groupManagementQuery.setXhfNsrsbh(pageKpzzglReq.getXhfNsrsbh()); |
|
|
@ -1192,14 +1194,15 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 价税分离后订单信息补全处理 |
|
|
|
* 价税分离后订单信息补全处理 |
|
|
|
* @param orderInfo 订单信息 |
|
|
|
* |
|
|
|
* @param fpzldm 发票种类代码 |
|
|
|
* @param orderInfo 订单信息 |
|
|
|
* @param kpjh 开票机号 |
|
|
|
* @param fpzldm 发票种类代码 |
|
|
|
* @param sldid 受理点id |
|
|
|
* @param kpjh 开票机号 |
|
|
|
* @param kce 扣除额 |
|
|
|
* @param sldid 受理点id |
|
|
|
|
|
|
|
* @param kce 扣除额 |
|
|
|
* @param terminalCode 税控设备代码 |
|
|
|
* @param terminalCode 税控设备代码 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void completeOrderInfo(OrderInfo orderInfo, String fpzldm, String kpjh, String sldid, String kce, String terminalCode){ |
|
|
|
private void completeOrderInfo(OrderInfo orderInfo, String fpzldm, String kpjh, String sldid, String kce, String terminalCode) { |
|
|
|
//补全对象转换工具类中不能补充的数据
|
|
|
|
//补全对象转换工具类中不能补充的数据
|
|
|
|
orderInfo.setFpzlDm(fpzldm); |
|
|
|
orderInfo.setFpzlDm(fpzldm); |
|
|
|
orderInfo.setKpjh(kpjh); |
|
|
|
orderInfo.setKpjh(kpjh); |
|
|
@ -1219,14 +1222,14 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 判断该订单信息是否开过票 |
|
|
|
* 判断该订单信息是否开过票 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param ddqqpch 订单请求批次号 |
|
|
|
* @param ddqqpch 订单请求批次号 |
|
|
|
* @param ddqqlsh 订单请求流水号 |
|
|
|
* @param ddqqlsh 订单请求流水号 |
|
|
|
* @param commonOrderInfo 订单信息 |
|
|
|
* @param commonOrderInfo 订单信息 |
|
|
|
* @return true:开票中和开票失败; false: 未开票 |
|
|
|
* @return true:开票中和开票失败; false: 未开票 |
|
|
|
* @throws OrderReceiveException 自定义业务异常 |
|
|
|
* @throws OrderReceiveException 自定义业务异常 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isBillingSuccess(String ddqqpch, String ddqqlsh, CommonOrderInfo commonOrderInfo, |
|
|
|
private boolean isBillingSuccess(String ddqqpch, String ddqqlsh, CommonOrderInfo commonOrderInfo, |
|
|
|
OrderProcessInfo selectOrderProcessInfo) throws OrderReceiveException{ |
|
|
|
OrderProcessInfo selectOrderProcessInfo) throws OrderReceiveException { |
|
|
|
//是否开票成功标识,true表示开票中或开票失败
|
|
|
|
//是否开票成功标识,true表示开票中或开票失败
|
|
|
|
boolean flag = false; |
|
|
|
boolean flag = false; |
|
|
|
//校验请求流水号是否重复
|
|
|
|
//校验请求流水号是否重复
|
|
|
@ -1244,30 +1247,30 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010002_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010002_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(selectOrderProcessInfo != null){ |
|
|
|
if (selectOrderProcessInfo != null) { |
|
|
|
//当前流水号查询开票数据不为空时,验证请求数据是否与数据库一致,如果不一致,返回异常
|
|
|
|
//当前流水号查询开票数据不为空时,验证请求数据是否与数据库一致,如果不一致,返回异常
|
|
|
|
OrderInfo orderInfo1 = commonOrderInfo.getOrderInfo(); |
|
|
|
OrderInfo orderInfo1 = commonOrderInfo.getOrderInfo(); |
|
|
|
if(!selectOrderProcessInfo.getFpzlDm().equals(orderInfo1.getFpzlDm())){ |
|
|
|
if (!selectOrderProcessInfo.getFpzlDm().equals(orderInfo1.getFpzlDm())) { |
|
|
|
log.error("{}发票开具请求多次,请求发票种类代码不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求发票种类代码不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_A_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_A_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!selectOrderProcessInfo.getGhfMc().equals(orderInfo1.getGhfMc())){ |
|
|
|
if (!selectOrderProcessInfo.getGhfMc().equals(orderInfo1.getGhfMc())) { |
|
|
|
log.error("{}发票开具请求多次,请求购买方名称不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求购买方名称不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_B_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_B_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!selectOrderProcessInfo.getGhfNsrsbh().equals(orderInfo1.getGhfNsrsbh())){ |
|
|
|
if (!selectOrderProcessInfo.getGhfNsrsbh().equals(orderInfo1.getGhfNsrsbh())) { |
|
|
|
log.error("{}发票开具请求多次,请求购买方纳税人识别号不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求购买方纳税人识别号不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_C_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_C_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!selectOrderProcessInfo.getXhfNsrsbh().equals(orderInfo1.getXhfNsrsbh())){ |
|
|
|
if (!selectOrderProcessInfo.getXhfNsrsbh().equals(orderInfo1.getXhfNsrsbh())) { |
|
|
|
log.error("{}发票开具请求多次,请求销货方纳税人识别号不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求销货方纳税人识别号不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_D_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_D_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!selectOrderProcessInfo.getXhfMc().equals(orderInfo1.getXhfMc())){ |
|
|
|
if (!selectOrderProcessInfo.getXhfMc().equals(orderInfo1.getXhfMc())) { |
|
|
|
log.error("{}发票开具请求多次,请求销货方名称不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求销货方名称不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_E_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_E_V3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!selectOrderProcessInfo.getKphjje().equals(orderInfo1.getKphjje())){ |
|
|
|
if (!selectOrderProcessInfo.getKphjje().equals(orderInfo1.getKphjje())) { |
|
|
|
log.error("{}发票开具请求多次,请求价税合计不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
log.error("{}发票开具请求多次,请求价税合计不一致!批次号为:{},流水号为:{}", LOGGER_MSG, ddqqpch, ddqqlsh); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_F_V3); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010017_F_V3); |
|
|
|
} |
|
|
|
} |
|
|
@ -1298,7 +1301,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 异常开票相当于订单编辑后开票,新增方法合并订单编辑和存放开票队列. |
|
|
|
* 异常开票相当于订单编辑后开票,新增方法合并订单编辑和存放开票队列. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
log.info("{}异常重开流程,请求数据为:{}", LOGGER_MSG,JsonUtils.getInstance().toJsonString(fpkjMqDataList)); |
|
|
|
log.info("{}异常重开流程,请求数据为:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(fpkjMqDataList)); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 此时数据不能变动流水号,如果开票失败,需要调用底层再次请求 |
|
|
|
* 此时数据不能变动流水号,如果开票失败,需要调用底层再次请求 |
|
|
@ -1311,7 +1314,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
String registCodeByRedis = ""; |
|
|
|
String registCodeByRedis = ""; |
|
|
|
|
|
|
|
|
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,orderInvoiceInfo.getXhfNsrsbh())) { |
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, orderInvoiceInfo.getXhfNsrsbh())) { |
|
|
|
log.info("终端号为{}时,消息放入redis中", terminalCode); |
|
|
|
log.info("终端号为{}时,消息放入redis中", terminalCode); |
|
|
|
registCodeByRedis = fangGeService.getRegisterCodeByRedis(orderInvoiceInfo.getXhfNsrsbh(), orderInvoiceInfo.getSld()); |
|
|
|
registCodeByRedis = fangGeService.getRegisterCodeByRedis(orderInvoiceInfo.getXhfNsrsbh(), orderInvoiceInfo.getSld()); |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
|
if (OrderInfoEnum.ORDER_REQUEST_TYPE_0.getKey().equals(kpfs) || OrderInfoEnum.ORDER_REQUEST_TYPE_3.getKey().equals(kpfs)) { |
|
|
@ -1332,7 +1335,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
* 存放开票信息到redis队列 |
|
|
|
* 存放开票信息到redis队列 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
fangGeService.saveMqttToRedis(orderInvoiceInfo.getXhfNsrsbh(), registrationCode.getJqbh(), OrderInfoEnum.FANGGE_INTERFACE_TYPE_1.getKey(), orderInvoiceInfo.getFpqqlsh(),false); |
|
|
|
fangGeService.saveMqttToRedis(orderInvoiceInfo.getXhfNsrsbh(), registrationCode.getJqbh(), OrderInfoEnum.FANGGE_INTERFACE_TYPE_1.getKey(), orderInvoiceInfo.getFpqqlsh(), false); |
|
|
|
|
|
|
|
|
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(orderInvoiceInfo.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", registrationCode.getJqbh(), registrationCode.getJqbh(), registrationCode.getJqbh(), shList); |
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(orderInvoiceInfo.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", registrationCode.getJqbh(), registrationCode.getJqbh(), registrationCode.getJqbh(), shList); |
|
|
@ -1342,7 +1345,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 数据放入开票队列 |
|
|
|
* 数据放入开票队列 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -1357,7 +1360,7 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt |
|
|
|
fpkjMqDataList.add(fpkjMqData); |
|
|
|
fpkjMqDataList.add(fpkjMqData); |
|
|
|
|
|
|
|
|
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
//存放redis成功,修改开票状态为开票中
|
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(orderInvoiceInfo.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", "","","", shList); |
|
|
|
boolean isSuccess = orderProcessService.updateKpzt(orderInvoiceInfo.getFpqqlsh(), OrderInfoEnum.ORDER_STATUS_4.getKey(), OrderInfoEnum.INVOICE_STATUS_1.getKey(), "", "", "", "", shList); |
|
|
|
if (isSuccess) { |
|
|
|
if (isSuccess) { |
|
|
|
log.info("===========》开票中状态发票数据更新成功,流水号为:[{}]", orderInvoiceInfo.getFpqqlsh()); |
|
|
|
log.info("===========》开票中状态发票数据更新成功,流水号为:[{}]", orderInvoiceInfo.getFpqqlsh()); |
|
|
|
} |
|
|
|
} |
|
|
|