|
|
|
@ -28,7 +28,8 @@ import com.dxhy.order.consumer.openapi.protocol.po.EsOutput; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.IsInput; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonRequestParam; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonResponseParam; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.pushinvoice.sap.FptsReqSap; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.generateinvoicepush.sap.FpkjtsReqSap; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.voidinvoicepush.sap.FpzftsReqSap; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.ResponseV4BO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.invalid.ZftsxxReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.invalid.ZfxxRspBO; |
|
|
|
@ -325,6 +326,8 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
//判断数据是否需要放入延时队列再次推送
|
|
|
|
|
boolean sendPushDelay = false; |
|
|
|
|
String errorMsg = ""; |
|
|
|
|
//TODO lfl 系统来源待赋值
|
|
|
|
|
String xtly = ""; |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
//查询多个推送地址
|
|
|
|
@ -333,6 +336,8 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
queryPushInfo.setNsrsbh(fpTsMqData.getNsrsbh()); |
|
|
|
|
//接口类型为发票状态推送
|
|
|
|
|
queryPushInfo.setInterfaceType(fpTsMqData.getPushType()); |
|
|
|
|
//byzd1作为系统来源字段使用
|
|
|
|
|
queryPushInfo.setByzd1(xtly); |
|
|
|
|
List<PushInfo> pushInfoList = pushInfoMapper.selectListByPushInfo(queryPushInfo); |
|
|
|
|
log.info("查询到的推送地址信息:{}", JsonUtils.getInstance().toJsonString(pushInfoList)); |
|
|
|
|
|
|
|
|
@ -341,8 +346,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
String error = "税号:" + fpTsMqData.getNsrsbh() + ",推送地址没有配置"; |
|
|
|
|
return R.error(error); |
|
|
|
|
} |
|
|
|
|
//TODO lfl 系统来源待赋值
|
|
|
|
|
String xtly = ""; |
|
|
|
|
|
|
|
|
|
String fptsParam = ""; |
|
|
|
|
//多个地址循环推送
|
|
|
|
|
for (PushInfo pushInfo : pushInfoList) { |
|
|
|
@ -360,7 +364,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
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(xtly,content); |
|
|
|
|
fptsParam = convertToYwxtParam(fpTsMqData,xtly,content); |
|
|
|
|
}else { |
|
|
|
|
fptsParam = JsonUtils.getInstance().toJsonString(requestMap); |
|
|
|
|
} |
|
|
|
@ -382,30 +386,58 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
if (ConfigurerInfo.INTERFACE_VERSION_V5.equals(pushInfo.getVersionIdent()) |
|
|
|
|
|| ConfigurerInfo.INTERFACE_VERSION_V6.equals(pushInfo.getVersionIdent())) { |
|
|
|
|
DxhyInterfaceResponse dxhyInterfaceResponse = new DxhyInterfaceResponse(); |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class); |
|
|
|
|
EsOutput es_output = poCommonResponseParam.getES_OUTPUT(); |
|
|
|
|
String sapkey = es_output.getSAPKEY(); |
|
|
|
|
String ztype = es_output.getZTYPE(); |
|
|
|
|
String zmessage = es_output.getZMESSAGE(); |
|
|
|
|
DdfptsV5 ddfptsV5 = new DdfptsV5(); |
|
|
|
|
ddfptsV5.setDDQQLSH(sapkey); |
|
|
|
|
ddfptsV5.setNSRSBH(""); |
|
|
|
|
if(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey().equals(ztype)){ |
|
|
|
|
ddfptsV5.setZTDM(ConfigureConstant.STRING_000000); |
|
|
|
|
}else { |
|
|
|
|
ddfptsV5.setZTDM(ConfigureConstant.STRING_9999); |
|
|
|
|
if (OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())) { |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class); |
|
|
|
|
EsOutput es_output = poCommonResponseParam.getES_OUTPUT(); |
|
|
|
|
String sapkey = es_output.getSAPKEY(); |
|
|
|
|
String ztype = es_output.getZTYPE(); |
|
|
|
|
String zmessage = es_output.getZMESSAGE(); |
|
|
|
|
DdfptsV5 ddfptsV5 = new DdfptsV5(); |
|
|
|
|
ddfptsV5.setDDQQLSH(sapkey); |
|
|
|
|
ddfptsV5.setNSRSBH(""); |
|
|
|
|
if(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey().equals(ztype)){ |
|
|
|
|
ddfptsV5.setZTDM(ConfigureConstant.STRING_000000); |
|
|
|
|
}else { |
|
|
|
|
ddfptsV5.setZTDM(ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
ddfptsV5.setZTXX(zmessage); |
|
|
|
|
dxhyInterfaceResponse.setReturnCode(ConfigureConstant.STRING_000000); |
|
|
|
|
dxhyInterfaceResponse.setReturnMessage("处理成功"); |
|
|
|
|
dxhyInterfaceResponse.setEncryptCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setZipCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setContent(Base64Encoding.encode(JsonUtils.getInstance().toJsonString(ddfptsV5))); |
|
|
|
|
}else{ |
|
|
|
|
dxhyInterfaceResponse = JsonUtils.getInstance().parseObject(result, DxhyInterfaceResponse.class); |
|
|
|
|
} |
|
|
|
|
}else if (OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())) { |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class); |
|
|
|
|
EsOutput es_output = poCommonResponseParam.getES_OUTPUT(); |
|
|
|
|
String sapkey = es_output.getSAPKEY(); |
|
|
|
|
String ztype = es_output.getZTYPE(); |
|
|
|
|
String zmessage = es_output.getZMESSAGE(); |
|
|
|
|
ZffpxxV5 zffpxxV5 = new ZffpxxV5(); |
|
|
|
|
zffpxxV5.setXHFSBH(""); |
|
|
|
|
zffpxxV5.setFPDM(""); |
|
|
|
|
zffpxxV5.setFPHM(""); |
|
|
|
|
if(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey().equals(ztype)){ |
|
|
|
|
zffpxxV5.setZTDM(ConfigureConstant.STRING_000000); |
|
|
|
|
}else { |
|
|
|
|
zffpxxV5.setZTDM(ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
zffpxxV5.setZTXX(zmessage); |
|
|
|
|
dxhyInterfaceResponse.setReturnCode(ConfigureConstant.STRING_000000); |
|
|
|
|
dxhyInterfaceResponse.setReturnMessage("处理成功"); |
|
|
|
|
dxhyInterfaceResponse.setEncryptCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setZipCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setContent(Base64Encoding.encode(JsonUtils.getInstance().toJsonString(zffpxxV5))); |
|
|
|
|
}else{ |
|
|
|
|
dxhyInterfaceResponse = JsonUtils.getInstance().parseObject(result, DxhyInterfaceResponse.class); |
|
|
|
|
} |
|
|
|
|
ddfptsV5.setZTXX(zmessage); |
|
|
|
|
dxhyInterfaceResponse.setReturnCode(ConfigureConstant.STRING_000000); |
|
|
|
|
dxhyInterfaceResponse.setReturnMessage("处理成功"); |
|
|
|
|
dxhyInterfaceResponse.setEncryptCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setZipCode(ConfigurerInfo.ENCRYPTCODE_0); |
|
|
|
|
dxhyInterfaceResponse.setContent(Base64Encoding.encode(JsonUtils.getInstance().toJsonString(ddfptsV5))); |
|
|
|
|
}else{ |
|
|
|
|
dxhyInterfaceResponse = JsonUtils.getInstance().parseObject(result, DxhyInterfaceResponse.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(dxhyInterfaceResponse)) { |
|
|
|
|
if (ConfigureConstant.STRING_000000.equals(dxhyInterfaceResponse.getReturnCode())) { |
|
|
|
|
CommonRequestParam commonRequestParam1 = new CommonRequestParam(); |
|
|
|
@ -825,27 +857,55 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
return content; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String convertToYwxtParam(String xtly,String content){ |
|
|
|
|
public String convertToYwxtParam(CommonTsMqData fpTsMqData,String xtly,String content){ |
|
|
|
|
String ywxtParam = ""; |
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content, DdfpzxxV5.class); |
|
|
|
|
FptsReqSap fptsReqSap = new FptsReqSap(); |
|
|
|
|
//TODO lfl 发票推送数据转换
|
|
|
|
|
|
|
|
|
|
IsInput isInput = new IsInput(); |
|
|
|
|
isInput.setSYSID(OrderInfoEnum.SYS_SIGN_FP.getKey()); |
|
|
|
|
isInput.setIFYWID(OrderInfoEnum.INTERFACE_BUSINESS_ID_FPKJTS.getKey()); |
|
|
|
|
isInput.setBSKEY(apiInvoiceCommonMapperService.getGenerateShotKey()); |
|
|
|
|
isInput.setZORG(""); |
|
|
|
|
isInput.setZFILED5(""); |
|
|
|
|
String jsonString = JsonUtils.getInstance().toJsonString(fptsReqSap); |
|
|
|
|
Map map = JsonUtils.getInstance().parseObject(jsonString, Map.class); |
|
|
|
|
isInput.setZDATA(map); |
|
|
|
|
PoCommonRequestParam poCommonRequestParam = new PoCommonRequestParam(); |
|
|
|
|
poCommonRequestParam.setISINPUT(isInput); |
|
|
|
|
if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
//发票开具推送
|
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content, DdfpzxxV5.class); |
|
|
|
|
FpkjtsReqSap fpkjtsReqSap = new FpkjtsReqSap(); |
|
|
|
|
//TODO lfl 发票推送数据转换
|
|
|
|
|
|
|
|
|
|
IsInput isInput = new IsInput(); |
|
|
|
|
isInput.setSYSID(OrderInfoEnum.SYS_SIGN_FP.getKey()); |
|
|
|
|
isInput.setIFYWID(OrderInfoEnum.INTERFACE_BUSINESS_ID_FPKJTS.getKey()); |
|
|
|
|
isInput.setBSKEY(apiInvoiceCommonMapperService.getGenerateShotKey()); |
|
|
|
|
isInput.setZORG(""); |
|
|
|
|
isInput.setZFILED5(""); |
|
|
|
|
String jsonString = JsonUtils.getInstance().toJsonString(fpkjtsReqSap); |
|
|
|
|
Map map = JsonUtils.getInstance().parseObject(jsonString, Map.class); |
|
|
|
|
isInput.setZDATA(map); |
|
|
|
|
PoCommonRequestParam poCommonRequestParam = new PoCommonRequestParam(); |
|
|
|
|
poCommonRequestParam.setISINPUT(isInput); |
|
|
|
|
|
|
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
|
} |
|
|
|
|
}else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){ |
|
|
|
|
//发票作废推送
|
|
|
|
|
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){ |
|
|
|
|
ZffptsV5 zffptsV5 = JsonUtils.getInstance().parseObject(content, ZffptsV5.class); |
|
|
|
|
FpzftsReqSap fpzftsReqSap = new FpzftsReqSap(); |
|
|
|
|
fpzftsReqSap.setZFPDM(zffptsV5.getFPDM()); |
|
|
|
|
fpzftsReqSap.setZFPHM(zffptsV5.getFPHM()); |
|
|
|
|
fpzftsReqSap.setZFPZT(""); |
|
|
|
|
fpzftsReqSap.setZJSDH(""); |
|
|
|
|
IsInput isInput = new IsInput(); |
|
|
|
|
isInput.setSYSID(OrderInfoEnum.SYS_SIGN_FP.getKey()); |
|
|
|
|
isInput.setIFYWID(OrderInfoEnum.INTERFACE_BUSINESS_ID_FPKJTS.getKey()); |
|
|
|
|
isInput.setBSKEY(apiInvoiceCommonMapperService.getGenerateShotKey()); |
|
|
|
|
isInput.setZORG(""); |
|
|
|
|
isInput.setZFILED5(""); |
|
|
|
|
String jsonString = JsonUtils.getInstance().toJsonString(fpzftsReqSap); |
|
|
|
|
Map map = JsonUtils.getInstance().parseObject(jsonString, Map.class); |
|
|
|
|
isInput.setZDATA(map); |
|
|
|
|
PoCommonRequestParam poCommonRequestParam = new PoCommonRequestParam(); |
|
|
|
|
poCommonRequestParam.setISINPUT(isInput); |
|
|
|
|
|
|
|
|
|
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ywxtParam; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|