From 6e2afbec06701eb40498b19f8efa75c8474fd663 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 10:30:07 +0800 Subject: [PATCH] =?UTF-8?q?ariesy=20=E8=B4=AD=E6=96=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=87=8D=E6=96=B0=E6=9F=A5=E9=AA=8C&?= =?UTF-8?q?=E6=9C=BA=E5=8A=A8=E8=BD=A6=E4=BB=B7=E7=A8=8E=E5=90=88=E8=AE=A1?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index 9eafc439..36a260a9 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -263,6 +263,41 @@ public class SDNYMainProcessController extends AbstractController { if (checkInvoiceByUuid != null) { log.info("进项票池已存在发票.直接返回票池信息"); R data = new R(1000, "default success"); + + //如果购方名称为空,则查验之后补充购销方相关信息 + String gfName = checkInvoiceByUuid.getGfName(); + String gfAddressAndPhone = checkInvoiceByUuid.getGfAddressAndPhone(); + if(StringUtils.isEmpty(gfName) || StringUtils.isEmpty(gfAddressAndPhone)){ + log.info("购方名称为空,查验补充信息"); + checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap, null); + + if (!checkInvoiceResult.containsKey("code")) { + if (!checkInvoiceResult.containsKey("cyjg")) { + //先删除原有主数据,再查验更新主数据和明细数据 + int delete = baseTDxRecordInvoiceDao.delete(recordWrapper); + if (delete > 0) { + checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); + signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); + } + } 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)); + + } + } + + checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); + } + String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); QueryWrapper detailWrapper = new QueryWrapper<>(); detailWrapper.eq("uuid", uuid); @@ -807,7 +842,7 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("taxAuthorityNo", vehicleList.getString("taxBureauCode")); checkInvoice.put("taxAuthorityName", vehicleList.getString("taxBureauName")); checkInvoice.put("idcardNo", vehicleList.getString("buyerIdNum")); - checkInvoice.put("amountTax", vehicleList.getString("carPrice")); +// checkInvoice.put("amountTax", vehicleList.getString("carPrice")); } //二手车 if ("15".equals(invoiceType)) {