Merge branches '0630-增加权限筛选' and 'test' of http://192.168.12.182/invoice/pt into test

release
yefei 2 years ago
commit 464e3d3991
  1. 8
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 6
      dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java
  3. 11
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  4. 2
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseFpdrrzServiceImpl.java
  5. 3
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  6. 24
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  7. 1
      dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java
  8. 2
      dxhy-core/src/main/java/com/dxhy/core/controller/FtpDownloadController.java
  9. 29
      dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java
  10. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/QyswxxExportThread.java
  11. 2
      dxhy-core/src/main/java/com/dxhy/core/thread/RzFpxxExportThread.java
  12. 25
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  13. 14
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  14. 4
      dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java
  15. 71
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  16. 251
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java
  17. 2
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java
  18. 12
      dxhy-erp/src/main/resources/mapper/TdxRecordInvoiceDao.xml
  19. 3
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtFpmxcxServiceImpl.java
  20. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtFpzhcxServiceImpl.java
  21. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtRzrbcxServiceImpl.java
  22. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtYcfpcxServiceImpl.java
  23. 4
      dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java
  24. 8
      dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java

@ -512,6 +512,10 @@ 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);
}
@ -553,6 +557,10 @@ 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);

@ -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) {

@ -64,6 +64,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
@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);
@ -105,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)) {
@ -122,12 +125,16 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
}
log.info("查询合计耗时:{}",System.currentTimeMillis()-enter);
PageHelper.startPage(curr, 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) {
@ -262,6 +269,8 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
json.put("total", pageInfo.getTotal());
json.put("datalist", voList);
log.info("总计耗时:{}",System.currentTimeMillis()-enter);
} catch (Exception e) {
// 统一设置操作异常标识
log.info("错误信息为:{}",e.getMessage());

@ -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 && StringHelper.isNotBlank(rdxRecordInvoice.getDkTaxAmount().toPlainString())){
rzlb.setDkse(rdxRecordInvoice.getDkTaxAmount().toPlainString());
}
if (rdxRecordInvoice != null) {

@ -242,6 +242,7 @@
and t.tax_rate like '%,%'
</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 +258,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'

@ -556,6 +556,30 @@
<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>

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

@ -169,14 +169,18 @@ public class FpcjhzExportThread extends BaseThread {
excelFile.append(ftpFileName.toString());
// 递归导出数据到excel
this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
String ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
+ toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString();
// 文件上传ftp
fileService.uploadFile(ftpFilePath, excelFile.toString());
String ftpFilePath = "";
String rtnMsg = this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
if("ok".equals(rtnMsg)) {
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
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";
}
}

@ -46,7 +46,7 @@ public class QyswxxExportThread extends BaseThread {
/**
* 文件名后缀
*/
private final String fileNameSurfix = ".xlsx";
private final String fileNameSurfix = ".xls";
/**
* 文件名中间分隔符
*/

@ -46,7 +46,7 @@ public class RzFpxxExportThread extends BaseThread {
/**
* 文件名后缀
*/
private final String fileNameSurfix = ".xlsx";
private final String fileNameSurfix = ".xls";
/**
* 文件名中间分隔符
*/

@ -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>

@ -796,6 +796,7 @@ public class SDNYMainProcessController extends AbstractController {
info.setZGFZH(snInvoice.getPurchaserBank());
info.setZBZ(snInvoice.getRemarks());
List<SNInvoiceDetail> invoiceLineList = snInvoice.getInvoiceLineList();
List<SAPInvoiceDetail> sapInvoiceDetailList = new ArrayList<>();
//查询明细
@ -1260,4 +1261,17 @@ public class SDNYMainProcessController extends AbstractController {
}
return ZCYJG;
}
/**
* 查验发票
*/
@PostMapping("/refresh")
@ResponseBody
@SysLog("发票查验")
public String refreshDetailData(@RequestBody Map<String, Object> pramsMap) throws Exception {
log.info("接口请求的参数为:{}",pramsMap);
String result = snPushCheckRecordService.getRecords(pramsMap);
return result;
}
}

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

@ -4,7 +4,9 @@ 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;
@ -40,6 +42,7 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 与山东能源交互数据主类
@ -88,12 +91,18 @@ 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;
@ -270,6 +279,50 @@ 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.封装查验参数
@ -564,20 +617,20 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
int index = taxRateDetail.indexOf("%");
if (index > 0) {
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
Float num = Float.parseFloat(taxRateDetail);
if (num > 9) {
taxRateDetail = "0." + taxRateDetail;
} else {
if (!taxRateDetail.startsWith("0")) {
taxRateDetail = "0.0" + taxRateDetail;
}
}
// Float num = Float.parseFloat(taxRateDetail);
// if (num > 9) {
// taxRateDetail = "0." + taxRateDetail;
// } else {
// if (!taxRateDetail.startsWith("0")) {
// taxRateDetail = "0.0" + taxRateDetail;
// }
// }
}
}
}
if ("11".equals(invoiceType)) {
taxRateDetail = "0.000";
taxRateDetail = "0";
}
log.info("明细-发票税率为:{}", taxRateDetail);
snDetailMap.put("taxRate", taxRateDetail);

@ -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;
@ -44,7 +43,7 @@ import java.util.stream.Collectors;
@Service
@Slf4j
public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, RecordInvoice>
implements InvoiceAuthService {
implements InvoiceAuthService {
@Resource
AuthRecordDao authRecordDao;
@ -59,7 +58,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
@Override
public String applyInvoiceAuth(GlobalInfo globalInfo, Map<String, String> map, HttpServletRequest request,
HttpServletResponse response, Authorize authorize) {
HttpServletResponse response, Authorize authorize) {
ReturnStateInfo run = new ReturnStateInfo();
InterfaceCode interfaceCode = new InterfaceCode();
AuthDateReq data = null;
@ -86,7 +85,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
interfaceCode.setReturnStateInfo(run);
return JSON.toJSONString(interfaceCode);
}
List<Map<String, Object>> authStateList = (List<Map<String, Object>>)data.getInvoices();
List<Map<String, Object>> authStateList = (List<Map<String, Object>>) data.getInvoices();
run = getCheckData(authStateList, data.getContentRows());
if (run.getReturnCode() != null || run.getReturnMessage() != null) {
interfaceCode.setReturnStateInfo(run);
@ -126,39 +125,39 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
}
for (Map<String, Object> authState : authStateList) {
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_READ);
TdxRecordInvoice recordInvoice = tDxrecordInvoiceDao.getRecordInvoice((String)authState.get("buyerTaxNo"),
(String)authState.get("invoiceCode"), (String)authState.get("invoiceNo"));
TdxRecordInvoice recordInvoice = tDxrecordInvoiceDao.getRecordInvoice((String) authState.get("buyerTaxNo"),
(String) authState.get("invoiceCode"), (String) authState.get("invoiceNo"));
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE);
if (recordInvoice != null) {
if ("01".equals(recordInvoice.getInvoiceType()) || "03".equals(recordInvoice.getInvoiceType())
|| "08".equals(recordInvoice.getInvoiceType()) || "14".equals(recordInvoice.getInvoiceType())
|| "08".equals(recordInvoice.getInvoiceType()) || "14".equals(recordInvoice.getInvoiceType())
|| "31".equals(recordInvoice.getInvoiceType())) {
if ("5".equals(data.getApplyRzlx())) {
if (!"4".equals(recordInvoice.getCxrzStatus()) && !"2".equals(recordInvoice.getCxrzStatus())
&& !"1".equals(recordInvoice.getCxrzStatus())) {
String invoiceCode = StringUtils.isBlank((String)authState.get("invoiceCode"))?"":(String)authState.get("invoiceCode");
tDxrecordInvoiceDao.updateCxrz((String)authState.get("applyTaxPeriod"),
invoiceCode+ (String)authState.get("invoiceNo"));
&& !"1".equals(recordInvoice.getCxrzStatus())) {
String invoiceCode = StringUtils.isBlank((String) authState.get("invoiceCode")) ? "" : (String) authState.get("invoiceCode");
tDxrecordInvoiceDao.updateCxrz((String) authState.get("applyTaxPeriod"),
invoiceCode + (String) authState.get("invoiceNo"));
}
} else if ("6".equals(data.getApplyRzlx())) {
if (!"4".equals(recordInvoice.getCxbdkStatus()) && !"2".equals(recordInvoice.getCxbdkStatus())
&& !"1".equals(recordInvoice.getCxrzStatus())) {
String invoiceCode = StringUtils.isBlank((String)authState.get("invoiceCode"))?"":(String)authState.get("invoiceCode");
tDxrecordInvoiceDao.updateCxbdk((String)authState.get("applyTaxPeriod"),
invoiceCode + (String)authState.get("invoiceNo"));
&& !"1".equals(recordInvoice.getCxrzStatus())) {
String invoiceCode = StringUtils.isBlank((String) authState.get("invoiceCode")) ? "" : (String) authState.get("invoiceCode");
tDxrecordInvoiceDao.updateCxbdk((String) authState.get("applyTaxPeriod"),
invoiceCode + (String) authState.get("invoiceNo"));
}
} else {
if (!"4".equals(recordInvoice.getAuthStatus()) && !"3".equals(recordInvoice.getAuthStatus())
&& !"2".equals(recordInvoice.getAuthStatus())) {
&& !"2".equals(recordInvoice.getAuthStatus())) {
if ("1".equals(data.getApplyRzlx())) {
tDxrecordInvoiceDao.updateRz(authState, data.getApplyRzlx(), "1",
recordInvoice.getUuid());
recordInvoice.getUuid());
} else if ("4".equals(data.getApplyRzlx())) {
tDxrecordInvoiceDao.updateRz(authState, data.getApplyRzlx(), "2",
recordInvoice.getUuid());
recordInvoice.getUuid());
} else {
tDxrecordInvoiceDao.updateRz(authState, data.getApplyRzlx(), "99",
recordInvoice.getUuid());
recordInvoice.getUuid());
}
}
}
@ -179,17 +178,17 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
for (Map<String, Object> map : list) {
AuthRecord authRecord = new AuthRecord();
authRecord.setBatchNo(batchNo);
authRecord.setInvoiceCode((String)map.get("invoiceCode"));
authRecord.setInvoiceNo((String)map.get("invoiceNo"));
authRecord.setUuid(map.get("invoiceCode") + (String)map.get("invoiceNo"));
authRecord.setInvoiceCode((String) map.get("invoiceCode"));
authRecord.setInvoiceNo((String) map.get("invoiceNo"));
authRecord.setUuid(map.get("invoiceCode") + (String) map.get("invoiceNo"));
if (StringUtils.isBlank(rzlx)) {
authRecord.setRzlx("1");
} else {
authRecord.setRzlx(rzlx);
}
authRecord.setApplyTaxPeriod((String)map.get("applyTaxPeriod"));
authRecord.setBuyerTaxNo((String)map.get("buyerTaxNo"));
authRecord.setYxse((String)map.get("taxCredit"));
authRecord.setApplyTaxPeriod((String) map.get("applyTaxPeriod"));
authRecord.setBuyerTaxNo((String) map.get("buyerTaxNo"));
authRecord.setYxse((String) map.get("taxCredit"));
authRecord.setCreateDate(new Date());
authRecordList.add(authRecord);
}
@ -198,7 +197,7 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
@Override
public String getAuthResult(GlobalInfo globalInfo, Map<String, String> map, HttpServletRequest request,
HttpServletResponse response, Authorize authorize) {
HttpServletResponse response, Authorize authorize) {
ReturnStateInfo run = new ReturnStateInfo();
InterfaceCode interfaceCode = new InterfaceCode();
AuthDateReq data = null;
@ -289,22 +288,22 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
} else {
authStatus.setTaxCredit("");
}
if("5".equals(authStatus.getRzlx())){
if ("5".equals(authStatus.getRzlx())) {
authStatus.setAuthState(authStatus.getCxrzStatus());
}
if(StringUtils.isBlank(authStatus.getInvoiceCode())){
if (StringUtils.isBlank(authStatus.getInvoiceCode())) {
authStatus.setInvoiceCode("");
}
authStatus.setTaxCredit("");
if ("1".equals(authStatus.getRzlx()) || "4".equals(authStatus.getRzlx())) {
if(StringUtils.isNotBlank(authStatus.getTaxCredit())){
if (StringUtils.isNotBlank(authStatus.getTaxCredit())) {
authStatus.setTaxCredit(df.format(new BigDecimal(authStatus.getTaxCredit())));
}
}
if("5".equals(authStatus.getRzlx())){
if ("5".equals(authStatus.getRzlx())) {
authStatus.setAuthState(authStatus.getCxrzStatus());
}
if("6".equals(authStatus.getRzlx())){
if ("6".equals(authStatus.getRzlx())) {
authStatus.setAuthState(authStatus.getCxbdkStatus());
}
}
@ -332,11 +331,11 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
StringBuilder promsg = new StringBuilder();
String zdata2 = isInput.getZDATA();
List<ZDATA> zdata = JSON.parseArray(zdata2, ZDATA.class);
AuthDateReq authDateReq=new AuthDateReq();
AuthDateReq authDateReq = new AuthDateReq();
authDateReq.setBatchNo(isInput.getSAPKEY());
authDateReq.setApplyRzlx("1");
StringBuilder errorMsg = new StringBuilder();
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
List<String> fplxList = new ArrayList<>();
fplxList.add("01");
fplxList.add("03");
@ -347,115 +346,125 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
fplxList.add("14");
fplxList.add("31");
fplxList.add("32");
for(ZDATA zdata1:zdata){
log.info("zdata1.getZFPHM()===>{}",zdata1.getZFPHM());
for (ZDATA zdata1 : zdata) {
log.info("zdata1.getZFPHM()===>{}", zdata1.getZFPHM());
String collect = fplxList.stream().collect(Collectors.joining(","));
if(!collect.contains(convertFpzldm(zdata1.getZFPLX()))){
log.info("非增值税先不处理:{}",JSON.toJSONString(zdata1));
if (!collect.contains(convertFpzldm(zdata1.getZFPLX()))) {
log.info("非增值税先不处理:{}", JSON.toJSONString(zdata1));
continue;
}
String fphm = zdata1.getZFPHM();
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.replace(zdata1.getZFPDM(),"");
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))) {
fphm = fphm.replace(zdata1.getZFPDM(), "");
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
log.info("发票号码{}", fphm);
String uuid = zdata1.getZFPDM() + fphm;
zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX()));
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);
//查询票池
//查询票池
QueryWrapper<TDxInvoiceReimburse> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("uuid",uuid);
queryWrapper.eq("uuid", uuid);
TDxInvoiceReimburse tDxInvoiceReimburse = tDxInvoiceReimburseService.getBaseMapper().selectOne(queryWrapper);
//没法区分来源是不是销项发票
TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid);
if(recordInvoiceByUuid==null && tDxInvoiceReimburse==null && tdxSaleRecordInvoice==null){
errorMsg.append("发票号码:"+zdata1.getZFPHM());
if (recordInvoiceByUuid == null && tDxInvoiceReimburse == null && tdxSaleRecordInvoice == null) {
errorMsg.append("发票号码:" + zdata1.getZFPHM());
}
}
if(errorMsg.length()>1){
es.setZMESSAGE(errorMsg.toString()+"不存在");
if (errorMsg.length() > 1) {
es.setZMESSAGE(errorMsg.toString() + "不存在");
es.setZTYPE("E");
return es;
}
for(ZDATA zdata1:zdata){
for (ZDATA zdata1 : zdata) {
//成功或者失败标识
boolean flag = false;
log.info("zdata1.getZFPHM():{}",zdata1.getZFPHM());
log.info("zdata1.getZFPHM():{}", zdata1.getZFPHM());
String fphm = zdata1.getZFPHM();
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.replace(zdata1.getZFPDM(),"");
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))) {
fphm = fphm.replace(zdata1.getZFPDM(), "");
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
log.info("发票号码{}", fphm);
String uuid = zdata1.getZFPDM() + fphm;
//销项标识
String xxbs = zdata1.getXXBS();
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
if(fplxList.contains(zdata1.getZFPLX()) && !"X".equalsIgnoreCase(xxbs)){
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
if (fplxList.contains(zdata1.getZFPLX()) && !"X".equalsIgnoreCase(xxbs)) {
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);
if(recordInvoiceByUuid!=null){
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
if (recordInvoiceByUuid != null) {
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){
if (update > 0) {
DynamicContextHolder.push(DbConstant.BASICS_READ);
SysDeptEntity org = sysDeptDao.getOrg(recordInvoiceByUuid.getGfTaxNo());
zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX()));
//如果设置的自动认证走申请认证逻辑
if(org!=null && "1".equals(org.getAutoRz()) && ("01".equals(zdata1.getZFPLX()) || "03".equals(zdata1.getZFPLX())
if (org != null && "1".equals(org.getAutoRz()) && ("01".equals(zdata1.getZFPLX()) || "03".equals(zdata1.getZFPLX())
|| "08".equals(zdata1.getZFPLX()) || "14".equals(zdata1.getZFPLX())
|| "31".equals(zdata1.getZFPLX())) && StringUtils.isNotBlank(zdata1.getBUDAT())){
if(!"4".equals(recordInvoiceByUuid.getAuthStatus()) && !"3".equals(recordInvoiceByUuid.getAuthStatus())
&& !"2".equals(recordInvoiceByUuid.getAuthStatus())){
Map<String,Object> authState = new HashMap<>();
authState.put("rz_user",zdata1.getZJBRT());
authState.put("applyTaxPeriod",zdata1.getBUDAT().substring(0,7).replace("-",""));
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
tDxrecordInvoiceDao.updateRz(authState,"1","1",recordInvoiceByUuid.getUuid());
|| "31".equals(zdata1.getZFPLX())) && StringUtils.isNotBlank(zdata1.getBUDAT())) {
if (!"4".equals(recordInvoiceByUuid.getAuthStatus()) && !"3".equals(recordInvoiceByUuid.getAuthStatus())
&& !"2".equals(recordInvoiceByUuid.getAuthStatus())) {
Map<String, Object> authState = new HashMap<>();
authState.put("rz_user", zdata1.getZJBRT());
authState.put("applyTaxPeriod", zdata1.getBUDAT().substring(0, 7).replace("-", ""));
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
tDxrecordInvoiceDao.updateRz(authState, "1", "1", recordInvoiceByUuid.getUuid());
}
}
}
}
}else {
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
tDxInvoiceReimburseService.getBaseMapper().update(null,updateWrapper);
} else {
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1, uuid);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
tDxInvoiceReimburseService.getBaseMapper().update(null, updateWrapper);
}
if ("X".equalsIgnoreCase(xxbs)){
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
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;
}
zdataresp.setPROMSG(promsg.toString());
zdataresp.setPROTYP("S");
es.setZMESSAGE("处理成功");
es.setZdata(zdataresp);
return es;
}
public UpdateWrapper convertRecordInvoice(ZDATA zdata,String uuid){
public UpdateWrapper convertRecordInvoice(ZDATA zdata, String uuid) {
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("sn_voucher_number",zdata.getBELNR());
updateWrapper.set("sn_voucher_number", zdata.getBELNR());
try {
DateTime parse = DateTime.parse(zdata.getBUDAT());
updateWrapper.set("posting_time",zdata.getBUDAT());
updateWrapper.set("posting_time", zdata.getBUDAT());
//账期
updateWrapper.set("account_period",zdata.getBUDAT().substring(0,7));
updateWrapper.set("account_period", zdata.getBUDAT().substring(0, 7));
} catch (Exception e) {
log.error("时间转换异常:{}",e);
log.error("时间转换异常:{}", e);
}
updateWrapper.set("bzdh",zdata.getZBZDH());
updateWrapper.set("inaccount_status",zdata.getZYWZT());
updateWrapper.set("comp_code",zdata.getZGSDM());
updateWrapper.set("bzr",zdata.getZJBRT());
updateWrapper.eq("uuid",uuid);
updateWrapper.set("bzdh", zdata.getZBZDH());
updateWrapper.set("inaccount_status", zdata.getZYWZT());
updateWrapper.set("comp_code", zdata.getZGSDM());
updateWrapper.set("bzr", zdata.getZJBRT());
updateWrapper.eq("uuid", uuid);
return updateWrapper;
}
@ -475,24 +484,24 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
// return run;
// }
boolean r =
!(CheckUtils.stringLength((String)map.get("invoiceNo"), 8) || CheckUtils.stringLength((String)map.get("invoiceNo"), 10)
|| CheckUtils.stringLength((String)map.get("invoiceNo"), 18) || CheckUtils.stringLength((String)map.get("invoiceNo"), 20));
if (CheckUtils.isNullOrEmpty((String)map.get("invoiceNo")) || r) {
!(CheckUtils.stringLength((String) map.get("invoiceNo"), 8) || CheckUtils.stringLength((String) map.get("invoiceNo"), 10)
|| CheckUtils.stringLength((String) map.get("invoiceNo"), 18) || CheckUtils.stringLength((String) map.get("invoiceNo"), 20));
if (CheckUtils.isNullOrEmpty((String) map.get("invoiceNo")) || r) {
run.setReturnCode(ReturnCodeEnum.DMHMBF.getFhzDm());
run.setReturnMessage(ReturnCodeEnum.DMHMBF.getFhzMc(ReturnCodeEnum.DMHMBF.getIndex()));
}
if (StringUtils.isBlank((String)map.get("applyTaxPeriod"))
|| ((String)map.get("applyTaxPeriod")).length() != 6) {
if (StringUtils.isBlank((String) map.get("applyTaxPeriod"))
|| ((String) map.get("applyTaxPeriod")).length() != 6) {
run.setReturnCode(ReturnCodeEnum.SKSSQBF.getFhzDm());
run.setReturnMessage(ReturnCodeEnum.SKSSQBF.getFhzMc(ReturnCodeEnum.SKSSQBF.getIndex()));
return run;
}
if (StringUtils.isBlank((String)map.get("buyerTaxNo"))) {
if (StringUtils.isBlank((String) map.get("buyerTaxNo"))) {
run.setReturnCode(ReturnCodeEnum.SHBNWK.getFhzDm());
run.setReturnMessage(ReturnCodeEnum.SHBNWK.getFhzMc(ReturnCodeEnum.SHBNWK.getIndex()));
return run;
}
if (StringUtils.isBlank((String)map.get("rz_user"))) {
if (StringUtils.isBlank((String) map.get("rz_user"))) {
run.setReturnCode(ReturnCodeEnum.RZRBNWK.getFhzDm());
run.setReturnMessage(ReturnCodeEnum.RZRBNWK.getFhzMc(ReturnCodeEnum.RZRBNWK.getIndex()));
return run;
@ -506,27 +515,27 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
}
return run;
}
public String convertFpzldm(String fpzldm){
if("10".equals(fpzldm)){
fpzldm= FplxEnum.ZP.getFplxDm();
}else if("11".equals(fpzldm)){
fpzldm=FplxEnum.PP.getFplxDm();
}else if("12".equals(fpzldm)){
fpzldm=FplxEnum.DZP.getFplxDm();
}else if("13".equals(fpzldm)){
fpzldm=FplxEnum.JSP.getFplxDm();
}else if("14".equals(fpzldm)){
fpzldm=FplxEnum.JDC.getFplxDm();
}else if("15".equals(fpzldm)){
fpzldm=FplxEnum.ESC.getFplxDm();
}else if("24".equals(fpzldm)){
fpzldm=FplxEnum.TXF.getFplxDm();
}else if("25".equals(fpzldm)){
fpzldm=FplxEnum.DZZP.getFplxDm();
}else if("26".equals(fpzldm)){
fpzldm= FplxEnum.QDZZP.getFplxDm();
}else if("27".equals(fpzldm)){
fpzldm=FplxEnum.QDPP.getFplxDm();
public String convertFpzldm(String fpzldm) {
if ("10".equals(fpzldm)) {
fpzldm = FplxEnum.ZP.getFplxDm();
} else if ("11".equals(fpzldm)) {
fpzldm = FplxEnum.PP.getFplxDm();
} else if ("12".equals(fpzldm)) {
fpzldm = FplxEnum.DZP.getFplxDm();
} else if ("13".equals(fpzldm)) {
fpzldm = FplxEnum.JSP.getFplxDm();
} else if ("14".equals(fpzldm)) {
fpzldm = FplxEnum.JDC.getFplxDm();
} else if ("15".equals(fpzldm)) {
fpzldm = FplxEnum.ESC.getFplxDm();
} else if ("24".equals(fpzldm)) {
fpzldm = FplxEnum.TXF.getFplxDm();
} else if ("25".equals(fpzldm)) {
fpzldm = FplxEnum.DZZP.getFplxDm();
} else if ("26".equals(fpzldm)) {
fpzldm = FplxEnum.QDZZP.getFplxDm();
} else if ("27".equals(fpzldm)) {
fpzldm = FplxEnum.QDPP.getFplxDm();
}
return fpzldm;
}
@ -537,17 +546,17 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
DateTime parse1 = DateTime.parse("2012-12-01");
Date date11 = parse1.toDate();
HashMap<Object, Object> map = Maps.newHashMap();
map.put("1","3");
map.put("1", "3");
try {
DateTime parse = DateTime.parse("0000-00-00");
map.put("2","3");
map.put("2", "3");
Date date1 = parse.toDate();
String s = parse.toString("yyyy-MM-dd ");
System.out.println("");
} catch (Exception e) {
// throw new RuntimeException(e);
}
map.put("3","3");
map.put("3", "3");
System.out.println();
// String d="2023";
// String substring = d.substring(0, 7);

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

Loading…
Cancel
Save