接口记录查询sql修改以及接口记录保存代码修改

release
xuliangwei 2 years ago
parent 0aaf2d9bad
commit d142535a98
  1. 29
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  2. 4
      dxhy-erp/src/main/resources/mapper/RequestRecordMapper.xml

@ -270,6 +270,14 @@ public class SDNYMainProcessController extends AbstractController {
if(baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0){
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("cyjg")) {
//先删除原有主数据,再查验更新主数据和明细数据
@ -277,12 +285,6 @@ public class SDNYMainProcessController extends AbstractController {
if(delete > 0) {
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber"));
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);
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
@ -290,6 +292,15 @@ public class SDNYMainProcessController extends AbstractController {
}
}else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) {
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));
}
@ -310,12 +321,6 @@ public class SDNYMainProcessController extends AbstractController {
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.saveSuccessfulRequestRecord(singleInvoiceCheckRecord,JSONObject.toJSONString(data));

@ -55,10 +55,10 @@
<if test="portName!=null and portName!=''">
and port_name=#{portName}
</if>
<if test="startTime!=null and startTime!=''">
<if test="startTime!=null">
and create_time>=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
<if test="endTime!=null">
<![CDATA[
and create_time<=#{endTime}
]]>

Loading…
Cancel
Save