Merge remote-tracking branch 'sdny/test' into test

# Conflicts:
#	dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
release
zhenghaiyang@ele-cloud.com 2 years ago
commit 8abacc302c
  1. 92
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java
  2. 49
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  3. 3
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  4. 22
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  5. 54
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  6. 9
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/RzFpxxServiceImpl.java
  7. 81
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java

@ -75,18 +75,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
@Override
public PageUtils queryPage(Map<String, Object> params) {
DynamicContextHolder.push(DbConstant.BASICS_READ);
String username = (String)params.get("username");
String company = (String)params.get("company");
String deptId = (String)params.get("deptId");
String taxno = (String)params.get("taxno");
Integer userType = (Integer)params.get("userType");
String username = (String) params.get("username");
String company = (String) params.get("company");
String deptId = (String) params.get("deptId");
String taxno = (String) params.get("taxno");
Integer userType = (Integer) params.get("userType");
IPage<SysUserEntity> page = this.page(new Query<SysUserEntity>().getPage(params),
new QueryWrapper<SysUserEntity>().like(StringUtils.isNotBlank(username), "username", username)
.eq(StringUtils.isNotBlank(deptId), "dept_id", deptId)
.eq(StringUtils.isNotBlank(company), "company", company)
.eq(StringUtils.isNotBlank(taxno), "taxno", taxno)
.eq(StringUtils.isNotBlank(taxno), "user_type", userType)
.apply(params.get(Constant.SQL_FILTER) != null, (String)params.get(Constant.SQL_FILTER)));
new QueryWrapper<SysUserEntity>().like(StringUtils.isNotBlank(username), "username", username)
.eq(StringUtils.isNotBlank(deptId), "dept_id", deptId)
.eq(StringUtils.isNotBlank(company), "company", company)
.eq(StringUtils.isNotBlank(taxno), "taxno", taxno)
.eq(StringUtils.isNotBlank(taxno), "user_type", userType)
.apply(params.get(Constant.SQL_FILTER) != null, (String) params.get(Constant.SQL_FILTER)));
List<SysUserEntity> records = page.getRecords();
if (records != null && records.size() > 0) {
@ -285,11 +285,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
}
//获取组织编码
List<SysCompanyEntity> companyEntitys = sysUserOrgService.getOrgsByUserId(userEntity.getUserId());
if (companyEntitys != null && companyEntitys.size() > 0){
if (companyEntitys != null && companyEntitys.size() > 0) {
for (SysCompanyEntity companyEntity : companyEntitys) {
if (companyEntity != null) {
if (StringHelper.isNotBlank(companyEntity.getCompanyCode()) && StringHelper.isNotBlank(companyEntity.getCompanyName())){
String companyName ="("+companyEntity.getCompanyCode()+")"+companyEntity.getCompanyName();
if (StringHelper.isNotBlank(companyEntity.getCompanyCode()) && StringHelper.isNotBlank(companyEntity.getCompanyName())) {
String companyName = "(" + companyEntity.getCompanyCode() + ")" + companyEntity.getCompanyName();
companyEntity.setCompanyName(companyName);
}
}
@ -357,8 +357,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 菜单路由转换
*
* @param childPerms
* 树状菜单信息
* @param childPerms 树状菜单信息
* @return 转换后路由信息
*/
private List<RouterVo> toRouter(List<SysMenuEntity> childPerms) {
@ -397,7 +396,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
router.setComponent(sysMenuEntity.getComponent());
router.setPath(sysMenuEntity.getUrl());
router.setMeta(new MetaVo(sysMenuEntity.getName(), sysMenuEntity.getIcon(), null,
sysMenuEntity.isNoCache(), null));
sysMenuEntity.isNoCache(), null));
router.setName(StringUtils.capitalize(sysMenuEntity.getUrl().replaceAll("/", "")));
router.setMenuId(String.valueOf(sysMenuEntity.getMenuId()));
childrenList.add(router);
@ -454,7 +453,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
}
private void toDeptOrgCode(User user, List<TaxOrgCode> orgCodeList, List<SysDeptEntity> queryDept) {
log.info("查询到的企业列表为:{}",queryDept);
log.info("查询到的企业列表为:{}", queryDept);
String qsStatus = "0";
String productType = "0";
if (queryDept.size() > 0) {
@ -470,7 +469,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
orgCodeList.addAll(oldTaxOrgCode);
qsStatus = queryDept.get(0).getQsStatus();
productType = queryDept.get(0).getProductType();
log.info("orgCodeList:{}",orgCodeList);
log.info("orgCodeList:{}", orgCodeList);
user.setOrgCodes(orgCodeList);
user.setQsStatus(qsStatus);
user.setProductType(productType);
@ -479,12 +478,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
private TaxOrgCode toTaxOrgCode(SysDeptEntity sysDeptEntity) {
TaxOrgCode orgCode = new TaxOrgCode();
orgCode.setTaxno(sysDeptEntity.getTaxno());
orgCode.setTaxname(sysDeptEntity.getTaxname());
orgCode.setOrgCode(sysDeptEntity.getOrgCode());
orgCode.setCompany(sysDeptEntity.getCompany());
orgCode.setAreaCode(sysDeptEntity.getAreaCode());
orgCode.setIsPassword(sysDeptEntity.getIsPassword());
if (StringUtils.isNotEmpty(sysDeptEntity.getTaxno())) {
orgCode.setTaxno(sysDeptEntity.getTaxno());
orgCode.setTaxname(sysDeptEntity.getTaxname());
orgCode.setOrgCode(sysDeptEntity.getOrgCode());
orgCode.setCompany(sysDeptEntity.getCompany());
orgCode.setAreaCode(sysDeptEntity.getAreaCode());
orgCode.setIsPassword(sysDeptEntity.getIsPassword());
}
return orgCode;
}
@ -562,7 +563,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
public void uploadUser(SysUserEntity user) {
if (SysConfig.ITAX_SWITCH.equals(AdminConfig.itaxSwitch)
&& SysConfig.UserType.USET_TYPE_2.getCode().equals(user.getUserType())) {
&& SysConfig.UserType.USET_TYPE_2.getCode().equals(user.getUserType())) {
// 获取部门信息
SysDeptEntity sysDeptEntity = sysDeptService.getById(user.getDeptId());
Map<String, Object> map = new HashMap<>(9);
@ -607,9 +608,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
for (SysUserEntity sysUserEntity : userList) {
// 保存用户信息到redis
redisUtils.set(RedisConstant.KEY_USER_MENU + sysUserEntity.getLoginname(),
this.getUserInfo(sysUserEntity), -1);
this.getUserInfo(sysUserEntity), -1);
redisUtils.set(RedisConstant.KEY_USER_TOKEN + sysUserEntity.getLoginname(),
loginService.infoListRedis(sysUserEntity.getLoginname()), RedisUtils.NOT_EXPIRE);
loginService.infoListRedis(sysUserEntity.getLoginname()), RedisUtils.NOT_EXPIRE);
}
}
// 刷新显示列表缓存、只刷新中心企业
@ -649,8 +650,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 构建前端路由所需要的菜单
*
* @param menus
* 菜单列表
* @param menus 菜单列表
* @return 路由列表
*/
public List<RouterVo> buildMenus(List<SysMenuEntity> menus) {
@ -700,8 +700,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 构建前端路由所需要的菜单
*
* @param menus
* 菜单列表
* @param menus 菜单列表
* @return 路由列表
*/
public List<RouterVo> buildMenusSystem(List<SysMenuEntity> menus) {
@ -754,8 +753,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 转换按钮信息
*
* @param sysMenuEntity
* 菜单信息
* @param sysMenuEntity 菜单信息
* @return 按钮信息
*/
public ButtonQueryVo toButtonQuery(SysMenuEntity sysMenuEntity) {
@ -782,10 +780,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 根据父节点的ID获取所有子节点
*
* @param list
* 分类表
* @param parentId
* 传入的父节点ID
* @param list 分类表
* @param parentId 传入的父节点ID
* @return String
*/
@Override
@ -812,10 +808,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 递归列表
*
* @param list
* 菜单列
* @param t
* 菜单信息
* @param list 菜单列
* @param t 菜单信息
*/
private void recursionFn(List<SysMenuEntity> list, SysMenuEntity t) {
// 得到子节点列表
@ -854,8 +848,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 是否为系统信息
*
* @param menu
* 菜单信息
* @param menu 菜单信息
* @return 结果
*/
public boolean isMeunFrame(SysMenuEntity menu) {
@ -865,8 +858,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 菜单信息
*
* @param menuEntities
* 菜单信息
* @param menuEntities 菜单信息
* @return 菜单信息
*/
public Map<String, SysMenuEntity> toMenuList(List<SysMenuEntity> menuEntities) {
@ -874,20 +866,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
if (menuEntities.size() > 0) {
for (SysMenuEntity sysMenuEntity : menuEntities) {
if (0 == sysMenuEntity.getType()
&& (sysMenuEntity.getChildren() != null && sysMenuEntity.getChildren().size() > 0)) {
&& (sysMenuEntity.getChildren() != null && sysMenuEntity.getChildren().size() > 0)) {
List<SysMenuEntity> childrenDirList = sysMenuEntity.getChildren();
if (childrenDirList.size() > 0) {
for (SysMenuEntity childrenDir : childrenDirList) {
List<SysMenuEntity> childrenMenuList = childrenDir.getChildren();
if (1 == childrenDir.getType()
&& (childrenMenuList != null && childrenMenuList.size() > 0)) {
&& (childrenMenuList != null && childrenMenuList.size() > 0)) {
for (SysMenuEntity childrenMenu : childrenMenuList) {
if (2 == childrenMenu.getType()) {
ButtonQueryVo buttonQueryVo = this.toButtonQuery(childrenMenu);
childrenMenu.setMeta(
new MetaVo(childrenMenu.getName(), "", buttonQueryVo.getButtonVos(),
childrenMenu.isNoCache(), buttonQueryVo.getQueryVos()));
new MetaVo(childrenMenu.getName(), "", buttonQueryVo.getButtonVos(),
childrenMenu.isNoCache(), buttonQueryVo.getQueryVos()));
map.put(childrenMenu.getUrl().replaceAll("/", ""), childrenMenu);
}

@ -141,6 +141,9 @@ public class BaseInvoiceController extends AbstractController {
String businessCode = (String)map.get("businessCode");
String qsr = (String)map.get("qsr");
String rzhr = (String)map.get("rzhr");
String sortPzbh = String.valueOf(map.get("sortPzbh"));
String sortBzdh = String.valueOf(map.get("sortBzdh"));
String sortKprq = String.valueOf(map.get("sortKprq"));
String taxRate = String.valueOf(map.get("taxRate"));
log.info("taxRate={}",taxRate);
String inAccountStatus = (String)map.get("inAccountStatus");
@ -169,6 +172,9 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("company", map.get("company"));
pramsMap.put("menuId", map.get("menuId"));
pramsMap.put("sortPzbh",sortPzbh);
pramsMap.put("sortBzdh",sortBzdh);
pramsMap.put("sortKprq",sortKprq);
pramsMap.put("xfmc", xfmc);
pramsMap.put("qsr", qsr);
if (StringUtils.isNotBlank(rzhr)) {
@ -198,23 +204,6 @@ public class BaseInvoiceController extends AbstractController {
if (!StringUtils.isNotBlank(gfsh)){
pramsMap.put("sign","88");
}
//所属组织
// List<String> companyCodeList = new ArrayList<>();
// if (StringUtils.isNotBlank(companyCode)){
// companyCodeList.add(companyCode);
// }else {
// companyCodeList = getUserInfo().getCompanyCodes();
// }
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
}
//判断购方税号
List<String> gfshList = new ArrayList<>();
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
gfshList.add(gfsh);
@ -230,7 +219,20 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
//所属组织
// List<String> companyCodeList = new ArrayList<>();
// if (StringUtils.isNotBlank(companyCode)){
// companyCodeList.add(companyCode);
// }else {
// companyCodeList = getUserInfo().getCompanyCodes();
// }
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
}
if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)){
// List<String> rates = new ArrayList<>();
@ -517,10 +519,6 @@ public class BaseInvoiceController extends AbstractController {
String suspendDate = (String) map.get("suspendDate");
String bzr = (String) map.get("bzr");
String taxRate = String.valueOf(map.get("taxRate"));
String sortPzbh = String.valueOf(map.get("sortPzbh"));
String sortBzdh = String.valueOf(map.get("sortBzdh"));
String sortKprq = String.valueOf(map.get("sortKprq"));
if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){
suspendDate = suspendDate.substring(0,7);
}
@ -562,10 +560,6 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("imageNumber", map.get("imageNumber"));
pramsMap.put("suspendStatus",suspendStatus);
pramsMap.put("suspendDate",suspendDate);
pramsMap.put("sortPzbh",sortPzbh);
pramsMap.put("sortBzdh",sortBzdh);
pramsMap.put("sortKprq",sortKprq);
pramsMap.put("bzr",bzr);
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
@ -620,13 +614,10 @@ public class BaseInvoiceController extends AbstractController {
log.info("手工认证有税号");
} else {
gfshList = getGfshList(gfshList,companyCodes);
log.info("手工认证无税号{}",gfshList);
}
pramsMap.put("gfsh", gfshList);
if (!StringUtils.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
pramsMap.put("invoiceType", invoiceType);

@ -126,8 +126,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
log.info("查询合计耗时:{}", System.currentTimeMillis() - enter);
PageHelper.startPage(curr, size);
// pramsMap.put("curr",(curr -1) * size);
// pramsMap.put("size", size);
long start1 = System.currentTimeMillis();
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectSggxcx(pramsMap);
log.info("手工认证 查询列表信息耗时:{}", System.currentTimeMillis() - start1);

@ -74,7 +74,7 @@
voucher_number,t.ele_invoice_no, sn_voucher_number, account_period, posting_time ,image_id,t.tax_rate
from t_dx_record_invoice t
WHERE t.invoice_date 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')
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status in ('2','3','4')
@ -241,6 +241,24 @@
<if test="taxRate=='多税率'">
and t.tax_rate like '%,%'
</if>
<if test="sortPzbh == 1">
order by t.sn_voucher_number
</if>
<if test="sortPzbh == 2">
order by t.sn_voucher_number desc
</if>
<if test="sortBzdh == 1">
order by t.bzdh
</if>
<if test="sortBzdh == 2">
order by t.bzdh desc
</if>
<if test="sortKprq == 1">
order by t.invoice_date
</if>
<if test="sortKprq == 2">
order by t.invoice_date desc
</if>
</select>
<!-- order by t.rzh_date desc,t.invoice_date desc-->
<select id="selectByPramsMap" parameterType="java.util.Map"
@ -360,7 +378,7 @@
select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse
from t_dx_record_invoice t
WHERE t.invoice_date 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')
and t.auth_status in ('2','3','4')
and t.bdk_status in ('1','2')
and t.export_mark = '0'

@ -73,7 +73,7 @@
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 t.invoice_date 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')
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
@ -226,7 +226,30 @@
<!-- <if test="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''">-->
<!-- order by t.invoice_date desc-->
<!-- </if>-->
order by t.bzdh desc
<if test="taxRate!=null and taxRate!='' and taxRate!='多税率' and taxRate != null and taxRate !='99'">
and t.tax_rate = #{taxRate}
</if>
<if test="taxRate=='多税率'">
and t.tax_rate like '%,%'
</if>
<if test="sortPzbh == 1">
order by t.sn_voucher_number
</if>
<if test="sortPzbh == 2">
order by t.sn_voucher_number desc
</if>
<if test="sortBzdh == 1">
order by t.bzdh
</if>
<if test="sortBzdh == 2">
order by t.bzdh desc
</if>
<if test="sortKprq == 1">
order by t.invoice_date
</if>
<if test="sortKprq == 2">
order by t.invoice_date desc
</if>
</select>
<select id="selectDksh" parameterType="java.util.Map"
resultType="com.dxhy.base.entity.BaseTDxDkCount"
@ -400,7 +423,7 @@
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 t.invoice_date 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')
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
@ -556,31 +579,6 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<if test="sortPzbh == '1'">
order by t.sn_voucher_number desc
</if>
<if test="sortPzbh == '2'">
order by t.sn_voucher_number
</if>
<if test="sortBzdh == '1'">
order by t.bzdh desc
</if>
<if test="sortBzdh == '2'">
order by t.bzdh
</if>
<if test="sortKprq == '1'">
order by t.invoice_date desc
</if>
<if test="sortKprq == '2'">
order by t.invoice_date
</if>
<if test="taxRate!=null and taxRate!='' and taxRate!='多税率' and taxRate != null and taxRate !='99'">
and t.tax_rate = #{taxRate}
</if>
<if test="taxRate=='多税率'">
and t.tax_rate like '%,%'
</if>
order by t.bzdh desc
</select>
<select id="selectHj" parameterType="java.util.Map"

@ -7,6 +7,7 @@ import java.util.Map;
import javax.annotation.Resource;
import com.dxhy.common.util.AmountFormatUtil;
import com.dxhy.core.service.export.PoolPaperService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -82,7 +83,13 @@ public class RzFpxxServiceImpl extends MpBaseServiceImpl<FpxxZhDao, FpRzRespVO>
dataArray[7] = pageList.get(i).getXfName();
dataArray[8] = pageList.get(i).getInvoiceAmount();
dataArray[9] = pageList.get(i).getTaxAmount();
dataArray[10] = pageList.get(i).getDkTaxAmount();
if (pageList.get(i).getDkTaxAmount() != null) {
dataArray[10] = AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getDkTaxAmount()));
} else {
dataArray[10] = AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount()));
}
dataArray[11] = dictdetaServcice.queryDictName(DictConstant.QS_STATUS, pageList.get(i).getQsStatus());
dataArray[12] = pageList.get(i).getQsDate();
dataArray[13] = dictdetaServcice.queryDictName(DictConstant.QS_TYPE, pageList.get(i).getQsType());

@ -4,9 +4,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum;
@ -42,7 +40,6 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 与山东能源交互数据主类
@ -91,18 +88,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private TDxInvoiceReimburseDao invoiceReimburseDao;
@Resource
private TdxRecordInvoiceDao tdxRecordInvoiceDao;
@Resource
private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao;
@Resource
private TDxInvoiceReimburseService tDxInvoiceReimburseService;
@Resource
private BaseTDxRecordInvoiceDetailDao baseTDxRecordInvoiceDetailDao;
@Resource
private SysDeptDao sysDeptDao;
@ -279,50 +270,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return queryInvoiceResult;
}
public String getRecords(Map<String, Object> pramsMap) {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
QueryWrapper<TdxRecordInvoice> recordWrapper = new QueryWrapper<>();
List<String> uuids = tdxRecordInvoiceDao.selectRecords(pramsMap);
log.info("获取的uuid为{}",uuids);
for (String uuid: uuids) {
boolean flag = false;
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>();
detailWrapper.eq("uuid", uuid);
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ);
List<BaseTDxRecordInvoiceDetail> details = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
log.info("获取到的明细为:{}",details);
String taxRate = "";
for(BaseTDxRecordInvoiceDetail detail : details){
//获取明细信息 更新主表税率
if(StringUtils.isNotEmpty(detail.getTaxRate())){
if(flag){
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + "," + detail.getTaxRate();
}
}else{
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + detail.getTaxRate();
}
flag = true;
}
}
}
log.info("获取的数据明细taxRate为={}",taxRate);
if(StringUtils.isNotEmpty(taxRate)) {
Map<String, String> updateParam = new HashMap<>();
updateParam.put("taxRate", taxRate);
updateParam.put("uuid", uuid);
tdxRecordInvoiceDao.updateTaxRate(updateParam);
}
}
return "ok";
}
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception {
//1.封装查验参数
@ -512,20 +459,18 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
jsonObject.put("tonnage", invoiceData.get("dw"));
jsonObject.put("limitPeople", invoiceData.get("xcrs"));
String taxRate = "";
if (invoiceData.get("sl") == null || StringUtils.isBlank(invoiceData.get("sl").toString()) ||
"免税".equals(invoiceData.get("sl").toString()) || "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) {
if (StringUtils.isBlank(invoiceData.get("sl").toString()) || "免税".equals(invoiceData.get("sl").toString()) || "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) {
taxRate = "0";
jsonObject.put("taxRate", taxRate);
} else {
if (invoiceData.get("sl") != null && StringUtils.isNoneBlank(invoiceData.get("sl").toString())) {
if (StringUtils.isNoneBlank(invoiceData.get("sl").toString())) {
taxRate = invoiceData.get("sl").toString();
if (!"0".equals(taxRate)) {
taxRate = "0." + taxRate;
taxRate = taxRate.substring(0, taxRate.length() - 1);
}
if ("11".equals(invoiceType)) {
taxRate = "0.000";
taxRate = "0";
}
log.info("明细-发票税率为:{}", taxRate);
jsonObject.put("taxRate", taxRate);
@ -610,13 +555,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
taxRateDetail = "0";
snDetailMap.put("taxRate", taxRateDetail);
} else {
if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) {
if (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);
// if (index > 0) {
// taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
// Float num = Float.parseFloat(taxRateDetail);
// if (num > 9) {
// taxRateDetail = "0." + taxRateDetail;
@ -625,7 +570,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
// taxRateDetail = "0.0" + taxRateDetail;
// }
// }
}
// }
}
}
@ -1255,23 +1200,23 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (invoiceInfo == null) {
result = "发票信息不可为空";
}
if (invoiceInfo.getInvoiceTypeCode() == null || "".equals(invoiceInfo.getInvoiceTypeCode())) {
if (StringUtils.isNotEmpty(invoiceInfo.getInvoiceTypeCode())) {
result = "发票类型不可为空";
}
if (invoiceInfo.getInvoiceDate() == null || "".equals(invoiceInfo.getInvoiceDate())) {
if (StringUtils.isNotEmpty(invoiceInfo.getInvoiceDate().toString())) {
result = "开票日期不可为空";
}
if (!CommonEnum.INV_ZZS_ELE_PP.equals(invoiceInfo.getInvoiceTypeCode()) && !CommonEnum.INV_ZZS_ELE_TXF.equals(invoiceInfo.getInvoiceTypeCode())) {
if (invoiceInfo.getIdentityNumber() == null || "".equals(invoiceInfo.getIdentityNumber())) {
if (StringUtils.isNotEmpty(invoiceInfo.getIdentityNumber())) {
result = "用户证件号不可为空";
}
if (invoiceInfo.getPassenger() == null || "".equals(invoiceInfo.getPassenger())) {
if (StringUtils.isNotEmpty(invoiceInfo.getPassenger())) {
result = "乘车人不可为空";
}
if (invoiceInfo.getDepartCity() == null || invoiceInfo.getDepartCity().isEmpty()) {
if (StringUtils.isNotEmpty(invoiceInfo.getDepartCity())) {
result = "出发城市不可为空";
}
if (invoiceInfo.getArriveCity() == null || invoiceInfo.getArriveCity().isEmpty()) {
if (StringUtils.isNotEmpty(invoiceInfo.getArriveCity())) {
result = "到达城市不可为空";
}
}

Loading…
Cancel
Save