修改导出字段和查询条件

release
yishiqihuasheng 2 years ago
parent ae9b52ad19
commit cf81570b40
  1. 1
      dxhy-common/src/main/java/com/dxhy/common/enums/ExcelServiceTypeEnum.java
  2. 7
      dxhy-core/src/main/java/com/dxhy/core/dao/FpxxZhDao.java
  3. 3
      dxhy-core/src/main/java/com/dxhy/core/entity/ExtAddTaxInvoice.java
  4. 2
      dxhy-core/src/main/java/com/dxhy/core/entity/ExtOtherInvoice.java
  5. 2
      dxhy-core/src/main/java/com/dxhy/core/entity/TicketInvoiceModel.java
  6. 12
      dxhy-core/src/main/java/com/dxhy/core/model/FpRzRespVO.java
  7. 1
      dxhy-core/src/main/java/com/dxhy/core/model/JkszhcxRespVO.java
  8. 18
      dxhy-core/src/main/java/com/dxhy/core/service/export/RzFpxxService.java
  9. 18
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/CustomsServiceImpl.java
  10. 6
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/ExcelExportServiceImpl.java
  11. 28
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/PoolPaperServiceImpl.java
  12. 148
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/RzFpxxServiceImpl.java
  13. 9
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/TicketServiceImpl.java
  14. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/CustomExportThread.java
  15. 442
      dxhy-core/src/main/java/com/dxhy/core/thread/ManualAthensThread.java
  16. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java
  17. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolOtherThread.java
  18. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java
  19. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/QypcsmkpExportThread.java
  20. 4
      dxhy-core/src/main/java/com/dxhy/core/thread/RzFpxxExportThread.java
  21. 5
      dxhy-core/src/main/resources/mapper/CustomsMapper.xml
  22. 13
      dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml
  23. 168
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  24. 7
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtCautionController.java

@ -233,6 +233,7 @@ public enum ExcelServiceTypeEnum {
//乐企,异常海关缴款书导出
LQ_CUSTOM_FPYCXX(68,68);
private int serviceType;
private int index;

@ -36,4 +36,11 @@ public interface FpxxZhDao extends BaseMapper<FpRzRespVO> {
* @return java.util.List<com.dxhy.core.model.AuthenticationCheckListVO>
*/
List<AuthenticationCheckListVO> selectTaxRebateByPramsMap(Map<String, Object> pramsMap);
/**
* 功能描述
* @param pramsMap
* @return java.util.List<com.dxhy.core.model.FpRzRespVO>
*/
List<FpRzRespVO> selectByparams(Map<String, Object> pramsMap);
}

@ -272,4 +272,7 @@ public class ExtAddTaxInvoice implements Serializable {
private String imageId;
private String accountPeriod;
private String compCode;
private String bzdh;
}

@ -93,4 +93,6 @@ public class ExtOtherInvoice implements Serializable {
private String imageId;
private String accountPeriod;
private String compCode;
private String inAccountStatus;
private String bzdh;
}

@ -106,6 +106,8 @@ public class TicketInvoiceModel implements Serializable {
private String businessDocumentNumber;
private String createDate;
private String bzdh;
private String inAccountStatus;
private String snVoucherNumber;
private String postingTime;
private String imageId;

@ -211,4 +211,16 @@ public class FpRzRespVO implements Serializable {
* 全电发票号码
*/
private String eleInvoiceNo;
private String snVoucherNumber;
private String imageNumber;
private String bzdh;
private String compCode;
private String postingTime;
private String accountPeriod;
}

@ -159,4 +159,5 @@ public class JkszhcxRespVO implements Serializable {
private String imageId;
private String accountPeriod;
private String compCode;
private String bzdh;
}

@ -37,4 +37,22 @@ public interface RzFpxxService extends MpBaseService<FpRzRespVO> {
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getTaxRebateList(Map<String, Object> pramsMap, int curr, int size);
/**
* 功能描述
* @return java.lang.String
*/
String getblocName(String s);
/**
* @param gfsh
* @return java.lang.String
*/
String getGfName(String gfsh);
/**
* @param pramsMap
* @return JSONObject
*/
JSONObject selectWithParams(Map<String,Object> pramsMap,int curr,int size);
}

@ -56,13 +56,20 @@ public class CustomsServiceImpl extends MpBaseServiceImpl<CustomsDao, JkszhcxRes
if (pageList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
JkszhcxRespVO vo = pageList.get(i);
String[] dataArray = new String[32];
String[] dataArray = new String[36];
// xh
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
// 缴款书号码
dataArray[1] = vo.getCustomsCode();
// 管理状态
dataArray[2] = dictdetaServcice.queryDictName(DictConstant.GLZT, vo.getGlzt());
if (vo.getGlzt() != null && "0".equals(vo.getGlzt())){
dataArray[2] = "正常";
}else if (vo.getGlzt() != null && "1".equals(vo.getGlzt())){
dataArray[2] = "异常";
}else if (vo.getGlzt() != null && "2".equals(vo.getGlzt())){
dataArray[2] = "疑似非正常";
}
// dataArray[2] = dictdetaServcice.queryDictName(DictConstant.GLZT, vo.getGlzt());
// 填发日期
dataArray[3] = vo.getFillInDate();
// 缴款单位名称
@ -126,6 +133,13 @@ public class CustomsServiceImpl extends MpBaseServiceImpl<CustomsDao, JkszhcxRes
dataArray[29] = vo.getPostingTime();
dataArray[30] = vo.getAccountPeriod();
dataArray[31] = vo.getImageId();
dataArray[32] = vo.getBzdh();
if (vo.getInAccountStatus() != null && "1".equals(vo.getInAccountStatus())){
dataArray[33] = "已入账";
}else if (vo.getInAccountStatus() != null && "0".equals(vo.getInAccountStatus())){
dataArray[33] = "未入账";
}
dataArray[34] = vo.getCompCode();
returnList.add(dataArray);
}
}

@ -233,6 +233,7 @@ public class ExcelExportServiceImpl implements IExcelExportService {
@Resource
private OssConfig ossConfig;
@Override
public void exportExcel(String message) {
@ -473,6 +474,11 @@ public class ExcelExportServiceImpl implements IExcelExportService {
// 乐企,异常发票信息导出
new LqFpycxxExportThread(exportLogService, list, lqFpycxxService, fileService, sender, feginWebsocket,
tabulateRedisService).start();
}else if (69 == vo.getServiceType()){
//发票认证-手工认证
new ManualAthensThread(exportLogService, list, rzFpxxService, fileService, sender, feginWebsocket,
tabulateRedisService).start();
}
try{
Thread.sleep(1000);

@ -129,7 +129,7 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
String[] dataArray = new String[17];
String[] dataArray = new String[20];
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
// 发票类型
dataArray[1] = new InvoiceTypeUtils().invoiceTypeName(pageList.get(i).getInvoiceType());
@ -161,6 +161,14 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
dataArray[13] = pageList.get(i).getPostingTime();
dataArray[14] = pageList.get(i).getImageId();
dataArray[15] = pageList.get(i).getAccountPeriod();
dataArray[16] = pageList.get(i).getBzdh();
if(pageList.get(i).getInAccountStatus() != null && "1".equals(pageList.get(i).getInAccountStatus())){
dataArray[17] = "已入账";
}else if (pageList.get(i).getInAccountStatus() != null && "0".equals(pageList.get(i).getInAccountStatus())){
dataArray[17] = "未入账";
}
dataArray[18] = pageList.get(i).getCompCode();
returnList.add(dataArray);
}
}
@ -192,7 +200,7 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
String[] dataArray = new String[36];
String[] dataArray = new String[39];
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
// 发票类型
dataArray[1] = new InvoiceTypeUtils().invoiceTypeName(pageList.get(i).getInvoiceType());
@ -311,6 +319,13 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
dataArray[33] = pageList.get(i).getPostingTime();
dataArray[34] = pageList.get(i).getAccountPeriod();
dataArray[35] = pageList.get(i).getImageId();
dataArray[36] = pageList.get(i).getBzdh();
if (pageList.get(i).getInAccountStatus() != null && "1".equals(pageList.get(i).getInAccountStatus())){
dataArray[37] = "已入账";
}else if (pageList.get(i).getInAccountStatus() != null && "0".equals(pageList.get(i).getInAccountStatus())){
dataArray[37] = "未入账";
}
dataArray[38] = pageList.get(i).getCompCode();
returnList.add(dataArray);
}
}
@ -342,7 +357,7 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
String[] dataArray = new String[27];
String[] dataArray = new String[30];
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
// 发票类型
dataArray[1] = new InvoiceTypeUtils().invoiceTypeName(pageList.get(i).getInvoiceType());
@ -406,6 +421,13 @@ public class PoolPaperServiceImpl extends MpBaseServiceImpl<PoolPaperDao, Invoic
dataArray[24] = pageList.get(i).getVoucherNo();
dataArray[25] = pageList.get(i).getDocumentNumber();
dataArray[26] = pageList.get(i).getCreateDate();
dataArray[27] = pageList.get(i).getBzdh();
if (pageList.get(i).getInAccountStatus() != null && "1".equals(pageList.get(i).getInAccountStatus())){
dataArray[28] = "已入账";
}else if (pageList.get(i).getInAccountStatus() != null && "0".equals(pageList.get(i).getInAccountStatus())){
dataArray[28] = "未入账";
}
dataArray[29] = pageList.get(i).getCompCode();
returnList.add(dataArray);
}
}

@ -7,6 +7,7 @@ import java.util.Map;
import javax.annotation.Resource;
import com.dxhy.core.service.export.PoolPaperService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -42,9 +43,11 @@ public class RzFpxxServiceImpl extends MpBaseServiceImpl<FpxxZhDao, FpRzRespVO>
private DictdetaServcice dictdetaServcice;
@Value("${dxhy.datasource.dxhy_admin:dxhy_admin}")
private String dxhyAdmin;
@Resource
private PoolPaperService poolPaperService;
@Override
public JSONObject selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
public JSONObject selectWithParams(Map<String, Object> pramsMap, int curr, int size) {
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
JSONObject json = new JSONObject();
try {
@ -59,7 +62,7 @@ public class RzFpxxServiceImpl extends MpBaseServiceImpl<FpxxZhDao, FpRzRespVO>
json.put("datalist", new ArrayList<FpRzRespVO>());
} else {
PageHelper.startPage(curr, size);
List<FpRzRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
List<FpRzRespVO> pageList = super.baseMapper.selectByparams(pramsMap);
PageInfo<FpRzRespVO> pageInfo = new PageInfo<>(pageList);
json.put("hasNext", pageInfo.isHasNextPage());
json.put("nextPage", pageInfo.getNextPage());
@ -68,44 +71,32 @@ public class RzFpxxServiceImpl extends MpBaseServiceImpl<FpxxZhDao, FpRzRespVO>
List<String[]> returnList = new ArrayList<>();
if (resultList != null && resultList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
pageList.get(i).setXh(String.valueOf((curr - 1) * size + i + 1));
// 字典转换
pageList.get(i).setInAccountStatus(dictdetaServcice.queryDictName(DictConstant.DK_STATUS,
pageList.get(i).getInAccountStatus()));
pageList.get(i)
.setInvoiceType(new InvoiceTypeUtils().invoiceTypeName(pageList.get(i).getInvoiceType()));
String invoiceStatus = pageList.get(i).getInvoiceStatus();
pageList.get(i).setInvoiceStatus(
dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, invoiceStatus));
String qsStatus = pageList.get(i).getQszt();
pageList.get(i).setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS, qsStatus));
pageList.get(i)
.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE, pageList.get(i).getQsfs()));
pageList.get(i).setRzzt(
dictdetaServcice.queryDictName(DictConstant.DEDU_STATUS, pageList.get(i).getRzzt()));
pageList.get(i).setRzclzt(
dictdetaServcice.queryDictName(DictConstant.AUTH_STATUS_ALL, pageList.get(i).getRzclzt()));
pageList.get(i).setRzlx(
dictdetaServcice.queryDictName(DictConstant.BDK_STATUS, pageList.get(i).getBdkStatus()));
pageList.get(i).setCxrzStatus(
dictdetaServcice.queryDictName(DictConstant.CXRZ_STATUS, pageList.get(i).getCxrzStatus()));
pageList.get(i).setPaymentStatus(
dictdetaServcice.queryDictName(DictConstant.FK_STATUS, pageList.get(i).getPaymentStatus()));
String[] dataArray = new String[21];
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
dataArray[1] = pageList.get(i).getInvoiceCode();
dataArray[2] = pageList.get(i).getInvoiceNo();
dataArray[3] = dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,pageList.get(i).getInvoiceStatus());
dataArray[4] = pageList.get(i).getInvoiceDate();
dataArray[5] = pageList.get(i).getGfName();
dataArray[6] = pageList.get(i).getXfName();
dataArray[7] = pageList.get(i).getInvoiceAmount();
dataArray[8] = pageList.get(i).getTaxAmount();
dataArray[9] = pageList.get(i).getDkTaxAmount();
dataArray[10] = dictdetaServcice.queryDictName(DictConstant.QS_STATUS, pageList.get(i).getQsStatus());
dataArray[11] = pageList.get(i).getQsDate();
dataArray[12] = dictdetaServcice.queryDictName(DictConstant.QS_TYPE, pageList.get(i).getQsType());
dataArray[13] = pageList.get(i).getQsName();
dataArray[14] = pageList.get(i).getSnVoucherNumber();
dataArray[15] = pageList.get(i).getPostingTime();
dataArray[16] = pageList.get(i).getImageNumber();
dataArray[17] = pageList.get(i).getAccountPeriod();
dataArray[18] = pageList.get(i).getBzdh();
dataArray[19] = pageList.get(i).getCompCode();
if ("".equals(pageList.get(i).getInvoiceAmount())) {
pageList.get(i).setInvoiceAmount(MathUtil.round(pageList.get(i).getInvoiceAmount()));
} else {
pageList.get(i).setInvoiceAmount(MathUtil.round(pageList.get(i).getInvoiceAmount()));
}
if ("".equals(pageList.get(i).getTaxAmount())) {
pageList.get(i).setTaxAmount(MathUtil.round(pageList.get(i).getTaxAmount()));
} else {
pageList.get(i).setTaxAmount(MathUtil.round(pageList.get(i).getTaxAmount()));
}
pageList.get(i).setDkTaxAmount(MathUtil.round(pageList.get(i).getDkTaxAmount()));
returnList.add(dataArray);
}
}
json.put("datalist", pageList);
json.put("datalist", resultList);
}
} catch (Exception e) {
// 统一设置操作异常标识
@ -190,4 +181,87 @@ public class RzFpxxServiceImpl extends MpBaseServiceImpl<FpxxZhDao, FpRzRespVO>
}
return json;
}
@Override
public String getblocName(String s) {
return poolPaperService.getblocName(s);
}
@Override
public String getGfName(String gfsh) {
return poolPaperService.getGfName(gfsh);
}
@Override
public JSONObject selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
JSONObject json = new JSONObject();
try {
List<String> gfshList = (List<String>)pramsMap.get("gfsh");
String inAccountStatus = (String)pramsMap.get("inAccountStatus");
if (gfshList.size() == 0) {
// 未从getUserInfo()获取到购方税号信息
json.put("hjsl", "0");
json.put("hjje", "0");
json.put("hjse", "0");
json.put("total", "0");
json.put("datalist", new ArrayList<FpRzRespVO>());
} else {
PageHelper.startPage(curr, size);
List<FpRzRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
PageInfo<FpRzRespVO> pageInfo = new PageInfo<>(pageList);
json.put("hasNext", pageInfo.isHasNextPage());
json.put("nextPage", pageInfo.getNextPage());
List<FpRzRespVO> resultList = pageInfo.getList();
List<String[]> returnList = new ArrayList<>();
if (resultList != null && resultList.size() > 0) {
for (int i = 0; i < pageList.size(); i++) {
pageList.get(i).setXh(String.valueOf((curr - 1) * size + i + 1));
// 字典转换
pageList.get(i).setInAccountStatus(dictdetaServcice.queryDictName(DictConstant.DK_STATUS,
pageList.get(i).getInAccountStatus()));
pageList.get(i)
.setInvoiceType(new InvoiceTypeUtils().invoiceTypeName(pageList.get(i).getInvoiceType()));
String invoiceStatus = pageList.get(i).getInvoiceStatus();
pageList.get(i).setInvoiceStatus(
dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, invoiceStatus));
String qsStatus = pageList.get(i).getQszt();
pageList.get(i).setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS, qsStatus));
pageList.get(i)
.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE, pageList.get(i).getQsfs()));
pageList.get(i).setRzzt(
dictdetaServcice.queryDictName(DictConstant.DEDU_STATUS, pageList.get(i).getRzzt()));
pageList.get(i).setRzclzt(
dictdetaServcice.queryDictName(DictConstant.AUTH_STATUS_ALL, pageList.get(i).getRzclzt()));
pageList.get(i).setRzlx(
dictdetaServcice.queryDictName(DictConstant.BDK_STATUS, pageList.get(i).getBdkStatus()));
pageList.get(i).setCxrzStatus(
dictdetaServcice.queryDictName(DictConstant.CXRZ_STATUS, pageList.get(i).getCxrzStatus()));
pageList.get(i).setPaymentStatus(
dictdetaServcice.queryDictName(DictConstant.FK_STATUS, pageList.get(i).getPaymentStatus()));
if ("".equals(pageList.get(i).getInvoiceAmount())) {
pageList.get(i).setInvoiceAmount(MathUtil.round(pageList.get(i).getInvoiceAmount()));
} else {
pageList.get(i).setInvoiceAmount(MathUtil.round(pageList.get(i).getInvoiceAmount()));
}
if ("".equals(pageList.get(i).getTaxAmount())) {
pageList.get(i).setTaxAmount(MathUtil.round(pageList.get(i).getTaxAmount()));
} else {
pageList.get(i).setTaxAmount(MathUtil.round(pageList.get(i).getTaxAmount()));
}
pageList.get(i).setDkTaxAmount(MathUtil.round(pageList.get(i).getDkTaxAmount()));
}
}
json.put("datalist", pageList);
}
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);
}
return json;
}
}

@ -137,7 +137,7 @@ public class TicketServiceImpl extends MpBaseServiceImpl<TicketDao, TicketInvoic
for (int i = 0; i < resultList.size(); i++) {
// 页面展示需要信息
String[] dataArray = new String[24];
String[] dataArray = new String[27];
dataArray[0] = String.valueOf((curr - 1) * size + i + 1);
dataArray[1] = exchangeInvoiceType(resultList.get(i).getInvoiceType());
dataArray[2] = resultList.get(i).getInvoiceCode();
@ -186,6 +186,13 @@ public class TicketServiceImpl extends MpBaseServiceImpl<TicketDao, TicketInvoic
dataArray[20] = resultList.get(i).getPostingTime();
dataArray[21] = resultList.get(i).getImageId();
dataArray[22] = resultList.get(i).getAccountPeriod();
dataArray[23] = resultList.get(i).getBzdh();
if (pageList.get(i).getInAccountStatus() != null && "1".equals(pageList.get(i).getInAccountStatus())){
dataArray[24] = "已入账";
}else if (pageList.get(i).getInAccountStatus() != null && "0".equals(pageList.get(i).getInAccountStatus())){
dataArray[24] = "未入账";
}
dataArray[25] = resultList.get(i).getCompCode();
returnList.add(dataArray);
}

@ -64,7 +64,7 @@ public class CustomExportThread extends BaseThread {
String[] titleColumns = {"序号", "缴款书号码", "管理状态", "填发日期", "缴款单位名称", "缴款单位税号", "税款金额", "抵扣税款金额", "稽核结果", "是否申请核对",
"核对结果", "认证状态", "认证类型", "认证日期", "认证方式", "认证人", "采集状态", "底账库采集时间", "采集来源", "签收方式", "签收状态", "签收日期", "签收人", "入账月份",
"入账状态", "凭证号", "业务单元", "入池时间","凭证号", "过账时间", "影像号", "账期"};
"入账状态", "凭证号", "业务单元", "入池时间","凭证号", "过账时间", "影像号", "账期","报账单号","入账状态","所属组织"};
String[] titleprop = {"xh", "customsCode", "fillInDate", "gfTaxNo", "gfName", "taxAmount", "yxTaxAmount",
"auditStatus", "applyCheck", "checkStatus", "rzhYesorno", "bdkStatus", "rzhDate", "rzhType", "confirmUser",

@ -0,0 +1,442 @@
package com.dxhy.core.thread;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
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.CustomCellWriteHandler;
import com.dxhy.common.util.ExceptionUtil;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.utils.DateUtils;
import com.dxhy.core.entity.TDxExcelExportlog;
import com.dxhy.core.feign.IFeginWebsocket;
import com.dxhy.core.rabbitmq.Sender;
import com.dxhy.core.service.export.PoolPaperService;
import com.dxhy.core.service.export.RzFpxxService;
import com.dxhy.core.service.singletable.IExcelExportlogService;
import com.dxhy.core.util.JsonResponseUtils;
import com.dxhy.oss.service.FileService;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.*;
//import com.alibaba.excel.metadata.Sheet;
//import com.alibaba.excel.metadata.Table;
/**
* @author user
*/
@Slf4j
@SuppressWarnings({"AliDeprecation", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"})
public class ManualAthensThread extends BaseThread {
/**
* 默认要导出第几页的数据
*/
private final int default_curr = 1;
/**
* 默认每页导出多少条数据
*/
private final int default_size = 5000;
/**
* 文件名前缀
*/
private final String fileNamePrefix = "手工认证";
/**
* 文件名后缀
*/
private final String fileNameSurfix = ".xlsx";
/**
* 文件名中间分隔符
*/
private final String fileSplit = "_";
/**
* excel的标题
*/
private String title = "手工认证发票";
/**
* 导出excel的列名
*/
private final String[] titleColumns = {"序号", "发票代码", "发票号码", "发票状态", "开票日期","购方名称", "销方名称", "金额", "税额",
"抵扣税额", "签收状态", "签收日期", "签收方式", "签收人","凭证号","报账单号", "过账时间", "影像号", "账期", "报账单号", "所属组织"};
/**
* 导出excel的列名
*/
private final String[] detailTitleColumns =
{"序号", "发票代码", "发票号码", "货物或应税劳务名称", "规格型号", "单位", "数量", "单价", "金额", "税额", "税率", "车牌号", "类型", "通行日期起", "通行日期止"};
// private Sheet sheet;
// private Table table;
private WriteSheet writeSheet;
private WriteTable writeTable;
private ExcelWriter writer = null;
private final IExcelExportlogService exportLogService;
private final List<TDxExcelExportlog> exportLogs;
private final RzFpxxService rzFpxxService;
private final FileService fileService;
private final Sender sender;
private final IFeginWebsocket feginWebsocket;
private final TabulateRedisServiceImpl tabulateRedisService;
public ManualAthensThread(IExcelExportlogService exportLogService, List<TDxExcelExportlog> exportLogs,
RzFpxxService rzFpxxService, FileService fileService, Sender sender, IFeginWebsocket feginWebsocket,
TabulateRedisServiceImpl tabulateRedisService) {
this.exportLogService = exportLogService;
this.exportLogs = exportLogs;
this.rzFpxxService = rzFpxxService;
this.fileService = fileService;
this.sender = sender;
this.feginWebsocket = feginWebsocket;
this.tabulateRedisService = tabulateRedisService;
}
@Override
public void run() {
for (TDxExcelExportlog exportLog : exportLogs) {
// 日志表主键
Long id = exportLog.getId();
String userid = exportLog.getUserAccount();
String userName = exportLog.getUserName();
// 导出条件
String condition = exportLog.getConditions();
// 数据源名称
String dbName = exportLog.getDbName();
if (StringHelper.isBlank(dbName)) {
dbName = "";
}
String createDate = DateUtils.dateToStrLong(exportLog.getCreateDate());
JSONObject msg = new JSONObject();
// 捕获异常,防止某一条日志导出出错,影响其它日志的导出
try {
exportLogService.updateStart(id, dbName);
// 应该保存的参数
JSONObject prams = JSONObject.parseObject(condition);
String businessCode = prams.getString("businessCode");
String bzdh = prams.getString("bzdh");
String company = prams.getString("company");
String companyCode = prams.getString("companyCode");
String keyWord = prams.getString("keyWord");
String gfsh = prams.getString("gfsh");
String fpzt = prams.getString("invoiceStatus");
String invoiceType = prams.getString("invoiceType");
String qszt = prams.getString("qszt");
String qsr = prams.getString("qsr");
String qsfs = prams.getString("qsfs");
String rzzt = prams.getString("rzzt");
String rzlx = prams.getString("rzlx");
String rzr = prams.getString("rzr");
String cjksyf = prams.getString("cjksyf");
String cjjsyf = prams.getString("cjjsyf");
String gfTaxNo = prams.getString("gfTaxNo");
String inAccountStatus = prams.getString("inAccountStatus");
String inAccountMonth = prams.getString("inAccountMonth");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh);
pramsMap.put("gfsh", gfshList);
} else {
pramsMap.put("gfsh", gfshList);
}
if (cjksyf != null && !"".equals(cjksyf)) {
pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(cjksyf)));
}
if (cjjsyf != null && !"".equals(cjjsyf)) {
pramsMap.put("cjjsyf", DateUtils.getNight(DateUtils.strToDate(cjjsyf)));
}
if (prams.get("kpksrq") != null && !"".equals(prams.get("kpksrq"))) {
pramsMap.put("kpksrq",
DateUtils.getMorning(DateUtils.strToDate(prams.get("kpksrq").toString())));
}
if (prams.get("kpjsrq") != null && !"".equals(prams.get("kpjsrq"))) {
pramsMap.put("kpjsrq", DateUtils.getNight(DateUtils.strToDate(prams.get("kpjsrq").toString())));
}
if (prams.get("skssq") != null && !"".equals(prams.get("skssq")) && "1".equals(prams.get("rzzt"))) {
pramsMap.put("skssq", prams.get("skssq").toString().replace("-", ""));
} else {
pramsMap.put("skssq", "");
}
if (prams.get("qsyf") == null && "".equals(prams.get("qsyf")) && !"1".equals(prams.get("qszt"))) {
pramsMap.put("qsyf", "");
}else {
pramsMap.put("qsyf", prams.get("qsyf"));
}
if (prams.get("inAccountMonth") == null && "".equals(prams.get("inAccountMonth"))
&& !"1".equals(prams.get("inAccountStatus"))) {
pramsMap.put("inAccountMonth", "");
}else {
pramsMap.put("inAccountMonth", inAccountMonth);
}
pramsMap.put("keyWord", keyWord);
pramsMap.put("qszt", qszt);
pramsMap.put("invoiceType", invoiceType);
pramsMap.put("qsr", qsr);
pramsMap.put("qsfs", qsfs);
pramsMap.put("fpzt", fpzt);
pramsMap.put("rzzt", rzzt);
pramsMap.put("rzlx", rzlx);
pramsMap.put("rzr", rzr);
pramsMap.put("inAccountStatus", inAccountStatus);
pramsMap.put("company", company);
pramsMap.put("invoiceSource",prams.getString("invoiceSource"));
pramsMap.put("companyCodes",companyCodes);
pramsMap.put("companyCode",companyCode);
pramsMap.put("snVoucherNumber", prams.getString("snVoucherNumber"));
pramsMap.put("postingTimeEnd", prams.getString("postingTimeEnd"));
pramsMap.put("postingTimeStart", prams.getString("postingTimeStart"));
pramsMap.put("imageNumber", prams.getString("imageNumber"));
if (prams.getString("accountPeriod") != null && !"".equals(prams.getString("accountPeriod"))) {
String accountPeriod = prams.getString("accountPeriod").substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
}
// 导出文件名
StringBuilder ftpFileName = new StringBuilder();
ftpFileName.append(fileNamePrefix);
ftpFileName.append(DateUtils.dateToMonthStr(new Date()));
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(rzFpxxService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(rzFpxxService.getGfName(s));
ftpFileName.append(fileSplit);
}
}
}
ftpFileName.append(DateUtils.getNowTimeStamp());
title = ftpFileName.toString();
ftpFileName.append(fileNameSurfix);
// 本地文件存储路径
StringBuilder excelFile = new StringBuilder();
excelFile.append(fileService.getLocalPathDefault());
excelFile.append(ftpFileName.toString());
File filePath = new File(getFilePath(excelFile.toString()));
if (!filePath.exists()) {
filePath.mkdirs();
}
File file = new File(excelFile.toString());
if (!file.exists()) {
file.delete();
}
if (!file.exists()) {
file.createNewFile();
}
OutputStream out = new FileOutputStream(excelFile.toString());
// writer = new ExcelWriter(null, out, ExcelTypeEnum.XLSX, true, new CellWriteHandler());
ExcelWriterBuilder builder = EasyExcel.write(excelFile.toString());
builder.registerWriteHandler(new CustomCellWriteHandler());
writer = builder.build();
// 递归导出数据到excel 发票信息
this.cicleExport(pramsMap, default_curr, excelFile.toString(), out, writer);
writer.finish();
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
String ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
+ toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString();
// 文件上传ftp
fileService.uploadFile(ftpFilePath, excelFile.toString());
// 设置成功消息内容
msg.put("title", super.getSuccTitle(title));
msg.put("content", super.getSuccContent(createDate));
msg.put("url", super.getUrl(id));
msg.put("useraccount", userName);
// 记录导出完成状态
exportLogService.updateSucc(id, ftpFilePath, dbName);
} catch (Exception e) {
String errmsg = ExceptionUtil.getExceptionDeteil(e, 4000);
// 设置失败消息内容
msg.put("title", super.getFailTitle(title));
msg.put("content", super.getFailContent(createDate, errmsg));
msg.put("url", "");
msg.put("useraccount", userName);
log.error("", e);
// 记录导出出错状态
exportLogService.updateFail(id, errmsg, dbName);
} finally {
// 发送导出消息到mq
String responseResult = JsonResponseUtils.responseResult(msg);
sender.sendToMsg(responseResult);
// 申请成功后像websocket发送申请信息
feginWebsocket.setMessageToWebsocket(userName);
}
}
}
/**
* 递归导出数据到excel文件防止jvm oom
*
* @param pramsMap
* 查询数据参数集合
* @param curr
* 当前第几页
* @param excelFile
* 导出的文件
* @param writer
* @throws Exception
*
*/
private boolean cicleExport(Map<String, Object> pramsMap, int curr, String excelFile, OutputStream out,
ExcelWriter writer) throws Exception {
// 查询指定页数的数据
JSONObject pageData = rzFpxxService.selectWithParams(pramsMap, curr, default_size);
boolean hasNext = pageData.getBooleanValue("hasNext");
List<String[]> dataList = (List<String[]>)pageData.get("datalist");
boolean firstPage = false;
if (curr == default_curr) {
firstPage = true;
}
// 数据不是最后一页
if (hasNext) {
int nextPage = pageData.getIntValue("nextPage");
// 写入当前页数据
exportListArrayToExcel(excelFile, title, titleColumns, dataList, firstPage, false, 1, "发票信息", out, writer);
// 更新页数
return cicleExport(pramsMap, nextPage, excelFile, out, writer);
} else {
// 写入最后一页数据
exportListArrayToExcel(excelFile, title, titleColumns, dataList, firstPage, true, 1, "发票信息", out, writer);
return hasNext;
}
}
/**
* 递归导出数据到excel文件防止jvm oom
*
* @param pramsMap
* 查询数据参数集合
* @param curr
* 当前第几页
* @param excelFile
* 导出的文件
* @param writer
* @throws Exception
*
*/
private boolean detailCicleExport(Map<String, Object> pramsMap, int curr, String excelFile, OutputStream out,
ExcelWriter writer) throws Exception {
// 查询指定页数的数据
JSONObject pageData = rzFpxxService.getTaxRebateList(pramsMap, curr, default_size);
boolean hasNext = pageData.getBooleanValue("hasNext");
List<String[]> dataList = (List<String[]>)pageData.get("datalist");
boolean firstPage = false;
if (curr == default_curr) {
firstPage = true;
}
// 数据不是最后一页
if (hasNext) {
int nextPage = pageData.getIntValue("nextPage");
// 写入当前页数据
exportListArrayToExcel(excelFile, title, detailTitleColumns, dataList, firstPage, false, 2, "货物信息", out,
writer);
// 更新页数
return detailCicleExport(pramsMap, nextPage, excelFile, out, writer);
} else {
// 写入最后一页数据
exportListArrayToExcel(excelFile, title, detailTitleColumns, dataList, firstPage, true, 2, "货物信息", out,
writer);
return hasNext;
}
}
public void exportListArrayToExcel(String excelFile, String title, String[] titleColumns, List<String[]> dataList,
boolean firstPage, boolean lastPage, int sheetNo, String sheetName, OutputStream out, ExcelWriter writer) {
String[] datas;
if (firstPage) {
writeSheet = new WriteSheet();
writeSheet.setSheetNo(sheetNo);
writeSheet.setSheetName(sheetName);
writeTable = new WriteTable();
writeTable.setTableNo(sheetNo);
List<List<String>> titles = new ArrayList<>();
datas = titleColumns;
int var11 = titleColumns.length;
for (int var12 = 0; var12 < var11; ++var12) {
String titleColumn = datas[var12];
titles.add(Collections.singletonList(titleColumn));
}
writeTable.setHead(titles);
List<List<String>> list = new ArrayList<>();
for (String[] strings : dataList) {
datas = strings;
list.add(Arrays.asList(datas));
}
this.writer.write(list, writeSheet, writeTable);
} else {
List<List<String>> list = new ArrayList<>();
for (String[] strings : dataList) {
datas = strings;
list.add(Arrays.asList(datas));
}
this.writer.write(list, writeSheet, writeTable);
}
}
private static String getFilePath(String fileName) {
StringBuilder filePath = new StringBuilder();
if (!fileName.contains(":")) {
filePath.append("/");
}
String[] filePaths = fileName.split("/");
for (int i = 0; i < filePaths.length - 1; ++i) {
if (!StringHelper.isBlank(filePaths[i])) {
filePath.append(filePaths[i]);
filePath.append("/");
}
}
return filePath.toString();
}
}

@ -68,7 +68,7 @@ public class PoolAddTaxThread extends BaseThread {
*/
private final String[] titleColumns = {"序号", "发票类型", "发票代码", "发票号码", "发票状态", "开票日期", "销方名称", "销方税号", "金额", "税额",
"有效税额", "价税合计", "认证状态", "认证类型", "认证日期", "认证方式", "认证人", "采集状态", "底账库采集时间", "采集来源", "签收方式", "签收状态", "签收日期", "签收人",
"入账月份", "入账状态", "凭证号", "是否末次摊销", "摊销金额", "剩余金额", "业务单号", "入池时间","凭证号","过账时间","账期","影像id"};
"入账月份", "入账状态", "凭证号", "是否末次摊销", "摊销金额", "剩余金额", "业务单号", "入池时间","凭证号","过账时间","账期","影像id","报账单号","入账状态","所属组织"};
/**
* 导出excel的列名

@ -55,7 +55,7 @@ public class PoolOtherThread extends BaseThread {
* 导出excel的列名
*/
private final String[] titleColumns =
{"序号", "发票类型", "发票代码", "发票号码", "开票日期", "金额", "签收状态", "签收日期", "签收方式", "签收人", "业务单号", "入池时间","凭证号", "过账时间", "影像号", "账期"};
{"序号", "发票类型", "发票代码", "发票号码", "开票日期", "金额", "签收状态", "签收日期", "签收方式", "签收人", "业务单号", "入池时间","凭证号", "过账时间", "影像号", "账期","报账单号","入账状态","所属组织"};
private final IExcelExportlogService exportLogService;

@ -72,7 +72,7 @@ public class PoolSaleThread extends BaseThread {
*/
private final String[] titleColumns =
{"序号", "发票类型", "发票代码", "发票号码", "发票状态", "开票日期", "购方名称", "购方税号", "金额", "税额", "价税合计", "清单标志", "备注", "优惠政策类型",
"采集状态", "采集时间", "采集来源", "签收方式", "对接系统", "签收状态", "签收日期", "签收人", "入账月份", "入账状态", "凭证号", "业务单号", "入池时间"};
"采集状态", "采集时间", "采集来源", "签收方式", "对接系统", "签收状态", "签收日期", "签收人", "入账月份", "入账状态", "凭证号", "业务单号", "入池时间","报账单号","入账状态","所属组织"};
/**
* 导出excel的列名

@ -61,7 +61,7 @@ public class QypcsmkpExportThread extends BaseThread {
* 导出excel的列名
*/
private final String[] titleColumns = {"序号", "发票类型", "发票代码", "发票号码", "开票日期", "销方名称", "乘坐人", "证件号", "班次/车次", "金额",
"税率(%)", "税额", "签收状态", "签收日期", "签收方式", "签收人", "抵扣状态", "业务单号", "入池时间","凭证号", "过账时间", "影像号", "账期"};
"税率(%)", "税额", "签收状态", "签收日期", "签收方式", "签收人", "抵扣状态", "业务单号", "入池时间","凭证号", "过账时间", "影像号", "账期","报账单号","入账状态","所属组织"};
private final IExcelExportlogService exportLogService;

@ -59,7 +59,7 @@ public class RzFpxxExportThread extends BaseThread {
*/
private String[] titleColumns =
{"序号", "发票代码", "发票号码", "发票类型", "开票日期", "购方名称", "购方税号", "销方名称", "销方税号", "金额", "税额", "抵扣税额", "发票状态", "签收状态",
"签收日期", "签收方式", "签收人", "认证时间", "认证状态", "认证处理状态", "认证类型", "认证人", "税款所属期", "撤销认证处理状态", "业务单元"};
"签收日期", "签收方式", "签收人", "认证时间", "认证状态", "认证处理状态", "认证类型", "认证人", "税款所属期", "撤销认证处理状态", "业务单元","报账单号","入账状态","所属组织"};
private final IExcelExportlogService exportLogService;
@ -234,7 +234,7 @@ public class RzFpxxExportThread extends BaseThread {
if (StringUtils.isNotBlank(inAccountStatus)) {
titleColumns = new String[] {"序号", "打款状态", "发票代码", "发票号码", "发票类型", "开票日期", "购方名称", "购方税号", "销方名称",
"销方税号", "金额", "税额", "抵扣税额", "发票状态", "签收状态", "签收日期", "签收方式", "签收人", "认证时间", "认证状态", "认证处理状态",
"认证类型", "认证人", "税款所属期", "撤销认证处理状态", "业务单元"};
"认证类型", "认证人", "税款所属期", "撤销认证处理状态", "业务单元","报账单号","入账状态","所属组织"};
}
if ("1".equals(prams.getString("payment"))) {
titleColumns = new String[] {"序号", "发票代码", "发票号码", "发票类型", "开票日期", "购方名称", "购方税号", "销方名称", "销方税号",

@ -33,6 +33,9 @@
<result column="posting_time" property="postingTime"/>
<result column="image_id" property="imageId"/>
<result column="account_period" property="accountPeriod"/>
<result column="inaccount_status" property="inAccountStatus"/>
<result column="bzdh" property="bzdh"/>
<result column="comp_code" property="compCode"/>
</resultMap>
<select databaseId="mysql" id="selectByPramsMap"
@ -42,7 +45,7 @@
fill_in_date,t.gf_tax_no,t.gf_name,t.tax_amount,t.yx_tax_amount,t.audit_status,t.apply_check,t.check_status,t.qs_status,
DATE_FORMAT(t.qs_date,'%Y-%m-%d') qs_date,t.qs_type,t.qs_user,DATE_FORMAT(t.rzh_date,'%Y-%m-%d')
rzh_date, t.rzh_yesorno,t.sn_voucher_number snVoucherName,t.posting_time,t.image_id imageId,
t.account_period accountPeriod,t.auth_status,t.bdk_status,t.confirm_user,t.rzh_belong_date,t.glzt,
t.account_period accountPeriod,t.auth_status,t.bdk_status,t.confirm_user,t.rzh_belong_date,t.glzt,t.inaccount_status,t.bzdh,t.comp_code,
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

@ -99,7 +99,10 @@
source_system sourceSystem,
uuid,
select_id selectId,
business_document_number businessDocumentNumber
business_document_number businessDocumentNumber,
bzdh,
inaccount_status inAccountStatus,
comp_code compCode
FROM
t_dx_invoice_reimburse
where invoice_type in
@ -193,7 +196,10 @@
t.account_period accountPeriod,
t.document_number documentNumber,
DATE_FORMAT(t.collect_date,'%Y-%m-%d') collectDate,
t.collect_from collectFrom
t.collect_from collectFrom,
t.bzdh bzdh,
t.inaccount_status inAccountStatus,
t.comp_code compCode
from t_dx_record_invoice t
where 1 = 1
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
@ -287,6 +293,9 @@
<include refid="sql_fields_added"/>
,t.incentive_flag incentiveFlag
,t.system_name systemName
,t.bzdh
,t.inaccount_status inAccountStatus
,t.comp_code compCode
from t_dx_sale_record_invoice t
where 1 = 1
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">

@ -457,4 +457,172 @@
</if>
order by t.qs_date desc,t.invoice_date desc
</select>
<resultMap id="SggxcxResultMap" type="com.dxhy.core.model.FpRzRespVO">
<result column="id" property="id"/>
<result column="dept_name" property="deptName"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_no" property="invoiceNo"/>
<result column="gf_name" property="gfName"/>
<result column="gf_tax_no" property="gfTaxNo"/>
<result column="xf_name" property="xfName"/>
<result column="invoice_date" property="invoiceDate"/>
<result column="invoice_amount" property="invoiceAmount"/>
<result column="dk_tax_amount" property="dkTaxAmount"/>
<result column="tax_amount" property="taxAmount"/>
<result column="qs_date" property="qsDate"/>
<result column="qs_type" property="qsType"/>
<result column="qs_status" property="qsStatus"/>
<result column="dept_id" property="deptId"/>
<result column="invoice_type" property="invoiceType"/>
<result column="qs_name" property="qsName"/>
<result column="invoice_status" property="invoiceStatus"/>
<result column="authStatus" property="authStatus"/>
<result column="inaccount_status" property="inAccountStatus"/>
<result column="payment_date" property="paymentDate"/>
<result column="payment_status" property="paymentStatus"/>
<result column="voucher_number" property="voucherNumber"/>
<result column="sn_voucher_number" property="snVoucherNumber"/>
<result column="image_id" property="imageNumber"/>
<result column="tax_amount" property="taxAmount"/>
<result column="posting_time" property="postingTime"/>
<result column="account_period" property="accountPeriod"/>
<result column="ele_invoice_no" property="eleInvoiceNo"/>
<result column="bzdh" property="bzdh"/>
<result column="comp_code" property="compCode"/>
</resultMap>
<select id="selectByparams" parameterType="java.util.Map"
resultMap="SggxcxResultMap" databaseId="mysql">
select t.invoice_type,t.dept_id,t.dept_name,t.comp_code
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name,
DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period,
case date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date when
true then 1
else 2 end authStatus,t.bzdh,t.tax_amount
t.inaccount_status,t.payment_status,DATE_FORMAT(t.payment_date,'%Y-%m-%d')payment_date,t.settlement_no,t.ele_invoice_no
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08'))
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.company = #{company}
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
and t.invoice_amount>0
and t.tax_amount>=0
and date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date
and d.tj_status in('0','3')
</if>
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()">
and (t.invoice_status in ('1','2','3','4','8','80') or t.invoice_amount &lt;0 or t.tax_amount &lt;0 or
date_format(t.invoice_date,'%Y%m%d') &lt;= c.select_start_date or
date_format(t.invoice_date,'%Y%m%d') &gt;=
c.select_end_date or d.tj_status in ('1','2'))
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="companyCodes != null and companyCodes != '99' and companyCodes != '88' and companyCodes != '' and companyCodes != 'null'" >
and t.comp_code = #{companyCodes}
</if>
<if test="companyCodes != null and companyCodes != '' and companyCodes == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
and t.inaccount_status = #{inAccountStatus}
</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="voucherNumber != null and voucherNumber != ''">
and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</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="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'">
and t.invoice_source = #{invoiceSource}
</if>
<if test="fpzt != null and fpzt != '' and fpzt != 'null'">
and t.invoice_status = #{fpzt}
</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},'%')
</if>
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<if test="settlementNo != null and settlementNo != ''">
and t.settlement_no like concat(#{settlementNo},'%')
</if>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<!-- 按签收人查询 -->
<if test="position != null and position != '' and position != 'null' and position == '1'.toString()">
and t.qs_name = #{username}
</if>
<if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
</if>
<if test="businessCode==''">
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
</if>
<if test='businessCode == "99" and business != null and business.size()>0'>
and (t.dept_id in
<foreach collection="business" index="index" item="item" open="(" separator="," close="">
#{item.businessCode}
</foreach>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
<if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
and t.ele_invoice_no = #{eleInvoiceNo}
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<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>
<if test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
order by t.qs_date desc,t.invoice_date desc
</if>
<if test="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''">
order by t.invoice_date desc
</if>
</select>
</mapper>

@ -1,6 +1,7 @@
package com.dxhy.extend.controller;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource;
@ -118,4 +119,10 @@ public class ExtCautionController extends AbstractController {
}
}
@PostMapping("/list/notInAccount")
@SysLog("未入账发票预警")
public ResponseEntity<R> notInAccount(@RequestBody Map<String,Object> params){
return ResponseEntity.ok(R.ok());
}
}

Loading…
Cancel
Save