From ccb2314755ebbedee08ae23458c710382f8c3be2 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 3 Jul 2023 16:12:34 +0800 Subject: [PATCH] =?UTF-8?q?ariesy=20=E5=A2=9E=E5=8A=A0=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E7=A8=8E=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseInvoiceManualCheckServiceImpl.java | 168 +++++++++--------- 1 file changed, 83 insertions(+), 85 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index c8384fb1..335133f4 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -43,14 +43,14 @@ import com.github.pagehelper.PageInfo; * 手动勾选查询service实现类 * * @author kangzq - * @date 2019年5月11日 * @version 1.0 + * @date 2019年5月11日 */ @SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"}) @Slf4j @Service("baseInvoiceManualCheckService") public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl - implements BaseInvoiceManualCheckService { + implements BaseInvoiceManualCheckService { @Resource private BaseTDxTaxCurrentDao baseTDxTaxCurrentDao; @Resource @@ -65,18 +65,18 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pramsMap, int curr, int size) { long enter = System.currentTimeMillis(); - log.info("入参是:{}",pramsMap); + log.info("入参是:{}", pramsMap); JSONObject json; DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); try { - String company = (String)pramsMap.get("company"); - String menuId = (String)pramsMap.get("menuId"); + String company = (String) pramsMap.get("company"); + String menuId = (String) pramsMap.get("menuId"); json = tabulateRedisService.getTabulateMenu(company, menuId); List voList = new ArrayList<>(); - List gfshList = (List)pramsMap.get("gfsh"); - log.info("购方税号{}",gfshList); - String qsflag = (String)pramsMap.get("qsflag"); + List gfshList = (List) pramsMap.get("gfsh"); + log.info("购方税号{}", gfshList); + String qsflag = (String) pramsMap.get("qsflag"); List gfshList1 = new ArrayList<>(); if (gfshList.size() > 0) { List curList = super.baseMapper.selectDksh(pramsMap); @@ -88,7 +88,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl hjList = super.baseMapper.selectHj(pramsMap); - log.info("手工认证 查询统计信息耗时:{}",System.currentTimeMillis()-start); + log.info("手工认证 查询统计信息耗时:{}", System.currentTimeMillis() - start); BaseTDxRecordInvoice hjxx = hjList.get(0); hjsl = hjxx.getSfygx(); if (!"0".equals(hjsl)) { @@ -125,20 +125,20 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pageList = super.baseMapper.selectSggxcx(pramsMap); - log.info("手工认证 查询列表信息耗时:{}",System.currentTimeMillis()-start1); + log.info("手工认证 查询列表信息耗时:{}", System.currentTimeMillis() - start1); PageInfo pageInfo = new PageInfo<>(pageList); - log.info("返回的列表为:{}",pageList); - log.info("查询耗时:{}",System.currentTimeMillis()-enter); + log.info("返回的列表为:{}", pageList); + log.info("查询耗时:{}", System.currentTimeMillis() - enter); // 转化为页面展示对象 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (pageList.size() > 0) { - List taxList = (List)pramsMap.get("taxList"); + List taxList = (List) pramsMap.get("taxList"); List taxnoList = new ArrayList<>(); if (taxList != null && taxList.size() > 0) { for (Tax tax : taxList) { @@ -148,7 +148,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl businessList = (List)pramsMap.get("business"); + List businessList = (List) pramsMap.get("business"); int start = new Long(pageInfo.getStartRow()).intValue(); for (int i = 0; i < pageList.size(); i++) { BaseSggxCxRespVO vo = new BaseSggxCxRespVO(); @@ -163,17 +163,17 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl{}",pageList.get(i).getInAccountStatus()); + log.info("inaccountStatus==>{}", pageList.get(i).getInAccountStatus()); if ("1".equals(pageList.get(i).getInAccountStatus())) { vo.setInAccountStatus("已入账"); } else { vo.setInAccountStatus("未入账"); } String suspendStatus = pageList.get(i).getSuspendStatus(); - if ("1".equals(suspendStatus)){ + if ("1".equals(suspendStatus)) { vo.setSuspendStatus("是"); - }else { + } else { vo.setSuspendStatus("否"); } vo.setSuspendDate(pageList.get(i).getSuspendDate()); vo.setBzr(pageList.get(i).getBzr()); - vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,pageList.get(i).getPaymentStatus())); + vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS, pageList.get(i).getPaymentStatus())); vo.setPaymentDate(pageList.get(i).getPaymentDate()); vo.setGfmc(pageList.get(i).getGfName()); vo.setXfmc(pageList.get(i).getXfName()); @@ -237,18 +237,18 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl businessList) { String businessName = ""; if (!StringHelper.isBlank(businessCode) && businessList != null && businessList.size() > 0) { for (Business business : businessList) { if (!StringHelper.isBlank(business.getBusinessCode()) - && business.getBusinessCode().equals(businessCode)) { + && business.getBusinessCode().equals(businessCode)) { businessName = StringHelper.trim(business.getBusinessName(), ""); break; } @@ -421,7 +418,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pramsMap) { - log.info("入参是:{}",pramsMap); + log.info("入参是:{}", pramsMap); JSONObject json = new JSONObject(); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); try { - String company = (String)pramsMap.get("company"); - String menuId = (String)pramsMap.get("menuId"); - if (StringUtils.isNotBlank(menuId)){ + String company = (String) pramsMap.get("company"); + String menuId = (String) pramsMap.get("menuId"); + if (StringUtils.isNotBlank(menuId)) { json = tabulateRedisService.getTabulateMenu(company, menuId); } - List gfshList = (List)pramsMap.get("gfsh"); + List gfshList = (List) pramsMap.get("gfsh"); String sign = (String) pramsMap.get("sign"); //如果有自己的税号则选择出在未申请抵扣的税号 - if (!"88".equals(sign)){ + if (!"88".equals(sign)) { List gfshList1 = new ArrayList<>(); if (gfshList.size() > 0) { List curList = super.baseMapper.selectDksh(pramsMap); @@ -479,12 +476,12 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpltotalPage){ + if (curr > totalPage) { curr = totalPage; } - curr = (curr -1)*size; - pramsMap.put("curr",curr); + curr = (curr - 1) * size; + pramsMap.put("curr", curr); } List pageList = super.baseMapper.selectInTellingCheck(pramsMap); - if (pageList == null || pageList.size() == 0){ - json.put("message","无可操作的数据"); - json.put("code","501"); + if (pageList == null || pageList.size() == 0) { + json.put("message", "无可操作的数据"); + json.put("code", "501"); return super.responseResult(json); } PageInfo pageInfo = new PageInfo<>(pageList); - log.info("返回的列表为:{}",pageList); + log.info("返回的列表为:{}", pageList); // 转化为页面展示对象 List returnList = new ArrayList<>(); //记录数量 int count = 1; //税额上限 - List businessList = (List)pramsMap.get("business"); + List businessList = (List) pramsMap.get("business"); if (pageList.size() > 0) { - List taxList = (List)pramsMap.get("taxList"); + List taxList = (List) pramsMap.get("taxList"); List taxnoList = new ArrayList<>(); if (taxList != null && taxList.size() > 0) { for (Tax tax : taxList) { @@ -576,7 +572,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl taxnoMap = taxnoList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, SysDeptEntity::getTaxno)); Map parentIdMap = parentIdList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, e -> e.getParentId() == null ? "" : e.getParentId())); - log.info("taxnoMap={},parentIdMap={}",taxnoMap,parentIdMap); + log.info("taxnoMap={},parentIdMap={}", taxnoMap, parentIdMap); String gfsh = ""; - for(String companyCode : companyCodes){ + for (String companyCode : companyCodes) { QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("org_code",companyCode); - SysDeptEntity sysDeptEntity = sysDeptAuthDao.selectOne(wrapper); - if(sysDeptEntity != null) { + wrapper.eq("org_code", companyCode); + List sysDeptEntityList = sysDeptAuthDao.selectList(wrapper); + SysDeptEntity sysDeptEntity = sysDeptEntityList.get(0); + if (sysDeptEntity != null) { String dId = sysDeptEntity.getDeptId(); - log.info("获取deptId为:{}",dId); - if(StringUtils.isNotEmpty(dId)) { + log.info("获取deptId为:{}", dId); + if (StringUtils.isNotEmpty(dId)) { gfsh = getGfsh(dId, taxnoMap, parentIdMap); - gfshList.add(gfsh); + if (StringUtils.isNotEmpty(gfsh)) + gfshList.add(gfsh); log.info("获取的税号为:{}", gfsh); } } } - log.info("购方税号list为:{}",gfshList); + log.info("购方税号list为:{}", gfshList); return gfshList; } - private String getGfsh(String deptId,Map taxnoMap,Map parentIdMap) { + private String getGfsh(String deptId, Map taxnoMap, Map parentIdMap) { String taxno = ""; - if(StringUtils.isNotEmpty(deptId)) { + if (StringUtils.isNotEmpty(deptId)) { log.info("deptId={}", deptId); taxno = taxnoMap.get(deptId); @@ -671,7 +669,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl