修改空指针问题,添加非空判断

release
yishiqihuasheng 2 years ago
parent c86ff65d31
commit 737998b020
  1. 7
      dxhy-core/src/main/java/com/dxhy/core/controller/ExcelController.java
  2. 6
      dxhy-core/src/main/java/com/dxhy/core/thread/CustomExportThread.java
  3. 6
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java
  4. 7
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolOtherThread.java
  5. 6
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java
  6. 4
      dxhy-core/src/main/java/com/dxhy/core/thread/QypcsmkpExportThread.java
  7. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/RzFpxxExportThread.java
  8. 23
      dxhy-core/src/main/resources/mapper/CustomsMapper.xml
  9. 66
      dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml
  10. 6
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  11. 22
      dxhy-core/src/main/resources/mapper/TicketMapper.xml

@ -191,6 +191,13 @@ public class ExcelController extends AbstractController {
// 非查验综合查询、查验明细导出处理
if (!"30".equals(serviceType) && !"29".equals(serviceType)) {
// String companyCode = prams.getString("companyCode");
// if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
// pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
// log.info("组织机构====>{}",pramsMap.get("companyCodes"));
// }
prams.put("companyCodes",getUserInfo().getCompanyCodes());
// 判断购方税号是否为全部
if ("99".equals(gfsh)) {
StringBuffer newGfsh = new StringBuffer();

@ -2,6 +2,7 @@ package com.dxhy.core.thread;
import java.util.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.common.util.ExcelPoiUtil;
@ -143,12 +144,17 @@ public class CustomExportThread extends BaseThread {
String businessCode = prams.getString("businessCode");
String company = prams.getString("company");
String menuId = prams.getString("menuId");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// JSONObject jsonObject = tabulateRedisService.getTabulateExcel(company, menuId);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
pramsMap.put("business", businesses);
pramsMap.put("keyWord", prams.getString("keyWord"));
pramsMap.put("companyCode",companyCode);
pramsMap.put("companyCodes",companyCodes);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {

@ -13,6 +13,7 @@ import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.WriteTable;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.common.util.CellWriteHandler;
@ -146,6 +147,9 @@ public class PoolAddTaxThread extends BaseThread {
String inAccountStatus = prams.getString("inAccountStatus");
String inAccountMonth = prams.getString("inAccountMonth");
String company = prams.getString("company");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
@ -197,6 +201,8 @@ public class PoolAddTaxThread extends BaseThread {
pramsMap.put("inAccountStatus", inAccountStatus);
pramsMap.put("company", company);
pramsMap.put("invoiceSource",prams.getString("invoiceSource"));
pramsMap.put("companyCodes",companyCodes);
pramsMap.put("companyCode",companyCode);
// 导出文件名
StringBuilder ftpFileName = new StringBuilder();
ftpFileName.append(fileNamePrefix);

@ -2,6 +2,7 @@ package com.dxhy.core.thread;
import java.util.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.common.util.ExcelPoiUtil;
@ -147,6 +148,12 @@ public class PoolOtherThread extends BaseThread {
pramsMap.put("qsfs", qsfs);
pramsMap.put("invoiceType", invoiceType);
pramsMap.put("company", company);
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
pramsMap.put("companyCode",companyCode);
pramsMap.put("companyCodes",companyCodes);
// 导出文件名
StringBuilder ftpFileName = new StringBuilder();
ftpFileName.append(fileNamePrefix);

@ -13,6 +13,7 @@ import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.WriteTable;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.common.util.CellWriteHandler;
@ -150,6 +151,9 @@ public class PoolSaleThread extends BaseThread {
String inAccountStatus = prams.getString("inAccountStatus");
String gfTaxNo = prams.getString("gfTaxNo");
String company = prams.getString("company");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
@ -186,6 +190,8 @@ public class PoolSaleThread extends BaseThread {
pramsMap.put("fpzt", fpzt);
pramsMap.put("listMark", listMark);
pramsMap.put("remark", remark);
pramsMap.put("companyCode",companyCode);
pramsMap.put("companyCodes",companyCodes);
if (inAccountMonth == null && "".equals(inAccountMonth) && !"1".equals(inAccountMonth)) {
pramsMap.put("inAccountMonth", "");
}else {

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.common.util.ExcelPoiUtil;
@ -116,6 +117,9 @@ public class QypcsmkpExportThread extends BaseThread {
JSONObject prams = JSONObject.parseObject(condition);
prams.put("dbName", dbName);
// 参数转换为需要的形式
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
prams.put("companyCodes",companyCodes);
String gfTaxNo = prams.getString("gfTaxNo");
String gfsh = prams.getString("gfsh");
List<String> gfshList = new ArrayList<>();

@ -132,6 +132,7 @@ public class RzFpxxExportThread extends BaseThread {
String rzhr = prams.getString("rzhr");
String company = prams.getString("company");
String menuId = prams.getString("menuId");
String companyCode = prams.getString("companyCode");
JSONObject jsonObject = tabulateRedisService.getTabulateExcel(company, menuId);
List<Business> businesses = (List<Business>)prams.get("userBusiness");
String inAccountStatus = prams.getString("inAccountStatus");
@ -226,6 +227,7 @@ public class RzFpxxExportThread extends BaseThread {
pramsMap.put("rzhr", Arrays.asList(split1));
}
}
pramsMap.put("companyCode",companyCode);
pramsMap.put("inAccountStatus", inAccountStatus);
pramsMap.put("company", company);
pramsMap.put("qsr", prams.getString("qsr"));

@ -46,10 +46,11 @@
t.customs_scan_id,t.dept_name businessName,t.in_account_status,t.voucher_number,t.document_number,t.in_account_date,rzh_type,rzlx,t.create_date,
data_sources
from t_dx_customs_record t
where export_mark = '0' and t.gf_tax_no in
<foreach close=")" collection="gfsh" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
where export_mark = '0'
<!-- and t.gf_tax_no in-->
<!-- <foreach close=")" collection="gfsh" index="index" item="item" open="(" separator=",">-->
<!-- #{item}-->
<!-- </foreach>-->
<if test="keyWord != null and keyWord != '' and keyWord != 'null'">
and t.customs_code like CONCAT('%',#{keyWord},'%')
</if>
@ -141,6 +142,20 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<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="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'">
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
order by t.fill_in_date desc
</select>

@ -113,10 +113,10 @@
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
AND CONCAT(IFNULL(invoice_code,''),IFNULL(invoice_no,'')) like CONCAT('%',#{keyWord},'%')
</if>
and gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<!-- and gf_tax_no in-->
<!-- <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '999' ">
and invoice_type = #{invoiceType}
</if>
@ -132,6 +132,20 @@
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and qs_type = #{qsfs}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or comp_code is null or comp_code = ''
)
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'">
and comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'">
and (comp_code is null or comp_code = '')
</if>
GROUP BY uuid having min(create_date)
ORDER BY create_date DESC
</select>
@ -193,10 +207,10 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<!-- and t.gf_tax_no in-->
<!-- <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -251,6 +265,20 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<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="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'">
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
</select>
<!--销项票池查询-->
<select id="listSaleInvoice" parameterType="java.util.Map"
@ -272,10 +300,10 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.xf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<!-- and t.xf_tax_no in-->
<!-- <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -312,6 +340,20 @@
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
and t.invoice_source = #{invoiceSource}
</if>
<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="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'">
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
GROUP BY t.uuid
ORDER BY t.create_date DESC
</select>

@ -98,6 +98,12 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
</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 invoiceStatus != '99' ">
and t.invoice_status = #{invoiceStatus}

@ -63,10 +63,10 @@
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
and CONCAT(IFNULL(t.passenger,''),IFNULL(t.passenger_s_f_z_h,'')) like CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<!-- and t.gf_tax_no in-->
<!-- <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
and t.invoice_type in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
@ -89,6 +89,20 @@
<if test="company !=null and company !=''">
and t.company = #{company}
</if>
<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="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode != '88'">
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != '99' and companyCode == '88'">
and (t.comp_code is null or t.comp_code = '')
</if>
</select>

Loading…
Cancel
Save