From fa2e62e6aa9d7a9f10f53863ccbf9cc35a69e59e Mon Sep 17 00:00:00 2001 From: yefei Date: Fri, 12 May 2023 14:25:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?ariesy=20=E6=9F=A5=E9=AA=8C=E6=97=B6,?= =?UTF-8?q?=E5=BA=95=E8=B4=A6=E5=BA=93=E5=AD=98=E5=9C=A8=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E7=A5=A8,=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=98=8E?= =?UTF-8?q?=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 84 +++++++------ .../dao/BaseTDxRecordInvoiceDetailDao.java | 20 +++ .../dao/InvoiceDownDetaiSaleInsertDao.java | 14 +++ .../entity/BaseTDxRecordInvoiceDetail.java | 118 ++++++++++++++++++ .../entity/RecordInvoiceSaleDetailModel.java | 94 ++++++++++++++ .../impl/SignSaveInvoiceInfoServiceImpl.java | 3 + 6 files changed, 294 insertions(+), 39 deletions(-) create mode 100644 dxhy-erp/src/main/java/com/dxhy/erp/dao/BaseTDxRecordInvoiceDetailDao.java create mode 100644 dxhy-erp/src/main/java/com/dxhy/erp/dao/InvoiceDownDetaiSaleInsertDao.java create mode 100644 dxhy-erp/src/main/java/com/dxhy/erp/entity/BaseTDxRecordInvoiceDetail.java create mode 100644 dxhy-erp/src/main/java/com/dxhy/erp/entity/RecordInvoiceSaleDetailModel.java 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 05620a1d..a41895d2 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 @@ -11,32 +11,26 @@ import com.dxhy.common.controller.AbstractController; import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; -import com.dxhy.common.util.UserInfoUtil; import com.dxhy.common.utils.Base64Encoding; import com.dxhy.common.utils.R; -import com.dxhy.common.vo.Tax; -import com.dxhy.common.vo.TaxOrgCode; import com.dxhy.erp.dao.*; import com.dxhy.erp.entity.*; import com.dxhy.erp.entity.sdny.*; import com.dxhy.erp.service.*; import com.dxhy.erp.utils.Base64; import com.dxhy.erp.utils.HmacSHA1Util; -import com.dxhy.erp.utils.ServiceResult; +import com.google.gson.JsonArray; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Result; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Async; -import org.springframework.util.Base64Utils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.text.ParseException; -import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.*; @@ -85,6 +79,12 @@ public class SDNYMainProcessController extends AbstractController { @Resource private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao; + @Resource + private BaseTDxRecordInvoiceDetailDao baseTDxRecordInvoiceDetailDao; + + @Resource + private InvoiceDownDetaiSaleInsertDao invoiceDownDetaiSaleInsertDao; + @Resource private RecordInvoiceDao recordInvoiceDao; @@ -175,16 +175,25 @@ public class SDNYMainProcessController extends AbstractController { return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); } - - //查询底账库是否有对应发票,有则直接返回 - TdxCheckRecordInvoice checkInvoiceByUuid = signCheckRecordService.getCheckInvoiceByUuid(uuid); + 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("invoice_no", invoiceNo); + DynamicContextHolder.push(DbConstant.DETAIL_READ); + List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); + + DynamicContextHolder.push(DbConstant.BUSINESS_READ); JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); - convertToResult(checkInvoice); + JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail); + + convertToResult(checkInvoice,checkInvoiceDetail); data.put("data", checkInvoice); //查验结果保存 @@ -198,8 +207,17 @@ public class SDNYMainProcessController extends AbstractController { 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); + + DynamicContextHolder.push(DbConstant.BUSINESS_READ); + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(tdxSaleRecordInvoice); - convertToResult(checkInvoice); + JSONArray saleDetail = (JSONArray) JSONObject.toJSON(recordInvoiceSaleDetailModel); + convertToResult(checkInvoice,saleDetail); data.put("data", checkInvoice); //查验结果保存 @@ -340,7 +358,7 @@ public class SDNYMainProcessController extends AbstractController { return data; } - private void convertToResult(JSONObject checkInvoice) throws ParseException { + private void convertToResult(JSONObject checkInvoice, JSONArray detailArray) throws ParseException { checkInvoice.put("totalTax", checkInvoice.getString("taxAmount")); checkInvoice.put("amountTax", checkInvoice.getString("totalAmount")); checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount")); @@ -390,40 +408,29 @@ public class SDNYMainProcessController extends AbstractController { String taxRate = ""; List> returnDetailList = new ArrayList<>(); -// JSONArray detailList = (JSONArray) invoiceData.get("detailList"); - JSONArray detailList = new JSONArray(); + JSONArray detailList = detailArray; for (int i = 0; i < detailList.size(); i++) { String taxRateDetail = ""; JSONObject detail = (JSONObject) detailList.get(i); Map snDetailMap = new HashMap(); snDetailMap.put("rowNo", i + 1 + ""); - snDetailMap.put("commodityCode", detail.getString("ssflbm")); - snDetailMap.put("commodityName", detail.getString("hwmc")); - snDetailMap.put("specificationModel", detail.getString("ggxh")); - snDetailMap.put("unit", detail.getString("jldw")); - String quantity = detail.getString("spsl"); -// if (quantity.length() > 3) { -// int index = quantity.indexOf("."); -// quantity = quantity.substring(0, index + 2); -// } + snDetailMap.put("commodityCode", detail.getString("goodsNum")); + snDetailMap.put("commodityName", detail.getString("spfwjc")); + snDetailMap.put("specificationModel", detail.getString("model")); + snDetailMap.put("unit", detail.getString("unit")); + String quantity = detail.getString("num"); snDetailMap.put("quantity", quantity); - String unitPrice = detail.getString("bhsdj"); -// if (unitPrice.length() > 3) { -// int index = unitPrice.indexOf("."); -// unitPrice = unitPrice.substring(0, index + 3); -// } - + String unitPrice = detail.getString("unitPrice"); snDetailMap.put("unitPrice", unitPrice); - if ("11".equals(invoiceType)) { snDetailMap.put("tax", "0"); //如果是卷票计算合计金额 Float hjje = null; - if (detail.getString("se") != null && detail.getString("je") != null) { + if (detail.getString("detailAmount") != null && detail.getString("taxAmount") != null) { Float je = Float.parseFloat(detail.getString("je")); Float se = Float.parseFloat(detail.getString("se")); hjje = je + se; @@ -433,17 +440,17 @@ public class SDNYMainProcessController extends AbstractController { snDetailMap.put("amount", hjje.toString()); } else { - snDetailMap.put("tax", "***".equals(detail.getString("se")) ? "0.00" : detail.getString("se")); - snDetailMap.put("amount", detail.getString("je")); + snDetailMap.put("tax", "***".equals(detail.getString("amount")) ? "0.00" : detail.getString("se")); + snDetailMap.put("amount", detail.getString("detailAmount")); } - if ("免税".equals(detail.getString("sl"))) { + if ("免税".equals(detail.getString("taxRate"))) { taxRateDetail = "0"; snDetailMap.put("taxRate", taxRateDetail); } else { - if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) { - taxRateDetail = detail.get("sl").toString(); + if (detail.get("taxRate") != null && StringUtils.isNoneBlank(detail.get("taxRate").toString())) { + taxRateDetail = detail.get("taxRate").toString(); if (!"0".equals(taxRateDetail)) { if (StringUtils.isNoneBlank(taxRateDetail)) { int index = taxRateDetail.indexOf("%"); @@ -469,8 +476,7 @@ public class SDNYMainProcessController extends AbstractController { } } - log.info("明细-tax={}", detail.get("se")); - log.info("明细-commodityCode={}", detail.get("ssflbm")); + log.info("明细-tax={}", detail.get("taxAmount")); snDetailMap.put("currentDateEnd", detail.getString("txrqz")); snDetailMap.put("currentDateStart", detail.getString("txrqq")); snDetailMap.put("licensePlateNum", detail.getString("cph")); diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/BaseTDxRecordInvoiceDetailDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/BaseTDxRecordInvoiceDetailDao.java new file mode 100644 index 00000000..ae5ba34f --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/BaseTDxRecordInvoiceDetailDao.java @@ -0,0 +1,20 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.BaseTDxRecordInvoiceDetail; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * 底账明细表dao + * + * + * @author peipei.li + * @date 2019-04-23 + */ +@SuppressWarnings("AlibabaClassNamingShouldBeCamel") +@Mapper +public interface BaseTDxRecordInvoiceDetailDao extends BaseMapper { + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/InvoiceDownDetaiSaleInsertDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/InvoiceDownDetaiSaleInsertDao.java new file mode 100644 index 00000000..e77229e2 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/InvoiceDownDetaiSaleInsertDao.java @@ -0,0 +1,14 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.RecordInvoiceSaleDetailModel; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author user + */ +@SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaClassNamingShouldBeCamel"}) +@Mapper +public interface InvoiceDownDetaiSaleInsertDao extends BaseMapper { + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/BaseTDxRecordInvoiceDetail.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/BaseTDxRecordInvoiceDetail.java new file mode 100644 index 00000000..ae0d8db9 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/BaseTDxRecordInvoiceDetail.java @@ -0,0 +1,118 @@ +package com.dxhy.erp.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * + * 底账明细表 + * + * @author peipei.li + * @date 2019-04-23 + */ +@SuppressWarnings("AlibabaClassNamingShouldBeCamel") +@Data +@TableName("t_dx_record_invoice_detail") +public class BaseTDxRecordInvoiceDetail implements Serializable { + + private static final long serialVersionUID = -6703830991573450761L; + + /** + * id + */ + private Long id; + + /** + * 唯一标识(发票代码+发票号码) + */ + private String uuid; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNo; + + /** + * 明细序号 + */ + private String detailNo; + + /** + * 货物或应税劳务名称 + */ + private String goodsName; + + /** + * 规格型号 + */ + private String model; + + /** + * 单位 + */ + private String unit; + + /** + * 数量 + */ + private String num; + + /** + * 单价 + */ + private String unitPrice; + + /** + * 金额 + */ + private String detailAmount; + + /** + * 税率 + */ + private String taxRate; + + /** + * 税额 + */ + private String taxAmount; + + /** + * 车牌号 + */ + private String cph; + + /** + * 类型 + */ + private String lx; + + /** + * 通行日期起 + */ + private String txrqq; + + /** + * 通行日期止 + */ + private String txrqz; + + /** + * 商品编码 + */ + private String goodsNum; + + /** + * 商品编码 + */ + private String spfwjc; + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/RecordInvoiceSaleDetailModel.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/RecordInvoiceSaleDetailModel.java new file mode 100644 index 00000000..a638fa43 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/RecordInvoiceSaleDetailModel.java @@ -0,0 +1,94 @@ +package com.dxhy.erp.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +/** + * 专普电明细 + * + * @author jiaohongyang + */ +@Data +@Getter +@Setter +@ToString +@TableName("t_dx_record_invoice_detail_sales") +public class RecordInvoiceSaleDetailModel { + @TableId + private Long id; + /** + * 货物或应税劳务名称 + */ + private String goodsName; + + /** + * 规格型号 + */ + private String model; + + /** + * 单位 + */ + private String unit; + + /** + * 数量 + */ + private String num; + + /** + * 单价 + */ + private String unitPrice; + + /** + * 金额 + */ + private String detailAmount; + + /** + * 税率 + */ + private String taxRate; + + /** + * 税额 + */ + private String taxAmount; + + /** + * 车牌号 + */ + private String cph; + + /** + * 类型 + */ + private String lx; + + /** + * 通行日期起 + */ + private String txrqq; + + /** + * 通行日期止 + */ + private String txrqz; + + /** + * 商品编码 + */ + private String goodsNum; + + private String uuid; + + private String invoiceCode; + + private String invoiceNo; + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java index e04faabf..71dec67d 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java @@ -348,6 +348,9 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl Date: Fri, 12 May 2023 15:03:13 +0800 Subject: [PATCH 2/6] =?UTF-8?q?ariesy=20=E6=9F=A5=E9=AA=8C=E6=97=B6,?= =?UTF-8?q?=E5=BA=95=E8=B4=A6=E5=BA=93=E5=AD=98=E5=9C=A8=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E7=A5=A8,=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=98=8E?= =?UTF-8?q?=E7=BB=86=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/erp/controller/SDNYMainProcessController.java | 2 +- .../erp/service/impl/SignSaveInvoiceInfoServiceImpl.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 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 a41895d2..b6e24fba 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 @@ -416,7 +416,7 @@ public class SDNYMainProcessController extends AbstractController { Map snDetailMap = new HashMap(); snDetailMap.put("rowNo", i + 1 + ""); snDetailMap.put("commodityCode", detail.getString("goodsNum")); - snDetailMap.put("commodityName", detail.getString("spfwjc")); + snDetailMap.put("commodityName", detail.getString("goodsName")); snDetailMap.put("specificationModel", detail.getString("model")); snDetailMap.put("unit", detail.getString("unit")); String quantity = detail.getString("num"); diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java index 71dec67d..987e032f 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java @@ -159,10 +159,10 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl Date: Mon, 15 May 2023 11:36:07 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=9D=9E?= =?UTF-8?q?=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/SDNYMainProcessController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 2e934639..f1c163c4 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 @@ -136,13 +136,13 @@ public class SDNYMainProcessController extends AbstractController { //查验类发票,执行查验操作后入库 log.info("查验类发票,执行查验操作后入库"); //权限校验 - if (pramsMap.get("invoiceNumber").isEmpty()) { + if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) { return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票号码不能为空!"))); } pramsMap.put("invoiceNo", pramsMap.get("invoiceNumber")); - if (!pramsMap.get("billingDate").isEmpty()) { + if (StringUtils.isNotBlank(pramsMap.get("billingDate"))) { String billingDate = pramsMap.get("billingDate").replaceAll("-", ""); iu.setKprq(pramsMap.get("billingDate")); pramsMap.put("invoiceDate", billingDate); @@ -151,8 +151,8 @@ public class SDNYMainProcessController extends AbstractController { return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!"))); } - if (pramsMap.get("invoiceType").isEmpty()) { - return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!"))); + if (StringUtils.isBlank(pramsMap.get("invoiceType"))) { + return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票类型不能为空!"))); } if (SNFplxEnum.ZP.getSnFplxDm().equals(pramsMap.get("invoiceType")) @@ -161,11 +161,11 @@ public class SDNYMainProcessController extends AbstractController { || SNFplxEnum.ESC.getSnFplxDm().equals(pramsMap.get("invoiceType")) || SNFplxEnum.QDZP.getSnFplxDm().equals(pramsMap.get("invoiceType")) || SNFplxEnum.QDPP.getSnFplxDm().equals(pramsMap.get("invoiceType"))) { - if (pramsMap.get("totalAmount").isEmpty()) { + if (StringUtils.isBlank(pramsMap.get("totalAmount"))) { return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!"))); } } else { - if (pramsMap.get("checkCode").isEmpty()) { + if (StringUtils.isBlank(pramsMap.get("checkCode"))){ return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!"))); } } From 3d68f32a571b520b47040cd4a3c8f6c5c9586cd2 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 15 May 2023 16:38:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E5=BA=95?= =?UTF-8?q?=E8=B4=A6=E5=BA=93=E5=B7=B2=E6=9C=89=E6=95=B0=E6=8D=AE=20?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=8C=E5=AD=97=E6=AE=B5=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 16 ++++++++++------ .../impl/SignSaveInvoiceInfoServiceImpl.java | 2 +- 2 files changed, 11 insertions(+), 7 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 f1c163c4..ddac6f3d 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 @@ -193,10 +193,10 @@ public class SDNYMainProcessController extends AbstractController { String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); QueryWrapper detailWrapper = new QueryWrapper<>(); detailWrapper.eq("invoice_no", invoiceNo); - DynamicContextHolder.push(DbConstant.DETAIL_READ); + DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); - DynamicContextHolder.push(DbConstant.BUSINESS_READ); + DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail); @@ -443,16 +443,20 @@ public class SDNYMainProcessController extends AbstractController { //如果是卷票计算合计金额 Float hjje = null; if (detail.getString("detailAmount") != null && detail.getString("taxAmount") != null) { - Float je = Float.parseFloat(detail.getString("je")); - Float se = Float.parseFloat(detail.getString("se")); - hjje = je + se; + Float je = Float.parseFloat(detail.getString("detailAmount")); + if(detail.getString("taxAmount") != null) { + Float se = Float.parseFloat(detail.getString("se")); + hjje = je + se; + }else{ + hjje = je; + } } if (hjje != null) snDetailMap.put("amount", hjje.toString()); } else { - snDetailMap.put("tax", "***".equals(detail.getString("amount")) ? "0.00" : detail.getString("se")); + snDetailMap.put("tax", "***".equals(detail.getString("taxAmount")) ? "0.00" : detail.getString("taxAmount")); snDetailMap.put("amount", detail.getString("detailAmount")); } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java index 987e032f..3eb3191c 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java @@ -288,7 +288,7 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl invoiceDetailList = new ArrayList<>(dataArray.size()); for (int i = 0; i < dataArray.size(); i++) { JSONObject invoiceDetailQuery = dataArray.getJSONObject(i); From c6d8e4e125a3a34e044f2bb15ca91022aa1d7f24 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 15 May 2023 17:21:40 +0800 Subject: [PATCH 5/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=8F=91=E7=A5=A8=E5=8F=B7=E7=A0=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=98=8E=E7=BB=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/controller/SDNYMainProcessController.java | 2 +- 1 file changed, 1 insertion(+), 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 ddac6f3d..8716d009 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 @@ -192,7 +192,7 @@ public class SDNYMainProcessController extends AbstractController { R data = new R(1000, "default success"); String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); QueryWrapper detailWrapper = new QueryWrapper<>(); - detailWrapper.eq("invoice_no", invoiceNo); + detailWrapper.eq("uuid", uuid); DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); From 73ca5e1e44c6c9e3418df1aa902f884c4191574a Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 15 May 2023 19:18:10 +0800 Subject: [PATCH 6/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E9=AA=8C=E6=9F=A5=E8=AF=A2=E5=BA=95=E8=B4=A6=E5=BA=93=E5=85=A8?= =?UTF-8?q?=E7=94=B5=E7=B1=BB=E5=9E=8B=E5=8F=91=E7=A5=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=92=8C=E5=8F=B7=E7=A0=81=E5=88=86=E5=BC=80=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/erp/controller/SDNYMainProcessController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 8716d009..e7bcc8e8 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 @@ -387,8 +387,13 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("administrativeDivisionNo", ""); checkInvoice.put("administrativeDivisionName", ""); - checkInvoice.put("invoiceCode", invoiceCode); - checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString()); + if("31".equals(invoiceType) || "32".equals(invoiceType) || "185".equals(invoiceType) || "186".equals(invoiceType)){ + checkInvoice.put("invoiceCode", ""); + checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString()); + }else { + checkInvoice.put("invoiceCode", invoiceCode); + checkInvoice.put("invoiceNumber", invoiceCode == null ? checkInvoice.get("invoiceNo").toString() :invoiceCode + checkInvoice.get("invoiceNo").toString()); + } String uuid = ""; if (invoiceCode != null && StringUtils.isNoneBlank(invoiceCode)) { uuid = invoiceCode + checkInvoice.get("invoiceNo").toString();