修改认证查询导出

release
yishiqihuasheng 2 years ago
parent 8c4fef7c8c
commit 5e788a638b
  1. 41
      dxhy-core/src/main/java/com/dxhy/core/thread/RzFpxxExportThread.java
  2. 105
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml

@ -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;
@ -113,43 +114,59 @@ public class RzFpxxExportThread extends BaseThread {
// 应该保存的参数
JSONObject prams = JSONObject.parseObject(condition);
String gfsh = prams.getString("gfsh");
String companyCode = prams.getString("companyCode");
String invoiceType = prams.getString("invoiceType");
String kpksrq = prams.getString("kpksrq");
String kpjsrq = prams.getString("kpjsrq");
String invoiceType = prams.getString("invoiceType");
String invoiceSource = prams.getString("invoiceSource");
String qszt = prams.getString("qszt");
String rzzt = prams.getString("rzzt");
String rzclzt = prams.getString("rzclzt");
String rzlx = prams.getString("rzlx");
String skssq = prams.getString("skssq");
String qsfs = prams.getString("qsfs");
String invoiceStatus = prams.getString("invoiceStatus");
String qsksrq = prams.getString("qsksrq");
String qsjsrq = prams.getString("qsjsrq");
String rzzt = prams.getString("rzzt");
String rzksrq = prams.getString("rzksrq");
String rzjsrq = prams.getString("rzjsrq");
String skssq = prams.getString("skssq");
String invoiceStatus = prams.getString("invoiceStatus");
String qsfs = prams.getString("qsfs");
String rzclzt = prams.getString("rzclzt");
String invoiceNo = prams.getString("invoiceNo");
String xfmc = prams.getString("xfmc");
String rzlx = prams.getString("rzlx");
String businessCode = prams.getString("businessCode");
String qsr = prams.getString("qsr");
String rzhr = prams.getString("rzhr");
String inAccountStatus = prams.getString("inAccountStatus");
String xfmc = prams.getString("xfmc");
String company = prams.getString("company");
String menuId = prams.getString("menuId");
String companyCode = prams.getString("companyCode");
String bzdh = prams.getString("bzdh");
String bzr = prams.getString("bzr");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
JSONObject jsonObject = tabulateRedisService.getTabulateExcel(company, menuId);
List<Business> businesses = (List<Business>)prams.get("userBusiness");
String inAccountStatus = prams.getString("inAccountStatus");
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(30);
pramsMap.put("dbName", dbName);
pramsMap.put("business", businesses);
pramsMap.put("businessCode",businessCode);
pramsMap.put("qsr",qsr);
pramsMap.put("qszt", prams.getString("qszt"));
pramsMap.put("wrzfpStart", prams.getString("wrzfpStart"));
pramsMap.put("wrzfpEnd", prams.getString("wrzfpEnd"));
pramsMap.put("imageNumber", prams.getString("imageNumber"));
pramsMap.put("postingTimeStart", prams.getString("postingTimeStart"));
pramsMap.put("postingTimeEnd", prams.getString("postingTimeEnd"));
if (prams.getString("accountPeriod") != null && !"".equals(prams.getString("accountPeriod"))) {
String accountPeriod = prams.getString("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
pramsMap.put("paymentDateStart", prams.getString("paymentDateStart"));
pramsMap.put("paymentDateEnd", prams.getString("paymentDateEnd"));
pramsMap.put("paymentStatus", prams.getString("paymentStatus"));
pramsMap.put("voucherNumber", prams.getString("voucherNumber"));
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("companyCodes",companyCodes);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {

@ -84,7 +84,7 @@
select
t.invoice_code,t.invoice_no,t.invoice_type,DATE_FORMAT(t.invoice_date,'%Y-%m-%d')kprq,t.gf_tax_no
gfsh,t.gf_name
gfmc,t.dept_id deptId,t.dept_name deptName,t.bzdh,t.bzr
gfmc,t.dept_id deptId,t.dept_name deptName,t.bzdh,t.bzr,
t.xf_tax_no,t.xf_name,t.tax_amount,t.dk_tax_amount,t.invoice_status,t.invoice_amount,
date_format(t.rzh_date,'%Y-%m-%d') rzh_date,date_format(t.qs_date, '%Y-%m-%d')
qs_date,t.rzh_type,
@ -97,51 +97,77 @@
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status != '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99' ">
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCodes}
</if>
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<if test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' ">
and t.invoice_status = #{invoiceStatus}
</if>
<if test="voucherNumber != null and voucherNumber != ''">
and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null'">
and t.bzdh = #{bzdh}
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
and t.bzr like concat('%',#{bzr},'%')
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' ">
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
<if test="qsfs != null and qsfs != '' and qsfs != 'null'">
and t.qs_type = #{qsfs}
</if>
<if
test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
<if test="wrzfpStart != null and wrzfpStart != '' and wrzfpStart != 'null' and wrzfpEnd != null and wrzfpEnd != '' and wrzfpEnd != 'null'">
and rzh_yesorno = '0' and date_format(t.invoice_date,'%Y-%m-%d') between #{wrzfpStart} and #{wrzfpEnd}
</if>
<if test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq}
</if>
<if
test="rzksrq != null and rzksrq != '' and rzksrq != 'null' and rzjsrq != null and rzjsrq != '' and rzjsrq != 'null'">
and date_format(t.rzh_date,'%Y-%m-%d') between #{rzksrq} and #{rzjsrq}
</if>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '99'">
and t.rzh_yesorno = #{rzzt}
<if test="accountPeriodStart != null and accountPeriodStart != '' and accountPeriodStart != 'null'
and accountPeriodEnd != null and accountPeriodEnd != '' and accountPeriodEnd != 'null'">
and date_format(t.account_period,'%Y-%m') between #{accountPeriodStart} and #{accountPeriodEnd}
</if>
<if test="rzclzt != null and rzclzt != '' and rzclzt != 'null' and rzclzt != '99'">
and t.auth_status = #{rzclzt}
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null'
and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null'">
and date_format(t.posting_time,'%Y-%m-%d') between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') >= #{paymentDateStart} ]]>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '3'">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') <= #{paymentDateEnd} ]]>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt == '3'">
and (t.rzh_yesorno = '1' or t.rzh_yesorno = '2')
</if>
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'">
and t.payment_status = #{paymentStatus}
<if test="imageId != null and imageId != '' and imageId != 'null' ">
and t.image_id = #{imageId}
</if>
<if test="rzlx !=null and rzlx != ''">
<if test="rzclzt !=null and rzclzt != ''">
and t.auth_status = #{rzclzt}
</if>
<if test="rzlx!=null and rzlx!=''">
and t.bdk_status = #{rzlx}
</if>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType}
</if>
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='null' and invoiceSource!='99'">
@ -150,8 +176,15 @@
<if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
and t.ele_invoice_no = #{eleInvoiceNo}
</if>
<if
test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}
</if>
<if test="xfmc != null and xfmc != '' and xfmc != 'null' ">
and t.xf_name like CONCAT(#{xfmc},'%')
and t.xf_name like concat(#{xfmc},'%')
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<if test="rzhr != null and rzhr != '' and rzhr != 'null' ">
and t.confirm_user in
@ -160,13 +193,25 @@
</foreach>
</if>
<if
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<if test="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') >= #{paymentDateStart} ]]>
</if>
<if test="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') <= #{paymentDateEnd} ]]>
</if>
<if test="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'">
and t.payment_status = #{paymentStatus}
</if>
<if
test="skssq != null and skssq != '' and skssq != 'null' ">
and t.rzh_belong_date = #{skssq}
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' ">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
@ -181,14 +226,20 @@
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
<if test='inAccountStatus != null and inAccountStatus !="" and inAccountStatus!="99"'>
and t.in_account_status = #{inAccountStatus}
<!-- <if test='inAccountStatus!=null and inAccountStatus!="" and inAccountStatus !="99"'>-->
<!-- and t.in_account_status = #{inAccountStatus}-->
<!-- </if>-->
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="company !=null and company !=''">
and t.company = #{company}
<if test="postingTimeStart != null and postingTimeEnd != null and postingTimeStart != '' and postingTimeEnd != ''">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
order by t.rzh_date desc,t.invoice_date desc
</select>

Loading…
Cancel
Save