From 052725b75eb46a76a7ed15a32a8fe3c848e4883a Mon Sep 17 00:00:00 2001 From: yefei Date: Wed, 17 May 2023 16:26:04 +0800 Subject: [PATCH] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E8=A1=8C?= =?UTF-8?q?=E8=B4=B9=E7=B1=BB=E5=8F=91=E7=A5=A8=E6=9F=A5=E9=AA=8C=E6=97=A0?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) 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 bd41225e..d9772285 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 @@ -183,56 +183,59 @@ public class SDNYMainProcessController extends AbstractController { return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); } - //查询底账库是否有对应发票,有则直接返回 - QueryWrapper recordWrapper = new QueryWrapper<>(); - recordWrapper.eq("uuid", uuid); - BaseTDxRecordInvoice checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); - if (checkInvoiceByUuid != null) { - log.info("进项票池已存在发票.直接返回票池信息"); - R data = new R(1000, "default success"); - String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); - QueryWrapper detailWrapper = new QueryWrapper<>(); - detailWrapper.eq("uuid", uuid); - DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); - List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); + //非通行费类发票 先判断底账库中是否已存在 + if(!"32000".equals(pramsMap.get("invoiceType"))) { + //查询底账库是否有对应发票,有则直接返回 + QueryWrapper recordWrapper = new QueryWrapper<>(); + recordWrapper.eq("uuid", uuid); + BaseTDxRecordInvoice checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); + if (checkInvoiceByUuid != null) { + log.info("进项票池已存在发票.直接返回票池信息"); + R data = new R(1000, "default success"); + String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); + QueryWrapper detailWrapper = new QueryWrapper<>(); + detailWrapper.eq("uuid", uuid); + DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); + List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); - DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); + DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); - JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); - JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail); + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); + JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail); - convertToResult(checkInvoice,checkInvoiceDetail); + convertToResult(checkInvoice, checkInvoiceDetail); - data.put("data", checkInvoice); - //查验结果保存 + data.put("data", checkInvoice); + //查验结果保存 // saveCheckLog(pramsMap, checkInvoice); - return ResponseEntity.ok(JSONObject.toJSONString(data)); - } else { - TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid); - log.info("tdxSaleRecordInvoice={}", tdxSaleRecordInvoice); - if (tdxSaleRecordInvoice != null) { - log.info("销项票池已存在发票.直接返回票池信息"); - R data = new R(1000, "default success"); + return ResponseEntity.ok(JSONObject.toJSONString(data)); + } else { + TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid); + log.info("tdxSaleRecordInvoice={}", tdxSaleRecordInvoice); + if (tdxSaleRecordInvoice != null) { + log.info("销项票池已存在发票.直接返回票池信息"); + R data = new R(1000, "default success"); - String invoiceNo = tdxSaleRecordInvoice.getInvoiceNo(); - QueryWrapper saleDetailWrapper = new QueryWrapper<>(); - saleDetailWrapper.eq("invoice_no", invoiceNo); - DynamicContextHolder.push(DbConstant.DETAIL_READ); - List recordInvoiceSaleDetailModel = invoiceDownDetaiSaleInsertDao.selectList(saleDetailWrapper); + String invoiceNo = tdxSaleRecordInvoice.getInvoiceNo(); + QueryWrapper saleDetailWrapper = new QueryWrapper<>(); + saleDetailWrapper.eq("invoice_no", invoiceNo); + DynamicContextHolder.push(DbConstant.DETAIL_READ); + List recordInvoiceSaleDetailModel = invoiceDownDetaiSaleInsertDao.selectList(saleDetailWrapper); - DynamicContextHolder.push(DbConstant.BUSINESS_READ); + DynamicContextHolder.push(DbConstant.BUSINESS_READ); - JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(tdxSaleRecordInvoice); - JSONArray saleDetail = (JSONArray) JSONObject.toJSON(recordInvoiceSaleDetailModel); - convertToResult(checkInvoice,saleDetail); + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(tdxSaleRecordInvoice); + JSONArray saleDetail = (JSONArray) JSONObject.toJSON(recordInvoiceSaleDetailModel); + convertToResult(checkInvoice, saleDetail); - data.put("data", checkInvoice); - //查验结果保存 + data.put("data", checkInvoice); + //查验结果保存 // saveCheckLog(pramsMap,checkInvoice); - return ResponseEntity.ok(JSONObject.toJSONString(data)); + return ResponseEntity.ok(JSONObject.toJSONString(data)); + } } }