|
|
@ -270,6 +270,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
|
|
if(baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0){ |
|
|
|
if(baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0){ |
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null); |
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)); |
|
|
|
|
|
|
|
|
|
|
|
if (!checkInvoiceResult.containsKey("code")) { |
|
|
|
if (!checkInvoiceResult.containsKey("code")) { |
|
|
|
if (!checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
if (!checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
//先删除原有主数据,再查验更新主数据和明细数据
|
|
|
|
//先删除原有主数据,再查验更新主数据和明细数据
|
|
|
@ -277,12 +285,6 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
if(delete > 0) { |
|
|
|
if(delete > 0) { |
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
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)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); |
|
|
|
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); |
|
|
|
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); |
|
|
|
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); |
|
|
@ -290,6 +292,15 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
} |
|
|
|
} |
|
|
|
}else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
}else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
|
|
|
|
(String) checkInvoiceResult.get("cyjgxx")); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}",e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -310,12 +321,6 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
if (checkInvoiceResult.containsKey("code")) { |
|
|
|
if (checkInvoiceResult.containsKey("code")) { |
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0,JSONObject.toJSONString(data), |
|
|
|
(String) checkInvoiceResult.get("message")); |
|
|
|
(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 { |
|
|
|
} else { |
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data)); |
|
|
|
requestRecordService.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data)); |
|
|
|