购方税号去重

release
yishiqihuasheng 2 years ago
parent 5ade937873
commit 8594b27d96
  1. 33
      dxhy-core/src/main/java/com/dxhy/core/thread/FpzhcxmxExportThread.java
  2. 119
      dxhy-core/src/main/resources/mapper/BbfpzhmxMapper.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;
@ -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<Business> businesses = (List<Business>)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<String> 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<String, Object> 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<String> 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);
}

@ -56,40 +56,62 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99' ">
and t.invoice_status = #{invoiceStatus}
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
)
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and t.qs_type = #{qsfs}
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<if test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
and t.qs_date between #{qsksrq} and #{qsjsrq}
<if test="bzdh != null and bzdh != '' and bzdh != 'null'">
and t.bzdh = #{bzdh}
</if>
<if test="rzksrq != null and rzksrq != '' and rzksrq != 'null' and rzjsrq != null and rzjsrq != '' and rzjsrq != 'null'">
and t.rzh_date between #{rzksrq} and #{rzjsrq}
<if test="bzr != null and bzr != '' and bzr != 'null'">
and t.bzr like concat('%',#{bzr},'%')
</if>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '99'">
and t.rzh_yesorno = #{rzzt}
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="rzclzt != null and rzclzt != '' and rzclzt != 'null' and rzclzt != '99'">
and t.auth_status = #{rzclzt}
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if test="rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'">
and t.bdk_status = #{rzlx}
<if
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
<if test="voucherNumber != null and voucherNumber != ''">
and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</if>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '99'">
and t.rzh_yesorno = #{rzzt}
</if>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99'">
and t.invoice_type = #{invoiceType}
</if>
<if test="invoiceSource != null and invoiceSource != '' and invoiceSource != 'null' and invoiceSource != '99' ">
and t.invoice_source = #{invoiceSource}
</if>
<if
test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99' ">
and t.qs_type = #{qsfs}
test="fprzfs != null and fprzfs != '' and fprzfs != 'null' and fprzfs != '99'">
and t.rzh_type = #{fprzfs}
</if>
<if
test="fprzclzt != null and fprzclzt != '' and fprzclzt != 'null' and fprzclzt != '99'">
and t.auth_status = #{fprzclzt}
</if>
<if test="rzlx != null and rzlx != '' and rzlx != 'null' and rzlx != '99'">
and t.bdk_status = #{rzlx}
</if>
<if test="xfmc != null and xfmc != '' and xfmc != 'null' ">
and t.xf_name like CONCAT(#{xfmc},'%')
@ -111,32 +133,36 @@
<if test="taxAmountMax!=null and taxAmountMax!=''">
and t.tax_amount &lt;= #{taxAmountMax}
</if>
<if
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<if test="skssq != null and skssq != '' and skssq != 'null' ">
and t.rzh_belong_date = #{skssq}
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<if test="rzksrq != null and rzjsrq != null ">
and t.rzh_date between #{rzksrq} and #{rzjsrq}
<if test="rzhr != null and rzhr != '' and rzhr != 'null' ">
and t.confirm_user like CONCAT(#{rzhr},'%')
</if>
<if test="qsjsrq != null and qsjsrq != null ">
and t.qs_date between #{qsksrq} and #{qsjsrq}
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}
<if test="settlementNo != null and settlementNo != ''">
and t.settlement_no like concat(#{settlementNo},'%')
</if>
<if test="glzt != null and glzt != '' and glzt != 'null' and glzt != '99'">
and t.glzt = #{glzt}
</if>
<if test="rzhr != null and rzhr != '' and rzhr != 'null' ">
and t.confirm_user like CONCAT(#{rzhr},'%')
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
<if test="rzksrq != null and rzjsrq != null and rzksrq != '' and rzjsrq != ''">
and t.rzh_date between #{rzksrq} and #{rzjsrq}
</if>
<if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
<if test="skssq != null and skssq != '' and skssq != 'null' ">
and t.rzh_belong_date = #{skssq}
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and t.qs_type = #{qsfs}
</if>
<if test="qsksrq != null and qsjsrq != null and qsksrq != '' and qsjsrq != ''">
and t.qs_date between #{qsksrq} and #{qsjsrq}
</if>
<if
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
</if>
<if test="businessCode==''">
@ -149,16 +175,21 @@
</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 postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="voucherNumber!=null and voucherNumber!='' and voucherNumber!='null'">
and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
<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.invoice_date desc
</select>
<select id="selectByPramsMap" parameterType="java.util.Map"
resultMap="BaseResultMap" databaseId="oracle">

Loading…
Cancel
Save