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 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,14 +236,17 @@ 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); } pramsMap.put("company", company); if (StringUtils.isNotBlank(inAccountStatus)) { pramsMap.put("inAccountStatus", inAccountStatus); - titleColumns = new String[] {"序号", "打款状态", "发票代码", "发票号码", "发票类型", "开票日期", "购方税号", "购方名称", "购方地址电话", + titleColumns = new String[] {"序号", "入账状态", "发票代码", "发票号码", "发票类型", "开票日期", "购方税号", "购方名称", "购方地址电话", "购方开户行及账号", "销方税号", "销方名称", "销方地址电话", "销方开户行及账号", "发票金额", "发票税额", "发票价税合计", "货物或应税劳务、服务名称", "规格型号", "单位", "数量", "单价", "发票明细金额", "发票明细税额", "税率", "车牌号", "类型", "通行日期起", "通行日期止", "备注"}; } diff --git a/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxslExportThread.java b/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxslExportThread.java index 4f9b1658..939720a2 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxslExportThread.java +++ b/dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxslExportThread.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; @@ -129,12 +130,35 @@ public class FpzhcxslExportThread 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); @@ -167,6 +191,11 @@ public class FpzhcxslExportThread extends BaseThread { pramsMap.put("invoiceStatus", invoiceStatus); } } + if (!StringHelper.isBlank(glzt)) { + if (!"99".equals(glzt)) { + pramsMap.put("glzt", glzt); + } + } if ("1".equals(rzzt) || "2".equals(rzzt) || "3".equals(rzzt)) { if (!StringHelper.isBlank(skssq)) { pramsMap.put("skssq", skssq.replace("-", "")); @@ -183,16 +212,15 @@ public class FpzhcxslExportThread extends BaseThread { if (!"99".equals(qsfs)) { pramsMap.put("qsfs", qsfs); } - if (!StringHelper.isBlank(qsjsrq)) { + if (!StringHelper.isBlank(qsksrq)) { pramsMap.put("qsksrq", DateUtils.getMorning(DateUtils.strToDate(qsksrq))); } 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); @@ -204,19 +232,17 @@ public class FpzhcxslExportThread 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); } - if (!StringHelper.isBlank(glzt)) { - if (!"99".equals(glzt)) { - pramsMap.put("glzt", glzt); - } - } pramsMap.put("company", company); if (StringUtils.isNotBlank(inAccountStatus)) { pramsMap.put("inAccountStatus", inAccountStatus); - titleColumns = new String[] {"序号", "打款状态", "发票代码", "发票号码", "发票类型", "金额", "税额", "税率"}; + titleColumns = new String[] {"序号", "入账状态", "发票代码", "发票号码", "发票类型", "金额", "税额", "税率"}; } // 导出文件名 StringBuilder ftpFileName = new StringBuilder(); diff --git a/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml b/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml index 5a5a1557..f992a9e9 100644 --- a/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml +++ b/dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.xml @@ -30,7 +30,7 @@ - + @@ -47,49 +47,72 @@ xfkhhzh,t.tax_amount,t.invoice_amount,t.rzh_belong_date skssq, t.total_amount jshj,t.remark bz,t.uuid,b.goods_name hlmc,b.model ggxh,b.unit dw,b.num num,b.unit_price dj,b.detail_amount je,b.tax_amount se,b.tax_rate sl, - t.in_account_status,b.cph,b.lx,b.txrqq,b.txrqz + t.inaccount_status,b.cph,b.lx,b.txrqq,b.txrqz from ${dxhyTertiary}.t_dx_record_invoice t left JOIN ${dxhyDetail}.t_dx_record_invoice_detail b ON t.uuid = b.uuid WHERE t.invoice_date between #{kpksrq} and #{kpjsrq} + and t.company = #{company} and t.gf_tax_no in #{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 +134,36 @@ and t.tax_amount <= #{taxAmountMax} - - and t.invoice_no = #{invoiceNo} - - - and t.rzh_belong_date = #{skssq} - - - and t.rzh_date between #{rzksrq} and #{rzjsrq} + + + and t.qs_name = #{qsr} - - and t.qs_date between #{qsksrq} and #{qsjsrq} + + and t.confirm_user like CONCAT(#{rzhr},'%') - - 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 +176,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 + and t.invoice_code = tdis.invoice_code where t.invoice_date between #{kpksrq} and #{kpjsrq} + and t.company = #{company} and t.gf_tax_no in #{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},'%') @@ -89,32 +113,36 @@ and t.tax_amount <= #{taxAmountMax} - - and t.invoice_no = #{invoiceNo} - - - and t.rzh_belong_date = #{skssq} - - - and t.rzh_date between #{rzksrq} and #{rzjsrq} + + + and t.qs_name = #{qsr} - - and t.qs_date between #{qsksrq} and #{qsjsrq} + + and t.confirm_user like CONCAT(#{rzhr},'%') - - 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} @@ -127,16 +155,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