Merge branches '0507' and 'test' of http://192.168.12.182/invoice/pt into test

release
yefei 2 years ago
commit de30ee0f0f
  1. 9
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  2. 14
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  3. 12
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  4. 18
      dxhy-core/src/main/java/com/dxhy/core/thread/CustomExportThread.java
  5. 32
      dxhy-core/src/main/java/com/dxhy/core/thread/ManualAthensThread.java
  6. 33
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java
  7. 30
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolOtherThread.java
  8. 33
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java
  9. 17
      dxhy-core/src/main/java/com/dxhy/core/thread/QypcsmkpExportThread.java
  10. 10
      dxhy-core/src/main/java/com/dxhy/core/thread/RzFpxxExportThread.java
  11. 6
      dxhy-core/src/main/resources/mapper/BbfpzhMapper.xml
  12. 5
      dxhy-core/src/main/resources/mapper/BbycfpcxMapper.xml
  13. 4
      dxhy-core/src/main/resources/mapper/CustomsMapper.xml
  14. 11
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  15. 470
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  16. 6
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java
  17. 15
      dxhy-extend/src/main/resources/mapper/CustomsMapper.xml
  18. 12
      dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml
  19. 10
      dxhy-extend/src/main/resources/mapper/ExtBbycfpcxMapper.xml
  20. 5
      dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml

@ -200,9 +200,10 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
if (pageList.get(i).getQsStatus() != null) {
vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS,pageList.get(i).getQsStatus()));
}
log.info("inaccountStatus==>{}",pageList.get(i).getInAccountStatus());
if ("1".equals(pageList.get(i).getInAccountStatus())) {
vo.setInAccountStatus("已入账");
} {
} else {
vo.setInAccountStatus("未入账");
}
String suspendStatus = pageList.get(i).getSuspendStatus();
@ -685,6 +686,12 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} else if ("0".equals(baseTDxRecordInvoice.getInAccountStatus())) {
vo.setInAccountStatus("未入账");
}
if ("1".equals(vo.getSuspendStatus())){
vo.setSuspendStatus("是");
}else {
vo.setSuspendStatus("否");
vo.setSuspendDate("");
}
vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,baseTDxRecordInvoice.getPaymentStatus()));
vo.setPaymentDate(baseTDxRecordInvoice.getPaymentDate());
vo.setGfmc(baseTDxRecordInvoice.getGfName());

@ -78,6 +78,7 @@
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status != '0'
and t.rzh_yesorno != '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
@ -103,9 +104,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
@ -345,6 +349,7 @@
and t.auth_status != '0'
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.rzh_yesorno != '0'
and t.company =#{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
@ -380,10 +385,13 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
<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="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
<if

@ -124,9 +124,12 @@
<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'">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="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>
@ -483,9 +486,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="businessCode==''">
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
</if>
@ -1302,7 +1308,7 @@
,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,
else 2 end authStatus,t.bzdh,t.bzr,t.suspend_status,t.suspend_date,
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

@ -2,6 +2,7 @@ package com.dxhy.core.thread;
import java.util.*;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
@ -146,6 +147,16 @@ public class CustomExportThread extends BaseThread {
String menuId = prams.getString("menuId");
String bzdh = prams.getString("bzdh");
String bzr = prams.getString("bzr");
String inAccountStatus = prams.getString("inAccountStatus");
String snVoucherNumber = prams.getString("snVoucherNumber");
String accountPeriod = prams.getString("accountPeriod");
if (StringUtils.isNotEmpty(accountPeriod) && accountPeriod.length() > 7){
accountPeriod = accountPeriod.substring(0,7);
}
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
@ -159,6 +170,13 @@ public class CustomExportThread extends BaseThread {
pramsMap.put("companyCodes",companyCodes);
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("accountPeriod",accountPeriod);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {

@ -22,6 +22,7 @@ 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 org.apache.commons.lang.StringUtils;
import java.io.File;
import java.io.FileOutputStream;
@ -154,6 +155,11 @@ public class ManualAthensThread extends BaseThread {
String inAccountStatus = prams.getString("inAccountStatus");
String inAccountMonth = prams.getString("inAccountMonth");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
String snVoucherNumber = prams.getString("snVoucherNumber");
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
@ -163,6 +169,11 @@ public class ManualAthensThread extends BaseThread {
pramsMap.put("businessCode",businessCode);
pramsMap.put("suspendStatus",suspendStatus);
pramsMap.put("suspendDate",suspendDate);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh);
@ -228,14 +239,25 @@ public class ManualAthensThread extends BaseThread {
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(rzFpxxService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
if (StringUtils.isNotEmpty(gfshList.get(0))){
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(rzFpxxService.getblocName(gfshList.get(0)));
}
ftpFileName.append(fileSplit);
log.info("税号名称获取");
}
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(rzFpxxService.getGfName(s));
ftpFileName.append(fileSplit);
// for (String s : gfshList) {
// if (StringUtils.isNotEmpty(s)){
// ftpFileName.append(rzFpxxService.getGfName(s));
// ftpFileName.append(fileSplit);
// }
// }
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(rzFpxxService.getGfName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}
}

@ -31,6 +31,7 @@ import com.dxhy.oss.service.FileService;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* @author user
@ -151,12 +152,28 @@ public class PoolAddTaxThread extends BaseThread {
String bzr = prams.getString("bzr");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
String snVoucherNumber = prams.getString("snVoucherNumber");
String accountPeriod = prams.getString("accountPeriod");
if (StringUtils.isNotEmpty(accountPeriod) && accountPeriod.length() > 7){
accountPeriod = accountPeriod.substring(0,7);
}
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("accountPeriod",accountPeriod);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh);
@ -214,13 +231,21 @@ public class PoolAddTaxThread extends BaseThread {
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(poolPaperService.getGfName(s));
// for (String s : gfshList) {
// if (StringUtils.isNotEmpty(s)){
// ftpFileName.append(poolPaperService.getGfName(s));
// ftpFileName.append(fileSplit);
// }
// }
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getGfName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}

@ -19,6 +19,7 @@ import com.dxhy.oss.service.FileService;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* @author user
@ -123,12 +124,25 @@ public class PoolOtherThread extends BaseThread {
String bzr = prams.getString("bzr");
String bzdh = prams.getString("bzdh");
String inAccountStatus = prams.getString("inAccountStatus");
String snVoucherNumber = prams.getString("snVoucherNumber");
String accountPeriod = prams.getString("accountPeriod");
if (StringUtils.isNotEmpty(accountPeriod) && accountPeriod.length() > 7){
accountPeriod = accountPeriod.substring(0,7);
}
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
pramsMap.put("bzr",bzr);
pramsMap.put("bzdh",bzdh);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("accountPeriod",accountPeriod);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh);
@ -168,13 +182,21 @@ public class PoolOtherThread extends BaseThread {
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(poolPaperService.getGfName(s));
// for (String s : gfshList) {
// if (StringUtils.isNotEmpty(s)){
// ftpFileName.append(poolPaperService.getGfName(s));
// ftpFileName.append(fileSplit);
// }
// }
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getGfName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}

@ -31,6 +31,7 @@ import com.dxhy.oss.service.FileService;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* 功能描述
@ -156,12 +157,28 @@ public class PoolSaleThread extends BaseThread {
String company = prams.getString("company");
String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
String snVoucherNumber = prams.getString("snVoucherNumber");
String accountPeriod = prams.getString("accountPeriod");
if (StringUtils.isNotEmpty(accountPeriod) && accountPeriod.length() > 7){
accountPeriod = accountPeriod.substring(0,7);
}
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName);
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("accountPeriod",accountPeriod);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh);
@ -213,13 +230,21 @@ public class PoolSaleThread extends BaseThread {
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(poolPaperService.getGfName(s));
// for (String s : gfshList) {
// if (StringUtils.isNotEmpty(s)){
// ftpFileName.append(poolPaperService.getGfName(s));
// ftpFileName.append(fileSplit);
// }
// }
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(poolPaperService.getGfName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}

@ -22,6 +22,7 @@ import com.dxhy.oss.service.FileService;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* 实名客票
@ -134,13 +135,21 @@ public class QypcsmkpExportThread extends BaseThread {
ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) {
ftpFileName.append(ticketService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(ticketService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}
} else {
if (gfshList.size() > 0) {
for (String s : gfshList) {
ftpFileName.append(ticketService.getGfName(s));
// for (String s : gfshList) {
// if (StringUtils.isNotEmpty(s)){
// ftpFileName.append(ticketService.getGfName(s));
// ftpFileName.append(fileSplit);
// }
// }
if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(ticketService.getGfName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
}

@ -141,12 +141,22 @@ public class RzFpxxExportThread extends BaseThread {
String bzdh = prams.getString("bzdh");
String bzr = prams.getString("bzr");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
String snVoucherNumber = prams.getString("snVoucherNumber");
String imageNumber = prams.getString("imageNumber");
String postingTimeEnd = prams.getString("postingTimeEnd");
String postingTimeStart = prams.getString("postingTimeStart");
List<String> companyCodes = companyCodeArray.toJavaList(String.class);
JSONObject jsonObject = tabulateRedisService.getTabulateExcel(company, menuId);
List<Business> businesses = (List<Business>)prams.get("userBusiness");
// 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(30);
pramsMap.put("dbName", dbName);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("snVoucherNumber",snVoucherNumber);
pramsMap.put("imageNumber",imageNumber);
pramsMap.put("postingTimeEnd",postingTimeEnd);
pramsMap.put("postingTimeStart",postingTimeStart);
pramsMap.put("business", businesses);
pramsMap.put("businessCode",businessCode);
pramsMap.put("qsr",qsr);

@ -66,6 +66,7 @@
t.settlement_status,t.voucher_number,t.total_amount
from t_dx_record_invoice t
WHERE t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
@ -76,9 +77,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}

@ -61,9 +61,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>

@ -124,10 +124,10 @@
and t.rzh_type = #{rzhType}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.in_account_status = #{inAccountStatus}
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and (t.in_account_status = '0' or t.in_account_status = '' or t.in_account_status is null)
and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}

@ -100,6 +100,7 @@
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status != '0'
and t.rzh_yesorno != '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
@ -125,9 +126,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}
</if>
@ -606,9 +610,12 @@
<if test="suspendDate != null and suspendDate != '' and suspendDate != 'null' ">
and t.suspend_date = #{suspendDate}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="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>

@ -105,7 +105,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return post;
}
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company,String imageId,String compCode) throws Exception {
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company, String imageId, String compCode) throws Exception {
TDxInvoiceReimburse recordInvoice = new TDxInvoiceReimburse();
// DynamicContextHolder.push(DbConstant.BASICS_READ);
@ -160,7 +160,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
recordInvoice.setInvoiceCode(fpdm);
recordInvoice.setInvoiceNo(fphm);
String selectId = UUID.randomUUID().toString().replace("-", "");
log.info("selectId={}",selectId);
log.info("selectId={}", selectId);
recordInvoice.setSelectId(selectId);
if (je != null) {
@ -169,7 +169,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (se != null) {
recordInvoice.setTaxAmount(new BigDecimal(se));
}
if (amountTax != null){
if (amountTax != null) {
recordInvoice.setTotalAmount(new BigDecimal(amountTax));
}
@ -193,7 +193,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return "";
}
public Integer pushInvoiceToRecordInvoice2(SNInvoice snInvoice,String imageId,String compCode) {
public Integer pushInvoiceToRecordInvoice2(SNInvoice snInvoice, String imageId, String compCode) {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
int update = 0;
@ -318,11 +318,11 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
String returnResult = JSONObject.toJSONString(apiResponse);
String returnResultEncode = Base64.encode(returnResult.getBytes());
checkLog.setReturnResult(returnResultEncode);
log.info("封装的查验日志实体为{}",checkLog);
log.info("封装的查验日志实体为{}", checkLog);
platformCheckLogService.save(checkLog);
}
private JSONObject convertToSnObject(String content, JSONObject jsonObject, String invoiceType) {
private JSONObject convertToSnObject(String content, JSONObject jsonObject, String invoiceType) throws ParseException {
String con = new String(Base64.decode(content));
HashMap contentMap = JSONObject.parseObject(con, HashMap.class);
@ -330,266 +330,262 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if ("0000".equals(contentMap.get("code"))) {
HashMap<String, Object> invoiceData = JSONObject.parseObject(contentMap.get("data").toString(), HashMap.class);
if ("0001".equals(invoiceData.get("cyjg"))) {
try {
invoiceType = invoiceData.get("fpzl").toString();
if ("22".equals(invoiceType)) {
invoiceType = "32";
}
if ("21".equals(invoiceType)) {
invoiceType = "31";
}
invoiceType = invoiceData.get("fpzl").toString();
if ("22".equals(invoiceType)) {
invoiceType = "32";
}
if ("21".equals(invoiceType)) {
invoiceType = "31";
}
jsonObject.put("invoiceType", invoiceType);
jsonObject.put("administrativeDivisionNo", "");
jsonObject.put("administrativeDivisionName", "");
jsonObject.put("invoiceCode", invoiceData.get("fpdm"));
jsonObject.put("invoiceNumber", invoiceData.get("fphm"));
String kprq = invoiceData.get("kprq").toString();
Date formatDat = new SimpleDateFormat("yyyyMMdd").parse(kprq);
String str = new SimpleDateFormat("yyyy-MM-dd").format(formatDat);
log.info("开票日期为:{} ", str);
jsonObject.put("billingDate", str);
jsonObject.put("purchaserName", invoiceData.get("gmfmc"));
jsonObject.put("purchaserTaxNo", invoiceData.get("gmfsbh"));
jsonObject.put("purchaserBank", invoiceData.get("gmfyhzh"));
jsonObject.put("purchaserAddressPhone", invoiceData.get("gmfdzdh"));
jsonObject.put("salesName", invoiceData.get("xhfmc"));
jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh"));
jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh"));
if(FplxEnum.JDC.getFplxDm().equals(invoiceType)){
if(invoiceData.get("khyh") != null && invoiceData.get("khzh") != null) {
jsonObject.put("salesBank", invoiceData.get("khyh").toString() + invoiceData.get("khzh").toString());
}
}else{
jsonObject.put("salesBank", invoiceData.get("xhfyhzh"));
jsonObject.put("invoiceType", invoiceType);
jsonObject.put("administrativeDivisionNo", "");
jsonObject.put("administrativeDivisionName", "");
jsonObject.put("invoiceCode", invoiceData.get("fpdm"));
jsonObject.put("invoiceNumber", invoiceData.get("fphm"));
String kprq = invoiceData.get("kprq").toString();
Date formatDat = new SimpleDateFormat("yyyyMMdd").parse(kprq);
String str = new SimpleDateFormat("yyyy-MM-dd").format(formatDat);
log.info("开票日期为:{} ", str);
jsonObject.put("billingDate", str);
jsonObject.put("purchaserName", invoiceData.get("gmfmc"));
jsonObject.put("purchaserTaxNo", invoiceData.get("gmfsbh"));
jsonObject.put("purchaserBank", invoiceData.get("gmfyhzh"));
jsonObject.put("purchaserAddressPhone", invoiceData.get("gmfdzdh"));
jsonObject.put("salesName", invoiceData.get("xhfmc"));
jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh"));
jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh"));
if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) {
if (invoiceData.get("khyh") != null && invoiceData.get("khzh") != null) {
jsonObject.put("salesBank", invoiceData.get("khyh").toString() + invoiceData.get("khzh").toString());
}
} else {
jsonObject.put("salesBank", invoiceData.get("xhfyhzh"));
}
jsonObject.put("totalAmount", invoiceData.get("fpje"));
if ("11".equals(invoiceData.get("fpzl"))) {
jsonObject.put("totalTax", "0");
jsonObject.put("totalAmount", "0");
} else {
jsonObject.put("totalTax", invoiceData.get("fpse"));
jsonObject.put("totalAmount", invoiceData.get("fpje"));
if ("11".equals(invoiceData.get("fpzl"))) {
jsonObject.put("totalTax", "0");
jsonObject.put("totalAmount", "0");
} else {
jsonObject.put("totalTax", invoiceData.get("fpse"));
jsonObject.put("totalAmount", invoiceData.get("fpje"));
}
if("15".equals(invoiceData.get("fpzl"))){
jsonObject.put("amountTax", invoiceData.get("cjhj"));
}else{
jsonObject.put("amountTax", invoiceData.get("jshj"));
}
}
if ("15".equals(invoiceData.get("fpzl"))) {
jsonObject.put("amountTax", invoiceData.get("cjhj"));
} else {
jsonObject.put("amountTax", invoiceData.get("jshj"));
}
jsonObject.put("amountTaxCN", "");
jsonObject.put("amountTaxCN", "");
jsonObject.put("checkCode", invoiceData.get("jym"));
if ("N".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "0");
} else if ("H".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "2");
} else if ("Y".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "1");
}
jsonObject.put("checkCode", invoiceData.get("jym"));
if ("N".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "0");
} else if ("H".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "2");
} else if ("Y".equals(invoiceData.get("zfbz"))) {
jsonObject.put("state", "1");
}
jsonObject.put("carrierName", invoiceData.get("cyrmc"));
jsonObject.put("carrierTaxNo", invoiceData.get("cyrsbh"));
jsonObject.put("draweeName", invoiceData.get("spfmc"));
jsonObject.put("draweeTaxNo", invoiceData.get("spfsbh"));
jsonObject.put("cargoInformation", invoiceData.get("ysgwxx"));
jsonObject.put("transportRoute", invoiceData.get("qydjyddd"));
jsonObject.put("machineCode", invoiceData.get("skph"));
jsonObject.put("tonnage", invoiceData.get("ccdw"));
jsonObject.put("taxAuthorityNo", invoiceData.get("zgswjgdm"));
jsonObject.put("taxAuthorityName", invoiceData.get("zgswjgmc"));
if ("03".equals(invoiceData.get("fpzl"))) {
jsonObject.put("administrativeDivisionNo", invoiceData.get("zgswjgdm"));
jsonObject.put("administrativeDivisionName", invoiceData.get("zgswjgmc"));
}
jsonObject.put("remarks", invoiceData.get("bz"));
jsonObject.put("vehicleType", invoiceData.get("cllx"));
jsonObject.put("brandModel", invoiceData.get("cpxh"));
jsonObject.put("originPlace", invoiceData.get("cd"));
jsonObject.put("certificateNo", invoiceData.get("hgzs"));
jsonObject.put("inspectionListNo", invoiceData.get("sjdh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("vehicleNo", invoiceData.get("clsbh"));
jsonObject.put("importCertificateNo", invoiceData.get("jszmsh"));
jsonObject.put("paymentVoucherNo", invoiceData.get("wspzhm"));
jsonObject.put("passengersLimited", invoiceData.get("xcrs"));
if (invoiceData.get("txfbz") != null && "Y".equals(invoiceData.get("txfbz"))) {
jsonObject.put("tollSign", "06");
} else {
jsonObject.put("tollSign", "07");
}
jsonObject.put("carrierName", invoiceData.get("cyrmc"));
jsonObject.put("carrierTaxNo", invoiceData.get("cyrsbh"));
jsonObject.put("draweeName", invoiceData.get("spfmc"));
jsonObject.put("draweeTaxNo", invoiceData.get("spfsbh"));
jsonObject.put("cargoInformation", invoiceData.get("ysgwxx"));
jsonObject.put("transportRoute", invoiceData.get("qydjyddd"));
jsonObject.put("machineCode", invoiceData.get("skph"));
jsonObject.put("tonnage", invoiceData.get("ccdw"));
jsonObject.put("taxAuthorityNo", invoiceData.get("zgswjgdm"));
jsonObject.put("taxAuthorityName", invoiceData.get("zgswjgmc"));
if ("03".equals(invoiceData.get("fpzl"))) {
jsonObject.put("administrativeDivisionNo", invoiceData.get("zgswjgdm"));
jsonObject.put("administrativeDivisionName", invoiceData.get("zgswjgmc"));
}
jsonObject.put("remarks", invoiceData.get("bz"));
jsonObject.put("vehicleType", invoiceData.get("cllx"));
jsonObject.put("brandModel", invoiceData.get("cpxh"));
jsonObject.put("originPlace", invoiceData.get("cd"));
jsonObject.put("certificateNo", invoiceData.get("hgzs"));
jsonObject.put("inspectionListNo", invoiceData.get("sjdh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("vehicleNo", invoiceData.get("clsbh"));
jsonObject.put("importCertificateNo", invoiceData.get("jszmsh"));
jsonObject.put("paymentVoucherNo", invoiceData.get("wspzhm"));
jsonObject.put("passengersLimited", invoiceData.get("xcrs"));
if (invoiceData.get("txfbz") != null && "Y".equals(invoiceData.get("txfbz"))) {
jsonObject.put("tollSign", "06");
} else {
jsonObject.put("tollSign", "07");
}
jsonObject.put("zeroTaxRateSign", invoiceData.get("lslbs"));
log.info("零税率标识为:{}", invoiceData.get("lslbs"));
jsonObject.put("source", "");
jsonObject.put("idcardNo", invoiceData.get("sfzh"));
jsonObject.put("zeroTaxRateSign", invoiceData.get("lslbs"));
log.info("零税率标识为:{}", invoiceData.get("lslbs"));
jsonObject.put("source", "");
jsonObject.put("idcardNo", invoiceData.get("sfzh"));
if("15".equals(invoiceData.get("fpzl"))){
jsonObject.put("buyerIDNum", invoiceData.get("mfdwdmsfzh"));
}else{
jsonObject.put("buyerIDNum", invoiceData.get("sfzh"));
}
if ("15".equals(invoiceData.get("fpzl"))) {
jsonObject.put("buyerIDNum", invoiceData.get("mfdwdmsfzh"));
} else {
jsonObject.put("buyerIDNum", invoiceData.get("sfzh"));
}
jsonObject.put("vehicleType", invoiceData.get("cllx"));
jsonObject.put("factoryModel", invoiceData.get("cpxh"));
jsonObject.put("productPlace", invoiceData.get("cd"));
jsonObject.put("certificate", invoiceData.get("hgzs"));
jsonObject.put("certificateImport", invoiceData.get("jszmsh"));
jsonObject.put("inspectionNum", invoiceData.get("sjdh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("vehicleNo", invoiceData.get("clsbh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("taxBureauCode", invoiceData.get("zgswjgdm"));
jsonObject.put("taxBureauName", invoiceData.get("zgswjgmc"));
jsonObject.put("taxBureauCode", invoiceData.get("zgswjgdm"));
jsonObject.put("taxRecords", invoiceData.get("wspzhm"));
jsonObject.put("tonnage", invoiceData.get("dw"));
jsonObject.put("limitPeople", invoiceData.get("xcrs"));
String taxRate = "";
if ("免税".equals(invoiceData.get("sl"))) {
taxRate = "0";
jsonObject.put("taxRate", taxRate);
} else {
if (invoiceData.get("sl") != null && StringUtils.isNoneBlank(invoiceData.get("sl").toString())) {
taxRate = invoiceData.get("sl").toString();
if (!"0".equals(taxRate)) {
taxRate = "0." + taxRate;
taxRate = taxRate.substring(0, taxRate.length() - 1);
}
jsonObject.put("vehicleType", invoiceData.get("cllx"));
jsonObject.put("factoryModel", invoiceData.get("cpxh"));
jsonObject.put("productPlace", invoiceData.get("cd"));
jsonObject.put("certificate", invoiceData.get("hgzs"));
jsonObject.put("certificateImport", invoiceData.get("jszmsh"));
jsonObject.put("inspectionNum", invoiceData.get("sjdh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("vehicleNo", invoiceData.get("clsbh"));
jsonObject.put("engineNo", invoiceData.get("fdjhm"));
jsonObject.put("taxBureauCode", invoiceData.get("zgswjgdm"));
jsonObject.put("taxBureauName", invoiceData.get("zgswjgmc"));
jsonObject.put("taxBureauCode", invoiceData.get("zgswjgdm"));
jsonObject.put("taxRecords", invoiceData.get("wspzhm"));
jsonObject.put("tonnage", invoiceData.get("dw"));
jsonObject.put("limitPeople", invoiceData.get("xcrs"));
String taxRate = "";
if ("免税".equals(invoiceData.get("sl"))) {
taxRate = "0";
jsonObject.put("taxRate", taxRate);
} else {
if (invoiceData.get("sl") != null && StringUtils.isNoneBlank(invoiceData.get("sl").toString())) {
taxRate = invoiceData.get("sl").toString();
if (!"0".equals(taxRate)) {
taxRate = "0." + taxRate;
taxRate = taxRate.substring(0, taxRate.length() - 1);
}
if ("11".equals(invoiceType)) {
taxRate = "0.000";
}
log.info("明细-发票税率为:{}", taxRate);
jsonObject.put("taxRate", taxRate);
if ("11".equals(invoiceType)) {
taxRate = "0.000";
}
log.info("明细-发票税率为:{}", taxRate);
jsonObject.put("taxRate", taxRate);
}
taxRate = "";
jsonObject.put("limitPeople", invoiceData.get("xcrs"));
jsonObject.put("machineNo", invoiceData.get("jqbh"));
jsonObject.put("licensePlate", invoiceData.get("cpzh"));
jsonObject.put("registrationNo", invoiceData.get("djzh"));
jsonObject.put("vehicleIdentificationNo", invoiceData.get("clsbh"));
jsonObject.put("vehicleAdminOffice", invoiceData.get("zrdcgsmc"));
jsonObject.put("buyerUnitOrIndividual", invoiceData.get("mfdwgr"));
jsonObject.put("buyerUnitOrIndividualAddress", invoiceData.get("mfdwgrdz"));
jsonObject.put("buyerPhone", invoiceData.get("mfdh"));
jsonObject.put("sellerUnitOrIndividual", invoiceData.get("smfdwgr"));
jsonObject.put("sellerUnitCodeOrIdNo", invoiceData.get("smfdwdmsfzh"));
jsonObject.put("sellerUnitOrIndividualAddress", invoiceData.get("smfdwgrzz"));
jsonObject.put("sellerPhone", invoiceData.get("smfdh"));
jsonObject.put("businessUnit", invoiceData.get("jypmdw"));
jsonObject.put("businessUnitAddress", invoiceData.get("jypmdwdz"));
jsonObject.put("businessUnitTaxNo", invoiceData.get("jypmdwzsbh"));
jsonObject.put("businessUnitBankAndAccount", invoiceData.get("khyhjzh"));
jsonObject.put("businessUnitPhone", invoiceData.get("jypmdwdh"));
jsonObject.put("lemonMarket", invoiceData.get("escsc"));
jsonObject.put("lemonMarketTaxNo", invoiceData.get("escscsbh"));
jsonObject.put("lemonMarketAddress", invoiceData.get("escscdz"));
jsonObject.put("lemonMarketBankAndAccount", invoiceData.get("escsckhyhzh"));
jsonObject.put("lemonMarketPhone", invoiceData.get("escscdh"));
List<Map<String, String>> returnDetailList = new ArrayList<>();
JSONArray detailList = (JSONArray) invoiceData.get("detailList");
for (int i = 0; i < detailList.size(); i++) {
String taxRateDetail = "";
JSONObject detail = (JSONObject) detailList.get(i);
Map<String, String> snDetailMap = new HashMap<String, String>();
snDetailMap.put("rowNo", i + 1 + "");
snDetailMap.put("commodityCode", detail.getString("ssflbm"));
snDetailMap.put("commodityName", detail.getString("hwmc"));
snDetailMap.put("specificationModel", detail.getString("ggxh"));
snDetailMap.put("unit", detail.getString("jldw"));
snDetailMap.put("detailNo",detail.getString("mxbh"));
String quantity = detail.getString("spsl");
}
taxRate = "";
jsonObject.put("limitPeople", invoiceData.get("xcrs"));
jsonObject.put("machineNo", invoiceData.get("jqbh"));
jsonObject.put("licensePlate", invoiceData.get("cpzh"));
jsonObject.put("registrationNo", invoiceData.get("djzh"));
jsonObject.put("vehicleIdentificationNo", invoiceData.get("clsbh"));
jsonObject.put("vehicleAdminOffice", invoiceData.get("zrdcgsmc"));
jsonObject.put("buyerUnitOrIndividual", invoiceData.get("mfdwgr"));
jsonObject.put("buyerUnitOrIndividualAddress", invoiceData.get("mfdwgrdz"));
jsonObject.put("buyerPhone", invoiceData.get("mfdh"));
jsonObject.put("sellerUnitOrIndividual", invoiceData.get("smfdwgr"));
jsonObject.put("sellerUnitCodeOrIdNo", invoiceData.get("smfdwdmsfzh"));
jsonObject.put("sellerUnitOrIndividualAddress", invoiceData.get("smfdwgrzz"));
jsonObject.put("sellerPhone", invoiceData.get("smfdh"));
jsonObject.put("businessUnit", invoiceData.get("jypmdw"));
jsonObject.put("businessUnitAddress", invoiceData.get("jypmdwdz"));
jsonObject.put("businessUnitTaxNo", invoiceData.get("jypmdwzsbh"));
jsonObject.put("businessUnitBankAndAccount", invoiceData.get("khyhjzh"));
jsonObject.put("businessUnitPhone", invoiceData.get("jypmdwdh"));
jsonObject.put("lemonMarket", invoiceData.get("escsc"));
jsonObject.put("lemonMarketTaxNo", invoiceData.get("escscsbh"));
jsonObject.put("lemonMarketAddress", invoiceData.get("escscdz"));
jsonObject.put("lemonMarketBankAndAccount", invoiceData.get("escsckhyhzh"));
jsonObject.put("lemonMarketPhone", invoiceData.get("escscdh"));
List<Map<String, String>> returnDetailList = new ArrayList<>();
JSONArray detailList = (JSONArray) invoiceData.get("detailList");
for (int i = 0; i < detailList.size(); i++) {
String taxRateDetail = "";
JSONObject detail = (JSONObject) detailList.get(i);
Map<String, String> snDetailMap = new HashMap<String, String>();
snDetailMap.put("rowNo", i + 1 + "");
snDetailMap.put("commodityCode", detail.getString("ssflbm"));
snDetailMap.put("commodityName", detail.getString("hwmc"));
snDetailMap.put("specificationModel", detail.getString("ggxh"));
snDetailMap.put("unit", detail.getString("jldw"));
snDetailMap.put("detailNo", detail.getString("mxbh"));
String quantity = detail.getString("spsl");
// if (quantity.length() > 3) {
// int index = quantity.indexOf(".");
// quantity = quantity.substring(0, index + 2);
// }
snDetailMap.put("quantity", quantity);
snDetailMap.put("quantity", quantity);
String unitPrice = detail.getString("bhsdj");
String unitPrice = detail.getString("bhsdj");
// if (unitPrice.length() > 3) {
// int index = unitPrice.indexOf(".");
// unitPrice = unitPrice.substring(0, index + 3);
// }
snDetailMap.put("unitPrice", unitPrice);
snDetailMap.put("unitPrice", unitPrice);
if ("11".equals(invoiceType)) {
snDetailMap.put("tax", "0");
//如果是卷票计算合计金额
Float hjje = null;
if (detail.getString("se") != null && detail.getString("je") != null) {
Float je = Float.parseFloat(detail.getString("je"));
Float se = Float.parseFloat(detail.getString("se"));
hjje = je + se;
}
if (hjje != null)
snDetailMap.put("amount", hjje.toString());
if ("11".equals(invoiceType)) {
snDetailMap.put("tax", "0");
} else {
snDetailMap.put("tax", "***".equals(detail.getString("se")) ? "0.00" : detail.getString("se"));
snDetailMap.put("amount", detail.getString("je"));
//如果是卷票计算合计金额
Float hjje = null;
if (StringUtils.isNotEmpty(detail.getString("se")) && StringUtils.isNotEmpty(detail.getString("je"))) {
Float je = Float.parseFloat(detail.getString("je"));
Float se = Float.parseFloat(detail.getString("se"));
hjje = je + se;
}
if (hjje != null)
snDetailMap.put("amount", hjje.toString());
if ("免税".equals(detail.getString("sl"))) {
taxRateDetail = "0";
snDetailMap.put("taxRate", taxRateDetail);
} else {
if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) {
taxRateDetail = detail.get("sl").toString();
if (!"0".equals(taxRateDetail)) {
if (StringUtils.isNoneBlank(taxRateDetail)) {
int index = taxRateDetail.indexOf("%");
if (index > 0) {
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
Float num = Float.parseFloat(taxRateDetail);
if (num > 9) {
taxRateDetail = "0." + taxRateDetail;
} else {
if (!taxRateDetail.startsWith("0")) {
taxRateDetail = "0.0" + taxRateDetail;
}
} else {
snDetailMap.put("tax", "***".equals(detail.getString("se")) ? "0.00" : detail.getString("se"));
snDetailMap.put("amount", detail.getString("je"));
}
if ("免税".equals(detail.getString("sl"))) {
taxRateDetail = "0";
snDetailMap.put("taxRate", taxRateDetail);
} else {
if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) {
taxRateDetail = detail.get("sl").toString();
if (!"0".equals(taxRateDetail)) {
if (StringUtils.isNoneBlank(taxRateDetail)) {
int index = taxRateDetail.indexOf("%");
if (index > 0) {
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
Float num = Float.parseFloat(taxRateDetail);
if (num > 9) {
taxRateDetail = "0." + taxRateDetail;
} else {
if (!taxRateDetail.startsWith("0")) {
taxRateDetail = "0.0" + taxRateDetail;
}
}
}
}
}
if ("11".equals(invoiceType)) {
taxRateDetail = "0.000";
}
log.info("明细-发票税率为:{}", taxRateDetail);
snDetailMap.put("taxRate", taxRateDetail);
if ("11".equals(invoiceType)) {
taxRateDetail = "0.000";
}
log.info("明细-发票税率为:{}", taxRateDetail);
snDetailMap.put("taxRate", taxRateDetail);
}
log.info("明细-tax={}", detail.get("se"));
log.info("明细-commodityCode={}", detail.get("ssflbm"));
snDetailMap.put("currentDateEnd", detail.getString("txrqz"));
snDetailMap.put("currentDateStart", detail.getString("txrqq"));
snDetailMap.put("licensePlateNum", detail.getString("cph"));
snDetailMap.put("type", detail.getString("lx"));
returnDetailList.add(snDetailMap);
}
jsonObject.put("invoiceLineList", returnDetailList);
} catch (Exception e) {
e.printStackTrace();
log.info("明细-tax={}", detail.get("se"));
log.info("明细-commodityCode={}", detail.get("ssflbm"));
snDetailMap.put("currentDateEnd", detail.getString("txrqz"));
snDetailMap.put("currentDateStart", detail.getString("txrqq"));
snDetailMap.put("licensePlateNum", detail.getString("cph"));
snDetailMap.put("type", detail.getString("lx"));
returnDetailList.add(snDetailMap);
}
jsonObject.put("invoiceLineList", returnDetailList);
} else {
jsonObject.put("cyjg", invoiceData.get("cyjg"));
jsonObject.put("cyjgxx", invoiceData.get("cyjgxx"));
@ -603,7 +599,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return jsonObject;
}
public String updateInvoicePoll(String company, String taxNo, TDxInvoiceReimburse reimburse, SNInvoice invoice, String fplxdm,String imageId,String compCode) throws Exception {
public String updateInvoicePoll(String company, String taxNo, TDxInvoiceReimburse reimburse, SNInvoice invoice, String fplxdm, String imageId, String compCode) throws Exception {
String result = "0000";
//判断发票类型
@ -613,6 +609,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (SNFplxEnum.HCP.getFplxDm().equals(fplxdm) || SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)
|| SNFplxEnum.JPXCD.getFplxDm().equals(fplxdm) || SNFplxEnum.CP.getFplxDm().equals(fplxdm)
|| SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm)) {
//0523晚成伟提出新需求,客运汽车票必须实名才可以进行价税分离
if (SNFplxEnum.KYQCP.getFplxDm().equals(fplxdm) && StringUtils.isEmpty(reimburse.getPassenger()) || StringUtils.isEmpty(reimburse.getPassengerSFZH())) {
return result;
}
InvoiceInfo invoiceInfo = convertToInvoiceInfo(invoice);
log.info("进行价税分离的发票信息为:{}", invoiceInfo);
@ -652,7 +654,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
reimburse = convertToReimburse(invoice, reimburse, fplxdm, company);
log.info("插库的发票信息:{}",reimburse);
log.info("插库的发票信息:{}", reimburse);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
int insert = 0;
@ -661,7 +663,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
TDxInvoiceReimburse reimburse1 = tDxInvoiceReimburseService.getBaseMapper().selectOne(wrapper);
if (reimburse1 != null) {
// insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse);
insert = tDxInvoiceReimburseService.getBaseMapper().update(reimburse,wrapper);
insert = tDxInvoiceReimburseService.getBaseMapper().update(reimburse, wrapper);
} else {
insert = tDxInvoiceReimburseService.getBaseMapper().insert(reimburse);
}
@ -674,11 +676,11 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
|| "08".equals(fplxdm) || "10".equals(fplxdm) || "11".equals(fplxdm) || "14".equals(fplxdm)
|| "15".equals(fplxdm) || "31".equals(fplxdm) || "32".equals(fplxdm)) {
//可查验发票,已入库,更新票池
Integer integer = this.pushInvoiceToRecordInvoice2(invoice,imageId,compCode);
Integer integer = this.pushInvoiceToRecordInvoice2(invoice, imageId, compCode);
log.info("可查验发票,更新底账库完成");
} else {
//不可查验发票,未入库,插入票池
this.pushInvoiceToRecordInvoice(invoice, taxNo, company,imageId,compCode);
this.pushInvoiceToRecordInvoice(invoice, taxNo, company, imageId, compCode);
log.info("不可查验发票,插入底账库成功");
}
@ -715,7 +717,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
reimburse.setXfAddressAndPhone(invoice.getSalesAddressPhone());
reimburse.setXfBankAndNo(invoice.getSalesBank());
String uuid = UUID.randomUUID().toString().replace("-", "");
log.info("uuid={}",uuid);
log.info("uuid={}", uuid);
reimburse.setSelectId(uuid);
reimburse.setTaxRate(invoice.getTaxRate());
@ -805,7 +807,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
InvoiceInfo invoice = new InvoiceInfo();
invoice.setInvoiceTypeCode(snInvoice.getInvoiceType());
if(snInvoice.getBillingDate() != null) {
if (snInvoice.getBillingDate() != null) {
Date date = new Date();
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
try {
@ -814,7 +816,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
e.printStackTrace();
}
invoice.setInvoiceDate(date);
}else{
} else {
log.error("开票日期为空");
}

@ -379,7 +379,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
//入账状态
updateWrapper.set("inaccount_status",zdata1.getZYWZT());
updateWrapper.set("comp_code",zdata1.getZGSDM());
updateWrapper.set("bzr",zdata1.getZJBR());
updateWrapper.set("bzr",zdata1.getZJBRT());
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
int update = tDxrecordInvoiceDao.update(null, updateWrapper);
if(update>0){
@ -415,7 +415,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
//入账状态
updateWrapper.set("inaccount_status",zdata1.getZYWZT());
updateWrapper.set("comp_code",zdata1.getZGSDM());
updateWrapper.set("bzr",zdata1.getZJBR());
updateWrapper.set("bzr",zdata1.getZJBRT());
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
tDxInvoiceReimburseService.getBaseMapper().update(null,updateWrapper);
}
@ -427,7 +427,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
updateWrapper.set("bzdh",zdata1.getZBZDH());
updateWrapper.set("inaccount_status",zdata1.getZYWZT());
updateWrapper.set("comp_code",zdata1.getZGSDM());
updateWrapper.set("bzr",zdata1.getZJBR());
updateWrapper.set("bzr",zdata1.getZJBRT());
updateWrapper.eq("uuid",uuid);
tdxSaleRecordInvoiceDao.update(null,updateWrapper);
if(!flag){

@ -27,7 +27,7 @@
<result column="glzt" property="glzt"/>
<result column="customs_scan_id" property="customsScanId"/>
<result column="businessName" property="businessName"/>
<result column="in_account_status" property="inAccountStatus"/>
<result column="inaccount_status" property="inAccountStatus"/>
<result column="document_number" property="documentNumber"/>
<result column="sn_voucher_number" property="snVoucherNumber"/>
<result column="posting_time" property="postingTime"/>
@ -48,7 +48,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.auth_status,t.bdk_status,t.confirm_user,t.rzh_belong_date,t.glzt,
t.customs_scan_id,t.dept_name businessName,t.in_account_status,t.sn_voucher_number,t.document_number,t.in_account_date,rzh_type,rzlx,t.create_date,
t.customs_scan_id,t.dept_name businessName,t.inaccount_status,t.sn_voucher_number,t.document_number,t.in_account_date,rzh_type,rzlx,t.create_date,
data_sources,t.image_id,t.posting_time,t.account_period,t.comp_code,t.bzdh
from t_dx_customs_record t
where export_mark = '0'
@ -126,10 +126,10 @@
and t.rzh_type = #{rzhType}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.in_account_status = #{inAccountStatus}
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and (t.in_account_status = '0' or t.in_account_status = '' or t.in_account_status is null)
and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}
@ -247,8 +247,11 @@
<if test="rzhType != null and rzhType != '' and rzhType != 'null' ">
and t.rzh_type = #{rzhType}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' ">
and t.in_account_status = #{inAccountStatus}
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}

@ -80,9 +80,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}
@ -342,8 +345,11 @@
<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.in_account_status = #{inAccountStatus}
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
and t.qs_status = #{qszt}

@ -68,9 +68,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
@ -190,9 +193,12 @@
<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' ">
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<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="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>

@ -536,10 +536,7 @@
<if test="listMark != null and listMark != '' and listMark != 'null' and listMark != '99'">
and t.list_status = #{listMark}
</if>
<if
test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99'">
and t.payment_status = #{inAccountStatus}
</if>
<if
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}

Loading…
Cancel
Save