|
|
|
@ -465,7 +465,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
String error=String.format("税号:%s,组装请求报文为空,不进行推送数据",fpTsMqData.getNsrsbh()); |
|
|
|
|
log.warn(error); |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),error,error,pushInfo,fpTsMqData.getPushType()); |
|
|
|
|
continue; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
//推送影像系统
|
|
|
|
@ -1561,30 +1561,19 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
String version = pushInfo.getVersionIdent(); |
|
|
|
|
String pushWjl = pushInfo.getPushWjl(); |
|
|
|
|
|
|
|
|
|
List<OrderProcessInfo> orderProcessInfoList = new ArrayList<>(); |
|
|
|
|
OrderProcessInfo orderProcessInfo = orderProcessService.queryOrderProcessInfoByFpqqlsh(fpTsMqData.getFpqqlsh(), shList); |
|
|
|
|
log.info("{}推送接口orderProcessInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderProcessInfo)); |
|
|
|
|
|
|
|
|
|
OrderInfo orderInfo = orderInfoService.selectOrderInfoByOrderId(orderProcessInfo.getOrderInfoId(), shList); |
|
|
|
|
log.info("{}推送接口orderInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderInfo)); |
|
|
|
|
|
|
|
|
|
List<OrderItemInfo> orderItemInfos = orderItemInfoService.selectOrderItemInfoByOrderId(orderProcessInfo.getOrderInfoId(), shList); |
|
|
|
|
List<DdmxxxBO> ddmxxxList = BeanTransitionUtils.transitionOrderInvoiceItemV3(orderItemInfos); |
|
|
|
|
List<OrderInvoiceItemBO> orderInvoiceItems = BeanTransitionUtils.transitionOrderInvoiceItem(orderItemInfos); |
|
|
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo1 = new OrderInvoiceInfo(); |
|
|
|
|
orderInvoiceInfo1.setFpqqlsh(orderProcessInfo.getFpqqlsh()); |
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfo(orderInvoiceInfo1, shList); |
|
|
|
|
log.info("{}推送接口orderInvoiceInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderInvoiceInfo)); |
|
|
|
|
|
|
|
|
|
List<OrderProcessInfo> orderProcessInfoRelevantList = orderProcessService.findTopParentList(orderProcessInfo, shList); |
|
|
|
|
List<DdkzxxBO> orderExtensionInfos = BeanTransitionUtils.transitionOrderExtensionInfos(orderProcessInfoRelevantList); |
|
|
|
|
log.info("{}推送接口orderExtensionInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderExtensionInfos)); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询税控设备信息 |
|
|
|
|
*/ |
|
|
|
|
String terminalCode = orderInvoiceInfo.getSksbdm(); |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SNYXX.getKey().equals(orderProcessInfo.getXtly())){ |
|
|
|
|
List<OrderProcessInfo> orderProcessInfos = orderProcessService.queryOrderProcessInfoByBzdh(orderProcessInfo.getBzdh(), shList); |
|
|
|
|
int count = (int)orderProcessInfos.stream().filter(t -> OrderInfoEnum.ORDER_STATUS_5.getKey().equals(t.getDdzt())).count(); |
|
|
|
|
if(orderProcessInfos.size() != count){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
orderProcessInfoList.addAll(orderProcessInfos); |
|
|
|
|
}else{ |
|
|
|
|
orderProcessInfoList.add(orderProcessInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断推送版本
|
|
|
|
|
if (ConfigurerInfo.INTERFACE_VERSION_V5.equals(version) |
|
|
|
@ -1592,9 +1581,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
|
|
|
|
|
List<DdfpzxxV5> ddfpzxxV5s = new ArrayList<>(); |
|
|
|
|
try { |
|
|
|
|
DdfpzxxV5 interfaceOrderV5 = interfaceServiceV5.getInterfaceOrderV5(orderProcessInfo, shList, ConfigureConstant.STRING_0); |
|
|
|
|
|
|
|
|
|
ddfpzxxV5s.add(interfaceOrderV5); |
|
|
|
|
for (OrderProcessInfo processInfo : orderProcessInfoList) { |
|
|
|
|
DdfpzxxV5 interfaceOrderV5 = interfaceServiceV5.getInterfaceOrderV5(processInfo, shList, ConfigureConstant.STRING_0); |
|
|
|
|
ddfpzxxV5s.add(interfaceOrderV5); |
|
|
|
|
} |
|
|
|
|
} catch (InterfaceException e) { |
|
|
|
|
|
|
|
|
|
throw new OrderReceiveException(e.getCode(), e.getMessage()); |
|
|
|
@ -1604,6 +1594,25 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
content = JsonUtils.getInstance().toJsonString(ddfpzxxV5s); |
|
|
|
|
|
|
|
|
|
} else if (ConfigurerInfo.INTERFACE_VERSION_V4.equals(version) || ConfigurerInfo.INTERFACE_VERSION_V3.equals(version)) { |
|
|
|
|
OrderInfo orderInfo = orderInfoService.selectOrderInfoByOrderId(orderProcessInfo.getOrderInfoId(), shList); |
|
|
|
|
log.info("{}推送接口orderInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderInfo)); |
|
|
|
|
|
|
|
|
|
List<OrderItemInfo> orderItemInfos = orderItemInfoService.selectOrderItemInfoByOrderId(orderProcessInfo.getOrderInfoId(), shList); |
|
|
|
|
List<DdmxxxBO> ddmxxxList = BeanTransitionUtils.transitionOrderInvoiceItemV3(orderItemInfos); |
|
|
|
|
List<OrderInvoiceItemBO> orderInvoiceItems = BeanTransitionUtils.transitionOrderInvoiceItem(orderItemInfos); |
|
|
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo1 = new OrderInvoiceInfo(); |
|
|
|
|
orderInvoiceInfo1.setFpqqlsh(orderProcessInfo.getFpqqlsh()); |
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfo(orderInvoiceInfo1, shList); |
|
|
|
|
log.info("{}推送接口orderInvoiceInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderInvoiceInfo)); |
|
|
|
|
|
|
|
|
|
List<OrderProcessInfo> orderProcessInfoRelevantList = orderProcessService.findTopParentList(orderProcessInfo, shList); |
|
|
|
|
List<DdkzxxBO> orderExtensionInfos = BeanTransitionUtils.transitionOrderExtensionInfos(orderProcessInfoRelevantList); |
|
|
|
|
log.info("{}推送接口orderExtensionInfo数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(orderExtensionInfos)); |
|
|
|
|
/** |
|
|
|
|
* 查询税控设备信息 |
|
|
|
|
*/ |
|
|
|
|
String terminalCode = orderInvoiceInfo.getSksbdm(); |
|
|
|
|
//新版本请求参数组装response
|
|
|
|
|
DdfpcxRspBO ddfpcxRsp = new DdfpcxRspBO(); |
|
|
|
|
//新版本组装数据方式
|
|
|
|
@ -1800,42 +1809,42 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//旧版本请求参数组装response
|
|
|
|
|
PushReqBO response = new PushReqBO(); |
|
|
|
|
//旧版本组装方式
|
|
|
|
|
List<CommonOrderInvocieBO> commonOrderInvocies = new ArrayList<>(); |
|
|
|
|
CommonOrderInvocieBO commonOrderInvocie = new CommonOrderInvocieBO(); |
|
|
|
|
log.info("==>推送旧的版本接口"); |
|
|
|
|
OrderInvoiceHeadBO orderInvoiceHead = BeanTransitionUtils.transitionOrderInvoiceHead(orderInfo, orderInvoiceInfo); |
|
|
|
|
boolean fpdmhmDp = (OrderInfoEnum.ORDER_INVOICE_TYPE_51.getKey().equals(orderInvoiceInfo.getFpzlDm()) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_01.getKey().equals(orderInvoiceInfo.getFpzlDm()) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_02.getKey().equals(orderInvoiceInfo.getFpzlDm()) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_52.getKey().equals(orderInvoiceInfo.getFpzlDm())) |
|
|
|
|
&& StringUtils.isNotEmpty(orderInvoiceInfo.getFphm()); |
|
|
|
|
if (fpdmhmDp) { |
|
|
|
|
/** |
|
|
|
|
* 获取PDF判断 |
|
|
|
|
*/ |
|
|
|
|
List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode,""); |
|
|
|
|
if (ObjectUtil.isNotEmpty(fileDownLoadList)) { |
|
|
|
|
orderInvoiceHead.setPDF_FILE(fileDownLoadList.get(0).getFileContent()); |
|
|
|
|
} else { |
|
|
|
|
orderInvoiceHead.setPDF_FILE(""); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
orderInvoiceHead.setPDF_FILE(""); |
|
|
|
|
} |
|
|
|
|
// PushReqBO response = new PushReqBO();
|
|
|
|
|
// //旧版本组装方式
|
|
|
|
|
// List<CommonOrderInvocieBO> commonOrderInvocies = new ArrayList<>();
|
|
|
|
|
// CommonOrderInvocieBO commonOrderInvocie = new CommonOrderInvocieBO();
|
|
|
|
|
// log.info("==>推送旧的版本接口");
|
|
|
|
|
// OrderInvoiceHeadBO orderInvoiceHead = BeanTransitionUtils.transitionOrderInvoiceHead(orderInfo, orderInvoiceInfo);
|
|
|
|
|
// boolean fpdmhmDp = (OrderInfoEnum.ORDER_INVOICE_TYPE_51.getKey().equals(orderInvoiceInfo.getFpzlDm())
|
|
|
|
|
// || OrderInfoEnum.ORDER_INVOICE_TYPE_01.getKey().equals(orderInvoiceInfo.getFpzlDm())
|
|
|
|
|
// || OrderInfoEnum.ORDER_INVOICE_TYPE_02.getKey().equals(orderInvoiceInfo.getFpzlDm())
|
|
|
|
|
// || OrderInfoEnum.ORDER_INVOICE_TYPE_52.getKey().equals(orderInvoiceInfo.getFpzlDm()))
|
|
|
|
|
// && StringUtils.isNotEmpty(orderInvoiceInfo.getFphm());
|
|
|
|
|
// if (fpdmhmDp) {
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取PDF判断
|
|
|
|
|
// */
|
|
|
|
|
// List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode,"");
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(fileDownLoadList)) {
|
|
|
|
|
// orderInvoiceHead.setPDF_FILE(fileDownLoadList.get(0).getFileContent());
|
|
|
|
|
// } else {
|
|
|
|
|
// orderInvoiceHead.setPDF_FILE("");
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// orderInvoiceHead.setPDF_FILE("");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//组装
|
|
|
|
|
commonOrderInvocie.setORDER_INVOICE_HEAD(orderInvoiceHead); |
|
|
|
|
commonOrderInvocie.setORDER_INVOICE_ITEMS(orderInvoiceItems); |
|
|
|
|
commonOrderInvocies.add(commonOrderInvocie); |
|
|
|
|
|
|
|
|
|
//发票开具状态码 0000 成功 9999 失败
|
|
|
|
|
response.setSTATUS_CODE(OrderInfoContentEnum.PUSH_ENTERPRISE_SUCCESS.getKey()); |
|
|
|
|
response.setSTATUS_MESSAGE(OrderInfoContentEnum.PUSH_ENTERPRISE_SUCCESS.getMessage()); |
|
|
|
|
response.setCOMMON_ORDER_INVOCIE(commonOrderInvocies); |
|
|
|
|
content = JsonUtils.getInstance().toJsonString(response); |
|
|
|
|
// commonOrderInvocie.setORDER_INVOICE_HEAD(orderInvoiceHead);
|
|
|
|
|
// commonOrderInvocie.setORDER_INVOICE_ITEMS(orderInvoiceItems);
|
|
|
|
|
// commonOrderInvocies.add(commonOrderInvocie);
|
|
|
|
|
//
|
|
|
|
|
// //发票开具状态码 0000 成功 9999 失败
|
|
|
|
|
// response.setSTATUS_CODE(OrderInfoContentEnum.PUSH_ENTERPRISE_SUCCESS.getKey());
|
|
|
|
|
// response.setSTATUS_MESSAGE(OrderInfoContentEnum.PUSH_ENTERPRISE_SUCCESS.getMessage());
|
|
|
|
|
// response.setCOMMON_ORDER_INVOCIE(commonOrderInvocies);
|
|
|
|
|
// content = JsonUtils.getInstance().toJsonString(response);
|
|
|
|
|
} |
|
|
|
|
return content; |
|
|
|
|
} |
|
|
|
|