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

release
yefei 2 years ago
commit 1de63cb79b
  1. 32
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java
  2. 67
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  3. 111
      dxhy-base/src/main/java/com/dxhy/base/dao/SysDeptAuthDao.java
  4. 109
      dxhy-base/src/main/java/com/dxhy/base/entity/SysDeptEntity.java
  5. 6
      dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java
  6. 2
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckService.java
  7. 78
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  8. 2
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseFpdrrzServiceImpl.java
  9. 26
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  10. 44
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  11. 97
      dxhy-base/src/main/resources/mapper/SysDeptAuthDao.xml
  12. 1
      dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java
  13. 4
      dxhy-core/src/main/java/com/dxhy/core/controller/FtpDownloadController.java
  14. 9
      dxhy-core/src/main/java/com/dxhy/core/service/export/impl/RzFpxxServiceImpl.java
  15. 19
      dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java
  16. 25
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  17. 73
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  18. 4
      dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java
  19. 167
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  20. 23
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java
  21. 2
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java
  22. 12
      dxhy-erp/src/main/resources/mapper/TdxRecordInvoiceDao.xml
  23. 3
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtFpmxcxServiceImpl.java
  24. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtFpzhcxServiceImpl.java
  25. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtRzrbcxServiceImpl.java
  26. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtYcfpcxServiceImpl.java
  27. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java
  28. 8
      dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java
  29. 86
      dxhy-sign/src/main/java/com/dxhy/sign/dao/SysDeptDao.java
  30. 31
      dxhy-sign/src/main/java/com/dxhy/sign/entity/SysDeptEntity.java
  31. 97
      dxhy-sign/src/main/resources/mapper/SysDeptDao.xml

@ -357,8 +357,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
/**
* 菜单路由转换
*
* @param childPerms
* 树状菜单信息
* @param childPerms 树状菜单信息
* @return 转换后路由信息
*/
private List<RouterVo> toRouter(List<SysMenuEntity> childPerms) {
@ -479,12 +478,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
private TaxOrgCode toTaxOrgCode(SysDeptEntity sysDeptEntity) {
TaxOrgCode orgCode = new TaxOrgCode();
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;
}
@ -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) {

@ -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,15 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("company", map.get("company"));
pramsMap.put("menuId", map.get("menuId"));
// if(StringUtils.isNotEmpty(sortPzbh)) {
// pramsMap.put("sortPzbh", sortPzbh);
// }
// if(StringUtils.isNotEmpty(sortBzdh)) {
// pramsMap.put("sortBzdh", sortBzdh);
// }
// if(StringUtils.isNotEmpty(sortKprq)) {
// pramsMap.put("sortKprq", sortKprq);
// }
pramsMap.put("xfmc", xfmc);
pramsMap.put("qsr", qsr);
if (StringUtils.isNotBlank(rzhr)) {
@ -202,7 +214,8 @@ public class BaseInvoiceController extends AbstractController {
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
gfshList.add(gfsh);
} else {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
// gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
gfshList = getGfshList(gfshList,getUserInfo().getCompanyCodes());
}
pramsMap.put("gfsh", gfshList);
@ -497,6 +510,9 @@ public class BaseInvoiceController extends AbstractController {
String qsksrq = (String)map.get("qsksrq");
String qsjsrq = (String)map.get("qsjsrq");
String xfmc = (String)map.get("xfmc");
String sortPzbh = String.valueOf(map.get("sortPzbh"));
String sortBzdh = String.valueOf(map.get("sortBzdh"));
String sortKprq = String.valueOf(map.get("sortKprq"));
String position = (String)map.get("position");
String fpzt = (String)map.get("invoiceStatus");
String sfkrz = (String)map.get("sfkrz");
@ -553,7 +569,20 @@ 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(StringUtils.isNotEmpty(sortPzbh)) {
pramsMap.put("sortPzbh", sortPzbh);
}
if(StringUtils.isNotEmpty(sortBzdh)) {
pramsMap.put("sortBzdh", sortBzdh);
}
if(StringUtils.isNotEmpty(sortKprq)) {
pramsMap.put("sortKprq", sortKprq);
}
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
@ -581,24 +610,6 @@ public class BaseInvoiceController extends AbstractController {
// rates = convertRates(taxRate,rates);
pramsMap.put("taxRate",taxRate);
}
List<String> gfshList = new ArrayList<>();
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
gfshList.add(gfsh);
log.info("手工认证有税号");
} else {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
log.info("手工认证无税号{}",UserInfoUtil.getGfshAll(getUserInfo().getOrg()));
}
pramsMap.put("gfsh", gfshList);
boolean flag = checkList(gfshList);
log.info("gfshList.size(){}",gfshList.size());
if (flag){
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
//所属组织
// List<String> companyCodeList = new ArrayList<>();
@ -608,8 +619,10 @@ public class BaseInvoiceController extends AbstractController {
// companyCodeList = getUserInfo().getCompanyCodes();
// log.info("获取到的组织信息{}",companyCodeList);
// }
List<String> companyCodes = getUserInfo().getCompanyCodes();
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
pramsMap.put("companyCodes",companyCodes);
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
@ -617,6 +630,15 @@ public class BaseInvoiceController extends AbstractController {
}
List<String> gfshList = new ArrayList<>();
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
gfshList.add(gfsh);
log.info("手工认证有税号");
} else {
gfshList = getGfshList(gfshList,companyCodes);
log.info("手工认证无税号{}",gfshList);
}
pramsMap.put("gfsh", gfshList);
if (!StringUtils.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
@ -709,6 +731,11 @@ public class BaseInvoiceController extends AbstractController {
}
private List<String> getGfshList(List<String> gfshList, List<String> companyCodes) {
gfshList = baseInvoiceManualCheckService.getGfshList(gfshList,companyCodes);
return gfshList;
}
private List<String> convertRates(String taxRate,List<String> rates) {
switch (taxRate) {
case "0":

@ -0,0 +1,111 @@
package com.dxhy.base.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.base.entity.SysDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 部门管理
*
* @author jiaohongyang
*/
@Mapper
public interface SysDeptAuthDao extends BaseMapper<SysDeptEntity> {
/**
* 根据集团编码查询税号
*
* @author 陈刚扬
* @date 2020/12/4
* @param company
* @param orgType
* @return java.util.List<com.dxhy.admin.sys.entity.SysDeptEntity>
*/
List<SysDeptEntity> selectDeptByCompany(@Param("company") String company, @Param("orgType") String orgType);
/**
* 根据集团编码查询部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryList(@Param("company") String company);
/**
* 根据集团编码查询用户关联部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryListUser(@Param("company") String company);
/**
* 根据集团编码查询上级部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryListParent(@Param("company") String company);
/**
* 查询子部门ID列表
*
* @param parentId
* 上级部门ID
* @return 部门信息
*/
List<Long> queryDetpIdList(@Param("parentId") Long parentId);
/**
* 根据上级ID查询部门信息
*
* @param parentId
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryDeptParentId(@Param("parentId") Long parentId);
/**
* 获取部门信息
*
* @return 部门信息
*/
List<SysDeptEntity> queryDeptList();
/**
* 根据集团编码修改部分信息
*
* @param company
* 集团编码
* @param isCollext
* 是否采集
* @param aceKey
* key
* @param aceId
* id
* @param dbName
* 数据库
* @param qsStatus
* 签收状态
*/
void updateDeptCompany(@Param("company") String company, @Param("isCollext") String isCollext,
@Param("aceKey") String aceKey, @Param("aceId") String aceId, @Param("dbName") String dbName,
@Param("qsStatus") String qsStatus);
List<String> getOrgCodeList(Long userId);
/**
* 查询id与税号对应list
*
* @return 部门信息
*/
List<SysDeptEntity> queryTaxnoList();
List<SysDeptEntity> queryParentIdList();
}

@ -0,0 +1,109 @@
package com.dxhy.base.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 部门管理
*
* @author jiaohongyang
*/
@Data
@TableName("sys_dept")
public class SysDeptEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门ID
*/
@TableId
private String deptId;
/**
* 上级部门ID一级部门为0
*/
private String parentId;
/**
* 部门名称
*/
private String name;
/**
* 上级部门名称
*/
@TableField(exist = false)
private String parentName;
private Integer orderNum;
private String taxno;
private String taxname;
private String linkman;
private String phone;
private String address;
private String bank;
private String account;
private String company;
private String orgType;
private String deptType;
private String upgradeStatus;
/**
* 是否查验 0-- 不查验 1---查验
*/
private String checkStatus;
/**
* 是否采集状态 0 -- 不采集 1--采集
*/
private String cjStatus;
/**
* 是否签收认证 0 -- 不签收认证 1 -- 签收认证
*/
private String qsStatus;
/**
* 所选数据库名称
*/
private String dbName;
/**
* 兼容大企业平台添加
*/
private String aceKey;
/**
* 兼容大企业平台添加
*/
private String aceId;
/**
* 是否采集全票面 0-- 不采集全票面 1--采集全票面
*/
private String isCollext;
/**
* 机构编码
*/
private String orgCode;
/**
* 地区编码
*/
private String areaCode;
/**
* 是否需要确认密码
*/
private String isPassword;
/**
* 确认密码
*/
private String password;
private Date updateTime;
private Date createTime;
private String autoRz;
private String productType;
@TableField(exist = false)
private List<SysDeptEntity> children;
}

@ -54,6 +54,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
@Override
public String selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
log.info("认证查询列表-传入的参数为:{}",pramsMap);
long enter = System.currentTimeMillis();
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
JSONObject json;
@ -99,6 +100,8 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
json.put("hjse", AmountFormatUtil.fmtMicrometer(hjse));
}
log.info("认证查询-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
List<String> gfshList1 = new ArrayList<>();
List<BaseTDxDkCount> curList = baseTDxRecordInvoiceDao.selectDksh(pramsMap);
log.info("认证查询列表-返回的所属期列表为:{}",curList);
@ -116,7 +119,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
}
PageHelper.startPage(curr, size);
List<BaseFpRzRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
log.info("认证查询列表-返回的发票列表为:{}",pageList);
log.info("认证查询-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
PageInfo<BaseFpRzRespVO> pageInfo = new PageInfo<>(pageList);
// 用于页面返回list对象
if (pageList.size() > 0) {
@ -213,6 +216,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
List<BaseFpRzRespVO> resultList = pageInfo.getList();
log.info("resultList {}",resultList);
json.put("datalist", resultList);
log.info("认证查询-合计耗时:{}",System.currentTimeMillis()-enter);
}
} catch (Exception e) {

@ -63,4 +63,6 @@ public interface BaseInvoiceManualCheckService extends MpBaseService<BaseTDxReco
String inTellingCheck(Map<String,Object> pramsMap);
List<String> getGfshList(List<String> gfshList,List<String> companyCode);
}

@ -9,12 +9,12 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.dxhy.base.dao.SysDeptAuthDao;
import com.dxhy.base.entity.SysDeptEntity;
import com.dxhy.common.constant.DictConstant;
import com.dxhy.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
@ -28,8 +28,6 @@ import com.dxhy.base.model.BaseBeforegxRespVO;
import com.dxhy.base.model.BaseSggxCxRespVO;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FpqsjgEnum;
import com.dxhy.common.enums.QsfsEnum;
import com.dxhy.common.service.DictdetaServcice;
import com.dxhy.common.service.TabulateRedisService;
import com.dxhy.common.service.impl.MpBaseServiceImpl;
@ -37,7 +35,6 @@ import com.dxhy.common.util.AmountFormatUtil;
import com.dxhy.common.util.MathUtil;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.vo.Business;
import com.dxhy.common.vo.DictdetaModel;
import com.dxhy.common.vo.Tax;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -46,8 +43,8 @@ import com.github.pagehelper.PageInfo;
* 手动勾选查询service实现类
*
* @author kangzq
* @date 2019年5月11日
* @version 1.0
* @date 2019年5月11日
*/
@SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"})
@Slf4j
@ -59,12 +56,15 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
@Resource
private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao;
@Resource
private SysDeptAuthDao sysDeptAuthDao;
@Resource
private DictdetaServcice dictdetaServcice;
@Resource
private TabulateRedisService tabulateRedisService;
@Override
public String selectByManualCheck(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
log.info("入参是:{}", pramsMap);
JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
@ -106,7 +106,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String hjsl = "0";
String hjje = "0";
String hjse = "0";
long start = System.currentTimeMillis();
List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectHj(pramsMap);
log.info("手工认证 查询统计信息耗时:{}", System.currentTimeMillis() - start);
BaseTDxRecordInvoice hjxx = hjList.get(0);
hjsl = hjxx.getSfygx();
if (!"0".equals(hjsl)) {
@ -123,12 +125,17 @@ 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);
PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList);
log.info("返回的列表为:{}", pageList);
log.info("查询耗时:{}", System.currentTimeMillis() - enter);
// 转化为页面展示对象
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (pageList.size() > 0) {
@ -275,12 +282,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
/**
* 根据businessCode获取对应名称用于页面显示
*
* @param businessCode
* 业务单元
* @param businessList
* 业务单元list
* @param businessCode 业务单元
* @param businessList 业务单元list
* @return 返回
*
*/
private String getBusinessName(String businessCode, List<Business> businessList) {
String businessName = "";
@ -488,7 +492,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
String hjsl = "0";
String hjje = "0";
String hjse = "0";
@ -577,6 +580,55 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
return super.responseResult(json);
}
@Override
public List<String> getGfshList(List<String> gfshList, List<String> companyCodes) {
DynamicContextHolder.push(DbConstant.BASICS_READ);
List<SysDeptEntity> taxnoList = sysDeptAuthDao.queryTaxnoList();
List<SysDeptEntity> parentIdList = sysDeptAuthDao.queryParentIdList();
Map<String, String> taxnoMap = taxnoList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, SysDeptEntity::getTaxno));
Map<String, String> parentIdMap = parentIdList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, e -> e.getParentId() == null ? "" : e.getParentId()));
log.info("taxnoMap={},parentIdMap={}", taxnoMap, parentIdMap);
String gfsh = "";
for (String companyCode : companyCodes) {
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq("org_code", companyCode);
List<SysDeptEntity> sysDeptEntityList = sysDeptAuthDao.selectList(wrapper);
SysDeptEntity sysDeptEntity = sysDeptEntityList.get(0);
if (sysDeptEntity != null) {
String dId = sysDeptEntity.getDeptId();
log.info("获取deptId为:{}", dId);
if (StringUtils.isNotEmpty(dId)) {
gfsh = getGfsh(dId, taxnoMap, parentIdMap);
if (StringUtils.isNotEmpty(gfsh))
gfshList.add(gfsh);
log.info("获取的税号为:{}", gfsh);
}
}
}
log.info("购方税号list为:{}", gfshList);
return gfshList;
}
private String getGfsh(String deptId, Map<String, String> taxnoMap, Map<String, String> parentIdMap) {
String taxno = "";
if (StringUtils.isNotEmpty(deptId)) {
log.info("deptId={}", deptId);
taxno = taxnoMap.get(deptId);
if (StringUtils.isEmpty(taxno)) {
deptId = parentIdMap.get(deptId);
log.info("获取map中的deptId:{}", deptId);
getGfsh(deptId, taxnoMap, parentIdMap);
}
}
return taxno;
}
public BaseSggxCxRespVO getBaseSggxCxRespVO(BaseTDxRecordInvoice baseTDxRecordInvoice, int count, List<String> taxnoList, List<Business> businessList) {
BaseSggxCxRespVO vo = new BaseSggxCxRespVO();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

@ -146,7 +146,7 @@ public class BaseFpdrrzServiceImpl extends MpBaseServiceImpl<BaseFpdrrzDao, Base
QueryWrapper<BaseTDxRecordInvoice> queryRecord = new QueryWrapper<>();
queryRecord.eq("uuid", uuid);
BaseTDxRecordInvoice rdxRecordInvoice = baseTDxRecordInvoiceDao.selectOne(queryRecord);
if (StringHelper.isNotBlank(rdxRecordInvoice.getDkTaxAmount().toPlainString())){
if (rdxRecordInvoice.getDkTaxAmount() != null && StringUtils.isNotBlank(rdxRecordInvoice.getDkTaxAmount().toPlainString())){
rzlb.setDkse(rdxRecordInvoice.getDkTaxAmount().toPlainString());
}
if (rdxRecordInvoice != null) {

@ -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,7 +241,27 @@
<if test="taxRate=='多税率'">
and t.tax_rate like '%,%'
</if>
order by t.invoice_date desc
<!-- <if test="sortPzbh == 1">-->
<!-- order by t.sn_voucher_number-->
<!-- </if>-->
<!-- <if test="sortPzbh == 2 or sortPzbh == 0">-->
<!-- order by t.sn_voucher_number desc-->
<!-- </if>-->
<!-- <if test="sortBzdh == 1">-->
<!-- order by t.bzdh-->
<!-- </if>-->
<!-- <if test="sortBzdh == 2 or sortBzdh == 0">-->
<!-- order by t.bzdh desc-->
<!-- </if>-->
<!-- <if test="sortKprq == 1">-->
<!-- order by t.invoice_date-->
<!-- </if>-->
<!-- <if test="sortKprq == 2 or sortKprq == 0">-->
<!-- 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"
resultMap="BaseResultMap" databaseId="oracle">
select
@ -257,7 +277,7 @@
,t.rzh_back_msg,t.in_account_status,t.payment_status,to_char(t.payment_date,'yyyy-mm-dd')payment_date
from t_dx_record_invoice t
WHERE to_char(t.invoice_date,'yyyy-mm-dd') between #{kpksrq} and #{kpjsrq}
and t.auth_status != '0'
and t.auth_status in ('2','3','4')
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.bdk_status in ('1','2')
and t.export_mark = '0'
@ -359,7 +379,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'
@ -94,6 +94,12 @@
c.select_end_date or d.tj_status in ('1','2'))
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test=" bzdh == ''">
and t.bzdh is not null
</if>
<if test="sign !='88'">
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
@ -133,12 +139,7 @@
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test=" bzdh == ''">
and t.bzdh is not null
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
@ -226,7 +227,31 @@
<!-- <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="sortKprq == 1">
order by t.invoice_date
</if>
<if test="sortKprq == 2">
order by t.invoice_date desc
</if>
<if test="sortPzbh == 1">
,t.sn_voucher_number
</if>
<if test="sortPzbh == 2">
,t.sn_voucher_number desc
</if>
<if test="sortBzdh == 1">
,t.bzdh
</if>
<if test="sortBzdh == 2">
,t.bzdh desc
</if>
</select>
<select id="selectDksh" parameterType="java.util.Map"
resultType="com.dxhy.base.entity.BaseTDxDkCount"
@ -400,7 +425,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,7 +581,6 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
order by t.bzdh desc
</select>
<select id="selectHj" parameterType="java.util.Map"

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dxhy.base.dao.SysDeptAuthDao">
<select id="queryList" resultType="com.dxhy.base.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1
where (t1.org_type != '8' and t1.org_type != '9')
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryListUser" resultType="com.dxhy.base.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where
and t1.org_type != '7' and t1.org_type != '8' and t1.org_type != '9' and t1.org_type != '3'
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryListParent" resultType="com.dxhy.base.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where
(t1.dept_type = '0' or t1.dept_type = '1')
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryDetpIdList" resultType="long">
select dept_id
from sys_dept
where parent_id = #{parentId}
</select>
<select id="queryDeptParentId" resultType="com.dxhy.base.entity.SysDeptEntity">
select *
from sys_dept
where parent_id = #{parentId}
</select>
<select id="queryDeptList" resultType="com.dxhy.base.entity.SysDeptEntity">
select *
from sys_dept
where cj_status = '1'
and org_type = '5'
</select>
<update id="updateDeptCompany">
update
sys_dept
set qs_status = #{qsStatus},
db_name = #{dbName},
ace_key = #{aceKey},
ace_id = #{aceId},
is_collext = #{isCollext}
where company = #{company}
and org_type != '1'
</update>
<select id="selectDeptByCompany" resultType="com.dxhy.base.entity.SysDeptEntity" databaseId="mysql">
select * from sys_dept
where company = #{company}
<if test="orgType!=null and orgType !=''">
and org_type = #{orgType}
</if>
order by org_code
</select>
<!-- group by taxno-->
<select id="selectDeptByCompany" resultType="com.dxhy.base.entity.SysDeptEntity" databaseId="oracle">
select * from sys_dept a
where
a.company=#{company}
<if test="orgType!=null and orgType !=''">
and a.org_type = #{orgType}
</if>
<if test='orgType!="1"'>
and a.dept_id = (select max(dept_id) from sys_dept b where a.taxno=b.taxno )
</if>
order by a.org_code
</select>
<select id="getOrgCodeList" parameterType="long" resultType="string">
select d.org_code
from sys_user_org o left join sys_dept d
on o.dept_id = d.dept_id
where o.userid = #{userId}
</select>
<select id="queryTaxnoList" resultType="com.dxhy.base.entity.SysDeptEntity">
select dept_id,taxno,name from sys_dept where taxno is not null and taxno != '';
</select>
<select id="queryParentIdList" resultType="com.dxhy.base.entity.SysDeptEntity">
select dept_id,parent_id,name from sys_dept;
</select>
</mapper>

@ -34,7 +34,6 @@ public class DictdetaServciceImpl implements DictdetaServcice {
@Override
public String queryDictName(String type,String code) {
log.info("type={},code={}",type,code);
String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type);
List<DictdetaModel> dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class);
Map<String, String> collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname));

@ -97,7 +97,9 @@ public class FtpDownloadController extends AbstractController {
if ("1".equals(serviceType)) {
response.setContentType(this.getContentType(fileName));
} else {
response.setContentType("application/octet-stream");
// response.setContentType("application/octet-stream");
// response.setContentType("application/vnd.ms-excel");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}
response.setHeader("Content-disposition",
"attachment; filename=" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1"));

@ -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());

@ -169,14 +169,18 @@ public class FpcjhzExportThread extends BaseThread {
excelFile.append(ftpFileName.toString());
// 递归导出数据到excel
this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
String ftpFilePath = "";
String rtnMsg = this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
if("ok".equals(rtnMsg)) {
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
String ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
+ toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString();
// 文件上传ftp
fileService.uploadFile(ftpFilePath, excelFile.toString());
}else{
ftpFilePath = rtnMsg;
}
// 设置成功消息内容
msg.put("title", super.getSuccTitle(title));
@ -222,12 +226,15 @@ public class FpcjhzExportThread extends BaseThread {
*
*/
private boolean cicleExport(Map<String, Object> pramsMap, int curr, String excelFile, JSONObject jsonObject)
private String cicleExport(Map<String, Object> pramsMap, int curr, String excelFile, JSONObject jsonObject)
throws Exception {
// 查询指定页数的数据
JSONObject pageData = fpcjService.selectByGfshAndCjrq(pramsMap, curr, default_size);
boolean hasNext = pageData.getBooleanValue("hasNext");
List<FpcjCjhzRespVO> dataList = (List<FpcjCjhzRespVO>)pageData.get("datalist");
if(dataList.size() > 5000){
return "数据不能超过5000条";
}
boolean firstPage = false;
if (curr == default_curr) {
@ -243,7 +250,7 @@ public class FpcjhzExportThread extends BaseThread {
// 写入当前页数据
ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, false);
// 更新页数
return cicleExport(pramsMap, nextPage, excelFile, jsonObject);
cicleExport(pramsMap, nextPage, excelFile, jsonObject);
} else {
// 写入最后一页数据
FpcjCjhzRespVO vo = new FpcjCjhzRespVO();
@ -253,7 +260,7 @@ public class FpcjhzExportThread extends BaseThread {
vo.setSe(hjse);
dataList.add(vo);
ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, true);
return hasNext;
}
return "ok";
}
}

@ -100,7 +100,6 @@
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status != '0'
and t.rzh_yesorno != '0'
and t.company = #{company}
<if test="sign !='88'">
and t.gf_tax_no in
@ -259,12 +258,6 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</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.rzh_date desc,t.invoice_date desc
</select>
<select id="selectByPramsMap" parameterType="java.util.Map"
@ -578,11 +571,12 @@
t.inaccount_status,t.payment_status,DATE_FORMAT(t.payment_date,'%Y-%m-%d')payment_date,t.settlement_no,t.ele_invoice_no
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
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.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.inaccount_status = '1'
and t.company = #{company}
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
@ -611,12 +605,14 @@
<!-- #{companyCode}-->
<!-- </foreach>-->
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and t.comp_code in
and (t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
)
</if>
<!--or t.comp_code is null or t.comp_code = ''-->
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
</if>
@ -629,6 +625,9 @@
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test=" bzdh == ''">
and t.bzdh is not null
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
and t.bzr like concat('%',#{bzr},'%')
</if>
@ -722,12 +721,6 @@
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</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>
<if test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
order by t.qs_date desc,t.invoice_date desc
</if>

@ -33,6 +33,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -796,6 +798,7 @@ public class SDNYMainProcessController extends AbstractController {
info.setZGFZH(snInvoice.getPurchaserBank());
info.setZBZ(snInvoice.getRemarks());
List<SNInvoiceDetail> invoiceLineList = snInvoice.getInvoiceLineList();
List<SAPInvoiceDetail> sapInvoiceDetailList = new ArrayList<>();
//查询明细
@ -828,24 +831,26 @@ public class SDNYMainProcessController extends AbstractController {
sapInvoiceDetail.setZHH(snInvoiceDetail.getRowNo());
//将类似于0.03数据格式转化为3.00
if (snInvoiceDetail.getTaxRate() != null && snInvoiceDetail.getTaxRate() != "") {
sapInvoiceDetail.setZTAX(snInvoiceDetail.getTaxRate());
if ("0".equals(snInvoiceDetail.getTaxRate())) {
sapInvoiceDetail.setZTAX("0.00");
// sapInvoiceDetail.setZSM(sapInvoiceDetail.getZTAX());
}
if (snInvoiceDetail.getTaxRate().contains(".")) {
String getTaxRate = snInvoiceDetail.getTaxRate();
if (snInvoiceDetail.getTaxRate().length() > 4) {
getTaxRate = getTaxRate.substring(0, 4);
String taxRate = snInvoiceDetail.getTaxRate();
sapInvoiceDetail.setZTAX(taxRate);
if (taxRate.contains("%")){
taxRate = taxRate.replace("%","");
}
BigDecimal tax = new BigDecimal(getTaxRate);
if ("0".equals(taxRate) || "*".equals(taxRate) || "**".equals(taxRate) || "***".equals(taxRate)) {
sapInvoiceDetail.setZTAX("0.00");
sapInvoiceDetail.setZSM(sapInvoiceDetail.getZTAX());
} else {
BigDecimal tax = new BigDecimal(taxRate);
sapInvoiceDetail.setZSM(getZSM(tax.toString()));
BigDecimal tax1 = tax.multiply(new BigDecimal("100"));
sapInvoiceDetail.setZTAX(tax1.toString());
if (tax1.compareTo(new BigDecimal("100")) < 1) {
sapInvoiceDetail.setZTAX(taxRate);
}else if (tax1.scale() > 2){
DecimalFormat decimalFormat = new DecimalFormat("#.00");
String formattedDecimal = decimalFormat.format(tax1);
sapInvoiceDetail.setZTAX(formattedDecimal);
}
if (snInvoiceDetail.getTaxRate().contains("%") && !snInvoiceDetail.getTaxRate().contains(".")) {
String replace = snInvoiceDetail.getTaxRate().replace("%", ".00");
sapInvoiceDetail.setZTAX(replace);
}
}
// if (invoiceLineList.size() == 1 && snInvoice.getTaxRate() == null) {
@ -872,15 +877,16 @@ public class SDNYMainProcessController extends AbstractController {
}
}
sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity());
String zsmTax = snInvoiceDetail.getTaxRate();
if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4) {
zsmTax = zsmTax.substring(0, 4);
}
if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")) {
zsmTax = (new BigDecimal(zsmTax.replace("%", ""))).divide(new BigDecimal("100")).toString();
}
// sapInvoiceDetail.setZSM(getZSM(snInvoiceDetail.getTaxRate()));
sapInvoiceDetail.setZSM(getZSM(zsmTax));
// String zsmTax = snInvoiceDetail.getTaxRate();
// if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4) {
// zsmTax = zsmTax.substring(0, 4);
// }
// if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")) {
// zsmTax = (new BigDecimal(zsmTax.replace("%", ""))).divide(new BigDecimal("100")).toString();
// }
//// sapInvoiceDetail.setZSM(getZSM(snInvoiceDetail.getTaxRate()));
// sapInvoiceDetail.setZSM(getZSM(zsmTax));
sapInvoiceDetail.setZGGXH(snInvoiceDetail.getSpecificationModel());
if (snInvoice.getInvoiceCode() != null) {
sapInvoiceDetail.setZTID(snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber() + snFplx);
@ -898,7 +904,7 @@ public class SDNYMainProcessController extends AbstractController {
if (taxRate != null && !taxRate.contains("%")) {
BigDecimal bigDecimal = new BigDecimal(taxRate);
BigDecimal multiply = bigDecimal.multiply(new BigDecimal("100"));
info.setZTAX(multiply.toString());
info.setZTAX(multiply.toPlainString());
info.setZSM(getZSM(taxRate));
}
if (taxRate != null && taxRate.contains("%")) {
@ -911,13 +917,12 @@ public class SDNYMainProcessController extends AbstractController {
info.setZSM(getZSM(divide.toString()));
}
if (taxRate != null && taxRate.contains(".") && !taxRate.contains("%")) {
if (taxRate.length() > 4) {
taxRate = taxRate.substring(0, 4);
BigDecimal tax = new BigDecimal(taxRate);
info.setZSM(getZSM(tax.toString()));
info.setZSM(getZSM(tax.toPlainString()));
BigDecimal tax1 = tax.multiply(new BigDecimal("100"));
info.setZTAX(tax1.toString());
}
info.setZTAX(tax1.setScale(2,RoundingMode.FLOOR).toPlainString());
}
if (taxRate != null && "0".equals(taxRate)) {
info.setZTAX("0.00");
@ -1187,6 +1192,9 @@ public class SDNYMainProcessController extends AbstractController {
case "1.5":
sm = "JA";
break;
case "0.015":
sm = "JA";
break;
case "1":
sm = "J9";
break;
@ -1260,4 +1268,13 @@ public class SDNYMainProcessController extends AbstractController {
}
return ZCYJG;
}
public static void main(String[] args) {
DecimalFormat decimalFormat = new DecimalFormat("#.00");
String formattedDecimal = decimalFormat.format(new BigDecimal("15"));
BigDecimal bigDecimal = new BigDecimal("101");
boolean b = bigDecimal.compareTo(new BigDecimal("110")) < 1;
System.out.println();
}
}

@ -185,4 +185,8 @@ public interface TdxRecordInvoiceDao extends BaseMapper<TdxRecordInvoice> {
void saveInvoiceAccount(TdxInvoiceAccount invoice);
void deleteByuuid(@Param("uuids") String[] uuids);
List<String> selectRecords(@Param("pramsMap") Map<String, Object> pramsMap);
void updateTaxRate(@Param("pramsMap") Map<String, String> pramsMap);
}

@ -106,7 +106,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private TdxPlatformCheckLogService platformCheckLogService;
public String pushCheckResultToSAP(String requestParam) throws Exception {
public String pushCheckResultToSAP(String requestParam) {
log.info("获取请求参数:{} , 请求地址:{}", requestParam, snYxUrl);
String post = HttpUtils.sendPo(snYxUrl, requestParam, userName, password);
log.info("获取返回信息:{}", post);
@ -114,7 +114,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return post;
}
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company, String imageId, String compCode) throws Exception {
public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company, String imageId, String compCode) {
TDxInvoiceReimburse recordInvoice = new TDxInvoiceReimburse();
// DynamicContextHolder.push(DbConstant.BASICS_READ);
@ -459,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);
@ -557,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;
@ -572,7 +570,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
// taxRateDetail = "0.0" + taxRateDetail;
// }
// }
}
// }
}
}
@ -735,7 +733,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
log.error("补充查验失败,errormsg:{}", e.getMessage());
}
if (!checkInvoiceResult.containsKey("code")) {
if (checkInvoiceResult != null && !checkInvoiceResult.containsKey("code")) {
if (!checkInvoiceResult.containsKey("cyjg")) {
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber"));
log.info("补充查验的结果为:{}", checkInvoiceResult);
@ -1020,8 +1018,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
* @return
* @throws ParseException
*/
public ServiceResult<InvoiceInfo> valoremTaxCount(InvoiceInfo invoiceInfo, String isDeductible)
throws ParseException {
public ServiceResult<InvoiceInfo> valoremTaxCount(InvoiceInfo invoiceInfo, String isDeductible) {
if (isDeductible == null || StringUtils.isEmpty(isDeductible)) {
logger.error("客票价税计算失败:费用类别或可抵扣标识为空");
return fail("费用类别或可抵扣标识为空");
@ -1128,148 +1125,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return typeList;
}
/**
* @param invoiceInfo
* @return
* @throws ParseException
*/
private ServiceResult<?> checkIsDeduction(InvoiceInfo invoiceInfo) throws ParseException {
try {
String result = verifyInfo(invoiceInfo);
if (!CommonEnum.RESPONSE_INTERFACE_STATUS_CODE_SUCCESS.equals(result)) {
return fail(result);
}
if (Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_CODE.equals(invoiceInfo.getInvoiceTypeCode())
|| Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_PASSENGER_CODE
.equals(invoiceInfo.getInvoiceTypeCode())) {
if (invoiceInfo.getDetailList() != null) {
if (invoiceInfo.getDetailList() == null || invoiceInfo.getDetailList().isEmpty()) {
return fail("发票明细不可为空");
}
// 校验增值税电子普通发票
String invoiceTypeCode = invoiceInfo.getInvoiceTypeCode();
if (invoiceTypeCode.equals(Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_CODE)
|| invoiceTypeCode.equals(Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_PASSENGER_CODE)) {
List<InvoiceDetail> details = invoiceInfo.getDetailList();
if (details != null && details.size() > 0) {
for (int i = 0, length = details.size(); i < length; i++) {
if (!isRightRule(details.get(i).getGoodsName(), details.get(i).getTaxRate())) {
return fail("发票底账明细中第" + i + 1 + "条名称或税率不正确");
}
if (StringUtils.isNotEmpty(details.get(i).getTaxRate())) {
if (details.get(i).getTaxRate().contains("%")) {
invoiceInfo.setTaxRate(details.get(i).getTaxRate());
} else {
invoiceInfo.setTaxRate(details.get(i).getTaxRate() + "%");
}
}
}
}
}
} else {
return fail("未获取到发票明细");
}
}
// // 校验公路、水路、其他运输客票(实名),航空客运电子客票行程单,火车票
// if (invoiceInfo.getInvoiceTypeCode().equals(Constant.ROAD_TRANSPORT_TICKET_REAL_NAME_CODE)
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.WATER_TRANSPORT_TICKET_REAL_NAME_CODE)
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.OTHER_TRANSPORT_TICKET_REAL_NAME_CODE)
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.AIR_PASSENGER_ELECTRONIC_TICKET_ITINERARY_CODE)
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.RAILWAY_TICKET_CODE)) {
// if (StringUtils.isEmpty(invoiceInfo.getIdentityNumber())
// || StringUtils.isEmpty(invoiceInfo.getPassenger())) {
// return fail("必填字段为空");
// }
// int count = orgUserInfoDao.countUserByIdentityNumber(invoiceInfo.getIdentityNumber(),
// invoiceInfo.getPassenger(), enterpriseId);
// if (count == 0) {
// return fail("未查询到用户信息");
// }
// if (count > 1) {
// return fail("查询到多个用户");
// }
// }
return ok();
} catch (Exception e) {
logger.error("校验客运发票是否可抵扣异常:" + e.toString());
return fail("客运发票是否可抵扣校验失败");
}
}
public String verifyInfo(InvoiceInfo invoiceInfo) {
String result = "0000";
if (invoiceInfo == null) {
result = "发票信息不可为空";
}
if (invoiceInfo.getInvoiceTypeCode() == null || "".equals(invoiceInfo.getInvoiceTypeCode())) {
result = "发票类型不可为空";
}
if (invoiceInfo.getInvoiceDate() == null || "".equals(invoiceInfo.getInvoiceDate())) {
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())) {
result = "用户证件号不可为空";
}
if (invoiceInfo.getPassenger() == null || "".equals(invoiceInfo.getPassenger())) {
result = "乘车人不可为空";
}
if (invoiceInfo.getDepartCity() == null || invoiceInfo.getDepartCity().isEmpty()) {
result = "出发城市不可为空";
}
if (invoiceInfo.getArriveCity() == null || invoiceInfo.getArriveCity().isEmpty()) {
result = "到达城市不可为空";
}
}
if (invoiceInfo.getInvoiceDate()
.compareTo(DateUtil.parse("2019-04-01", DatePattern.NORM_DATE_PATTERN)) < 0) {
result = "开票日期需要晚于2019年4月1日";
}
DynamicContextHolder.push(DbConstant.BASICS_READ);
if (!invoiceInfo.getInvoiceTypeCode().equals(Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_CODE)
&& !invoiceInfo.getInvoiceTypeCode()
.equals(Constant.VALUE_ADDED_TAX_INVOICE_ELECTRONIC_PASSENGER_CODE)) {
// 港澳台城市
List<String> hmtList = new ArrayList<>();
// 香港
hmtList.add("香港特别行政区");
hmtList.add("香港");
// 澳门
hmtList.add("澳门特别行政区");
hmtList.add("澳门");
// 台湾
hmtList.add("台湾省");
hmtList.add("台湾");
// 出发地和到达地是否为非港澳台城市
List<Area> departCities = areaDao.queryAreaByName(invoiceInfo.getDepartCity());
List<Area> arriveCities = areaDao.queryAreaByName(invoiceInfo.getArriveCity());
boolean invHmtListExisted = (StringUtils.isNotEmpty(invoiceInfo.getDepartCity())
&& hmtList.contains(invoiceInfo.getDepartCity()))
|| (StringUtils.isNotEmpty(invoiceInfo.getArriveCity())
&& hmtList.contains(invoiceInfo.getArriveCity()));
if (departCities == null || departCities.isEmpty() || arriveCities == null || arriveCities.isEmpty()) {
result = "出发或到达城市不符合标准";
} else if (invHmtListExisted) {
result = "出发或到达城市不符合标准";
}
}
return result;
}
/**
* 增值税电子普通发票验证逻辑
*
* @param goodsName
* @param rate
* @return
*/
private Boolean isRightRule(String goodsName, String rate) {
return (goodsName.contains("*运输服务*")) && (rate.contains("3") || rate.contains("9"));
}
public static boolean isBigDecimal(String str) {
if (str == null || str.trim().length() == 0) {
return false;

@ -21,7 +21,6 @@ import com.dxhy.erp.model.auth.InterfaceCode;
import com.dxhy.erp.service.InvoiceAuthService;
import com.dxhy.erp.service.TDxInvoiceReimburseService;
import com.dxhy.erp.utils.CheckUtils;
import lombok.extern.slf4j.Slf4j;
import com.dxhy.erp.utils.DateUtil;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
@ -396,7 +395,20 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
if (fplxList.contains(zdata1.getZFPLX()) && !"X".equalsIgnoreCase(xxbs)) {
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);
if (recordInvoiceByUuid != null) {
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("uuid", uuid);
//凭证号
updateWrapper.set("sn_voucher_number", zdata1.getBELNR());
//凭证过账日期
updateWrapper.set("posting_time", zdata1.getBUDAT());
//账期
updateWrapper.set("account_period", zdata1.getBUDAT().substring(0, 7));
//报账单号
updateWrapper.set("bzdh", zdata1.getZBZDH());
//入账状态
updateWrapper.set("inaccount_status", zdata1.getZYWZT());
updateWrapper.set("comp_code", zdata1.getZGSDM());
updateWrapper.set("bzr", zdata1.getZJBRT());
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
int update = tDxrecordInvoiceDao.update(null, updateWrapper);
if (update > 0) {
@ -428,17 +440,14 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
tdxSaleRecordInvoiceDao.update(null,updateWrapper);
}
if(!flag){
promsg.append("票据号码:"+zdata1.getZFPHM()+"绑定成功! ");
}
}
zdataresp.setPROMSG(promsg.toString());
zdataresp.setPROTYP("S");
es.setZMESSAGE("处理成功");
es.setZdata(zdataresp);
return es;
}
return es;
}
public UpdateWrapper convertRecordInvoice(ZDATA zdata, String uuid) {
UpdateWrapper updateWrapper = new UpdateWrapper();

@ -71,7 +71,7 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao,
List<BaseTDxRecordInvoice> condList = setPartInvoiceByType(invoices, condVO, userInfo);
List<BaseTDxRecordInvoiceOut> outList = new ArrayList<>();
// fourth:对比流水明细,区分底账表list中需要update或者insert数据
// fourth:对比流水明细,区分底账表list中需要update或者insert数据
invoices.forEach(invoice -> {
BaseTDxRecordInvoiceOut e = new BaseTDxRecordInvoiceOut();
if (outMap.containsKey(invoice.getUuid())) {

@ -688,5 +688,17 @@
</select>
<select id="selectRecords" resultType="java.lang.String">
select t.uuid
from t_dx_record_invoice t where uuid = '01200210010409484675'
<!-- limit #{pramsMap.start},#{pramsMap.num}-->
</select>
<update id="updateTaxRate">
update t_dx_record_invoice
set tax_rate = #{pramsMap.taxRate}
where uuid = #{pramsMap.uuid}
</update>
</mapper>

@ -37,6 +37,7 @@ public class ExtFpmxcxServiceImpl extends MpBaseServiceImpl<ExtBbfpmxDao, ExtBbf
@Override
public String selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try {
@ -49,6 +50,7 @@ public class ExtFpmxcxServiceImpl extends MpBaseServiceImpl<ExtBbfpmxDao, ExtBbf
pramsMap.put("dxhyTertiary", dxhyTertiary);
pramsMap.put("dxhyDetail", dxhyDetail);
List<ExtBbfpmxcxRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
log.info("发票明细查询-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
PageInfo<ExtBbfpmxcxRespVO> pageInfo = new PageInfo<>(pageList);
List<ExtBbfpmxcxRespVO> resultList = pageInfo.getList();
if (resultList.size() > 0) {
@ -103,6 +105,7 @@ public class ExtFpmxcxServiceImpl extends MpBaseServiceImpl<ExtBbfpmxDao, ExtBbf
// 设置记录总数
json.put("total", pageInfo.getTotal());
json.put("datalist", resultList);
log.info("发票明细查询-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);

@ -46,6 +46,7 @@ public class ExtFpzhcxServiceImpl extends MpBaseServiceImpl<ExtBbfpzhDao, ExtBbf
@Override
public String selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
log.info("发票综合查询-传入的参数为:{}",pramsMap);
@ -69,11 +70,13 @@ public class ExtFpzhcxServiceImpl extends MpBaseServiceImpl<ExtBbfpzhDao, ExtBbf
json.put("hjsl", hjsl);
json.put("hjje", hjje);
json.put("hjse", hjse);
log.info("发票综合查询-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
List<ExtBbfpzhcxRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
log.info("返回的发票信息为:{}",pageList);
log.info("发票综合查询-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
PageInfo<ExtBbfpzhcxRespVO> pageInfo = new PageInfo<>(pageList);
List<ExtBbfpzhcxRespVO> resultList = pageInfo.getList();
// 用于页面返回list对象
@ -135,6 +138,7 @@ public class ExtFpzhcxServiceImpl extends MpBaseServiceImpl<ExtBbfpzhDao, ExtBbf
// 设置记录总数
json.put("total", pageInfo.getTotal());
json.put("datalist", resultList);
log.info("发票综合查询-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识

@ -79,6 +79,7 @@ public class ExtRzrbcxServiceImpl extends MpBaseServiceImpl<ExtBbrzrbcxDao, ExtB
@Override
public String selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
@ -112,10 +113,12 @@ public class ExtRzrbcxServiceImpl extends MpBaseServiceImpl<ExtBbrzrbcxDao, ExtB
json.put("hjse", hjse);
json.put("hjdkse", hjdkse);
json.put("hjsl", hjsl);
log.info("发票认证日报-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
List<ExtBbrzrbcxRespVO> pageList = super.baseMapper.selectBbycfpbbHj(pramsMap);
log.info("发票认证日报-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
PageInfo<ExtBbrzrbcxRespVO> pageInfo = new PageInfo<>(pageList);
// 用于页面返回list对象
if (pageList.size() > 0) {
@ -145,6 +148,7 @@ public class ExtRzrbcxServiceImpl extends MpBaseServiceImpl<ExtBbrzrbcxDao, ExtB
String skssq = (String)pramsMap.get("skssq");
String[] mouthArray = getRzDate(resultList);
json = dataChart(json, resultList, mouthArray);
log.info("发票认证日报-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);

@ -47,6 +47,7 @@ public class ExtYcfpcxServiceImpl extends MpBaseServiceImpl<ExtBbycfpcxDao, ExtB
@Override
public String selectByPramsMap(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
@ -74,11 +75,13 @@ public class ExtYcfpcxServiceImpl extends MpBaseServiceImpl<ExtBbycfpcxDao, ExtB
json.put("hjsl", hjsl);
json.put("hjje", hjje);
json.put("hjse", hjse);
log.info("异常发票查询-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
List<ExtBbycfpcxRespVO> pageList = super.baseMapper.selectByPramsMap(pramsMap);
log.info("数据库查询结果pageList {}",pageList);
log.info("异常发票查询-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
PageInfo<ExtBbycfpcxRespVO> pageInfo = new PageInfo<>(pageList);
// 用于页面返回list对象
if (pageList.size() > 0) {
@ -127,6 +130,7 @@ public class ExtYcfpcxServiceImpl extends MpBaseServiceImpl<ExtBbycfpcxDao, ExtB
List<ExtBbycfpcxRespVO> resultList = pageInfo.getList();
json.put("datalist", resultList);
log.info("异常发票查询-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识

@ -40,6 +40,7 @@ public class TicketServiceImpl extends MpBaseServiceImpl<ExtTicketDao, ExtTicket
@Override
public String queryList(Map<String, Object> paramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json = new JSONObject();
DynamicContextHolder.push(paramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try {
@ -70,11 +71,13 @@ public class TicketServiceImpl extends MpBaseServiceImpl<ExtTicketDao, ExtTicket
json.put("hjsl", hjsl);
json.put("hjje", hjje);
json.put("hjse", hjse);
log.info("实名客票-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
log.info("查询实名客票参数 {}",paramsMap);
List<ExtTicketInvoiceModel> pageList = super.baseMapper.queryTickets(paramsMap);
PageInfo<ExtTicketInvoiceModel> pageInfo = new PageInfo<>(pageList);
log.info("实名客票-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
// 用于页面返回list对象
if (pageList.size() > 0) {
@ -158,6 +161,7 @@ public class TicketServiceImpl extends MpBaseServiceImpl<ExtTicketDao, ExtTicket
json.put("total", pageInfo.getTotal());
List<ExtTicketInvoiceModel> resultList = pageInfo.getList();
json.put("datalist", resultList);
log.info("实名客票-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);

@ -44,6 +44,7 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
@Override
public String listAddTax(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json = new JSONObject();
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try {
@ -77,10 +78,12 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
json.put("hjsl", hjsl);
json.put("hjje", hjje);
json.put("hjse", hjse);
log.info("进项增值税票池-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
List<ExtAddTaxInvoice> pageList = super.baseMapper.listAddTaxInvoice(pramsMap);
PageInfo<ExtAddTaxInvoice> pageInfo = new PageInfo<>(pageList);
log.info("进项增值税票池-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {
@ -203,6 +206,7 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
json.put("total", pageInfo.getTotal());
List<ExtAddTaxInvoice> resultList = pageInfo.getList();
json.put("datalist", resultList);
log.info("进项增值税票池-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);
@ -212,6 +216,7 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
@Override
public Object listOther(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis();
JSONObject json = new JSONObject();
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try {
@ -242,12 +247,14 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
json.put("hjsl", hjsl);
json.put("hjje", hjje);
json.put("hjse", hjse);
log.info("其他客票-查询首页合计信息耗时:{}",System.currentTimeMillis()-enter);
}
PageHelper.startPage(curr, size);
log.info("开始进行分页查询");
List<ExtOtherInvoice> pageList = super.baseMapper.listOtherInvoice(pramsMap);
log.info("查询结果为 {}",pageList);
PageInfo<ExtOtherInvoice> pageInfo = new PageInfo<>(pageList);
log.info("其他客票-查询列表信息耗时:{}",System.currentTimeMillis()-enter);
// 用于页面返回list对象
if (pageList != null && pageList.size() > 0) {
int start = (int)pageInfo.getStartRow();
@ -295,6 +302,7 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
json.put("total", pageInfo.getTotal());
List<ExtOtherInvoice> resultList = pageInfo.getList();
json.put("datalist", resultList);
log.info("其他客票-合计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
json = super.errorResult(e);

@ -3,6 +3,9 @@ package com.dxhy.sign.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.sign.entity.SysDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 部门管理
@ -11,5 +14,88 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface SysDeptDao extends BaseMapper<SysDeptEntity> {
/**
* 根据集团编码查询税号
*
* @author 陈刚扬
* @date 2020/12/4
* @param company
* @param orgType
* @return java.util.List<com.dxhy.admin.sys.entity.SysDeptEntity>
*/
List<SysDeptEntity> selectDeptByCompany(@Param("company") String company, @Param("orgType") String orgType);
/**
* 根据集团编码查询部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryList(@Param("company") String company);
/**
* 根据集团编码查询用户关联部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryListUser(@Param("company") String company);
/**
* 根据集团编码查询上级部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryListParent(@Param("company") String company);
/**
* 查询子部门ID列表
*
* @param parentId
* 上级部门ID
* @return 部门信息
*/
List<Long> queryDetpIdList(@Param("parentId") Long parentId);
/**
* 根据上级ID查询部门信息
*
* @param parentId
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryDeptParentId(@Param("parentId") Long parentId);
/**
* 获取部门信息
*
* @return 部门信息
*/
List<SysDeptEntity> queryDeptList();
/**
* 根据集团编码修改部分信息
*
* @param company
* 集团编码
* @param isCollext
* 是否采集
* @param aceKey
* key
* @param aceId
* id
* @param dbName
* 数据库
* @param qsStatus
* 签收状态
*/
void updateDeptCompany(@Param("company") String company, @Param("isCollext") String isCollext,
@Param("aceKey") String aceKey, @Param("aceId") String aceId, @Param("dbName") String dbName,
@Param("qsStatus") String qsStatus);
List<String> getOrgCodeList(Long userId);
}

@ -1,29 +1,42 @@
package com.dxhy.sign.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 部门管理
*
* @author jiaohongyang
* @date 2019年3月26日 下午6:02:48
*/
@Data
@TableName("sys_dept")
public class SysDeptEntity implements Serializable {
private static final long serialVersionUID = 1L;
private String password;
private Long deptId;
/**
* 部门ID
*/
@TableId
private String deptId;
/**
* 上级部门ID一级部门为0
*/
private Long parentId;
private String parentId;
/**
* 部门名称
*/
private String name;
/**
* 上级部门名称
*/
@TableField(exist = false)
private String parentName;
private Integer orderNum;
private String taxno;
@ -79,10 +92,18 @@ public class SysDeptEntity implements Serializable {
* 是否需要确认密码
*/
private String isPassword;
/**
* 确认密码
*/
private String password;
private Date updateTime;
private Date createTime;
private String autoRz;
private String productType;
@TableField(exist = false)
private List<SysDeptEntity> children;
}

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dxhy.sign.dao.SysDeptDao">
<select id="queryList" resultType="com.dxhy.sign.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1
where (t1.org_type != '8' and t1.org_type != '9')
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryListUser" resultType="com.dxhy.sign.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where
and t1.org_type != '7' and t1.org_type != '8' and t1.org_type != '9' and t1.org_type != '3'
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryListParent" resultType="com.dxhy.sign.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where
(t1.dept_type = '0' or t1.dept_type = '1')
<if test="company != null and company != '' and company != 'null'">
and t1.company = #{company}
</if>
</select>
<select id="queryDetpIdList" resultType="long">
select dept_id
from sys_dept
where parent_id = #{parentId}
</select>
<select id="queryDeptParentId" resultType="com.dxhy.sign.entity.SysDeptEntity">
select *
from sys_dept
where parent_id = #{parentId}
</select>
<select id="queryDeptList" resultType="com.dxhy.sign.entity.SysDeptEntity">
select *
from sys_dept
where cj_status = '1'
and org_type = '5'
</select>
<update id="updateDeptCompany">
update
sys_dept
set qs_status = #{qsStatus},
db_name = #{dbName},
ace_key = #{aceKey},
ace_id = #{aceId},
is_collext = #{isCollext}
where company = #{company}
and org_type != '1'
</update>
<select id="selectDeptByCompany" resultType="com.dxhy.sign.entity.SysDeptEntity" databaseId="mysql">
select * from sys_dept
where company = #{company}
<if test="orgType!=null and orgType !=''">
and org_type = #{orgType}
</if>
order by org_code
</select>
<!-- group by taxno-->
<select id="selectDeptByCompany" resultType="com.dxhy.sign.entity.SysDeptEntity" databaseId="oracle">
select * from sys_dept a
where
a.company=#{company}
<if test="orgType!=null and orgType !=''">
and a.org_type = #{orgType}
</if>
<if test='orgType!="1"'>
and a.dept_id = (select max(dept_id) from sys_dept b where a.taxno=b.taxno )
</if>
order by a.org_code
</select>
<select id="getOrgCodeList" parameterType="long" resultType="string">
select d.org_code
from sys_user_org o left join sys_dept d
on o.dept_id = d.dept_id
where o.userid = #{userId}
</select>
<select id="queryTaxnoList" resultType="com.dxhy.sign.entity.SysDeptEntity">
select dept_id,taxno,name from sys_dept where taxno is not null and taxno != '';
</select>
<select id="queryParentIdList" resultType="com.dxhy.sign.entity.SysDeptEntity">
select dept_id,parent_id,name from sys_dept;
</select>
</mapper>
Loading…
Cancel
Save