From 18c6b11297c41889de2c22f7c0116f55632f910e Mon Sep 17 00:00:00 2001 From: yefei Date: Fri, 26 May 2023 11:20:25 +0800 Subject: [PATCH 01/10] =?UTF-8?q?ariesy=20=E5=AE=A2=E8=BF=90=E6=B1=BD?= =?UTF-8?q?=E8=BD=A6=E7=A5=A8=E5=8F=AA=E6=9C=89=E4=B9=98=E8=BD=A6=E4=BA=BA?= =?UTF-8?q?=E5=92=8C=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=8F=B7=E9=83=BD=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E6=89=8D=E5=81=9A=E4=BB=B7?= =?UTF-8?q?=E7=A8=8E=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/service/impl/SysUserServiceImpl.java | 2 + .../erp/service/SNPushCheckRecordService.java | 42 +++++++------------ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java index 881c9306..87bc2a29 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java @@ -454,6 +454,7 @@ public class SysUserServiceImpl extends ServiceImpl i } private void toDeptOrgCode(User user, List orgCodeList, List queryDept) { + log.info("查询到的企业列表为:{}",queryDept); String qsStatus = "0"; String productType = "0"; if (queryDept.size() > 0) { @@ -469,6 +470,7 @@ public class SysUserServiceImpl extends ServiceImpl i orgCodeList.addAll(oldTaxOrgCode); qsStatus = queryDept.get(0).getQsStatus(); productType = queryDept.get(0).getProductType(); + log.info("orgCodeList:{}",orgCodeList); user.setOrgCodes(orgCodeList); user.setQsStatus(qsStatus); user.setProductType(productType); 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 c3e92e1c..eb50f764 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 @@ -612,24 +612,24 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { InvoiceInfo invoiceInfo = convertToInvoiceInfo(invoice); log.info("进行价税分离的发票信息为:{}", invoiceInfo); - + ServiceResult invoiceResult = new ServiceResult<>(); //0523晚成伟提出新需求,客运汽车票必须实名才可以进行价税分离 -// if(SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)){ -// if(StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())){ -// return result; -// } -// } - - ServiceResult invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); - InvoiceInfo data = invoiceResult.getData(); - if (data != null) { - invoice.setIsDeductible(data.getIsDeductible()); - invoice.setTaxRate(data.getTaxRate()); - if (data.getInvoiceAmount() != null) { - invoice.setTotalAmount(data.getInvoiceAmount().toString()); + if(SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)){ + if(StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())){ + log.info("客运汽车票没有实名信息,不需要做价税分离"); } - if (data.getTaxAmount() != null) { - invoice.setTotalTax(data.getTaxAmount().toString()); + }else{ + invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); + InvoiceInfo data = invoiceResult.getData(); + if (data != null) { + invoice.setIsDeductible(data.getIsDeductible()); + invoice.setTaxRate(data.getTaxRate()); + if (data.getInvoiceAmount() != null) { + invoice.setTotalAmount(data.getInvoiceAmount().toString()); + } + if (data.getTaxAmount() != null) { + invoice.setTotalTax(data.getTaxAmount().toString()); + } } } @@ -637,16 +637,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("价税分离失败:{}", invoiceResult.getMsg()); return invoiceResult.getMsg(); } -// DynamicContextHolder.push(DbConstant.BASICS_READ); -// -// SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); -// log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); -// if(orgByCompCode != null) { -// reimburse.setGfTaxNo(orgByCompCode.getTaxno()); -// reimburse.setGfName(orgByCompCode.getTaxname()); -// reimburse.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); -// reimburse.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); -// } reimburse = convertToReimburse(invoice, reimburse, fplxdm, company); From a4817a263ebc1fc542e9b59e1dacbd503cd65dee Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 29 May 2023 15:51:50 +0800 Subject: [PATCH 02/10] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E5=BE=81=E7=A8=8E=E5=8F=91=E7=A5=A8=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=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 43874a81..15cd93ca 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 @@ -488,7 +488,7 @@ public class SDNYMainProcessController extends AbstractController { } - if ("免税".equals(detail.getString("taxRate"))) { + if ("免税".equals(detail.getString("taxRate")) || "不征税".equals(detail.getString("taxRate"))) { taxRateDetail = "0"; snDetailMap.put("taxRate", taxRateDetail); } else { From 8bcc68f445d10e90e98e4a3c1a053a4fd3a6c709 Mon Sep 17 00:00:00 2001 From: WangQi <1021674882@qq.com> Date: Mon, 29 May 2023 16:53:51 +0800 Subject: [PATCH 03/10] bug:3158 --- .../com/dxhy/erp/entity/SalesInvoicePushInfos.java | 10 ++++++++++ .../java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java | 10 ++++++++++ .../dxhy/erp/service/impl/InvoicePoolServiceImpl.java | 8 ++++++++ 3 files changed, 28 insertions(+) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/SalesInvoicePushInfos.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/SalesInvoicePushInfos.java index 4ce5f4a9..35a92aea 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/SalesInvoicePushInfos.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/SalesInvoicePushInfos.java @@ -88,5 +88,15 @@ public class SalesInvoicePushInfos { private String buyerPhone; private String compCode; + /** + * 报账单号 + */ + private String bzdh; + + /** + * 报账人 + */ + private String bzr; + private List detailList; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java index 701d9348..84822a02 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java @@ -484,4 +484,14 @@ public class TdxSaleRecordInvoice implements Serializable { private String incentiveFlag; private String compCode; + + /** + * 报账单号 + */ + private String bzdh; + + /** + * 报账人 + */ + private String bzr; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoicePoolServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoicePoolServiceImpl.java index 5c18342e..0e575c41 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoicePoolServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoicePoolServiceImpl.java @@ -1662,6 +1662,10 @@ public class InvoicePoolServiceImpl implements InvoicePoolService { update.setStatusUpdateDate(new Date()); } update.setCompCode(infos.getCompCode()); + // 报账单号 报账人 + update.setBzdh(infos.getBzdh()); + update.setBzr(infos.getBzr()); + TDxInvoiceSales tDxInvoiceSales = new TDxInvoiceSales(); tDxInvoiceSales.setQsDate(new Date()); DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); @@ -1813,6 +1817,10 @@ public class InvoicePoolServiceImpl implements InvoicePoolService { invoice.setCheckCode(info.getCheckCode()); } + // 报账单号 报账人 + invoice.setBzdh(info.getBzdh()); + invoice.setBzr(info.getBzr()); + invoice.setSourceSystem("1"); invoice.setValid("1"); invoice.setQsDate(new Date()); From ec20b2473336aee6fa9ac9cc8aeb9c7e3ba2686a Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 29 May 2023 19:55:29 +0800 Subject: [PATCH 04/10] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E5=BE=81=E7=A8=8E=E5=8F=91=E7=A5=A8=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 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 15cd93ca..d3a54b26 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 @@ -487,39 +487,41 @@ public class SDNYMainProcessController extends AbstractController { snDetailMap.put("amount", detail.getString("detailAmount")); } - - if ("免税".equals(detail.getString("taxRate")) || "不征税".equals(detail.getString("taxRate"))) { + if ("免税".equals(detail.getString("taxRate")) || "不征税".equals(detail.getString("taxRate")) || "***".equals(detail.getString("taxRate"))) { taxRateDetail = "0"; snDetailMap.put("taxRate", taxRateDetail); } else { 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("%"); - if (index > 0) { - taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); - Float num = Float.parseFloat(taxRateDetail); - if (num > 9) { - taxRateDetail = "0." + taxRateDetail; - } else { - if (!taxRateDetail.startsWith("0")) { - taxRateDetail = "0.0" + taxRateDetail; + try { + taxRateDetail = detail.get("taxRate").toString(); + if (!"0".equals(taxRateDetail)) { + if (StringUtils.isNoneBlank(taxRateDetail)) { + int index = taxRateDetail.indexOf("%"); + if (index > 0) { + taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); + Float num = Float.parseFloat(taxRateDetail); + if (num > 9) { + taxRateDetail = "0." + taxRateDetail; + } else { + if (!taxRateDetail.startsWith("0")) { + taxRateDetail = "0.0" + taxRateDetail; + } } - } - }else{ - Float num = Float.parseFloat(taxRateDetail); - if (num > 9) { - taxRateDetail = "0." + taxRateDetail; } else { - if (!taxRateDetail.startsWith("0")) { - taxRateDetail = "0.0" + taxRateDetail; + Float num = Float.parseFloat(taxRateDetail); + if (num > 9) { + taxRateDetail = "0." + taxRateDetail; + } else { + if (!taxRateDetail.startsWith("0")) { + taxRateDetail = "0.0" + taxRateDetail; + } } } } } - -// taxRateDetail = CheckUtil.formatPercentSl(taxRateDetail); + }catch (Exception e){ + log.error("报错的原因为:{}",e); + taxRateDetail = "0.00"; } if ("11".equals(invoiceType)) { From cf805f9b7c4f931759ff853e4524a4a9d9a81a99 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Mon, 29 May 2023 20:25:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2reh=5Fyesorno=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 2980ff5a..5385babf 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -78,7 +78,6 @@ and t.bdk_status in ('1','2') and t.export_mark = '0' and t.auth_status != '0' - and t.rzh_yesorno != '0' and t.company = #{company} and t.gf_tax_no in @@ -349,7 +348,6 @@ and t.auth_status != '0' and t.bdk_status in ('1','2') and t.export_mark = '0' - and t.rzh_yesorno != '0' and t.company =#{company} and t.gf_tax_no in From 9ac34e45b7b7061c5717810f68811d0547ef633e Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 29 May 2023 21:46:01 +0800 Subject: [PATCH 06/10] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E8=AE=A4=E8=AF=81=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98(=E5=85=A8=E7=94=B5?= =?UTF-8?q?=E5=8F=B7=E7=A0=81=E5=A6=82=E6=9E=9C=E6=98=AF20=E4=BD=8D,?= =?UTF-8?q?=E5=88=99=E9=9C=80=E8=A6=81=E6=8A=8A=E5=8F=91=E7=A5=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E5=8F=B7=E7=A0=81=E5=88=86=E5=BC=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/job/service/impl/ConfirmServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java index ae8a3603..d0fd7b17 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java @@ -556,6 +556,18 @@ public class ConfirmServiceImpl extends ServiceImpl impl // } else { // applyInvoice.setYxse(list.get(i).getDkTaxAmount().toString()); // } + if("31".equals(list.get(i).getInvoiceType()) ||"32".equals(list.get(i).getInvoiceType()) + || "185".equals(list.get(i).getInvoiceType())){ + if(StringUtils.isNotEmpty(list.get(i).getInvoiceNo()) && list.get(i).getInvoiceNo().length() == 20){ + + String invoiceCode = list.get(i).getInvoiceNo().substring(0,12); + String invoiceNum = list.get(i).getInvoiceNo().substring(12); + log.info("全电发票申请认证 invoiceCode={},invoiceNum={}",invoiceCode,invoiceNum); + applyInvoice.setInvoiceCode(invoiceCode); + applyInvoice.setInvoiceNo(invoiceNum); + } + } + if("31".equals(list.get(i).getInvoiceType())){ applyInvoice.setYxse(list.get(i).getDkTaxAmount().toString()); }else { @@ -630,7 +642,7 @@ public class ConfirmServiceImpl extends ServiceImpl impl } } } catch (Exception e) { - log.info("申请认证执行失败"); + log.error("申请认证执行失败,失败原因是:{}",e); e.printStackTrace(); } } From 51ebfbecfecc3ed77fa346a5f53d14c439f2b471 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 29 May 2023 22:18:29 +0800 Subject: [PATCH 07/10] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E8=AE=A4=E8=AF=81=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98(=E5=85=A8=E7=94=B5?= =?UTF-8?q?=E5=8F=B7=E7=A0=81=E5=A6=82=E6=9E=9C=E6=98=AF20=E4=BD=8D,?= =?UTF-8?q?=E5=88=99=E9=9C=80=E8=A6=81=E6=8A=8A=E5=8F=91=E7=A5=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E5=8F=B7=E7=A0=81=E5=88=86=E5=BC=80)=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/core/job/service/impl/ConfirmServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java index d0fd7b17..a8c359e9 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java @@ -568,9 +568,11 @@ public class ConfirmServiceImpl extends ServiceImpl impl } } - if("31".equals(list.get(i).getInvoiceType())){ + log.info("list.get(i).getDkTaxAmount() = {}",list.get(i).getDkTaxAmount()); + log.info("list.get(i).getTaxAmount() = {}",list.get(i).getTaxAmount()); + if("31".equals(list.get(i).getInvoiceType()) && list.get(i).getDkTaxAmount() != null){ applyInvoice.setYxse(list.get(i).getDkTaxAmount().toString()); - }else { + }else if(list.get(i).getTaxAmount() != null){ applyInvoice.setYxse(list.get(i).getTaxAmount().toString()); } if("4".equals(list.get(i).getRzlx()) || "6".equals(list.get(i).getRzlx())) { From 0fa1a808ad9b02f329bbcc9174388f2b23edbc0c Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 30 May 2023 10:04:52 +0800 Subject: [PATCH 08/10] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E5=AE=A2?= =?UTF-8?q?=E8=BF=90=E6=B1=BD=E8=BD=A6=E7=A5=A8=E9=9D=9E=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E5=AE=A2=E7=A5=A8=E4=B8=8D=E9=9C=80=E8=A6=81=E5=81=9A=E4=BB=B7?= =?UTF-8?q?=E7=A8=8E=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/service/SNPushCheckRecordService.java | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 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 c3e92e1c..6c2f6a54 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 @@ -612,24 +612,26 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { InvoiceInfo invoiceInfo = convertToInvoiceInfo(invoice); log.info("进行价税分离的发票信息为:{}", invoiceInfo); - + ServiceResult invoiceResult = new ServiceResult<>(); //0523晚成伟提出新需求,客运汽车票必须实名才可以进行价税分离 -// if(SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)){ -// if(StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())){ -// return result; -// } -// } - - ServiceResult invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); - InvoiceInfo data = invoiceResult.getData(); - if (data != null) { - invoice.setIsDeductible(data.getIsDeductible()); - invoice.setTaxRate(data.getTaxRate()); - if (data.getInvoiceAmount() != null) { - invoice.setTotalAmount(data.getInvoiceAmount().toString()); + if(SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)){ + if(StringUtils.isEmpty(invoice.getRiderName()) || StringUtils.isEmpty(invoice.getIdcardNo())){ + log.info("非实名的实名客票 不需要做价税分离"); } - if (data.getTaxAmount() != null) { - invoice.setTotalTax(data.getTaxAmount().toString()); + invoiceResult.setMsg("ok"); + invoiceResult.setResult(true); + }else { + invoiceResult = this.valoremTaxCount(invoiceInfo, "Y"); + InvoiceInfo data = invoiceResult.getData(); + if (data != null) { + invoice.setIsDeductible(data.getIsDeductible()); + invoice.setTaxRate(data.getTaxRate()); + if (data.getInvoiceAmount() != null) { + invoice.setTotalAmount(data.getInvoiceAmount().toString()); + } + if (data.getTaxAmount() != null) { + invoice.setTotalTax(data.getTaxAmount().toString()); + } } } @@ -637,16 +639,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("价税分离失败:{}", invoiceResult.getMsg()); return invoiceResult.getMsg(); } -// DynamicContextHolder.push(DbConstant.BASICS_READ); -// -// SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); -// log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); -// if(orgByCompCode != null) { -// reimburse.setGfTaxNo(orgByCompCode.getTaxno()); -// reimburse.setGfName(orgByCompCode.getTaxname()); -// reimburse.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); -// reimburse.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); -// } reimburse = convertToReimburse(invoice, reimburse, fplxdm, company); @@ -717,7 +709,9 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { reimburse.setSelectId(uuid); reimburse.setTaxRate(invoice.getTaxRate()); - reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); + if(invoice.getTaxRate() != null) { + reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); + } reimburse.setIsDeduction(invoice.getIsDeductible()); if (StringUtils.isNoneBlank(reimburse.getInvoiceCode())) { From ca22cbb2e828813779e54d3b9f824b9fefefef61 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 30 May 2023 10:11:22 +0800 Subject: [PATCH 09/10] Merge branch 'test' of D:\work\project\sdny\pt with conflicts. --- .../main/resources/mapper/BaseFpZhMapper.xml | 2 - .../job/service/impl/ConfirmServiceImpl.java | 20 ++++++-- .../controller/SDNYMainProcessController.java | 48 ++++++++++--------- .../erp/service/SNPushCheckRecordService.java | 10 ++++ 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 2980ff5a..5385babf 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -78,7 +78,6 @@ and t.bdk_status in ('1','2') and t.export_mark = '0' and t.auth_status != '0' - and t.rzh_yesorno != '0' and t.company = #{company} and t.gf_tax_no in @@ -349,7 +348,6 @@ and t.auth_status != '0' and t.bdk_status in ('1','2') and t.export_mark = '0' - and t.rzh_yesorno != '0' and t.company =#{company} and t.gf_tax_no in diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java index ae8a3603..a8c359e9 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java @@ -556,9 +556,23 @@ public class ConfirmServiceImpl extends ServiceImpl impl // } else { // applyInvoice.setYxse(list.get(i).getDkTaxAmount().toString()); // } - if("31".equals(list.get(i).getInvoiceType())){ + if("31".equals(list.get(i).getInvoiceType()) ||"32".equals(list.get(i).getInvoiceType()) + || "185".equals(list.get(i).getInvoiceType())){ + if(StringUtils.isNotEmpty(list.get(i).getInvoiceNo()) && list.get(i).getInvoiceNo().length() == 20){ + + String invoiceCode = list.get(i).getInvoiceNo().substring(0,12); + String invoiceNum = list.get(i).getInvoiceNo().substring(12); + log.info("全电发票申请认证 invoiceCode={},invoiceNum={}",invoiceCode,invoiceNum); + applyInvoice.setInvoiceCode(invoiceCode); + applyInvoice.setInvoiceNo(invoiceNum); + } + } + + log.info("list.get(i).getDkTaxAmount() = {}",list.get(i).getDkTaxAmount()); + log.info("list.get(i).getTaxAmount() = {}",list.get(i).getTaxAmount()); + if("31".equals(list.get(i).getInvoiceType()) && list.get(i).getDkTaxAmount() != null){ applyInvoice.setYxse(list.get(i).getDkTaxAmount().toString()); - }else { + }else if(list.get(i).getTaxAmount() != null){ applyInvoice.setYxse(list.get(i).getTaxAmount().toString()); } if("4".equals(list.get(i).getRzlx()) || "6".equals(list.get(i).getRzlx())) { @@ -630,7 +644,7 @@ public class ConfirmServiceImpl extends ServiceImpl impl } } } catch (Exception e) { - log.info("申请认证执行失败"); + log.error("申请认证执行失败,失败原因是:{}",e); e.printStackTrace(); } } 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 43874a81..d3a54b26 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 @@ -487,39 +487,41 @@ public class SDNYMainProcessController extends AbstractController { snDetailMap.put("amount", detail.getString("detailAmount")); } - - if ("免税".equals(detail.getString("taxRate"))) { + if ("免税".equals(detail.getString("taxRate")) || "不征税".equals(detail.getString("taxRate")) || "***".equals(detail.getString("taxRate"))) { taxRateDetail = "0"; snDetailMap.put("taxRate", taxRateDetail); } else { 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("%"); - if (index > 0) { - taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); - Float num = Float.parseFloat(taxRateDetail); - if (num > 9) { - taxRateDetail = "0." + taxRateDetail; - } else { - if (!taxRateDetail.startsWith("0")) { - taxRateDetail = "0.0" + taxRateDetail; + try { + taxRateDetail = detail.get("taxRate").toString(); + if (!"0".equals(taxRateDetail)) { + if (StringUtils.isNoneBlank(taxRateDetail)) { + int index = taxRateDetail.indexOf("%"); + if (index > 0) { + taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); + Float num = Float.parseFloat(taxRateDetail); + if (num > 9) { + taxRateDetail = "0." + taxRateDetail; + } else { + if (!taxRateDetail.startsWith("0")) { + taxRateDetail = "0.0" + taxRateDetail; + } } - } - }else{ - Float num = Float.parseFloat(taxRateDetail); - if (num > 9) { - taxRateDetail = "0." + taxRateDetail; } else { - if (!taxRateDetail.startsWith("0")) { - taxRateDetail = "0.0" + taxRateDetail; + Float num = Float.parseFloat(taxRateDetail); + if (num > 9) { + taxRateDetail = "0." + taxRateDetail; + } else { + if (!taxRateDetail.startsWith("0")) { + taxRateDetail = "0.0" + taxRateDetail; + } } } } } - -// taxRateDetail = CheckUtil.formatPercentSl(taxRateDetail); + }catch (Exception e){ + log.error("报错的原因为:{}",e); + taxRateDetail = "0.00"; } if ("11".equals(invoiceType)) { 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 eb50f764..b7de84e0 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 @@ -637,6 +637,16 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("价税分离失败:{}", invoiceResult.getMsg()); return invoiceResult.getMsg(); } +// DynamicContextHolder.push(DbConstant.BASICS_READ); +// +// SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); +// log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); +// if(orgByCompCode != null) { +// reimburse.setGfTaxNo(orgByCompCode.getTaxno()); +// reimburse.setGfName(orgByCompCode.getTaxname()); +// reimburse.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); +// reimburse.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); +// } reimburse = convertToReimburse(invoice, reimburse, fplxdm, company); From 1bd03dd9584f43226645d220a7a9a63beb88e5c3 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 30 May 2023 10:12:11 +0800 Subject: [PATCH 10/10] =?UTF-8?q?ariesy=20=E8=AE=BE=E7=BD=AEcompany?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4041a0f9..6d577742 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 @@ -529,7 +529,7 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl