Merge branch 'release' of http://192.168.12.182/invoice/pt into release

release
gaorl 2 years ago
commit 8a726a158e
  1. 57
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java
  2. 2
      dxhy-admin/src/main/resources/dxhy-logback.xml
  3. 2
      dxhy-admin/src/main/resources/logback-spring.xml
  4. 46
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  5. 4
      dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java
  6. 2
      dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java
  7. 23
      dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java
  8. 5
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  9. 2
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseFpbrzServiceImpl.java
  10. 22
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  11. 29
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  12. 5
      dxhy-common/src/main/java/com/dxhy/common/util/InvoiceUtil.java
  13. 27
      dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java
  14. 2
      dxhy-core/src/main/java/com/dxhy/core/job/service/impl/SupplierRiskServiceImpl.java
  15. 2
      dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml
  16. 2
      dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java
  17. 275
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  18. 4
      dxhy-erp/src/main/java/com/dxhy/erp/dao/SysDeptDao.java
  19. 1
      dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxInvoiceReimburse.java
  20. 2
      dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java
  21. 107
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  22. 18
      dxhy-erp/src/main/resources/bootstrap-dev.yaml
  23. 4
      dxhy-erp/src/main/resources/bootstrap-std.yaml
  24. 8
      dxhy-erp/src/main/resources/mapper/SysDeptDao.xml
  25. 26
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java
  26. 2
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceExportCountController.java
  27. 3
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/count/impl/DomesticInvoiceExportCountServiceImpl.java
  28. 23
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/drawback/impl/DomesticInvoiceDrawbackServiceImpl.java
  29. 29
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtCustomsController.java
  30. 21
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java
  31. 7
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java
  32. 8
      dxhy-extend/src/main/java/com/dxhy/extend/entity/JkszhcxRespVO.java
  33. 2
      dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java
  34. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java
  35. 8
      dxhy-extend/src/main/resources/mapper/CustomsMapper.xml
  36. 4
      dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml
  37. 11
      dxhy-extend/src/main/resources/mapper/ExtBbycfpcxMapper.xml
  38. 59
      dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml
  39. 17
      dxhy-extend/src/main/resources/mapper/TicketMapper.xml
  40. 7
      dxhy-sign/src/main/java/com/dxhy/sign/controller/SignFpqsController.java
  41. 2
      dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java
  42. 4
      dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/SignFpqsServiceImpl.java
  43. 32
      dxhy-sign/src/main/resources/mapper/SignInvoiceMapper.xml

@ -264,29 +264,60 @@ public class SsoLoginServiceImpl implements SsoLoginService {
return roleIds;
}
// public List<SysUserOrgEntity> toUserOrg(SsoUser user) {
// SysUserOrgEntity userOrg;
// List<SysUserOrgEntity> listUserOrg = new ArrayList<>();
// List<Long> dataPerm = user.getDataPerm();
// List<com.xxl.sso.core.entity.SysDeptEntity> taxplayercodeDeptList = user.getTaxplayercodeDeptList();
// if (dataPerm != null && dataPerm.size() > 0) {
// for (Long deptId : dataPerm) {
// if (dataPerm.size() > 0) {
// for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) {
// log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId());
// if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) {
// userOrg = new SysUserOrgEntity();
// userOrg.setCompany(AdminConfig.company);
// userOrg.setDeptId(sysDeptEntity.getDeptId());
// userOrg.setTaxname(sysDeptEntity.getName());
// userOrg.setTaxno(sysDeptEntity.getTaxpayerCode());
// listUserOrg.add(userOrg);
// }
// }
// }
// }
// }
// log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg));
// return listUserOrg;
// }
public List<SysUserOrgEntity> toUserOrg(SsoUser user) {
SysUserOrgEntity userOrg;
Map<Long, com.xxl.sso.core.entity.SysDeptEntity> detpCollect = null;
List<SysUserOrgEntity> listUserOrg = new ArrayList<>();
List<Long> dataPerm = user.getDataPerm();
List<com.xxl.sso.core.entity.SysDeptEntity> taxplayercodeDeptList = user.getTaxplayercodeDeptList();
if(taxplayercodeDeptList != null && taxplayercodeDeptList.size() > 0){
detpCollect = taxplayercodeDeptList.stream().collect(Collectors.toMap(com.xxl.sso.core.entity.SysDeptEntity::getDeptId, tri -> tri));
}
if(detpCollect == null){
return listUserOrg;
}
if (dataPerm != null && dataPerm.size() > 0) {
for (Long deptId : dataPerm) {
if (dataPerm.size() > 0) {
for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) {
log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId());
if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) {
userOrg = new SysUserOrgEntity();
userOrg.setCompany(AdminConfig.company);
userOrg.setDeptId(sysDeptEntity.getDeptId());
userOrg.setTaxname(sysDeptEntity.getName());
userOrg.setTaxno(sysDeptEntity.getTaxpayerCode());
listUserOrg.add(userOrg);
}
}
com.xxl.sso.core.entity.SysDeptEntity deptEntity = detpCollect.get(deptId);
if(deptEntity != null){
userOrg = new SysUserOrgEntity();
userOrg.setCompany(AdminConfig.company);
userOrg.setDeptId(deptEntity.getDeptId());
userOrg.setTaxname(deptEntity.getName());
userOrg.setTaxno(deptEntity.getTaxpayerCode());
listUserOrg.add(userOrg);
}
}
}
log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg));
log.info("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg));
return listUserOrg;
}

@ -16,7 +16,7 @@
</rollingPolicy>
<!--临界值过滤器,过滤掉低于指定临界值的日志。当日志级别等于或高于临界值时,过滤器返回NEUTRAL;当日志级别低于临界值时,日志会被拒绝。-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
<level>INFO</level>
</filter>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${PATTERN}</pattern>

@ -25,7 +25,7 @@
<!-- 引用logback 日志配置 -->
<include resource="dxhy-logback.xml"/>
<logger name="com.dxhy" level="debug"/>
<logger name="com.dxhy" level="info"/>
<logger name="springfox.documentation.spring.web" level="error"/>
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}spring.log}"/>

@ -13,6 +13,7 @@ import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.util.InvoiceUtil;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.util.UserInfoUtil;
import com.dxhy.common.utils.DateUtils;
import com.dxhy.common.utils.R;
import com.dxhy.common.vo.Tax;
import lombok.extern.slf4j.Slf4j;
@ -277,6 +278,35 @@ public class BaseInvoiceController extends AbstractController {
if (StringUtils.isNotBlank(inAccountStatus)) {
pramsMap.put("inAccountStatus", inAccountStatus);
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageId",pramsMap.get("imageNumber"));
}
if(pramsMap.get("snVoucherNumber") != null){
pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber"));
}
if(pramsMap.get("accountPeriod") != null ){
if(pramsMap.get("accountPeriod").toString().length() > 7) {
String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0, 7);
pramsMap.put("accountPeriod", accountPeriod);
}else{
pramsMap.put("accountPeriod", pramsMap.get("accountPeriod"));
}
}
if (pramsMap.get("postingTimeStart") != null && !"".equals(pramsMap.get("postingTimeStart"))) {
pramsMap.put("postingTimeStart",
DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("postingTimeStart").toString())));
}
if (pramsMap.get("postingTimeEnd") != null && !"".equals(pramsMap.get("postingTimeEnd"))) {
pramsMap.put("postingTimeEnd",
DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString())));
}
log.info("请求列表的参数为:{}",pramsMap);
try {
return ResponseEntity.ok(R.ok().put("data", baseRzFpxxService.selectByPramsMap(pramsMap, curr, size)));
} catch (Exception e) {
@ -424,9 +454,15 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("settlementNo", map.get("settlementNo"));
pramsMap.put("voucherNumber", map.get("voucherNumber"));
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("postingTime", map.get("postingTime"));
pramsMap.put("imageId", map.get("imageId"));
pramsMap.put("accountPeriod", map.get("accountPeriod"));
pramsMap.put("postingTimeEnd", map.get("postingTimeEnd"));
pramsMap.put("postingTimeStart", map.get("postingTimeStart"));
pramsMap.put("imageId", map.get("imageNumber"));
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
// pramsMap.put("accountPeriod", map.get("accountPeriod"));
String inAccountStatus = (String)map.get("inAccountStatus");
if (sfkrz != null) {
@ -508,6 +544,7 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("position", position);
}
//发票号码
if (!StringUtils.isBlank(invoiceNo)) {
if(invoiceNo.length()==8){
pramsMap.put("invoiceNo", invoiceNo);
@ -515,6 +552,9 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("eleInvoiceNo", invoiceNo);
}
}
if (!StringUtils.isBlank(xfmc)) {
pramsMap.put("xfmc", xfmc);
}

@ -506,5 +506,7 @@ public class BaseTDxRecordInvoice implements Serializable {
//账期
private String accountPeriod;
//过账时间
private Date postingTime;
private String postingTime;
//影像号
private String imageId;
}

@ -202,5 +202,7 @@ public class BaseFpRzRespVO implements Serializable {
private Date postingTime;
//影像号 SN
private String imageNumber;
private String imageId;
}

@ -1,7 +1,10 @@
package com.dxhy.base.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 手工勾选查询返回对象
*
@ -126,4 +129,24 @@ public class BaseSggxCxRespVO {
*/
private String eleInvoiceNo;
/**
* 影像id
*/
private String imageId;
/**
* 凭证号
*/
private String snVoucherNumber;
/**
* 过账时间
*/
private String postingTime;
/**
* 过账时间
*/
private String accountPeriod;
}

@ -14,6 +14,7 @@ import java.util.Map;
import javax.annotation.Resource;
import com.dxhy.common.constant.DictConstant;
import com.dxhy.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -168,6 +169,10 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
log.info("businessName={}",businessName);
vo.setVoucherNumber(pageList.get(i).getVoucherNumber());
vo.setSnVoucherNumber(pageList.get(i).getSnVoucherNumber());
vo.setImageId(pageList.get(i).getImageId());
vo.setPostingTime(pageList.get(i).getPostingTime());
vo.setAccountPeriod(pageList.get(i).getAccountPeriod());
vo.setId(String.valueOf(pageList.get(i).getId()));
vo.setXh(String.valueOf(start + i));
vo.setInvoiceAmount(

@ -57,6 +57,7 @@ public class BaseFpbrzServiceImpl extends MpBaseServiceImpl<BaseFpbrzDao, BaseTD
private TabulateRedisService tabulateRedisService;
@Resource
private DictdetaServcice dictdetaServcice;
BaseFpbrzDao baseFpbrzDao;
@Override
public String selectByFpbrz(Map<String, Object> pramsMap, int curr, int size) {
@ -65,6 +66,7 @@ public class BaseFpbrzServiceImpl extends MpBaseServiceImpl<BaseFpbrzDao, BaseTD
String menuId = (String)pramsMap.get("menuId");
JSONObject json = tabulateRedisService.getTabulateMenu(company, menuId);
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
List<String> taxnoList = (List<String>)pramsMap.get("gfsh");

@ -11,7 +11,12 @@
<result column="kprq" property="invoiceDate"/>
<result column="invoice_type" property="invoiceType"/>
<result column="gfsh" property="gfsh"/>
<result column="image_id" property="imageId"/>
<result column="image_id" property="imageNumber"/>
<result column="gfmc" property="gfmc"/>
<result column="gf_tax_no" property="gfsh"/>
<result column="gf_name" property="gfmc"/>
<result column="rzh_date" property="rzsj"/>
<result column="xf_tax_no" property="xfsh"/>
<result column="xf_name" property="xfmc"/>
<result column="invoice_amount" property="invoiceAmount"/>
@ -52,9 +57,8 @@
<select id="selectByPramsMap" parameterType="java.util.Map"
resultMap="BaseResultMap" databaseId="mysql">
select
t.invoice_code,t.invoice_no,t.invoice_type,DATE_FORMAT(t.invoice_date,'%Y-%m-%d')kprq,t.gf_tax_no
gfsh,t.gf_name
gfmc,t.dept_id deptId,t.dept_name deptName,
t.invoice_code,t.invoice_no,t.invoice_type,DATE_FORMAT(t.invoice_date,'%Y-%m-%d')kprq,t.gf_tax_no,t.gf_name,t.image_id,t.rzh_date,
t.dept_id deptId,t.dept_name deptName,
t.xf_tax_no,t.xf_name,t.tax_amount,t.dk_tax_amount,t.invoice_status,t.invoice_amount,date_format(t.rzh_date,'%Y-%m-%d')
rzh_date,date_format(t.qs_date,'%Y-%m-%d') qs_date,t.rzh_type,t.id id,
t.gx_user_name,t.rzh_belong_date
@ -180,6 +184,18 @@
<if test='inAccountStatus!=null and inAccountStatus!="" and inAccountStatus !="99"'>
and t.in_account_status = #{inAccountStatus}
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTimeStart != null and postingTimeEnd != null and postingTimeStart != '' and postingTimeEnd != ''">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
order by t.rzh_date desc,t.invoice_date desc
</select>
<select id="selectByPramsMap" parameterType="java.util.Map"

@ -56,7 +56,7 @@
select t.invoice_type,t.dept_id
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name,
DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.voucher_number,
,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,
@ -64,13 +64,12 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08'))
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.company = #{company}
<if
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
and t.invoice_amount>0
and t.tax_amount>=0
@ -78,8 +77,7 @@
and d.tj_status in('0','3')
</if>
<if
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()">
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()">
and (t.invoice_status in ('1','2','3','4','8','80') or t.invoice_amount &lt;0 or t.tax_amount &lt;0 or
date_format(t.invoice_date,'%Y%m%d') &lt;= c.select_start_date or
date_format(t.invoice_date,'%Y%m%d') &gt;=
@ -93,8 +91,7 @@
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</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}
</if>
<if test="voucherNumber != null and voucherNumber != ''">
@ -121,8 +118,7 @@
<if test="fpzt != null and fpzt != '' and fpzt != 'null'">
and t.invoice_status = #{fpzt}
</if>
<if
test="qsfs != null and qsfs != '' and qsfs != 'null' ">
<if test="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}
</if>
<if test="xfmc != null and xfmc != '' and xfmc != 'null' ">
@ -134,18 +130,15 @@
<if test="settlementNo != null and settlementNo != ''">
and t.settlement_no like concat(#{settlementNo},'%')
</if>
<if
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<!-- 按签收人查询 -->
<if
test="position != null and position != '' and position != 'null' and position == '1'.toString()">
<if test="position != null and position != '' and position != 'null' and position == '1'.toString()">
and t.qs_name = #{username}
</if>
<if
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
<if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
</if>
<if test="businessCode==''">
@ -167,8 +160,8 @@
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.postingTime = #{postingTime}
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}

@ -179,8 +179,9 @@ public class InvoiceUtil {
*/
public boolean fpdmValid() {
boolean valid = false;
if (!StringHelper.isBlank(fpdm)
&& (FPDM10_PATTERN.matcher(fpdm).matches() || FPDM12_PATTERN.matcher(fpdm).matches())) {
if (!StringHelper.isBlank(fpdm) && (FPDM10_PATTERN.matcher(fpdm).matches() || FPDM12_PATTERN.matcher(fpdm).matches())) {
valid = true;
}else if(fpdm == null || StringHelper.isBlank(fpdm)){
valid = true;
}
return valid;

@ -93,6 +93,7 @@ public class EmailMaintainController extends AbstractController {
}
String loginname = getUserInfo().getLoginname();
emailMaintain.setCreateUser(loginname);
DynamicContextHolder.push(DbConstant.BASICS_READ);
EmailMaintainVo vo = new EmailMaintainVo();
vo.setEmailAddress(emailMaintain.getEmailAddress());
@ -115,8 +116,11 @@ public class EmailMaintainController extends AbstractController {
*/
@PostMapping("/edit")
public ResponseEntity<R> edit(@RequestBody EmailMaintainVo emailMaintain) {
if(StringUtils.isBlank(emailMaintain.getEmailPassword())){
return ResponseEntity.ok(R.error("邮箱地址不能为空!"));
if(StringUtils.isBlank(emailMaintain.getEmailPassword()) || StringUtils.isBlank(emailMaintain.getEmailAddress()) ){
return ResponseEntity.ok(R.error("邮箱地址/密码不能为空!"));
}else {
String encode = Base64Encoding.encode(emailMaintain.getEmailPassword());
emailMaintain.setEmailPassword(encode);
}
DynamicContextHolder.push(DbConstant.BASICS_READ);
EmailMaintainVo vo = new EmailMaintainVo();
@ -132,6 +136,25 @@ public class EmailMaintainController extends AbstractController {
return ResponseEntity.ok(R.error());
}
/**
* 编辑数据
*
* @param id id
* @return 删除结果
*/
@PostMapping("/delete")
public ResponseEntity<R> delete(@RequestBody String id) {
log.info("传入的删除参数id={}",id);
DynamicContextHolder.push(DbConstant.BASICS_READ);
boolean b = emailMaintainService.deleteById(id);
if(b){
return ResponseEntity.ok(R.ok());
}
return ResponseEntity.ok(R.error());
}
/**
* 编辑数据

@ -172,7 +172,7 @@ public class SupplierRiskServiceImpl extends MpBaseServiceImpl<ViolationLogDao,
object.setSYSID("FPXT");
object.setIFYWID("FI870");
object.setBSKEY(UUID.randomUUID().toString().replace("-", ""));
object.setZFILED5("200");
object.setZFILED5("300");
List<SupplierRisk> risks = new ArrayList<>();

@ -29,7 +29,7 @@
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="EmailMaintainMap" parameterType="java.util.Map">
select
id, dept_id, company_code, dept_name, username, user_id, email_address, create_time, del_status, modify_time
id, dept_id, company_code, dept_name, username, user_id, email_address,email_password, create_time, del_status, modify_time
from email_maintain
<where>
<if test="deptId != null and deptId != ''">

@ -59,7 +59,7 @@ public class ErpWebConfiguration implements WebMvcConfigurer {
*/
private ArrayList<String> getIncludePathPatterns() {
ArrayList<String> list = new ArrayList<>();
String[] urls = {"/order/**"};
String[] urls = {"/order/**,/sn/**"};
Collections.addAll(list, urls);
return list;
}

@ -1,20 +1,26 @@
package com.dxhy.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dxhy.common.aspect.SysLog;
import com.dxhy.common.constant.CommonConstants;
import com.dxhy.common.constant.ConfigureConstant;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.SNFplxEnum;
import com.dxhy.common.util.InvoiceUtil;
import com.dxhy.common.util.UserInfoUtil;
import com.dxhy.common.utils.R;
import com.dxhy.erp.dao.CustomsRecordDao;
import com.dxhy.erp.dao.RecordInvoiceDao;
import com.dxhy.erp.dao.TdxSaleRecordInvoiceDao;
import com.dxhy.erp.entity.TDxInvoiceReimburse;
import com.dxhy.erp.entity.TdxCheckRecordInvoice;
import com.dxhy.erp.entity.TdxSaleRecordInvoice;
import com.dxhy.erp.entity.*;
import com.dxhy.erp.entity.sdny.*;
import com.dxhy.erp.service.*;
import com.dxhy.erp.utils.HmacSHA1Util;
import com.dxhy.erp.utils.ServiceResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
@ -64,13 +70,19 @@ public class SDNYMainProcessController extends AbstractController {
@Resource
TdxSaleRecordInvoiceDao tdxSaleRecordInvoiceDao;
@Resource
private CustomsRecordDao customsRecordDao;
@Resource
private RecordInvoiceDao recordInvoiceDao;
/**
* 查验发票
*/
@PostMapping("/sn/singleInvoiceCheck")
@ResponseBody
@SysLog("发票查验")
public ResponseEntity<String> singleInvoiceCheck(@RequestBody Map<String, String> pramsMap) {
public ResponseEntity<String> singleInvoiceCheck(@RequestBody Map<String, String> pramsMap) throws ParseException {
log.info("传入的参数为:{}", pramsMap);
String userid = "101833";
String dbName = "business";
@ -128,6 +140,7 @@ public class SDNYMainProcessController extends AbstractController {
log.info("发票类型为:{}", pramsMap.get("invoiceType"));
String uuid = (StringUtils.isBlank(pramsMap.get("invoiceCode")) ? "" : pramsMap.get("invoiceCode")) + pramsMap.get("invoiceNo");
log.info("uuid={}", uuid);
String notes = invoiceQueryService.checkingInvoiceInfo("business", uuid, getUserInfo());
if (notes != null) {
return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes)));
@ -136,18 +149,25 @@ public class SDNYMainProcessController extends AbstractController {
//查询底账库是否有对应发票,有则直接返回
TdxCheckRecordInvoice checkInvoiceByUuid = signCheckRecordService.getCheckInvoiceByUuid(uuid);
if (checkInvoiceByUuid != null) {
log.info("进项票池已存在发票.直接返回票池信息");
R data = new R(1000, "default success");
String checkInvoice = JSONObject.toJSONString(checkInvoiceByUuid);
JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid);
convertToResult(checkInvoice);
data.put("data", checkInvoice);
return ResponseEntity.ok(JSONObject.toJSONString(data));
} else {
TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid);
log.info("tdxSaleRecordInvoice={}", tdxSaleRecordInvoice);
if (tdxSaleRecordInvoice != null) {
log.info("销项票池已存在发票.直接返回票池信息");
R data = new R(1000, "default success");
String checkInvoice = JSONObject.toJSONString(tdxSaleRecordInvoice);
JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(tdxSaleRecordInvoice);
convertToResult(checkInvoice);
data.put("data", checkInvoice);
return ResponseEntity.ok(JSONObject.toJSONString(data));
@ -199,6 +219,148 @@ public class SDNYMainProcessController extends AbstractController {
return ResponseEntity.ok(JSONObject.toJSONString(R.error().put("data", checkInvoiceResult)));
}
private void convertToResult(JSONObject checkInvoice) throws ParseException {
checkInvoice.put("totalTax", checkInvoice.getString("taxAmount"));
checkInvoice.put("amountTax", checkInvoice.getString("totalAmount"));
checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount"));
String invoiceCode = checkInvoice.get("invoiceCode").toString();
String invoiceType = checkInvoice.get("invoiceType").toString();
if ("22".equals(invoiceType)) {
invoiceType = "33";
}
if ("21".equals(invoiceType)) {
invoiceType = "31";
}
checkInvoice.put("invoiceType", invoiceType);
checkInvoice.put("administrativeDivisionNo", "");
checkInvoice.put("administrativeDivisionName", "");
checkInvoice.put("invoiceCode", invoiceCode);
checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString());
String uuid = "";
if(invoiceCode != null && StringUtils.isNoneBlank(invoiceCode)){
uuid = invoiceCode + checkInvoice.get("invoiceNo").toString();
checkInvoice.put("uuid",uuid);
}else{
uuid = checkInvoice.get("invoiceNo").toString();
checkInvoice.put("uuid",uuid);
}
String kprq = checkInvoice.get("invoiceDate").toString();
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
Date date = sdf.parse(kprq);
String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(date);
log.info("开票日期为:{} ", formatStr);
checkInvoice.put("billingDate", formatStr);
checkInvoice.put("purchaserName", checkInvoice.get("gfName"));
checkInvoice.put("purchaserTaxNo", checkInvoice.get("gfTaxNo"));
checkInvoice.put("purchaserBank", checkInvoice.get("gfBankAndNo"));
checkInvoice.put("purchaserAddressPhone", checkInvoice.get("gfAddressAndPhone"));
checkInvoice.put("salesName", checkInvoice.get("xfName"));
checkInvoice.put("salesTaxNo", checkInvoice.get("xfTaxNo"));
checkInvoice.put("salesAddressPhone", checkInvoice.get("gfAddressAndPhone"));
checkInvoice.put("salesBank", checkInvoice.get("gfBankAndNo"));
checkInvoice.put("checkCode", checkInvoice.get("checkCode"));
checkInvoice.put("state", "0");
checkInvoice.put("tollSign", "07");
String taxRate = "";
List<Map<String, String>> returnDetailList = new ArrayList<>();
// JSONArray detailList = (JSONArray) invoiceData.get("detailList");
JSONArray detailList = new JSONArray();
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"));
String quantity = detail.getString("spsl");
// if (quantity.length() > 3) {
// int index = quantity.indexOf(".");
// quantity = quantity.substring(0, index + 2);
// }
snDetailMap.put("quantity", quantity);
String unitPrice = detail.getString("bhsdj");
// if (unitPrice.length() > 3) {
// int index = unitPrice.indexOf(".");
// unitPrice = unitPrice.substring(0, index + 3);
// }
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());
} 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);
}
}
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);
}
checkInvoice.put("invoiceLineList", returnDetailList);
}
/**
* 查验发票
*/
@ -461,20 +623,20 @@ public class SDNYMainProcessController extends AbstractController {
BigDecimal bigDecimal = new BigDecimal(taxRate);
BigDecimal multiply = bigDecimal.multiply(new BigDecimal("100"));
info.setZTAX(multiply.toString());
info.setZSM(getZSM(taxRate));
}
if (taxRate != null && taxRate.contains("%")) {
String replace = taxRate.replace("%", "");
BigDecimal bigDecimal = new BigDecimal(replace);
BigDecimal divide = bigDecimal.divide(new BigDecimal(100));
taxRate = divide.toString();
info.setZTAX(bigDecimal.multiply(new BigDecimal("0.01")).toString());
info.setZSM(getZSM(taxRate));
}
if (info.getZTAX() != null) {
info.setZSM(getZSM(info.getZTAX()));
// taxRate = divide.toString();
// info.setZTAX(bigDecimal.multiply(new BigDecimal("0.01")).toString());
info.setZTAX(replace+".00");
info.setZSM(getZSM(divide.toString()));
}
if (info.getZTAX() == null || info.getZTAX() == "") {
info.setZTAX("0.00");
info.setZSM(getZSM(info.getZTAX()));
}
info.setZFPDM(snInvoice.getInvoiceCode());
info.setZCD(snInvoice.getOriginPlace());
@ -506,7 +668,8 @@ public class SDNYMainProcessController extends AbstractController {
info.setZGXR("");
//认证相关
info.setZRZJG("0");
String zrzjg = getZRZJG(snInvoice.getInvoiceCode(),snInvoice.getInvoiceNumber(),info.getZFPLX());
info.setZRZJG(zrzjg);
info.setZRZSSQ("");
// info.setZRZMS("");
// info.setZRZRQ("");
@ -527,12 +690,20 @@ public class SDNYMainProcessController extends AbstractController {
info.setZCCRZH(snInvoice.getIdcardNo());
info.setZCPXH(snInvoice.getBrandModel());
info.setZMHFZJJ(snInvoice.getCaacDevelopmentFund());
info.setZGFDH(snInvoice.getPurchaserAddressPhone());
if (!"nullnull".equals(snInvoice.getPurchaserAddressPhone())){
info.setZGFDH(snInvoice.getPurchaserAddressPhone());
// info.setZGFDH("");
}
info.setZXFZH(snInvoice.getSalesBank());
info.setZJYM(snInvoice.getCheckCode());
info.setZSJDH(snInvoice.getInspectionListNo());
// info.setZYGC("");
info.setZJSHJ(snInvoice.getAmountTax());
if (snInvoice.getAmountTax() == null && ("17".equals(info.getZFPLX()) || "18".equals(info.getZFPLX()))){
info.setZJSHJ(snInvoice.getTotalAmount());
}
info.setZCYRMC(snInvoice.getCarrierName());
info.setZJGDM(snInvoice.getTaxAuthorityNo());
//时间转换
@ -543,10 +714,20 @@ public class SDNYMainProcessController extends AbstractController {
if (snInvoice.getSource() == null) {
info.setZPJLY("1");
}
info.setZCYZT(snInvoice.getCheckStaus());
if (snInvoice.getCheckStaus() == null) {
info.setZCYZT("1");
if ("01".equals(snInvoice.getInvoiceType()) || "02".equals(snInvoice.getInvoiceType()) || "03".equals(snInvoice.getInvoiceType()) || "04".equals(snInvoice.getInvoiceType())
|| "08".equals(snInvoice.getInvoiceType()) || "10".equals(snInvoice.getInvoiceType()) || "11".equals(snInvoice.getInvoiceType()) || "14".equals(snInvoice.getInvoiceType())
|| "15".equals(snInvoice.getInvoiceType()) || "31".equals(snInvoice.getInvoiceType()) || "32".equals(snInvoice.getInvoiceType())) {
//可查验发票,
info.setZCYZT("1");
} else {
//不可查验发票
info.setZCYZT("3");
}
// info.setZCYZT(snInvoice.getCheckStaus());
// if (snInvoice.getCheckStaus() == null) {
// info.setZCYZT("1");
// }
info.setZCJR("opentext");
info.setZGXR("opentext");
info.setZQM("opentext");
@ -684,4 +865,64 @@ public class SDNYMainProcessController extends AbstractController {
}
return sm;
}
private String getZRZJG(String invoiceCode, String invoiceNo,String FPLX){
String ZCYJG = "";
String uuid = invoiceCode+invoiceNo;
DynamicContextHolder.push(DbConstant.BUSINESS_READ);
//可价税分离票种
//10:增值税专用发票
//12:增值税电子普通发票
//13:增值税普通发票(卷票)
//14:机动车销售统一发票
//15:二手车销售统一发票
//24:增值税电子普通发票(通行费)
//25:增值税电子专用发票
//26:电子发票(增值税专用发票)
//27:电子发票(普通发票)
//22:过路费发票
//11:增值税普通发票
//16:定额发票
//17:机打发票
//18:出租车发票
if ("10".equals(FPLX) || "12".equals(FPLX) || "13".equals(FPLX) || "14".equals(FPLX) || "15".equals(FPLX)
|| "24".equals(FPLX) || "25".equals(FPLX) || "26".equals(FPLX) || "27".equals(FPLX) || "22".equals(FPLX)
|| "11".equals(FPLX) || "16".equals(FPLX) || "17".equals(FPLX) || "18".equals(FPLX) ) {
QueryWrapper<TDxInvoiceReimburse> wrapper = new QueryWrapper();
wrapper.eq("uuid", uuid);
TDxInvoiceReimburse one = tDxInvoiceReimburseService.getOne(wrapper);
if (one != null){
ZCYJG = one.getRzhYesorno();
}
} else {
//19:火车票
//20:客运汽车
//21:航空运输电子客票行程单
//28:船票
//如果是可查验类型,直接更新数据库
if ( "19".equals(FPLX) || "20".equals(FPLX) || "21".equals(FPLX) || "28".equals(FPLX)) {
//其他票种
QueryWrapper<RecordInvoice> wrapper = new QueryWrapper();
wrapper.eq("uuid", uuid);
RecordInvoice recordInvoice = recordInvoiceDao.selectOne(wrapper);
if (recordInvoice != null){
ZCYJG = recordInvoice.getRzhYesorno();
}
} else {
//海关缴款书
QueryWrapper<TdxCustomsRecord> wrapper = new QueryWrapper();
wrapper.eq("uuid", uuid);
TdxCustomsRecord tdxCustomsRecord = customsRecordDao.selectOne(wrapper);
if (tdxCustomsRecord != null){
ZCYJG = tdxCustomsRecord.getRzhYesorno();
}
}
}
return ZCYJG;
}
}

@ -38,6 +38,10 @@ public interface SysDeptDao extends BaseMapper<SysDeptEntity> {
* @return
*/
SysDeptEntity getOrg(@Param("taxno") String taxno);
SysDeptEntity getOrgByCompCode(@Param("compCode") String compCode);
SysDeptEntity getOrgByCompany(@Param("company") String company);
/**

@ -53,6 +53,7 @@ public class TDxInvoiceReimburse {
private String xfTaxNo;
private String xfName;
private String taxRate;
private String taxCode;
private String createDate;
private String rzhYesorno;
private String tag;

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
@ -42,6 +43,7 @@ public class TdxSaleRecordInvoice implements Serializable {
/**
* 开票日期
*/
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date invoiceDate;
/**

@ -7,14 +7,17 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum;
import com.dxhy.common.enums.SNFplxEnum;
import com.dxhy.common.util.InvoiceUtil;
import com.dxhy.common.vo.UserInfo;
import com.dxhy.erp.dao.AreaDao;
import com.dxhy.erp.dao.BaseTDxRecordInvoiceDao;
import com.dxhy.erp.dao.BaseTDxTaxCurrentDao;
import com.dxhy.erp.dao.SysDeptDao;
import com.dxhy.erp.entity.BaseTDxRecordInvoice;
import com.dxhy.erp.entity.BaseTDxTaxCurrent;
import com.dxhy.erp.entity.SysDeptEntity;
import com.dxhy.erp.entity.TDxInvoiceReimburse;
import com.dxhy.erp.entity.kfpt.ApiCheckInvoiceSingleRequest;
import com.dxhy.erp.entity.kfpt.ApiRequest;
@ -90,6 +93,9 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private TDxInvoiceReimburseService tDxInvoiceReimburseService;
@Resource
private SysDeptDao sysDeptDao;
public String pushCheckResultToSAP(String requestParam) throws Exception {
log.info("获取请求参数:{} , 请求地址:{}", requestParam, snYxUrl);
String post = HttpUtils.sendPo(snYxUrl, requestParam, userName, password);
@ -98,7 +104,17 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return post;
}
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company) throws Exception {
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company,String compCode) throws Exception {
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
DynamicContextHolder.push(DbConstant.BASICS_READ);
SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode);
log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode));
recordInvoice.setGfTaxNo(orgByCompCode.getTaxno());
recordInvoice.setGfName(orgByCompCode.getTaxname());
recordInvoice.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone());
recordInvoice.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount());
QueryWrapper<BaseTDxTaxCurrent> currentWrapper = new QueryWrapper<>();
currentWrapper.eq("taxno", taxNo);
@ -129,7 +145,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
String gfmc = snInvoice.getPurchaserName();
String invoiceType = snInvoice.getInvoiceType();
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
recordInvoice.setUuid(fpdm + fphm);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (kprq != null) {
@ -317,7 +333,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
jsonObject.put("salesName", invoiceData.get("xhfmc"));
jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh"));
jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh"));
jsonObject.put("salesBank", invoiceData.get("xhfyhzh"));
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");
@ -570,17 +592,27 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
log.info("价税分离失败:{}", invoiceResult.getMsg());
return invoiceResult.getMsg();
}
DynamicContextHolder.push(DbConstant.BASICS_READ);
SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode);
log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode));
reimburse.setGfTaxNo(orgByCompCode.getTaxno());
reimburse.setGfName(orgByCompCode.getTaxname());
reimburse.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone());
reimburse.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount());
reimburse = convertToReimburse(invoice, reimburse, fplxdm, company);
log.info("插库的发票信息:{}",reimburse);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
int insert = 0;
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("uuid", reimburse.getUuid());
TDxInvoiceReimburse reimburse1 = tDxInvoiceReimburseService.getBaseMapper().selectOne(wrapper);
if (reimburse1 != null) {
insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse1);
// insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse);
insert = tDxInvoiceReimburseService.getBaseMapper().update(reimburse,wrapper);
} else {
insert = tDxInvoiceReimburseService.getBaseMapper().insert(reimburse);
}
@ -597,7 +629,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
log.info("可查验发票,更新底账库完成");
} else {
//不可查验发票,未入库,插入票池
this.pushInvoiceToRecordInvoice(invoice, taxNo, company);
this.pushInvoiceToRecordInvoice(invoice, taxNo, company,compCode);
log.info("不可查验发票,插入底账库成功");
}
@ -634,12 +666,8 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
reimburse.setXfAddressAndPhone(invoice.getSalesAddressPhone());
reimburse.setXfBankAndNo(invoice.getSalesBank());
reimburse.setGfTaxNo(invoice.getPurchaserTaxNo());
reimburse.setGfName(invoice.getPurchaserName());
reimburse.setGfAddressAndPhone(invoice.getPurchaserAddressPhone());
reimburse.setGfBankAndNo(invoice.getPurchaserBank());
reimburse.setTaxRate(invoice.getTaxRate());
reimburse.setTaxCode(getTaxCode(invoice.getTaxRate()));
reimburse.setIsDeduction(invoice.getIsDeductible());
if (StringUtils.isNoneBlank(reimburse.getInvoiceCode())) {
@ -664,6 +692,63 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return reimburse;
}
private String getTaxCode(String taxRate) {
String sm = "J0";
switch (taxRate) {
// 发票采集
case "0%":
sm = "J0";
break;
case "0.00":
sm = "J0";
break;
case "0.000":
sm = "J0";
break;
case "免税":
sm = "J0";
break;
case "16%":
sm = "J1";
break;
case "13%":
sm = "J2";
break;
case "10%":
sm = "J3";
break;
case "9%":
sm = "J4";
break;
case "6%":
sm = "J5";
break;
case "5%":
sm = "J6";
break;
case "3%":
sm = "J7";
break;
case "2%":
sm = "J8";
break;
case "1%":
sm = "J9";
break;
case "17%":
sm = "JC";
break;
default:
sm = "J0";
break;
}
return sm;
}
private InvoiceInfo convertToInvoiceInfo(SNInvoice snInvoice) {
InvoiceInfo invoice = new InvoiceInfo();
invoice.setInvoiceTypeCode(snInvoice.getInvoiceType());
@ -681,7 +766,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
invoice.setPassenger(snInvoice.getRiderName());
invoice.setDepartCity(snInvoice.getStationGetOn());
invoice.setArriveCity(snInvoice.getStationGetOff());
if ("92".equals(invoice.getInvoiceTypeCode()) || "89".equals(invoice.getInvoiceTypeCode())) {
if ("92".equals(invoice.getInvoiceTypeCode()) || "89".equals(invoice.getInvoiceTypeCode()) || "88".equals(invoice.getInvoiceTypeCode())) {
if (snInvoice.getAmountTax() != null)
invoice.setInvoiceAmount(new BigDecimal(snInvoice.getAmountTax()));
}

@ -4,22 +4,24 @@ spring:
nacos:
config:
# Nacos config 地址
server-addr: 10.1.2.202:8848
server-addr: 172.31.36.147:33000
# Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace)
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6
# Nacos config 分组
group: dxhy-erp-group
# Nacos config 登录用户名
username: dxhy-jxpt
username: nacos
# Nacos config 登录密码
password: dxhy-jxpt
password: Invoice.nacos.!1
# Nacos config 配置文件前缀
prefix: dxhy-erp
# Nacos config 配置文件后缀,拼接完URL需要对应NacosServer中的dataId对应配置,${prefix}-${spring.profiles.active}.${file-extension}
file-extension: yaml
# Nacos discovery 配置
discovery:
server-addr: 10.1.2.202:8848
username: dxhy-jxpt
password: dxhy-jxpt
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
server-addr: 172.31.36.147:33000
# Nacos config 登录用户名
username: nacos
# Nacos config 登录密码
password: Invoice.nacos.!1
namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6

@ -10,7 +10,7 @@ spring:
# Nacos config 分组
group: dxhy-erp-group
# Nacos config 登录用户名
username: admin
username: nacos
# Nacos config 登录密码
password: Invoice.nacos.!1
# Nacos config 配置文件前缀
@ -21,7 +21,7 @@ spring:
discovery:
server-addr: 172.31.36.143:33000
# Nacos config 登录用户名
username: admin
username: nacos
# Nacos config 登录密码
password: Invoice.nacos.!1
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c

@ -28,6 +28,14 @@
and del_flag = '0' limit 1
</select>
<select id="getOrgByCompCode" resultType="com.dxhy.erp.entity.SysDeptEntity">
select *
from sys_dept
where org_code = #{compCode}
and org_type = '5'
and del_flag = '0' limit 1
</select>
<select id="getOrgByCompany" resultType="com.dxhy.erp.entity.SysDeptEntity">
select *
from sys_dept

@ -42,22 +42,20 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
/**
* 退税手工认证列表接口
*
* @param dto
* 参数
* @param dto 参数
*/
@PostMapping("/authentication_list")
@ApiOperation(value = "退税手工认证列表接口")
public ResponseEntity<R> authenticationList(@RequestBody @Valid AuthenticationConditionDTO dto) {
CommonListResponseVO<ManualAuthenticationListVO> resultVO =
domesticInvoiceDrawbackService.authenticationList(dto, getUserInfo());
domesticInvoiceDrawbackService.authenticationList(dto, getUserInfo());
return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(resultVO))));
}
/**
* 退税手工认证接口
*
* @param dto
* 参数
* @param dto 参数
*/
@PostMapping("/authentication")
@ApiOperation(value = "退税手工认证接口")
@ -70,8 +68,7 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
/**
* 退税导入认证信息查询接口
*
* @param datalist
* 参数
* @param datalist 参数
*/
@ResponseBody
@PostMapping("/import_authentication_check")
@ -79,24 +76,24 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
public ResponseEntity<R> importAuthenticationCheck(@RequestBody Map<String, String> datalist) {
List<AuthenticationImportDTO> dtoList =
JSON.parseArray(datalist.get("datalist"), AuthenticationImportDTO.class);
JSON.parseArray(datalist.get("datalist"), AuthenticationImportDTO.class);
dtoList.forEach(dto -> {
dto.setInvoiceCode(dto.getInvoiceCode().replace(" ", ""));
if (dto.getInvoiceCode() != null)
dto.setInvoiceCode(dto.getInvoiceCode().replace(" ", ""));
dto.setInvoiceDate(dto.getInvoiceDate().replace(" ", ""));
dto.setInvoiceNo(dto.getInvoiceNo().replace(" ", ""));
dto.setTaxAmount(dto.getTaxAmount().replace(" ", ""));
});
String menuId = datalist.get("menuId");
CommonListResponseVO<ImportAuthenticationListVO> resultList =
domesticInvoiceDrawbackService.importAuthenticationCheck(dtoList, getUserInfo(), menuId);
domesticInvoiceDrawbackService.importAuthenticationCheck(dtoList, getUserInfo(), menuId);
return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(resultList))));
}
/**
* 退税认证查询接口
*
* @param dto
* 参数
* @param dto 参数
*/
@PostMapping("/authentication_check")
@ApiOperation(value = "退税认证查询接口")
@ -105,15 +102,14 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
dto.setCompany(getUserInfo().getCompany());
}
CommonListResponseVO<AuthenticationCheckListVO> responseVO =
domesticInvoiceDrawbackService.authenticationCheck(dto, getUserInfo());
domesticInvoiceDrawbackService.authenticationCheck(dto, getUserInfo());
return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(responseVO))));
}
/**
* 请求结果加密封装
*
* @param json
* json
* @param json json
*/
private String responseResult(String json) {
String jsonString = null;

@ -41,6 +41,8 @@ public class DomesticInvoiceExportCountController extends AbstractController {
@PostMapping("/queryExportInvoiceList")
@ApiOperation(value = "转内销发票查询")
public ResponseEntity<R> queryExportInvoiceList(Page<Object> page, @RequestBody TdxExportInvoiceModelDTO dto) {
log.info("传入参数dto {}",dto);
log.info("传入参数page {}",page);
try {
dto.setUserInfo(getUserInfo());
return ResponseEntity

@ -7,6 +7,7 @@ import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -36,6 +37,7 @@ import com.dxhy.domestic.service.count.DomesticInvoiceExportCountService;
* @Version: 1.0
*/
@Service
@Slf4j
public class DomesticInvoiceExportCountServiceImpl extends MpBaseServiceImpl<DomesticExportInvoiceDao, TdxExportInvoice>
implements DomesticInvoiceExportCountService {
@ -59,6 +61,7 @@ public class DomesticInvoiceExportCountServiceImpl extends MpBaseServiceImpl<Dom
resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase();
}
log.info("开始分页查询queryPrams值为 {}",dto);
Page<Map> result = this.baseMapper.queryExportInvoiceList(page, dto);
if (CollectionUtils.isNotEmpty(result.getRecords())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

@ -422,12 +422,12 @@ public class DomesticInvoiceDrawbackServiceImpl implements DomesticInvoiceDrawba
String invoiceDate = dto.getInvoiceDate();
String taxAmount = dto.getTaxAmount();
if (StringUtils.isEmpty(invoiceCode)) {
return "发票代码格式错误";
}
if (invoiceCode.length() != 10 && invoiceCode.length() != 12) {
return "发票代码格式错误";
}
// if (StringUtils.isEmpty(invoiceCode)) {
// return "发票代码格式错误";
// }
// if (invoiceCode.length() != 10 && invoiceCode.length() != 12) {
// return "发票代码格式错误";
// }
if (StringUtils.isBlank(invoiceNo) && invoiceNo.length() != 8) {
return "发票号码格式错误";
}
@ -449,8 +449,17 @@ public class DomesticInvoiceDrawbackServiceImpl implements DomesticInvoiceDrawba
}
// 发票类型校验
InvoiceUtil invoiceUtil = new InvoiceUtil(dto.getInvoiceCode());
log.info("invoiceCode={}",dto.getInvoiceCode());
log.info("invoiceNo={}",dto.getInvoiceNo());
String invoiceType = invoiceUtil.getFplxdm();
if (!Arrays.asList("01", "08").contains(invoiceType)) {
if(dto.getInvoiceNo().length() == 20){
invoiceType = "31";
}
if (!Arrays.asList("01", "08", "31").contains(invoiceType)) {
return "发票类型错误";
}
// 重复校验

@ -117,6 +117,35 @@ public class ExtCustomsController extends AbstractController {
if("99".equals(pramsMap.get("rzhYesorno"))){
pramsMap.put("rzhYesorno", null);
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageId",pramsMap.get("imageNumber"));
}
if(pramsMap.get("snVoucherNumber") != null){
pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber"));
}
if(pramsMap.get("accountPeriod") != null ){
if(pramsMap.get("accountPeriod").toString().length() > 7) {
String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0, 7);
pramsMap.put("accountPeriod", accountPeriod);
}else{
pramsMap.put("accountPeriod", pramsMap.get("accountPeriod"));
}
}
if (pramsMap.get("postingTimeStart") != null && !"".equals(pramsMap.get("postingTimeStart"))) {
pramsMap.put("postingTimeStart",
DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("postingTimeStart").toString())));
}
if (pramsMap.get("postingTimeEnd") != null && !"".equals(pramsMap.get("postingTimeEnd"))) {
pramsMap.put("postingTimeEnd",
DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString())));
}
log.info("请求列表的参数为:{}",pramsMap);
try {
return ResponseEntity.ok(Objects
.requireNonNull(R.ok().put("data", customsService.selectByPramsMap(pramsMap, curr, size))));

@ -147,6 +147,27 @@ public class ExtFpzhcxController extends AbstractController {
pramsMap.put("rzjsrq", "");
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageId",pramsMap.get("imageNumber"));
}
if(pramsMap.get("snVoucherNumber") != null){
pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber"));
}
if(pramsMap.get("accountPeriod") != null){
pramsMap.put("accountPeriod",pramsMap.get("accountPeriod"));
}
if (pramsMap.get("postingTimeStart") != null && !"".equals(pramsMap.get("postingTimeStart"))) {
pramsMap.put("postingTimeStart",
DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("postingTimeStart").toString())));
}
if (pramsMap.get("postingTimeEnd") != null && !"".equals(pramsMap.get("postingTimeEnd"))) {
pramsMap.put("postingTimeEnd",
DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString())));
}
if (pramsMap.get("qsksrq") != null && !"".equals(pramsMap.get("qsksrq")) && "1".equals(pramsMap.get("qszt"))) {
pramsMap.put("qsksrq", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("qsksrq").toString())));
} else {

@ -135,6 +135,7 @@ public class ExtInvoicePoolController extends AbstractController {
public ResponseEntity<R> listOtherInvoice(@RequestBody Map<String, Object> pramsMap) {
pramsMap.put("dbName", getUserInfo().getDbName());
log.info("其他发票采集接收参数 {}",pramsMap);
List<String> gfshList = new ArrayList<>();
List<String> invoiceTypeList = new ArrayList<>();
if (!"99".equals(pramsMap.get("gfsh")) && pramsMap.get("gfsh") != null && !"".equals(pramsMap.get("gfsh"))) {
@ -161,9 +162,15 @@ public class ExtInvoicePoolController extends AbstractController {
if (pramsMap.get("qsyf") == null && "".equals(pramsMap.get("qsyf")) && !"1".equals(pramsMap.get("qszt"))) {
pramsMap.put("qsyf", "");
}
if (pramsMap.get("accountPeriod") != null && !"".equals(pramsMap.get("accountPeriod"))) {
String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
int curr = (int)pramsMap.get("curr");
int size = (int)pramsMap.get("size");
try {
log.info("其他发票采集接收参数 {}" ,pramsMap);
return ResponseEntity.ok(R.ok().put("data", extInvoicePoolService.listOther(pramsMap, curr, size)));
} catch (Exception e) {
e.printStackTrace();

@ -142,6 +142,14 @@ public class JkszhcxRespVO {
*/
private String customsScanId;
private String postingTime;
private String imageId;
private String accountPeriod;
private String snVoucherNumber;
private String payerOneTaxno;
private String payerOneName;
private String payerTwoTaxno;

@ -53,6 +53,7 @@ public class TicketServiceImpl extends MpBaseServiceImpl<ExtTicketDao, ExtTicket
String hjsl = "0";
String hjje = "0";
String hjse = "0";
log.info("查询实名客票总数参数 {}",paramsMap);
List<ExtTicketInvoiceModel> hjList = super.baseMapper.queryTotal(paramsMap);
ExtTicketInvoiceModel hjxx = hjList.get(0);
hjsl = hjxx.getId();
@ -65,6 +66,7 @@ public class TicketServiceImpl extends MpBaseServiceImpl<ExtTicketDao, ExtTicket
json.put("hjse", hjse);
}
PageHelper.startPage(curr, size);
log.info("查询实名客票参数 {}",paramsMap);
List<ExtTicketInvoiceModel> pageList = super.baseMapper.queryTickets(paramsMap);
PageInfo<ExtTicketInvoiceModel> pageInfo = new PageInfo<>(pageList);
// 用于页面返回list对象

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import com.dxhy.extend.entity.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -22,6 +23,7 @@ import com.github.pagehelper.PageInfo;
/**
* @author dxhy
*/
@Slf4j
@SuppressWarnings({"AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"})
@Service
public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolDao, ExtAddTaxInvoice>
@ -229,7 +231,9 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
json.put("hjse", hjse);
}
PageHelper.startPage(curr, size);
log.info("开始进行分页查询");
List<ExtOtherInvoice> pageList = super.baseMapper.listOtherInvoice(pramsMap);
log.info("查询结果为 {}",pageList);
PageInfo<ExtOtherInvoice> pageInfo = new PageInfo<>(pageList);
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {

@ -49,7 +49,7 @@
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.voucher_number,t.document_number,t.in_account_date,rzh_type,rzlx,t.create_date,
data_sources
data_sources,t.image_id,t.posting_time,t.account_period
from t_dx_customs_record t
where export_mark = '0' and t.gf_tax_no in
<foreach close=")" collection="gfsh" index="index" item="item" open="(" separator=",">
@ -137,12 +137,12 @@
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
<if test="postingTimeStart != null and postingTimeEnd != null and postingTimeStart != '' and postingTimeEnd != ''">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>

@ -170,8 +170,8 @@
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}

@ -62,18 +62,19 @@
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
<if test="rzzt != null and rzzt != '' and rzzt != 'null' ">
<if test="rzzt != null and rzzt != '' and rzzt != 'null' and rzzt != '3'">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="rzzt != null and rzzt == '3'">
and (t.rzh_yesorno = '2' OR t.rzh_yesorno = '3')
</if>
<if test="xfmc != null and xfmc != '' and xfmc != 'null' ">
and t.xf_name like CONCAT(#{xfmc},'%')
</if>
<if
test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<if
test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
<if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
</if>
<if test="businessCode==''">

@ -160,6 +160,7 @@
DATE_FORMAT(t.payment_date,'%Y-%m') inAccountMonth,
t.payment_status inAccountStatus,
t.voucher_number voucherNo,
t.posting_time postingTime,
t.amortize_status amortizeStatus,
t.amortize_amount amortizeAmount,
t.remain_amortize_amount remainAmortizeAmount,
@ -169,6 +170,8 @@
t.scan_id scanId,
t.remark,
t.document_number documentNumber,
t.image_id imageId,
t.account_period accountPeriod,
DATE_FORMAT(t.collect_date,'%Y-%m-%d') collectDate,
t.collect_from collectFrom
from t_dx_record_invoice t
@ -188,12 +191,10 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
<if
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
<if test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
@ -223,26 +224,27 @@
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
and t.qs_type = #{qsfs}
</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 t.payment_status = #{inAccountStatus}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<if
test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
<if test="inAccountMonth != null and inAccountMonth != null and inAccountMonth != '' and inAccountMonth != ''">
and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth}
</if>
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
and t.invoice_source = #{invoiceSource}
</if>
<if test="snVoucherNumber !=null and snVoucherNumber !='' and snVoucherNumber !='99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
</select>
<!--其他发票汇总-->
<select id="selectOtherHj" parameterType="java.util.Map"
@ -321,8 +323,7 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '999' ">
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '999' ">
AND invoice_type = #{invoiceType}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' and qszt != '99'">
@ -337,17 +338,29 @@
<if test="qsfs != null and qsfs != '' and qsfs != 'null' and qsfs != '99'">
AND qs_type = #{qsfs}
</if>
<!-- <if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">-->
<!-- and t.sn_voucher_number = #{snVoucherNumber}-->
<!-- </if>-->
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
and sn_voucher_number = #{snVoucherNumber}
</if>
<!-- <if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">-->
<!-- and t.posting_time = #{postingTime}-->
<!-- </if>-->
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<!-- <if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">-->
<!-- and t.image_id = #{imageId}-->
<!-- </if>-->
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and image_id = #{imageNumber}
</if>
<!-- <if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">-->
<!-- and t.account_period = #{accountPeriod}-->
<!-- </if>-->
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
and account_period = #{accountPeriod}
</if>
GROUP BY uuid having min(create_date)
ORDER BY create_date DESC

@ -74,12 +74,10 @@
select *
from t_dx_invoice_reimburse t
where 1=1
<if
test="kpksrq != null and kpksrq != '' and kpksrq != 'null' and kpjsrq != null and kpjsrq != '' and kpjsrq != 'null'">
<if test="kpksrq != null and kpksrq != '' and kpksrq != 'null' and kpjsrq != null and kpjsrq != '' and kpjsrq != 'null'">
and t.invoice_date between #{kpksrq} and #{kpjsrq}
</if>
<if
test="cjksyf != null and cjksyf != '' and cjksyf != 'null' and cjjsyf != null and cjjsyf != '' and cjjsyf != 'null'">
<if test="cjksyf != null and cjksyf != '' and cjksyf != 'null' and cjjsyf != null and cjjsyf != '' and cjjsyf != 'null'">
and t.create_date between #{cjksyf} and #{cjjsyf}
</if>
<if test="keyWord != null and keyWord != '' and keyWord != 'null' ">
@ -117,11 +115,14 @@
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.posting_time = #{postingTime}
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
</select>
</mapper>

@ -278,8 +278,13 @@ public class SignFpqsController extends AbstractController {
}
}
String invoiceType = pramsMap.get("invoiceType");
String invoiceCode = pramsMap.get("invoiceCode");
String invoiceNo = pramsMap.get("invoiceNo");
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){
pramsMap.put("invoiceType", invoiceType);
}else if("99".equals(invoiceType) && invoiceNo.length() == 20){
invoiceType = "31";
pramsMap.put("invoiceType", invoiceType);
}else {
InvoiceUtil iu = new InvoiceUtil(pramsMap.get("invoiceCode"));
pramsMap.put("invoiceType", iu.getFplxdm());
@ -650,7 +655,7 @@ public class SignFpqsController extends AbstractController {
int size = (int)pramsMap.get("size");
try {
log.info("签收列表查询参数 {}",data);
log.info("返回结果为 {}",signFpqsService.selectDelfpList(data,curr,size));
log.info("返回结果为 {}",signFpqsService.selectQsfpList(data,curr,size));
return ResponseEntity.ok(R.ok().put("data", signFpqsService.selectQsfpList(data, curr, size)));
} catch (Exception e) {
e.printStackTrace();

@ -92,7 +92,7 @@ public class FpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao, TDx
// 1、基础信息校验
String note ="";
String uuid ="";
if(pramsMap.get("invoiceCode") != null) {
if(pramsMap.get("invoiceCode") != null && StringUtils.isNotBlank(pramsMap.get("invoiceCode"))) {
uuid = pramsMap.get("invoiceCode") + pramsMap.get("invoiceNo");
}else{
uuid = pramsMap.get("invoiceNo");

@ -1625,10 +1625,13 @@ public class SignFpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao,
}
PageHelper.startPage(curr, size);
log.info("启动分页插件");
List<TDxInvoice> pageList = new ArrayList<>();
if (pramsMap.get("gxStatus") != null && !"".equals(pramsMap.get("gxStatus"))) {
log.info("gxStatus不为空直接进行查询");
pageList = signInvoiceDao.selectQsfpListJrtt(pramsMap);
} else {
log.info("进入到signInvoiceMapper查询");
pageList = signInvoiceSmService.selectQsfpList(pramsMap);
}
log.info("pageList {}",pageList);
@ -1651,6 +1654,7 @@ public class SignFpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao,
if (curr == 1) {
QsInvoiceCount selectQsfpListCount = null;
if (pramsMap.get("gxStatus") != null && !"".equals(pramsMap.get("gxStatus"))) {
log.info("");
selectQsfpListCount = signInvoiceDao.selectQsfpListCountJrtt(pramsMap);
} else {
selectQsfpListCount = signInvoiceSmService.selectQsfpListCount(pramsMap);

@ -32,7 +32,7 @@
<select id="selectQsfpList" parameterType="java.util.Map"
resultMap="BaseResultMap" databaseId="mysql">
SELECT
r.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount,
t.voucher_number,img.image_path
FROM t_dx_invoice t
@ -50,11 +50,14 @@
and t.invoice_type = #{invoiceType}
</if>
-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') )
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'
<!-- <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">-->
<!-- and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') )-->
<!-- </if>-->
<!-- <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">-->
<!-- and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'-->
<!-- </if>-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
and r.invoice_type = #{invoiceType}
</if>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
@ -115,17 +118,18 @@
<if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
and t.gf_tax_no = #{gfsh}
</if>
<!--
<!-- <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">-->
<!-- and t.invoice_type = #{invoiceType}-->
<!-- </if>-->
<!-- <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">-->
<!-- and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') )-->
<!-- </if>-->
<!-- <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">-->
<!-- and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'-->
<!-- </if>-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
and t.invoice_type = #{invoiceType}
</if>
-->
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') )
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'
</if>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>

Loading…
Cancel
Save