|
|
@ -157,6 +157,19 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BaseServiceConfig baseServiceConfig; |
|
|
|
private BaseServiceConfig baseServiceConfig; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final static Map smMap = new HashMap() {{ |
|
|
|
|
|
|
|
put(new BigDecimal("0"), "X0"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.16"), "X1"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.13"), "X2"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.1"), "X3"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.09"), "X4"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.06"), "X5"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.05"), "X6"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.03"), "X7"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.02"), "X8"); |
|
|
|
|
|
|
|
put(new BigDecimal("0.01"), "X9"); |
|
|
|
|
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R pushRouting(String pushMsg) { |
|
|
|
public R pushRouting(String pushMsg) { |
|
|
|
R r = new R(); |
|
|
|
R r = new R(); |
|
|
@ -180,11 +193,8 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
|
|
|
|
|
|
|
if (OrderInfoEnum.ORDER_STATUS_5.getKey().equals(orderProcessInfo.getDdzt()) || OrderInfoEnum.ORDER_STATUS_7.getKey().equals(orderProcessInfo.getDdzt())) { |
|
|
|
if (OrderInfoEnum.ORDER_STATUS_5.getKey().equals(orderProcessInfo.getDdzt()) || OrderInfoEnum.ORDER_STATUS_7.getKey().equals(orderProcessInfo.getDdzt())) { |
|
|
|
|
|
|
|
|
|
|
|
//判断订单来源,如果是接口开票的进行推送,其他不进行推送
|
|
|
|
//判断是否有报账单号,有则回推,没有不回推
|
|
|
|
boolean pushEnterprise = fpTsMqData.isForcePush() || (OrderInfoEnum.ORDER_SOURCE_2.getKey().equals(orderProcessInfo.getDdly()) || |
|
|
|
boolean pushEnterprise = StrUtil.isNotBlank(orderProcessInfo.getBzdh()); |
|
|
|
OrderInfoEnum.ORDER_SOURCE_3.getKey().equals(orderProcessInfo.getDdly()) || |
|
|
|
|
|
|
|
OrderInfoEnum.ORDER_SOURCE_5.getKey().equals(orderProcessInfo.getDdly()) || |
|
|
|
|
|
|
|
OrderInfoEnum.ORDER_SOURCE_6.getKey().equals(orderProcessInfo.getDdly())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pushEnterprise) { |
|
|
|
if (pushEnterprise) { |
|
|
|
|
|
|
|
|
|
|
@ -193,10 +203,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
log.warn("税号:{},当前数据订单来源为:{},不进行推送数据,直接更新为推送失败,失败原因为:非接口开票数据不进行推送", orderProcessInfo.getXhfNsrsbh(), orderProcessInfo.getDdly()); |
|
|
|
log.warn("税号:{},当前数据报账单号为:{},不进行推送数据,直接更新为推送失败,失败原因为:无报账单号不进行推送", orderProcessInfo.getXhfNsrsbh(), orderProcessInfo.getBzdh()); |
|
|
|
OrderInvoiceInfo updateOrderInvoiceInfo = new OrderInvoiceInfo(); |
|
|
|
OrderInvoiceInfo updateOrderInvoiceInfo = new OrderInvoiceInfo(); |
|
|
|
updateOrderInvoiceInfo.setFpqqlsh(orderProcessInfo.getFpqqlsh()); |
|
|
|
updateOrderInvoiceInfo.setFpqqlsh(orderProcessInfo.getFpqqlsh()); |
|
|
|
updateOrderInvoiceInfo.setInvoicePushSbyy("非接口开票数据不进行推送"); |
|
|
|
updateOrderInvoiceInfo.setInvoicePushSbyy("无报账单号不进行推送"); |
|
|
|
int updateByPrimaryKeySelective = orderInvoiceInfoService.updateOrderInvoiceInfoByFpqqlsh(updateOrderInvoiceInfo, shList); |
|
|
|
int updateByPrimaryKeySelective = orderInvoiceInfoService.updateOrderInvoiceInfoByFpqqlsh(updateOrderInvoiceInfo, shList); |
|
|
|
if (updateByPrimaryKeySelective <= 0) { |
|
|
|
if (updateByPrimaryKeySelective <= 0) { |
|
|
|
log.error("{}推送失败原因更新失败", LOGGER_MSG); |
|
|
|
log.error("{}推送失败原因更新失败", LOGGER_MSG); |
|
|
@ -348,7 +358,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
//接口类型为发票状态推送
|
|
|
|
//接口类型为发票状态推送
|
|
|
|
queryPushInfo.setInterfaceType(fpTsMqData.getPushType()); |
|
|
|
queryPushInfo.setInterfaceType(fpTsMqData.getPushType()); |
|
|
|
//byzd1作为系统来源字段使用
|
|
|
|
//byzd1作为系统来源字段使用
|
|
|
|
queryPushInfo.setByzd1(xtly); |
|
|
|
//queryPushInfo.setByzd1(xtly);
|
|
|
|
List<PushInfo> pushInfoList = pushInfoMapper.selectListByPushInfo(queryPushInfo); |
|
|
|
List<PushInfo> pushInfoList = pushInfoMapper.selectListByPushInfo(queryPushInfo); |
|
|
|
log.info("查询到的推送地址信息:{}", JsonUtils.getInstance().toJsonString(pushInfoList)); |
|
|
|
log.info("查询到的推送地址信息:{}", JsonUtils.getInstance().toJsonString(pushInfoList)); |
|
|
|
|
|
|
|
|
|
|
@ -948,7 +958,13 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
public String convertToYwxtParam(CommonTsMqData fpTsMqData,String xtly,String content,String poClient){ |
|
|
|
public String convertToYwxtParam(CommonTsMqData fpTsMqData,String xtly,String content,String poClient){ |
|
|
|
String ywxtParam = ""; |
|
|
|
String ywxtParam = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
|
|
|
OrderProcessInfo orderProcessInfo = orderProcessService.queryOrderProcessInfoByFpqqlsh(fpTsMqData.getFpTsMqData().getFpqqlsh(), null); |
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo1 = new OrderInvoiceInfo(); |
|
|
|
|
|
|
|
orderInvoiceInfo1.setFpqqlsh(orderProcessInfo.getFpqqlsh()); |
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfo(orderInvoiceInfo1, null); |
|
|
|
|
|
|
|
|
|
|
|
//发票开具推送
|
|
|
|
//发票开具推送
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class); |
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class); |
|
|
@ -979,8 +995,9 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
fpkjtsReqSap.setZGFDH(ddfpxx.getGMFDH()); |
|
|
|
fpkjtsReqSap.setZGFDH(ddfpxx.getGMFDH()); |
|
|
|
fpkjtsReqSap.setZXFDH(ddfpxx.getXHFDH()); |
|
|
|
fpkjtsReqSap.setZXFDH(ddfpxx.getXHFDH()); |
|
|
|
fpkjtsReqSap.setZXFZH(ddfpxx.getXHFZH()); |
|
|
|
fpkjtsReqSap.setZXFZH(ddfpxx.getXHFZH()); |
|
|
|
fpkjtsReqSap.setZGSDM(""); |
|
|
|
fpkjtsReqSap.setZGSDM(orderProcessInfo.getGsdm()); |
|
|
|
fpkjtsReqSap.setZYWDJ(""); |
|
|
|
fpkjtsReqSap.setZYWDJ(orderProcessInfo.getBzdh()); |
|
|
|
|
|
|
|
fpkjtsReqSap.setIMGID(orderInvoiceInfo.getDocuId()); |
|
|
|
//明细信息
|
|
|
|
//明细信息
|
|
|
|
ddmxxx.stream().forEach(f -> { |
|
|
|
ddmxxx.stream().forEach(f -> { |
|
|
|
FpkjtsMxSap detail = new FpkjtsMxSap(); |
|
|
|
FpkjtsMxSap detail = new FpkjtsMxSap(); |
|
|
@ -988,7 +1005,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
detail.setZFPDM(ddfpxx.getFPDM()); |
|
|
|
detail.setZFPDM(ddfpxx.getFPDM()); |
|
|
|
detail.setZFPHM(ddfpxx.getFPHM()); |
|
|
|
detail.setZFPHM(ddfpxx.getFPHM()); |
|
|
|
detail.setZFPHH(f.getXH()); |
|
|
|
detail.setZFPHH(f.getXH()); |
|
|
|
detail.setMATNR(""); |
|
|
|
detail.setMATNR(f.getZXBM()); |
|
|
|
detail.setZGGXH(f.getGGXH()); |
|
|
|
detail.setZGGXH(f.getGGXH()); |
|
|
|
detail.setZSLDW(f.getDW()); |
|
|
|
detail.setZSLDW(f.getDW()); |
|
|
|
detail.setZZSL(f.getSPSL()); |
|
|
|
detail.setZZSL(f.getSPSL()); |
|
|
@ -999,7 +1016,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
detail.setINVOICEDATE(ddfpxx.getKPRQ()); |
|
|
|
detail.setINVOICEDATE(ddfpxx.getKPRQ()); |
|
|
|
detail.setINVOICETYPE(ddfpxx.getFPLXDM()); |
|
|
|
detail.setINVOICETYPE(ddfpxx.getFPLXDM()); |
|
|
|
detail.setZHWMC(f.getXMMC()); |
|
|
|
detail.setZHWMC(f.getXMMC()); |
|
|
|
detail.setZSM(""); |
|
|
|
detail.setZSM(smMap.get(new BigDecimal(f.getSL())).toString()); |
|
|
|
itemList.add(detail); |
|
|
|
itemList.add(detail); |
|
|
|
}); |
|
|
|
}); |
|
|
|
fpkjtsReqSap.setITITEM(itemList); |
|
|
|
fpkjtsReqSap.setITITEM(itemList); |
|
|
@ -1018,6 +1035,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
}else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfoByFpdmAndFphm(fpTsMqData.getZfTsMqData().getFpdm(), fpTsMqData.getZfTsMqData().getFphm(), null); |
|
|
|
//发票作废推送
|
|
|
|
//发票作废推送
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
ZffptsV5 zffptsV5 = JsonUtils.getInstance().parseObject(content, ZffptsV5.class); |
|
|
|
ZffptsV5 zffptsV5 = JsonUtils.getInstance().parseObject(content, ZffptsV5.class); |
|
|
@ -1025,8 +1043,9 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
FpzftsReqSap fpzftsReqSap = new FpzftsReqSap(); |
|
|
|
FpzftsReqSap fpzftsReqSap = new FpzftsReqSap(); |
|
|
|
fpzftsReqSap.setZFPDM(zffptsV5.getFPDM()); |
|
|
|
fpzftsReqSap.setZFPDM(zffptsV5.getFPDM()); |
|
|
|
fpzftsReqSap.setZFPHM(zffptsV5.getFPHM()); |
|
|
|
fpzftsReqSap.setZFPHM(zffptsV5.getFPHM()); |
|
|
|
fpzftsReqSap.setZFPZT(""); |
|
|
|
//0 是正常 1是作废
|
|
|
|
fpzftsReqSap.setZJSDH(""); |
|
|
|
fpzftsReqSap.setZFPZT(ConfigureConstant.STRING_1); |
|
|
|
|
|
|
|
fpzftsReqSap.setZJSDH(orderInvoiceInfo.getDdh()); |
|
|
|
IsInput isInput = new IsInput(); |
|
|
|
IsInput isInput = new IsInput(); |
|
|
|
isInput.setSYSID(OrderInfoEnum.SYS_SIGN_FP.getKey()); |
|
|
|
isInput.setSYSID(OrderInfoEnum.SYS_SIGN_FP.getKey()); |
|
|
|
isInput.setIFYWID(OrderInfoEnum.INTERFACE_BUSINESS_ID_FPZFTS.getKey()); |
|
|
|
isInput.setIFYWID(OrderInfoEnum.INTERFACE_BUSINESS_ID_FPZFTS.getKey()); |
|
|
|