|
|
@ -18,11 +18,8 @@ import com.dxhy.erp.entity.*; |
|
|
|
import com.dxhy.erp.entity.sdny.*; |
|
|
|
import com.dxhy.erp.entity.sdny.*; |
|
|
|
import com.dxhy.erp.model.InvoiceDetailInfo; |
|
|
|
import com.dxhy.erp.model.InvoiceDetailInfo; |
|
|
|
import com.dxhy.erp.service.*; |
|
|
|
import com.dxhy.erp.service.*; |
|
|
|
import com.dxhy.erp.service.impl.GatherServiceImpl; |
|
|
|
|
|
|
|
import com.dxhy.erp.utils.Base64; |
|
|
|
import com.dxhy.erp.utils.Base64; |
|
|
|
import com.dxhy.erp.utils.CheckUtil; |
|
|
|
|
|
|
|
import com.dxhy.erp.utils.HmacSHA1Util; |
|
|
|
import com.dxhy.erp.utils.HmacSHA1Util; |
|
|
|
import com.google.gson.JsonArray; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
@ -134,7 +131,13 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
data.put("message", "success"); |
|
|
|
data.put("message", "success"); |
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord, 0,0, JSONObject.toJSONString(data)); |
|
|
|
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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
} |
|
|
|
} |
|
|
@ -147,7 +150,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
//权限校验
|
|
|
|
//权限校验
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("发票号码不能为空!")),0); |
|
|
|
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("发票号码不能为空!"))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票号码不能为空!"))); |
|
|
|
} |
|
|
|
} |
|
|
@ -161,14 +169,24 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
pramsMap.put("billingDate", billingDate); |
|
|
|
pramsMap.put("billingDate", billingDate); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("开票日期不能为空!")), 0); |
|
|
|
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("开票日期不能为空!"))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!"))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceType"))) { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("invoiceType"))) { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("发票类型不能为空!")), 0); |
|
|
|
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("发票类型不能为空!"))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票类型不能为空!"))); |
|
|
|
} |
|
|
|
} |
|
|
@ -181,14 +199,24 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|| SNFplxEnum.QDPP.getSnFplxDm().equals(pramsMap.get("invoiceType"))) { |
|
|
|
|| SNFplxEnum.QDPP.getSnFplxDm().equals(pramsMap.get("invoiceType"))) { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("totalAmount"))) { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("totalAmount"))) { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("金额不能为空!")), 0); |
|
|
|
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("金额不能为空!"))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!"))); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("checkCode"))) { |
|
|
|
if (StringUtils.isBlank(pramsMap.get("checkCode"))) { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("校验码不能为空!")), 0); |
|
|
|
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("校验码不能为空!"))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!"))); |
|
|
|
} |
|
|
|
} |
|
|
@ -205,7 +233,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
String notes = invoiceQueryService.checkingInvoiceInfo("business", uuid, getUserInfo()); |
|
|
|
String notes = invoiceQueryService.checkingInvoiceInfo("business", uuid, getUserInfo()); |
|
|
|
if (notes != null) { |
|
|
|
if (notes != null) { |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error(notes)), 0); |
|
|
|
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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); |
|
|
|
} |
|
|
|
} |
|
|
@ -261,14 +294,19 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
//查验结果保存
|
|
|
|
//查验结果保存
|
|
|
|
// saveCheckLog(pramsMap, checkInvoice);
|
|
|
|
// saveCheckLog(pramsMap, checkInvoice);
|
|
|
|
|
|
|
|
|
|
|
|
if (checkInvoiceResult!=null && checkInvoiceResult.containsKey("code")) { |
|
|
|
try { |
|
|
|
if (checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
if (checkInvoiceResult!=null && checkInvoiceResult.containsKey("code")) { |
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
if (checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e.getMessage()); |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
@ -295,7 +333,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
//查验结果保存
|
|
|
|
//查验结果保存
|
|
|
|
// saveCheckLog(pramsMap,checkInvoice);
|
|
|
|
// saveCheckLog(pramsMap,checkInvoice);
|
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
} |
|
|
|
} |
|
|
@ -315,7 +358,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("查验失败,errormsg:{}",e.getMessage()); |
|
|
|
log.error("查验失败,errormsg:{}",e.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error("查验失败,"+e.getMessage())), 1); |
|
|
|
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()))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败,"+e.getMessage()))); |
|
|
|
} |
|
|
|
} |
|
|
@ -326,7 +374,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
R data = new R(); |
|
|
|
R data = new R(); |
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(data), 0); |
|
|
|
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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
|
@ -342,7 +395,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
log.info("返回给影像系统的结果为:{}", checkInvoiceResult); |
|
|
|
log.info("返回给影像系统的结果为:{}", checkInvoiceResult); |
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
@ -364,13 +422,23 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
data.put("data", checkInvoiceResult); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,0,0,JSONObject.toJSONString(data)); |
|
|
|
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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(singleInvoiceCheckRecord,1,1,JSONObject.toJSONString(R.error().put("data", checkInvoiceResult)),0); |
|
|
|
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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error().put("data", checkInvoiceResult))); |
|
|
|
} |
|
|
|
} |
|
|
@ -700,7 +768,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
data.put("data", result); |
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(R.error(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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(result))); |
|
|
|
} |
|
|
|
} |
|
|
@ -729,7 +802,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
data.put("data", result); |
|
|
|
data.put("data", result); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -737,7 +815,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
log.error("", e); |
|
|
|
log.error("", e); |
|
|
|
|
|
|
|
|
|
|
|
// requestRecordService.saveRecord(pushCheckResultToSAPRecord,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)), 1);
|
|
|
|
// requestRecordService.saveRecord(pushCheckResultToSAPRecord,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)), 1);
|
|
|
|
requestRecordService.saveRecord(record,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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY))); |
|
|
|
} |
|
|
|
} |
|
|
@ -759,7 +842,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
data.put("data", ""); |
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -779,7 +867,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
R data = new R(1000, "default success"); |
|
|
|
data.put("data", ""); |
|
|
|
data.put("data", ""); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,0, 0, JSONObject.toJSONString(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)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
|
@ -789,21 +882,36 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
exception.printStackTrace(); |
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)),1); |
|
|
|
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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); |
|
|
|
} catch(NullPointerException exception){ |
|
|
|
} catch(NullPointerException exception){ |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
exception.printStackTrace(); |
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)), 1); |
|
|
|
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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); |
|
|
|
} catch(Exception exception){ |
|
|
|
} catch(Exception exception){ |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
log.error("同步SAP失败,报错信息为:{}", exception); |
|
|
|
exception.printStackTrace(); |
|
|
|
exception.printStackTrace(); |
|
|
|
|
|
|
|
|
|
|
|
requestRecordService.saveRecord(record,1, 1, JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)),1); |
|
|
|
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))); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); |
|
|
|
} |
|
|
|
} |
|
|
|