|
|
|
@ -18,11 +18,8 @@ import com.dxhy.erp.entity.*; |
|
|
|
|
import com.dxhy.erp.entity.sdny.*; |
|
|
|
|
import com.dxhy.erp.model.InvoiceDetailInfo; |
|
|
|
|
import com.dxhy.erp.service.*; |
|
|
|
|
import com.dxhy.erp.service.impl.GatherServiceImpl; |
|
|
|
|
import com.dxhy.erp.utils.Base64; |
|
|
|
|
import com.dxhy.erp.utils.CheckUtil; |
|
|
|
|
import com.dxhy.erp.utils.HmacSHA1Util; |
|
|
|
|
import com.google.gson.JsonArray; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
@ -108,6 +105,9 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GatherService gatherService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private RequestRecordService requestRecordService; |
|
|
|
|
/** |
|
|
|
|
* 查验发票 |
|
|
|
|
*/ |
|
|
|
@ -119,6 +119,8 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
String userid = "101833"; |
|
|
|
|
String dbName = "business"; |
|
|
|
|
JSONObject checkInvoiceResult = null; |
|
|
|
|
RequestRecord singleInvoiceCheckRecord = requestRecordService.getBaseRequestRecord(JSONObject.toJSONString(pramsMap), |
|
|
|
|
"/singleInvoiceCheck",pramsMap.get("invoiceCode"),pramsMap.get("invoiceNumber"), "singleInvoiceCheck"); |
|
|
|
|
|
|
|
|
|
//挡板开关
|
|
|
|
|
if ("1".equals(isPresure)) { |
|
|
|
@ -131,6 +133,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
data.put("message", "success"); |
|
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord, 0,0, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -141,6 +151,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
log.info("查验类发票,执行查验操作后入库"); |
|
|
|
|
//权限校验
|
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("发票号码不能为空!")),0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票号码不能为空!"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -152,10 +170,26 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
pramsMap.put("invoiceDate", billingDate); |
|
|
|
|
pramsMap.put("billingDate", billingDate); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("开票日期不能为空!")), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票类型不能为空!"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -166,10 +200,26 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|| SNFplxEnum.QDZP.getSnFplxDm().equals(pramsMap.get("invoiceType")) |
|
|
|
|
|| SNFplxEnum.QDPP.getSnFplxDm().equals(pramsMap.get("invoiceType"))) { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("totalAmount"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("金额不能为空!")), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!"))); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("checkCode"))) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("校验码不能为空!")), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!"))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -184,6 +234,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
log.info("uuid={}", uuid); |
|
|
|
|
String notes = invoiceQueryService.checkingInvoiceInfo("business", uuid, getUserInfo()); |
|
|
|
|
if (notes != null) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error(notes)), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -209,6 +267,9 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if(delete > 0) { |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null); |
|
|
|
|
|
|
|
|
|
singleInvoiceCheckRecord.setActiveCall("singleCheckInvoice"); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallResponse(JSONObject.toJSONString(checkInvoiceResult)); |
|
|
|
|
|
|
|
|
|
if (!checkInvoiceResult.containsKey("code")) { |
|
|
|
|
if (!checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
@ -230,6 +291,21 @@ 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); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} else { |
|
|
|
|
TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid); |
|
|
|
@ -254,6 +330,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
//查验结果保存
|
|
|
|
|
// saveCheckLog(pramsMap,checkInvoice);
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} |
|
|
|
@ -262,10 +344,21 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,"1"); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCall("singleCheckInvoice"); |
|
|
|
|
singleInvoiceCheckRecord.setActiveCallResponse(JSONObject.toJSONString(checkInvoiceResult)); |
|
|
|
|
|
|
|
|
|
log.info("查验结果为:{}", checkInvoiceResult); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("查验失败,errormsg:{}",e.getMessage()); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("查验失败,"+e.getMessage())), 1); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败,"+e.getMessage()))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -274,6 +367,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
|
R data = new R(); |
|
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -287,6 +388,13 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
|
log.info("返回给影像系统的结果为:{}", checkInvoiceResult); |
|
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
@ -307,9 +415,25 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error().put("data", checkInvoiceResult)),0); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error().put("data", checkInvoiceResult))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -549,6 +673,37 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
log.info("影像系统同步数据:{}", JSONObject.toJSONString(snRequestObject)); |
|
|
|
|
|
|
|
|
|
List<String> invoiceCodes = new ArrayList<>(); |
|
|
|
|
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) { |
|
|
|
|
record = requestRecordService.getBaseRequestRecord(JSONObject.toJSONString(snRequestObject), |
|
|
|
|
"/syncInvoiceInfo", |
|
|
|
|
JSONObject.toJSONString(invoiceCodes), |
|
|
|
|
JSONObject.toJSONString(invoiceNos), |
|
|
|
|
"syncInvoiceInfo"); |
|
|
|
|
} else { |
|
|
|
|
record = requestRecordService.getBaseRequestRecord(JSONObject.toJSONString(snRequestObject), |
|
|
|
|
"/syncInvoiceInfo", |
|
|
|
|
JSONObject.toJSONString(invoiceNos), |
|
|
|
|
"syncInvoiceInfo"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
record = requestRecordService.getBaseRequestRecord(JSONObject.toJSONString(snRequestObject), |
|
|
|
|
"/syncInvoiceInfo", |
|
|
|
|
"syncInvoiceInfo"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
record.setImageId(snRequestObject.getImageId()); |
|
|
|
|
|
|
|
|
|
String dbName = "business"; |
|
|
|
|
// 入参统一在入口处理
|
|
|
|
|
String orgCode = snRequestObject.getCompCode(); |
|
|
|
@ -609,6 +764,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (!"ok".equals(result) && !"0000".equals(result)) { |
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(R.error(result))); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(result))); |
|
|
|
|
} |
|
|
|
|
SAPInvoiceInfo info = convertToSapOnject(invoice, imageId, compCode); |
|
|
|
@ -621,16 +784,41 @@ 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 { |
|
|
|
|
record.setActiveCall("pushCheckResultToSAP"); |
|
|
|
|
//将信息推送到影像系统
|
|
|
|
|
result = snPushCheckRecordService.pushCheckResultToSAP(request.toJSONString()); |
|
|
|
|
|
|
|
|
|
record.setActiveCallResponse(JSONObject.toJSONString(result)); |
|
|
|
|
|
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("", e); |
|
|
|
|
|
|
|
|
|
// 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); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY))); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -650,6 +838,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
} else { |
|
|
|
|
//删除对应的影像号
|
|
|
|
@ -667,6 +863,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(data)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -674,14 +878,38 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
} catch (TimeoutException exception) { |
|
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)),1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); |
|
|
|
|
} catch(NullPointerException exception){ |
|
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)), 1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); |
|
|
|
|
} catch(Exception exception){ |
|
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)),1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票同步接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|