ariesy 补明细的时候 如果查验结果是失败的,返回相应的失败信息

release
yefei 2 years ago
parent 50e5ad9cc6
commit bb47e682c9
  1. 23
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java

@ -263,26 +263,31 @@ public class SDNYMainProcessController extends AbstractController {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
if(baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0){
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null);
if (!checkInvoiceResult.containsKey("code")) {
if (!checkInvoiceResult.containsKey("cyjg")) {
//先删除原有主数据,再查验更新主数据和明细数据
int delete = baseTDxRecordInvoiceDao.delete(recordWrapper);
if(delete > 0) {
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null);
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.setActiveCall("singleCheckInvoice");
singleInvoiceCheckRecord.setActiveCallResponse(JSONObject.toJSONString(checkInvoiceResult));
if (!checkInvoiceResult.containsKey("code")) {
if (!checkInvoiceResult.containsKey("cyjg")) {
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber"));
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName);
}
}
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ);
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
}
}
}else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) {
data = errorInfo(checkInvoiceResult, data);
return ResponseEntity.ok(JSONObject.toJSONString(data));
}
}
}
JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid);
JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail);

Loading…
Cancel
Save