|
|
|
@ -410,10 +410,16 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
log.warn("税号:{},组装请求报文为空,不进行推送数据", fpTsMqData.getNsrsbh()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrderProcessInfo orderProcessInfo = null; |
|
|
|
|
Map<String, String> requestMap = commonDisposeService.getRequestParameter(pushInfo.getNsrsbh(), pushInfo.getZipCode(), pushInfo.getEncryptCode(), content, pushInfo.getPushUrl(), pushInfo.getInterfaceType(), pushInfo.getVersionIdent()); |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
fptsParam = convertToYwxtParam(fpTsMqData,xtly,content); |
|
|
|
|
if (OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())) { |
|
|
|
|
orderProcessInfo = orderProcessService.queryOrderProcessInfoByFpqqlsh(fpTsMqData.getFpTsMqData().getFpqqlsh(), null); |
|
|
|
|
} else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfoByFpdmAndFphm(fpTsMqData.getZfTsMqData().getFpdm(), fpTsMqData.getZfTsMqData().getFphm(), null); |
|
|
|
|
orderProcessInfo = orderProcessService.selectByOrderId(orderInvoiceInfo.getOrderInfoId(), null); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isNotBlank(pushInfo.getByzd1())){ |
|
|
|
|
fptsParam = convertToYwxtParam(fpTsMqData,content); |
|
|
|
|
}else { |
|
|
|
|
fptsParam = JsonUtils.getInstance().toJsonString(requestMap); |
|
|
|
|
} |
|
|
|
@ -428,7 +434,15 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
String result = ""; |
|
|
|
|
if (ConfigurerInfo.INTERFACE_VERSION_V5.equals(pushInfo.getVersionIdent()) |
|
|
|
|
|| ConfigurerInfo.INTERFACE_VERSION_V6.equals(pushInfo.getVersionIdent())) { |
|
|
|
|
if (StringUtils.isNotBlank(pushInfo.getByzd1()) && OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(pushInfo.getByzd1())) { |
|
|
|
|
result = HttpUtils.sendPo(pushInfo.getPushUrl(), fptsParam,baseServiceConfig.getPoUserName(),baseServiceConfig.getPoPassword()); |
|
|
|
|
}else if(OrderInfoEnum.SYS_SOURCE_DSXT01.getKey().equals(orderProcessInfo.getXtly()) && StringUtils.isNotBlank(pushInfo.getByzd1()) |
|
|
|
|
&& pushInfo.getByzd1().equals(orderProcessInfo.getXtly())){ |
|
|
|
|
result = HttpUtils.sendPo(pushInfo.getPushUrl(), fptsParam,baseServiceConfig.getPoUserName(),baseServiceConfig.getPoPassword()); |
|
|
|
|
} else if (OrderInfoEnum.SYS_SOURCE_DSXT02.getKey().equals(orderProcessInfo.getXtly()) && StringUtils.isNotBlank(pushInfo.getByzd1()) |
|
|
|
|
&& pushInfo.getByzd1().equals(orderProcessInfo.getXtly())) { |
|
|
|
|
result = HttpUtils.sendPo(pushInfo.getPushUrl(), fptsParam,baseServiceConfig.getPoUserName(),baseServiceConfig.getPoPassword()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
result = HttpUtils.doPost(pushInfo.getPushUrl(), requestMap); |
|
|
|
|
} |
|
|
|
@ -1288,7 +1302,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
return content; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String convertToYwxtParam(CommonTsMqData fpTsMqData,String xtly,String content){ |
|
|
|
|
public String convertToYwxtParam(CommonTsMqData fpTsMqData,String content){ |
|
|
|
|
String ywxtParam = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1300,7 +1314,6 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
List<GsClient> gsClients = gsClientMapper.selectByGsdm(orderProcessInfo.getGsdm()); |
|
|
|
|
|
|
|
|
|
//发票开具推送
|
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class); |
|
|
|
|
DdfpxxV5 ddfpxx = ddfpzxxV5.getDDFPXX(); |
|
|
|
|
List<DdmxxxV5> ddmxxx = ddfpzxxV5.getDDMXXX(); |
|
|
|
@ -1308,7 +1321,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
FpkjtsReqSap fpkjtsReqSap = new FpkjtsReqSap(); |
|
|
|
|
List<FpkjtsMxSap> itemList = new ArrayList<>(); |
|
|
|
|
//主信息
|
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(orderProcessInfo.getXtly())){ |
|
|
|
|
if(!OrderInfoEnum.SYS_SOURCE_FPPAGE.getKey().equals(orderProcessInfo.getXtly())){ |
|
|
|
|
fpkjtsReqSap.setZJSDH(orderProcessInfo.getOriginDdh()); |
|
|
|
|
}else { |
|
|
|
|
fpkjtsReqSap.setZJSDH(""); |
|
|
|
@ -1344,8 +1357,11 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
fpkjtsReqSap.setZGSDM(orderProcessInfo.getGsdm()); |
|
|
|
|
fpkjtsReqSap.setZYWDJ(orderProcessInfo.getBzdh()); |
|
|
|
|
fpkjtsReqSap.setIMGID(orderInvoiceInfo.getDocuId()); |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_DSXT01.getKey().equals(orderProcessInfo.getXtly()) || |
|
|
|
|
OrderInfoEnum.SYS_SOURCE_DSXT02.getKey().equals(orderProcessInfo.getXtly())){ |
|
|
|
|
fpkjtsReqSap.setPDFZJL(ddfpxx.getPDFZJL()); |
|
|
|
|
fpkjtsReqSap.setZJLLX(ddfpxx.getZJLLX()); |
|
|
|
|
} |
|
|
|
|
//明细信息
|
|
|
|
|
ddmxxx.stream().forEach(f -> { |
|
|
|
|
FpkjtsMxSap detail = new FpkjtsMxSap(); |
|
|
|
@ -1398,13 +1414,12 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
poCommonRequestParam.setIS_INPUT(isInput); |
|
|
|
|
|
|
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfoByFpdmAndFphm(fpTsMqData.getZfTsMqData().getFpdm(), fpTsMqData.getZfTsMqData().getFphm(), null); |
|
|
|
|
OrderProcessInfo orderProcessInfo = orderProcessService.selectByOrderId(orderInvoiceInfo.getOrderInfoId(), null); |
|
|
|
|
List<GsClient> gsClients = gsClientMapper.selectByGsdm(orderProcessInfo.getGsdm()); |
|
|
|
|
//发票作废推送
|
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
ZffptsV5 zffptsV5 = JsonUtils.getInstance().parseObject(content, ZffptsV5.class); |
|
|
|
|
List<FpzftsReqSap> zfList = new ArrayList<>(); |
|
|
|
|
FpzftsReqSap fpzftsReqSap = new FpzftsReqSap(); |
|
|
|
@ -1430,7 +1445,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
poCommonRequestParam.setIS_INPUT(isInput); |
|
|
|
|
|
|
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ywxtParam; |
|
|
|
|