From 263b98c910a10d56ecc7fd30a55e33c812da17c3 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Thu, 1 Jun 2023 09:57:49 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E5=AE=A2=E7=A5=A8=E4=BB=A3=E7=A0=81=E8=A6=86=E7=9B=96=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/erp/service/SNPushCheckRecordService.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index d77173f5..587d8959 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -10,6 +10,7 @@ import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; +import com.dxhy.common.util.StringHelper; import com.dxhy.common.vo.UserInfo; import com.dxhy.erp.dao.*; import com.dxhy.erp.entity.*; @@ -718,8 +719,14 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("uuid={}", uuid); reimburse.setSelectId(uuid); - reimburse.setTaxRate(invoice.getTaxRate()); - reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); + if (StringHelper.isNotBlank(invoice.getTaxRate())){ + reimburse.setTaxRate(invoice.getTaxRate()); + reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); + }else { + reimburse.setTaxRate("0%"); + reimburse.setTaxCode(getTaxCode(reimburse.getTaxRate())); + } + reimburse.setIsDeduction(invoice.getIsDeductible()); if (StringUtils.isNoneBlank(reimburse.getInvoiceCode())) { From fc5c0e3a3934ec36634a5c37643fe427281201ed Mon Sep 17 00:00:00 2001 From: yefei Date: Thu, 1 Jun 2023 15:26:24 +0800 Subject: [PATCH 02/15] =?UTF-8?q?ariesy=20=E6=8E=A8=E9=80=81=E5=88=B0S4?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=8D=E4=BC=A0=E5=B8=A6=E9=94=80=E8=B4=A7?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E7=9A=84=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/erp/controller/SDNYMainProcessController.java | 3 +++ 1 file changed, 3 insertions(+) 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 d3a54b26..a78050ae 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 @@ -452,6 +452,9 @@ public class SDNYMainProcessController extends AbstractController { for (int i = 0; i < detailList.size(); i++) { String taxRateDetail = ""; JSONObject detail = (JSONObject) detailList.get(i); + if(StringUtils.isNotEmpty(detail.getString("goodsName")) && detail.getString("goodsName").contains("详见销货清单")){ + continue; + } Map snDetailMap = new HashMap(); snDetailMap.put("rowNo", i + 1 + ""); snDetailMap.put("commodityCode", detail.getString("goodsNum")); From 335baf1593a74140b29fabeb1036df214e24ce1e Mon Sep 17 00:00:00 2001 From: WangQi <1021674882@qq.com> Date: Thu, 1 Jun 2023 15:40:38 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=9F=A5=E9=AA=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=A8=8E=E7=8E=87=E4=B8=BA=E4=B8=8D=E5=BE=81=E7=A8=8E=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/service/SNPushCheckRecordService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 587d8959..46d5a178 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -451,7 +451,8 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { jsonObject.put("tonnage", invoiceData.get("dw")); jsonObject.put("limitPeople", invoiceData.get("xcrs")); String taxRate = ""; - if ("免税".equals(invoiceData.get("sl"))) { + if (invoiceData.get("sl")==null||StringUtils.isBlank(invoiceData.get("sl").toString())|| + "免税".equals(invoiceData.get("sl").toString())|| "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) { taxRate = "0"; jsonObject.put("taxRate", taxRate); } else { From 5ce2eeef15084d1946a94b1dda7b221cdd1d47b2 Mon Sep 17 00:00:00 2001 From: WangQi <1021674882@qq.com> Date: Thu, 1 Jun 2023 15:51:01 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=9F=A5=E9=AA=8C=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= 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, 2 insertions(+) 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 d3a54b26..300af15a 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,8 @@ public class SDNYMainProcessController extends AbstractController { log.info("查验结果为:{}", checkInvoiceResult); } catch (Exception e) { e.printStackTrace(); + log.error("查验失败,errormsg:{}",e.getMessage()); + return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败,"+e.getMessage()))); } if (!checkInvoiceResult.containsKey("code")) { From 7e55595765999873c45279ad093f6915ad3475b3 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Fri, 2 Jun 2023 10:47:49 +0800 Subject: [PATCH 05/15] =?UTF-8?q?po=E6=8E=A5=E5=8F=A3=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=8F=B7=E7=A0=81=E4=B8=BA=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E5=8F=B7=E7=A0=81=E5=92=8C=E5=8F=91=E7=A5=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8B=BC=E4=B8=B2=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 28 ++++++++++++++++++- .../service/impl/InvoiceAuthServiceImpl.java | 22 +++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java index ac966283..95572f32 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java @@ -840,6 +840,21 @@ public class BaseInvoiceController extends AbstractController { String menuId = (String)map.get("menuId"); String company = (String)map.get("company"); + int curr = 0; + if (map.get("curr") != null){ + curr = (int) map.get("curr"); + }else { + ResponseEntity.ok(R.error("分页数据不能为空")); + } + + int size = 0; + if (map.get("size")!= null){ + size = (int) map.get("size"); + }else { + ResponseEntity.ok(R.error("分页大小不能为空")); + } + + if (StringUtils.isNotBlank(inAccountStatus)){ return ResponseEntity.ok(R.error("入账状态不能为空")); } @@ -851,7 +866,13 @@ public class BaseInvoiceController extends AbstractController { try { BigDecimal tax = new BigDecimal(maxTax); } catch (NumberFormatException e) { - return ResponseEntity.ok(R.error("输入税额上线格式不对,请重新输入")); + return ResponseEntity.ok(R.error("输入税额上限格式不对,请重新输入")); + } + + String allIn = "88"; + + if (map.get("sign") != null && "99".equals((String)map.get("sign"))){ + allIn = "99"; } @@ -890,6 +911,9 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("menuId", menuId); pramsMap.put("menuId", "118061"); pramsMap.put("maxTax",maxTax); + pramsMap.put("sign",allIn); + pramsMap.put("curr",curr); + pramsMap.put("size",size); pramsMap.put("business", getUserInfo().getBusiness()); pramsMap.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); @@ -901,6 +925,8 @@ public class BaseInvoiceController extends AbstractController { } else { gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); } + + if (ObjectUtils.isNotEmpty(gfshList)){ pramsMap.put("gfsh", gfshList); }else { diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index f80d945f..7a0733c0 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -10,6 +10,7 @@ import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.ReturnCodeEnum; import com.dxhy.common.service.impl.MpBaseServiceImpl; +import com.dxhy.common.util.StringHelper; import com.dxhy.common.util.pojo.Authorize; import com.dxhy.common.util.pojo.GlobalInfo; import com.dxhy.erp.dao.*; @@ -19,6 +20,7 @@ import com.dxhy.erp.model.auth.InterfaceCode; import com.dxhy.erp.service.InvoiceAuthService; import com.dxhy.erp.service.TDxInvoiceReimburseService; import com.dxhy.erp.utils.CheckUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; @@ -34,6 +36,7 @@ import java.util.*; */ @SuppressWarnings({"AlibabaMethodTooLong", "AlibabaUndefineMagicConstant"}) @Service +@Slf4j public class InvoiceAuthServiceImpl extends MpBaseServiceImpl implements InvoiceAuthService { @@ -339,7 +342,15 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl{}",zdata1.getZFPHM().length()); + + String fphm = zdata1.getZFPHM(); + if (StringHelper.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ + fphm = fphm.substring(fphm.length() - 8); + log.info("非全电但是号码"); + } + log.info("发票号码{}",fphm); + String uuid = zdata1.getZFPDM()+fphm; zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX())); TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); //查询票池 @@ -361,7 +372,14 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ + fphm = fphm.substring(fphm.length() - 8); + log.info("非全电但是号码"); + } + log.info("发票号码{}",fphm); + String uuid = zdata1.getZFPDM()+fphm; DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ); if(fplxList.contains(zdata1.getZFPLX())){ TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); From a71e34dbf40f223f102c228e194e21629b67f6bc Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Fri, 2 Jun 2023 11:54:09 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-erp/src/main/java/com/dxhy/erp/model/ZDATA.java | 2 ++ .../com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/model/ZDATA.java b/dxhy-erp/src/main/java/com/dxhy/erp/model/ZDATA.java index 03cc5312..ca2c0887 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/model/ZDATA.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/model/ZDATA.java @@ -36,4 +36,6 @@ public class ZDATA { private String BELNR; @JsonProperty(value = "BUDAT") private String BUDAT; + @JsonProperty(value = "XXBS") + private String XXBS; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index f80d945f..d16fa29d 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -362,8 +362,10 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl Date: Fri, 2 Jun 2023 12:03:58 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=AA=E5=8F=96?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index 45f5afb4..9bc509d7 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -342,11 +342,11 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl{}",zdata1.getZFPHM().length()); + log.info("zdata1.getZFPHM()===>{}",zdata1.getZFPHM()); String fphm = zdata1.getZFPHM(); if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ - fphm = fphm.substring(fphm.length() - 8); + fphm = fphm.replace(zdata1.getZFPDM(),""); log.info("非全电但是号码"); } log.info("发票号码{}",fphm); @@ -372,10 +372,10 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ - fphm = fphm.substring(fphm.length() - 8); + fphm = fphm.replace(zdata1.getZFPDM(),""); log.info("非全电但是号码"); } log.info("发票号码{}",fphm); From 735518e9261b2311815c92f5529c2d6f7a1bdd06 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Fri, 2 Jun 2023 22:02:40 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InvoiceAuthServiceImpl.java | 86 ++++++++++--------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index 9bc509d7..f27248a9 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -10,6 +10,7 @@ import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.ReturnCodeEnum; import com.dxhy.common.service.impl.MpBaseServiceImpl; +import com.dxhy.common.util.DateOrderUtil; import com.dxhy.common.util.StringHelper; import com.dxhy.common.util.pojo.Authorize; import com.dxhy.common.util.pojo.GlobalInfo; @@ -20,8 +21,11 @@ import com.dxhy.erp.model.auth.InterfaceCode; import com.dxhy.erp.service.InvoiceAuthService; import com.dxhy.erp.service.TDxInvoiceReimburseService; import com.dxhy.erp.utils.CheckUtils; +import com.dxhy.erp.utils.DateUtil; +import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.joda.time.DateTime; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -386,20 +390,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl0){ @@ -422,34 +413,13 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl> authStateList, Integer contentRows) { ReturnStateInfo run = new ReturnStateInfo(); if (contentRows == null || authStateList.size() != contentRows) { @@ -537,9 +526,26 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl map = Maps.newHashMap(); + map.put("1","3"); + try { + DateTime parse = DateTime.parse("0000-00-00"); + map.put("2","3"); + Date date1 = parse.toDate(); + String s = parse.toString("yyyy-MM-dd "); + System.out.println(""); + } catch (Exception e) { +// throw new RuntimeException(e); + } + map.put("3","3"); + System.out.println(); +// String d="2023"; +// String substring = d.substring(0, 7); +// System.out.println(substring); } From 59eb07d647efc379f9f550271fdfb794750d7548 Mon Sep 17 00:00:00 2001 From: yefei Date: Fri, 2 Jun 2023 23:37:47 +0800 Subject: [PATCH 09/15] =?UTF-8?q?ariesy=20=E6=8E=A8=E9=80=81=E5=88=B0S4?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E7=9A=84=E6=95=B0=E6=8D=AE=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=BA=93=E4=B8=AD=E6=B2=A1=E6=9C=89=E5=88=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=A1=A5=E5=85=85=E6=9F=A5=E9=AA=8C=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 9 +-- .../erp/service/SNPushCheckRecordService.java | 78 +++++++++++++++++-- 2 files changed, 73 insertions(+), 14 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 7923e143..5d092c32 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 @@ -606,18 +606,13 @@ public class SDNYMainProcessController extends AbstractController { } else { object.setZFILED5(environment); } -// object.setZFILED5(environment); + List sapInvoiceInfos = new ArrayList<>(); if (invoiceInfoList != null && invoiceInfoList.size() > 0) { for (SNInvoice invoice : invoiceInfoList) { String fplxdm = ""; String snFplx = ""; -// if (invoice.getPurchaserTaxNo() == null || "".equals(invoice.getPurchaserTaxNo())){ -// invoice.setPurchaserTaxNo(taxno); -// } -// if (invoice.getPurchaserName() == null || "".equals(invoice.getPurchaserName())){ -// invoice.setPurchaserName(taxname); -// } + result = snPushCheckRecordService.updateInvoicePoll(company, taxno, reimburse, invoice, fplxdm, imageId, compCode); //价税分离判断 diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 46d5a178..533c934e 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -11,6 +11,7 @@ import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; import com.dxhy.common.util.StringHelper; +import com.dxhy.common.utils.R; import com.dxhy.common.vo.UserInfo; import com.dxhy.erp.dao.*; import com.dxhy.erp.entity.*; @@ -30,6 +31,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -95,6 +97,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { @Resource private SysDeptDao sysDeptDao; + @Resource + private SNPushCheckRecordService snPushCheckRecordService; + + @Resource + private SignSaveInvoiceInfoService signSaveInvoiceInfoService; + @Resource private TdxPlatformCheckLogService platformCheckLogService; @@ -451,8 +459,8 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { jsonObject.put("tonnage", invoiceData.get("dw")); jsonObject.put("limitPeople", invoiceData.get("xcrs")); String taxRate = ""; - if (invoiceData.get("sl")==null||StringUtils.isBlank(invoiceData.get("sl").toString())|| - "免税".equals(invoiceData.get("sl").toString())|| "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) { + if (invoiceData.get("sl") == null || StringUtils.isBlank(invoiceData.get("sl").toString()) || + "免税".equals(invoiceData.get("sl").toString()) || "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) { taxRate = "0"; jsonObject.put("taxRate", taxRate); } else { @@ -616,13 +624,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("进行价税分离的发票信息为:{}", invoiceInfo); ServiceResult invoiceResult = new ServiceResult<>(); //0523晚成伟提出新需求,客运汽车票必须实名才可以进行价税分离 - if(SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)){ - if(StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())){ + if (SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)) { + if (StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())) { log.info("非实名的实名客票 不需要做价税分离"); } invoiceResult.setMsg("ok"); invoiceResult.setResult(true); - }else { + } else { invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); InvoiceInfo data = invoiceResult.getData(); if (data != null) { @@ -675,6 +683,62 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { if ("01".equals(fplxdm) || "02".equals(fplxdm) || "03".equals(fplxdm) || "04".equals(fplxdm) || "08".equals(fplxdm) || "10".equals(fplxdm) || "11".equals(fplxdm) || "14".equals(fplxdm) || "15".equals(fplxdm) || "31".equals(fplxdm) || "32".equals(fplxdm)) { + DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); + String fpdm = invoice.getInvoiceCode(); + String fphm = invoice.getInvoiceNumber(); + + QueryWrapper recordWrapper = new QueryWrapper<>(); + if (StringUtils.isEmpty(fpdm)) { + recordWrapper.eq("uuid", fphm); + } else { + recordWrapper.eq("uuid", fpdm + fphm); + } + + BaseTDxRecordInvoice update = baseTDxRecordInvoiceDao.selectOne(recordWrapper); + Map pramsMap = new HashMap<>(); + JSONObject checkInvoiceResult = null; + + //如果提交的发票信息在底账库不存在,则重新补充查验,插入数据库中. + if (update == null) { + try { + //传入的参数为:{billingDate=2023-04-24, totalAmount=9708.74, purchaserTaxNo=91370000MA3RD38A9Q, invoiceNumber=02014197, invoiceType=10100, + // invoiceCode=3700222130, checkCode=} + pramsMap.put("invoiceCode", fpdm); + pramsMap.put("invoiceNumber", fphm); + if (StringUtils.isNotEmpty(invoice.getBillingDate())) { + String billingDate = invoice.getBillingDate().replaceAll("-", ""); + pramsMap.put("billingDate", billingDate); + } + if("31".equals(invoice.getInvoiceType()) || "32".equals(invoice.getInvoiceType())){ + pramsMap.put("totalAmount", invoice.getAmountTax()); + }else{ + pramsMap.put("totalAmount", invoice.getTotalAmount()); + } + + pramsMap.put("purchaserTaxNo", invoice.getPurchaserTaxNo()); + if("31".equals(invoice.getInvoiceType()) || "32".equals(invoice.getInvoiceType())){ + pramsMap.put("invoiceType", "21"); + }else { + pramsMap.put("invoiceType", invoice.getInvoiceType()); + } + + checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); + log.info("补充查验结果为:{}", checkInvoiceResult); + } catch (Exception e) { + e.printStackTrace(); + log.error("补充查验失败,errormsg:{}", e.getMessage()); + } + + if (!checkInvoiceResult.containsKey("code")) { + if (!checkInvoiceResult.containsKey("cyjg")) { + checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); + log.info("补充查验的结果为:{}", checkInvoiceResult); + signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, "", "1", "business"); + } + } + } + DynamicContextHolder.push(DbConstant.BASICS_WRITE); + //可查验发票,已入库,更新票池 Integer integer = this.pushInvoiceToRecordInvoice2(invoice, imageId, compCode); log.info("可查验发票,更新底账库完成"); @@ -720,10 +784,10 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("uuid={}", uuid); reimburse.setSelectId(uuid); - if (StringHelper.isNotBlank(invoice.getTaxRate())){ + if (StringHelper.isNotBlank(invoice.getTaxRate())) { reimburse.setTaxRate(invoice.getTaxRate()); reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); - }else { + } else { reimburse.setTaxRate("0%"); reimburse.setTaxCode(getTaxCode(reimburse.getTaxRate())); } From 75e3bd15c3a006a29dec676c0cb7335c3f354214 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 3 Jun 2023 11:10:25 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=96=B9=E6=A1=88--=E6=8E=92=E9=99=A4=E6=8E=89=E5=AE=9E?= =?UTF-8?q?=E5=90=8D=E5=AE=A2=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index f27248a9..913f758f 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.*; +import java.util.stream.Collectors; /** * @author dxhy @@ -347,7 +348,11 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl{}",zdata1.getZFPHM()); - + String collect = fplxList.stream().collect(Collectors.joining(",")); + if(collect.contains(zdata1.getZFPLX())){ + log.info("非增值税先不处理:{}",JSON.toJSONString(zdata1)); + continue; + } String fphm = zdata1.getZFPHM(); if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ fphm = fphm.replace(zdata1.getZFPDM(),""); From 0973dbc4ac28421d707bb767314be48da21300db Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 3 Jun 2023 11:16:03 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=96=B9=E6=A1=88--=E6=8E=92=E9=99=A4=E6=8E=89=E5=AE=9E?= =?UTF-8?q?=E5=90=8D=E5=AE=A2=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index 913f758f..8e170bdf 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -349,7 +349,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl{}",zdata1.getZFPHM()); String collect = fplxList.stream().collect(Collectors.joining(",")); - if(collect.contains(zdata1.getZFPLX())){ + if(!collect.contains(zdata1.getZFPLX())){ log.info("非增值税先不处理:{}",JSON.toJSONString(zdata1)); continue; } From be7d1f1ff08816ff172d7c287cb3fdd1d0067bc8 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 3 Jun 2023 11:29:28 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=96=B9=E6=A1=88--=E6=8E=92=E9=99=A4=E6=8E=89=E5=AE=9E?= =?UTF-8?q?=E5=90=8D=E5=AE=A2=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java index 8e170bdf..3a935bdd 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java @@ -349,7 +349,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl{}",zdata1.getZFPHM()); String collect = fplxList.stream().collect(Collectors.joining(",")); - if(!collect.contains(zdata1.getZFPLX())){ + if(!collect.contains(convertFpzldm(zdata1.getZFPLX()))){ log.info("非增值税先不处理:{}",JSON.toJSONString(zdata1)); continue; } From 43dcfc617982cd9da1211e6a262b525453c5fb62 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 3 Jun 2023 16:57:56 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invoicecheck/BaseInvoiceManualCheckServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index d327a680..ea3f43bc 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -225,9 +225,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl Date: Sat, 3 Jun 2023 20:52:13 +0800 Subject: [PATCH 14/15] =?UTF-8?q?ariesy=20=E8=BF=98=E5=8E=9Fauth=5Fstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index ea3f43bc..953def8a 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -226,7 +226,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl Date: Sun, 4 Jun 2023 11:05:16 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E5=AE=A2=E7=A5=A8=E6=9C=AA=E8=BF=9B=E8=A1=8C=E4=BB=B7=E7=A8=8E?= =?UTF-8?q?=E5=88=86=E7=A6=BB=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/erp/service/SNPushCheckRecordService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 533c934e..6b0cd5df 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -623,14 +623,19 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { InvoiceInfo invoiceInfo = convertToInvoiceInfo(invoice); log.info("进行价税分离的发票信息为:{}", invoiceInfo); ServiceResult invoiceResult = new ServiceResult<>(); + + boolean flag = false; //0523晚成伟提出新需求,客运汽车票必须实名才可以进行价税分离 if (SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)) { if (StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())) { log.info("非实名的实名客票 不需要做价税分离"); + flag = true; + invoiceResult.setMsg("ok"); + invoiceResult.setResult(true); } - invoiceResult.setMsg("ok"); - invoiceResult.setResult(true); - } else { + } + + if(!flag) { invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); InvoiceInfo data = invoiceResult.getData(); if (data != null) { @@ -645,6 +650,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { } } + if (!"ok".equals(invoiceResult.getMsg()) && !"0000".equals(invoiceResult.getMsg())) { log.info("价税分离失败:{}", invoiceResult.getMsg()); return invoiceResult.getMsg();