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

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

@ -124,9 +124,12 @@
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'"> <if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh} and t.bzdh = #{bzdh}
</if> </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} and t.inaccount_status = #{inAccountStatus}
</if> </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'"> <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} and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq}
</if> </if>
@ -483,9 +486,12 @@
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'"> <if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh} and t.bzdh = #{bzdh}
</if> </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} and t.inaccount_status = #{inAccountStatus}
</if> </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==''"> <if test="businessCode==''">
and (t.dept_id is null or t.dept_id='' or t.dept_id='99') and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
</if> </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, ,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 case date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date when
true then 1 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 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 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 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 java.util.*;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl; import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
@ -146,6 +147,16 @@ public class CustomExportThread extends BaseThread {
String menuId = prams.getString("menuId"); String menuId = prams.getString("menuId");
String bzdh = prams.getString("bzdh"); String bzdh = prams.getString("bzdh");
String bzr = prams.getString("bzr"); 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"); String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes"); JSONArray companyCodeArray = prams.getJSONArray("companyCodes");
List<String> companyCodes = companyCodeArray.toJavaList(String.class); List<String> companyCodes = companyCodeArray.toJavaList(String.class);
@ -159,6 +170,13 @@ public class CustomExportThread extends BaseThread {
pramsMap.put("companyCodes",companyCodes); pramsMap.put("companyCodes",companyCodes);
pramsMap.put("bzdh",bzdh); pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr); 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<>(); List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) { if (!StringHelper.isBlank(gfsh)) {

@ -22,6 +22,7 @@ import com.dxhy.core.service.singletable.IExcelExportlogService;
import com.dxhy.core.util.JsonResponseUtils; import com.dxhy.core.util.JsonResponseUtils;
import com.dxhy.oss.service.FileService; import com.dxhy.oss.service.FileService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -154,6 +155,11 @@ public class ManualAthensThread extends BaseThread {
String inAccountStatus = prams.getString("inAccountStatus"); String inAccountStatus = prams.getString("inAccountStatus");
String inAccountMonth = prams.getString("inAccountMonth"); String inAccountMonth = prams.getString("inAccountMonth");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes"); 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); List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式 // 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16); Map<String, Object> pramsMap = new HashMap<>(16);
@ -163,6 +169,11 @@ public class ManualAthensThread extends BaseThread {
pramsMap.put("businessCode",businessCode); pramsMap.put("businessCode",businessCode);
pramsMap.put("suspendStatus",suspendStatus); pramsMap.put("suspendStatus",suspendStatus);
pramsMap.put("suspendDate",suspendDate); 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<>(); List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) { if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh); gfshList = StringHelper.stringToList(gfsh);
@ -228,14 +239,25 @@ public class ManualAthensThread extends BaseThread {
ftpFileName.append(fileSplit); ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) { if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
ftpFileName.append(rzFpxxService.getblocName(gfshList.get(0))); if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(fileSplit); if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(rzFpxxService.getblocName(gfshList.get(0)));
}
ftpFileName.append(fileSplit);
log.info("税号名称获取");
}
} }
} else { } else {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
for (String s : gfshList) { // for (String s : gfshList) {
ftpFileName.append(rzFpxxService.getGfName(s)); // if (StringUtils.isNotEmpty(s)){
ftpFileName.append(fileSplit); // 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 cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/** /**
* @author user * @author user
@ -151,12 +152,28 @@ public class PoolAddTaxThread extends BaseThread {
String bzr = prams.getString("bzr"); String bzr = prams.getString("bzr");
String companyCode = prams.getString("companyCode"); String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes"); 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); List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式 // 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16); Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName); pramsMap.put("dbName", dbName);
pramsMap.put("bzdh",bzdh); pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr); 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<>(); List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) { if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh); gfshList = StringHelper.stringToList(gfsh);
@ -214,13 +231,21 @@ public class PoolAddTaxThread extends BaseThread {
ftpFileName.append(fileSplit); ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) { if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0))); if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(fileSplit); ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
} }
} else { } else {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
for (String s : gfshList) { // for (String s : gfshList) {
ftpFileName.append(poolPaperService.getGfName(s)); // 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); ftpFileName.append(fileSplit);
} }
} }

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

@ -31,6 +31,7 @@ import com.dxhy.oss.service.FileService;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j; 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 company = prams.getString("company");
String companyCode = prams.getString("companyCode"); String companyCode = prams.getString("companyCode");
JSONArray companyCodeArray = prams.getJSONArray("companyCodes"); 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); List<String> companyCodes = companyCodeArray.toJavaList(String.class);
// 参数转换为需要的形式 // 参数转换为需要的形式
Map<String, Object> pramsMap = new HashMap<>(16); Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", dbName); pramsMap.put("dbName", dbName);
pramsMap.put("bzdh",bzdh); pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr); 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<>(); List<String> gfshList = new ArrayList<>();
if (!StringHelper.isBlank(gfsh)) { if (!StringHelper.isBlank(gfsh)) {
gfshList = StringHelper.stringToList(gfsh); gfshList = StringHelper.stringToList(gfsh);
@ -213,13 +230,21 @@ public class PoolSaleThread extends BaseThread {
ftpFileName.append(fileSplit); ftpFileName.append(fileSplit);
if ("99".equals(gfTaxNo)) { if ("99".equals(gfTaxNo)) {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
ftpFileName.append(poolPaperService.getblocName(gfshList.get(0))); if (StringUtils.isNotEmpty(gfshList.get(0))){
ftpFileName.append(fileSplit); ftpFileName.append(poolPaperService.getblocName(gfshList.get(0)));
ftpFileName.append(fileSplit);
}
} }
} else { } else {
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
for (String s : gfshList) { // for (String s : gfshList) {
ftpFileName.append(poolPaperService.getGfName(s)); // 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); ftpFileName.append(fileSplit);
} }
} }

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

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

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

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

@ -124,10 +124,10 @@
and t.rzh_type = #{rzhType} and t.rzh_type = #{rzhType}
</if> </if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()"> <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>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()"> <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>
<if test="qsfs != null and qsfs != '' and qsfs != 'null' "> <if test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs} and t.qs_type = #{qsfs}

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

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

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

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

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

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

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

Loading…
Cancel
Save