|
|
|
@ -383,7 +383,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
pushInfoRecord.setResult(result); |
|
|
|
|
pushInfoRecord.setCreateTime(new Date()); |
|
|
|
|
if(pushInfoRecordId!=null){ |
|
|
|
|
pushInfoRecordMapper.updateByPrimaryKeySelective(pushInfoRecord); |
|
|
|
|
pushInfoRecordMapper.updateByPrimaryKey(pushInfoRecord); |
|
|
|
|
}else { |
|
|
|
|
pushInfoRecordMapper.insert(pushInfoRecord); |
|
|
|
|
} |
|
|
|
@ -408,7 +408,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
pushInfoRecord.setFailReason(failReason); |
|
|
|
|
pushInfoRecord.setCreateTime(new Date()); |
|
|
|
|
if(pushInfoRecordId!=null){ |
|
|
|
|
pushInfoRecordMapper.updateByPrimaryKeySelective(pushInfoRecord); |
|
|
|
|
pushInfoRecordMapper.updateByPrimaryKey(pushInfoRecord); |
|
|
|
|
}else { |
|
|
|
|
pushInfoRecordMapper.insert(pushInfoRecord); |
|
|
|
|
} |
|
|
|
@ -460,7 +460,6 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
pushUrl = pushInfo.getPushUrl(); |
|
|
|
|
//按照接口类型获取对应的报文数据
|
|
|
|
|
//推送影像系统
|
|
|
|
|
String content = getPushContent(fpTsMqData, pushInfo, shList); |
|
|
|
|
if (StrUtil.isBlank(content)) { |
|
|
|
|
String error=String.format("税号:%s,组装请求报文为空,不进行推送数据",fpTsMqData.getNsrsbh()); |
|
|
|
@ -470,14 +469,14 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
//推送影像系统
|
|
|
|
|
sendImageSys(content,fpTsMqData.getPushType(),pushInfo); |
|
|
|
|
sendImageSys(content,fpTsMqData.getPushType(),pushInfo, null); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
String error=String.format("影像推送出现异常%s,推送类型%s",e.getMessage(),fpTsMqData.getPushType()); |
|
|
|
|
String error=String.format("影像推送出现异常%s,推送类型%s",e,fpTsMqData.getPushType()); |
|
|
|
|
log.error(error); |
|
|
|
|
PushInfo pushInfo1 = new PushInfo(); |
|
|
|
|
pushInfo1.setId(pushInfo.getId()); |
|
|
|
|
pushInfo1.setByzd1("yxxt"); |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),error,error,pushInfo,fpTsMqData.getPushType()); |
|
|
|
|
pushInfo1.setByzd1("YXXT"); |
|
|
|
|
failPush(null,content,error,e.getMessage(),pushInfo1,fpTsMqData.getPushType()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
OrderProcessInfo orderProcessInfo = null; |
|
|
|
@ -660,20 +659,22 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
//多路径推送,返回数据异常后继续推送
|
|
|
|
|
log.error("{}推送企业异常,异常信息:{}", LOGGER_MSG, e); |
|
|
|
|
String error=String.format("%s推送企业异常,异常信息:%s",LOGGER_MSG,e); |
|
|
|
|
log.error(error); |
|
|
|
|
errorMsg = e.getMessage(); |
|
|
|
|
r = processPushFail(fpTsMqData, pushUrl, errorMsg, shList); |
|
|
|
|
sendPushDelay = true; |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),errorMsg,errorMsg,pushInfo,fpTsMqData.getPushType()); |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),error,errorMsg,pushInfo,fpTsMqData.getPushType()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("{}推送异常,异常信息:{}", LOGGER_MSG, e); |
|
|
|
|
String error=String.format("%s推送异常,异常信息:%s",LOGGER_MSG,e); |
|
|
|
|
log.error(error); |
|
|
|
|
errorMsg = e.getMessage(); |
|
|
|
|
r = processPushFail(fpTsMqData, pushUrl, errorMsg, shList); |
|
|
|
|
sendPushDelay = true; |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),errorMsg,errorMsg,null,fpTsMqData.getPushType()); |
|
|
|
|
failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),error,errorMsg,null,fpTsMqData.getPushType()); |
|
|
|
|
} |
|
|
|
|
//如果需要放入延时队列需要存入队列中
|
|
|
|
|
if (sendPushDelay) { |
|
|
|
@ -682,10 +683,11 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void sendImageSys(String content, String pushType, PushInfo pushInfo){ |
|
|
|
|
public R sendImageSys(String content, String pushType, PushInfo pushInfo, Long id){ |
|
|
|
|
R r = new R(); |
|
|
|
|
PushInfo pushInfo1 = new PushInfo(); |
|
|
|
|
pushInfo1.setId(pushInfo.getId()); |
|
|
|
|
pushInfo1.setByzd1("yxxt"); |
|
|
|
|
pushInfo1.setByzd1("YXXT"); |
|
|
|
|
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class); |
|
|
|
|
DdfpxxV5 ddfpxx = ddfpzxxV5.getDDFPXX(); |
|
|
|
|
OutputInvoiceRequest outputInvoiceRequest = buildInvoiceRequest(ddfpxx); |
|
|
|
@ -698,8 +700,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
if(!b){ |
|
|
|
|
String error=String.format("invoiceNo:%s not eleInvoice do not push",outputInvoiceRequest.getInvoiceList().get(0).getInvoiceNumber()); |
|
|
|
|
log.info(error); |
|
|
|
|
failPush(null,content,error,error,pushInfo1,pushType); |
|
|
|
|
return; |
|
|
|
|
failPush(id,content,error,error,pushInfo1,pushType); |
|
|
|
|
r.put(OrderManagementConstant.CODE, "9999"); |
|
|
|
|
r.put(OrderManagementConstant.ALL_MESSAGE, error); |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -720,18 +724,22 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
String data = jsonObject.getString("data"); |
|
|
|
|
if("200".equals(status)){ |
|
|
|
|
//成功
|
|
|
|
|
successPush(null,content,data,pushInfo,pushType); |
|
|
|
|
successPush(id,content,data,pushInfo,pushType); |
|
|
|
|
}else { |
|
|
|
|
//失败
|
|
|
|
|
failPush(null,content,message,data,pushInfo,pushType); |
|
|
|
|
failPush(id,content,message,data,pushInfo,pushType); |
|
|
|
|
} |
|
|
|
|
//暂时不保存状态
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
String error=String.format("影像系统推送数据异常,%s ,推送类型为%s",e.getMessage(),pushType); |
|
|
|
|
log.error(error); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
failPush(null,content,error,error,pushInfo1,pushType); |
|
|
|
|
failPush(id,content,error,e.getMessage(),pushInfo1,pushType); |
|
|
|
|
r.put(OrderManagementConstant.CODE, "9999"); |
|
|
|
|
r.put(OrderManagementConstant.ALL_MESSAGE, error); |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|