|
|
|
@ -11,6 +11,7 @@ import com.dxhy.common.constant.DbConstant; |
|
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
|
import com.dxhy.common.datasource.config.DynamicContextHolder; |
|
|
|
|
import com.dxhy.common.enums.SNFplxEnum; |
|
|
|
|
import com.dxhy.common.exception.BaseException; |
|
|
|
|
import com.dxhy.common.util.InvoiceUtil; |
|
|
|
|
import com.dxhy.common.utils.Base64Encoding; |
|
|
|
|
import com.dxhy.common.utils.R; |
|
|
|
@ -135,10 +136,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord, 0,0, JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -154,10 +155,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("发票号码不能为空!")),0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0,JSONObject.toJSONString(R.error("发票号码不能为空!")), "发票号码不能为空!"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票号码不能为空!"))); |
|
|
|
@ -173,10 +174,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("开票日期不能为空!")), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0, |
|
|
|
|
JSONObject.toJSONString(R.error("开票日期不能为空!")), "开票日期不能为空!"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!"))); |
|
|
|
@ -185,10 +187,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceType"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("发票类型不能为空!")), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0, |
|
|
|
|
JSONObject.toJSONString(R.error("发票类型不能为空!")), "发票类型不能为空!"); |
|
|
|
|
} catch (BaseException e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票类型不能为空!"))); |
|
|
|
@ -203,10 +206,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("totalAmount"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("金额不能为空!")), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0, |
|
|
|
|
JSONObject.toJSONString(R.error("金额不能为空!")), "金额不能为空!"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!"))); |
|
|
|
@ -215,10 +219,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("checkCode"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("校验码不能为空!")), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0, |
|
|
|
|
JSONObject.toJSONString(R.error("校验码不能为空!")), "校验码不能为空!"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!"))); |
|
|
|
@ -237,10 +242,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (notes != null) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error(notes)), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0, |
|
|
|
|
JSONObject.toJSONString(R.error(notes)), notes); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); |
|
|
|
@ -274,6 +280,7 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
List<String> activeCallRequest = new ArrayList<>(); |
|
|
|
|
activeCallRequest.add(JSONObject.toJSONString(pramsMap)); |
|
|
|
|
activeCallRequest.add(JSONObject.toJSONString(null)); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallRequestDetail(JSONObject.toJSONString(activeCallRequest)); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCall("singleCheckInvoice"); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallResponse(JSONObject.toJSONString(checkInvoiceResult)); |
|
|
|
|
|
|
|
|
@ -298,18 +305,23 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
// saveCheckLog(pramsMap, checkInvoice);
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if (checkInvoiceResult!=null && checkInvoiceResult.containsKey("code")) { |
|
|
|
|
if (checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
if (checkInvoiceResult != null) { |
|
|
|
|
if (checkInvoiceResult.containsKey("code")) { |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
|
(String) checkInvoiceResult.get("message")); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
|
log.info("进项票池已存在发票,查验结果:{}",JSONObject.toJSON(checkInvoiceResult)); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
|
(String) checkInvoiceResult.get("cyjgxx")); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data)); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -337,10 +349,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
// saveCheckLog(pramsMap,checkInvoice);
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -350,6 +362,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,"1"); |
|
|
|
|
|
|
|
|
|
List<String> activeCallRequest = new ArrayList<>(); |
|
|
|
|
activeCallRequest.add(JSONObject.toJSONString(pramsMap)); |
|
|
|
|
activeCallRequest.add(JSONObject.toJSONString("1")); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallRequestDetail(JSONObject.toJSONString(activeCallRequest)); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCall("singleCheckInvoice"); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallResponse(JSONObject.toJSONString(checkInvoiceResult)); |
|
|
|
|
|
|
|
|
@ -359,10 +376,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
log.error("查验失败,errormsg:{}",e.getMessage()); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("查验失败,"+e.getMessage())), 1); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,1,JSONObject.toJSONString(R.error("查验失败,"+e.getMessage())), |
|
|
|
|
"查验失败,异常信息:{}"+JSONObject.toJSONString(e.getMessage())); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败,"+e.getMessage()))); |
|
|
|
@ -375,10 +393,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
|
(String) checkInvoiceResult.get("cyjgxx")); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -395,10 +414,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -433,10 +452,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -444,10 +463,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error().put("data", checkInvoiceResult)),0); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord,0,JSONObject.toJSONString(R.error().put("data", checkInvoiceResult)), |
|
|
|
|
"未知异常,请联系管理员"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error().put("data", checkInvoiceResult))); |
|
|
|
@ -693,13 +713,13 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
List<String> invoiceNos = new ArrayList<>(); |
|
|
|
|
RequestRecord record=null; |
|
|
|
|
if (snRequestObject.getInvoiceInfoList()!=null && snRequestObject.getInvoiceInfoList().size()>0) { |
|
|
|
|
log.info("影像系统同步数据的发票号码为:{}", JSONObject.toJSONString(invoiceNos)); |
|
|
|
|
log.info("影像系统同步数据的发票代码为:{}", JSONObject.toJSONString(invoiceCodes)); |
|
|
|
|
snRequestObject.getInvoiceInfoList().stream().forEach(invoiceInfo->{ |
|
|
|
|
invoiceCodes.add(invoiceInfo.getInvoiceCode()); |
|
|
|
|
invoiceNos.add(invoiceInfo.getInvoiceNumber()); |
|
|
|
|
}); |
|
|
|
|
if (invoiceCodes.get(0)!=null) { |
|
|
|
|
log.info("影像系统同步数据的发票号码为:{}", JSONObject.toJSONString(invoiceNos)); |
|
|
|
|
log.info("影像系统同步数据的发票代码为:{}", JSONObject.toJSONString(invoiceCodes)); |
|
|
|
|
if (invoiceCodes.size()>0) { |
|
|
|
|
record = requestRecordService.getBaseRequestRecord(JSONObject.toJSONString(snRequestObject), |
|
|
|
|
"/syncInvoiceInfo", |
|
|
|
|
JSONObject.toJSONString(invoiceCodes), |
|
|
|
@ -782,10 +802,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(R.error(result))); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(record,0, JSONObject.toJSONString(R.error(result)), result); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(result))); |
|
|
|
@ -800,12 +820,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
|
request.put("IS_INPUT", object); |
|
|
|
|
|
|
|
|
|
// RequestRecord pushCheckResultToSAPRecord =requestRecordService.getBaseRequestRecord(request.toJSONString(),
|
|
|
|
|
// "/syncInvoiceInfo",
|
|
|
|
|
// JSONObject.toJSONString(invoiceCodes),
|
|
|
|
|
// JSONObject.toJSONString(invoiceNos),
|
|
|
|
|
// "pushCheckResultToSAP", 1);
|
|
|
|
|
try { |
|
|
|
|
List<String> requestList = new ArrayList<>(); |
|
|
|
|
requestList.add(request.toJSONString()); |
|
|
|
|
record.setActiveCallRequestDetail(JSONObject.toJSONString(requestList)); |
|
|
|
|
record.setActiveCall("pushCheckResultToSAP"); |
|
|
|
|
//将信息推送到影像系统
|
|
|
|
|
result = snPushCheckRecordService.pushCheckResultToSAP(request.toJSONString()); |
|
|
|
@ -816,10 +834,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(record, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -829,10 +847,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
// requestRecordService.saveRecord(pushCheckResultToSAPRecord,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)), 1);
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)), 1); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(record,1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)), |
|
|
|
|
"推送sap失败,失败原因:"+"{"+JSONObject.toJSONString(e)+"}"); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY))); |
|
|
|
@ -856,10 +875,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(record, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -881,10 +900,10 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveSuccessfulRequestRecord(record, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -896,10 +915,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)),1); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(record,1, JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)), |
|
|
|
|
"同步SAP失败,报错信息为:"+"{"+JSONObject.toJSONString(exception)+"}"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); |
|
|
|
@ -908,10 +928,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)), 1); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(record,1, JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)), |
|
|
|
|
"同步SAP失败,报错信息为:"+"{"+JSONObject.toJSONString(exception)+"}"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); |
|
|
|
@ -920,10 +941,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)),1); |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(record,1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)), |
|
|
|
|
"同步SAP失败,报错信息为:"+"{"+JSONObject.toJSONString(exception)+"}"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); |
|
|
|
|