From 8594b27d968031564192616471bcc3d39454a345 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Tue, 25 Jul 2023 19:37:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B4=AD=E6=96=B9=E7=A8=8E=E5=8F=B7?= =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/thread/FpzhcxmxExportThread.java | 33 ++++- .../main/resources/mapper/BbfpzhmxMapper.xml | 119 +++++++++++------- 2 files changed, 105 insertions(+), 47 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxmxExportThread.java b/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxmxExportThread.java index 73d4ad9b..58cfaa18 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxmxExportThread.java +++ b/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxmxExportThread.java @@ -1,6 +1,7 @@ package com.dxhy.core.thread; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.dxhy.common.service.impl.TabulateRedisServiceImpl; import com.dxhy.common.util.ExcelPoiUtil; @@ -109,6 +110,7 @@ public class FpzhcxmxExportThread extends BaseThread { try { exportLogService.updateStart(id, dbName); + // 应该保存的参数 // 应该保存的参数 JSONObject prams = JSONObject.parseObject(condition); String gfsh = prams.getString("gfsh"); @@ -132,12 +134,35 @@ public class FpzhcxmxExportThread extends BaseThread { String glzt = prams.getString("glzt"); String rzlx = prams.getString("rzlx"); String company = prams.getString("company"); + String menuId = prams.getString("menuId"); + String bzr = prams.getString("bzr"); List businesses = (List)prams.get("userBusiness"); + String bzdh = prams.getString("bzdh"); + String imageNumber = prams.getString("imageNumber"); String inAccountStatus = prams.getString("inAccountStatus"); + String snVoucherNumber =prams.getString("snVoucherNumber"); + String companyCode = prams.getString("companyCode"); + JSONArray companyCodeArray = prams.getJSONArray("companyCodes"); + List companyCodes = companyCodeArray.toJavaList(String.class); + String accountPeriod = prams.getString("accountPeriod"); + if (org.apache.commons.lang3.StringUtils.isNotEmpty(accountPeriod) && accountPeriod.length() > 7){ + accountPeriod = accountPeriod.substring(0,7); + } + String postingTimeEnd = prams.getString("postingTimeEnd"); + String postingTimeStart = prams.getString("postingTimeStart"); // 参数转换为需要的形式 Map pramsMap = new HashMap<>(31); pramsMap.put("dbName", dbName); pramsMap.put("business", businesses); + pramsMap.put("bzr",bzr); + pramsMap.put("bzdh",bzdh); + pramsMap.put("imageNumber",imageNumber); + pramsMap.put("inAccountStatus",inAccountStatus); + pramsMap.put("snVoucherNumber",snVoucherNumber); + pramsMap.put("postingTimeEnd",postingTimeEnd); + pramsMap.put("postingTimeStart",postingTimeStart); + pramsMap.put("accountPeriod",accountPeriod); + List gfshList = new ArrayList<>(); if (!StringHelper.isBlank(gfsh)) { gfshList = StringHelper.stringToList(gfsh); @@ -197,10 +222,9 @@ public class FpzhcxmxExportThread extends BaseThread { if (!StringHelper.isBlank(qsjsrq)) { pramsMap.put("qsjsrq", DateUtils.getNight(DateUtils.strToDate(qsjsrq))); } - if (!"99".equals(prams.getString("businessCode"))) { - pramsMap.put("businessCode", prams.getString("businessCode")); - } + pramsMap.put("businessCode", prams.getString("businessCode")); } + pramsMap.put("kpksrq", DateUtils.getMorning(DateUtils.strToDate(kpksrq))); pramsMap.put("kpjsrq", DateUtils.getNight(DateUtils.strToDate(kpjsrq))); pramsMap.put("invoiceNo", invoiceNo); @@ -212,7 +236,10 @@ public class FpzhcxmxExportThread extends BaseThread { pramsMap.put("amountMax", prams.getString("amountMax")); pramsMap.put("taxAmountMin", prams.getString("taxAmountMin")); pramsMap.put("taxAmountMax", prams.getString("taxAmountMax")); + pramsMap.put("settlementNo", prams.getString("settlementNo")); pramsMap.put("voucherNumber", prams.getString("voucherNumber")); + pramsMap.put("companyCodes",companyCodes); + pramsMap.put("companyCode",companyCode); if (!StringHelper.isBlank(rzlx) && !"99".equals(rzlx)) { pramsMap.put("rzlx", rzlx); } diff --git a/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml b/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml index 5a5a1557..b6b74f10 100644 --- a/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml +++ b/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml @@ -56,40 +56,62 @@ #{item} - - and t.invoice_status = #{invoiceStatus} + + and (t.comp_code in + + #{companyCode} + + or t.comp_code is null or t.comp_code = '' + ) - - and t.qs_status = #{qszt} + + and t.comp_code = #{companyCode} - - and t.qs_type = #{qsfs} + + and (t.comp_code = '' or t.comp_code is null) - - and t.qs_date between #{qsksrq} and #{qsjsrq} + + and t.bzdh = #{bzdh} - - and t.rzh_date between #{rzksrq} and #{rzjsrq} + + and t.bzr like concat('%',#{bzr},'%') - - and t.rzh_yesorno = #{rzzt} + + and t.inaccount_status = #{inAccountStatus} - - and t.auth_status = #{rzclzt} + + and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null) - - and t.bdk_status = #{rzlx} + + and t.invoice_status = #{invoiceStatus} + + + and t.qs_status = #{qszt} + + + and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) + + + and t.rzh_yesorno = #{rzzt} + test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99'"> and t.invoice_type = #{invoiceType} and t.invoice_source = #{invoiceSource} - and t.qs_type = #{qsfs} + test="fprzfs != null and fprzfs != '' and fprzfs != 'null' and fprzfs != '99'"> + and t.rzh_type = #{fprzfs} + + + and t.auth_status = #{fprzclzt} + + + and t.bdk_status = #{rzlx} and t.xf_name like CONCAT(#{xfmc},'%') @@ -111,32 +133,36 @@ and t.tax_amount <= #{taxAmountMax} - - and t.invoice_no = #{invoiceNo} - - - and t.rzh_belong_date = #{skssq} + + + and t.qs_name = #{qsr} - - and t.rzh_date between #{rzksrq} and #{rzjsrq} + + and t.confirm_user like CONCAT(#{rzhr},'%') - - and t.qs_date between #{qsksrq} and #{qsjsrq} - - - and t.qs_type = #{qsfs} + + and t.settlement_no like concat(#{settlementNo},'%') and t.glzt = #{glzt} - - and t.confirm_user like CONCAT(#{rzhr},'%') + + and t.invoice_no = #{invoiceNo} - - and t.qs_name = #{qsr} + + and t.rzh_date between #{rzksrq} and #{rzjsrq} - + + and t.rzh_belong_date = #{skssq} + + + and t.qs_type = #{qsfs} + + + and t.qs_date between #{qsksrq} and #{qsjsrq} + + and t.dept_id = #{businessCode} @@ -149,16 +175,21 @@ ) or (t.dept_id is null or t.dept_id='' or t.dept_id='99')) - - and t.in_account_status = #{inAccountStatus} + + + + + and t.sn_voucher_number = #{snVoucherNumber} - - and t.company = #{company} + + and posting_time between #{postingTimeStart} and #{postingTimeEnd} - - and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) + + and t.image_id = #{imageNumber} + + + and t.account_period = #{accountPeriod} - order by t.invoice_date desc on t.invoice_no = tdis.invoice_no where t.invoice_date between #{kpksrq} and #{kpjsrq} + and t.company = #{company} and t.gf_tax_no in #{item} From efc81b7c0052441132561ba0b413521f3cfecfae Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Mon, 31 Jul 2023 15:12:02 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=A8=8E=E7=8E=87=E5=92=8C=E6=98=8E=E7=BB=86=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E6=AC=BE=E7=8A=B6=E6=80=81=E4=B8=BA?= =?UTF-8?q?=E5=85=A5=E8=B4=A6=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/core/service/export/impl/FpzhcxmxServiceImpl.java | 6 +++++- .../dxhy/core/service/export/impl/FpzhcxslServiceImpl.java | 7 ++++++- .../java/com/dxhy/core/thread/FpzhcxmxExportThread.java | 2 +- .../java/com/dxhy/core/thread/FpzhcxslExportThread.java | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/export/impl/FpzhcxmxServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/export/impl/FpzhcxmxServiceImpl.java index 5bd3aaf6..497dc7fe 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/export/impl/FpzhcxmxServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/export/impl/FpzhcxmxServiceImpl.java @@ -84,7 +84,11 @@ public class FpzhcxmxServiceImpl extends MpBaseServiceImpl Date: Tue, 1 Aug 2023 08:47:43 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=A8=8E=E7=8E=87=E5=92=8C=E6=98=8E=E7=BB=86=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E6=AC=BE=E7=8A=B6=E6=80=81=E4=B8=BA?= =?UTF-8?q?=E5=85=A5=E8=B4=A6=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-core/src/main/resources/mapper/BbfpzhslMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dxhy-core/src/main/resources/mapper/BbfpzhslMapper.xml b/dxhy-core/src/main/resources/mapper/BbfpzhslMapper.xml index 25549e99..83bcb873 100644 --- a/dxhy-core/src/main/resources/mapper/BbfpzhslMapper.xml +++ b/dxhy-core/src/main/resources/mapper/BbfpzhslMapper.xml @@ -28,6 +28,7 @@ left join t_dx_record_invoice_statistics tdis on t.invoice_no = tdis.invoice_no + and t.invoice_code = tdis.invoice_code where t.invoice_date between #{kpksrq} and #{kpjsrq} and t.company = #{company}