From 04608d285d9f9e1515be36de8e7332d8a308579b Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Fri, 19 May 2023 09:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8D=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseInvoiceManualCheckServiceImpl.java | 185 +++++++++--------- 1 file changed, 94 insertions(+), 91 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 f3cf6c42..0cf02161 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 @@ -16,6 +16,7 @@ import javax.annotation.Resource; import com.dxhy.common.constant.DictConstant; import com.dxhy.common.utils.DateUtils; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONObject; @@ -435,9 +436,8 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl voList = new ArrayList<>(); List gfshList = (List)pramsMap.get("gfsh"); - String qsflag = (String)pramsMap.get("qsflag"); + List gfshList1 = new ArrayList<>(); if (gfshList.size() > 0) { List curList = super.baseMapper.selectDksh(pramsMap); @@ -486,7 +486,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl 0) { List taxList = (List)pramsMap.get("taxList"); List taxnoList = new ArrayList<>(); @@ -498,119 +497,48 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl businessList = (List)pramsMap.get("business"); for (int i = 0; i < pageList.size(); i++) { - currentTax.add(pageList.get(i).getTaxAmount()); - hjje.add(pageList.get(i).getInvoiceAmount()); + currentTax = currentTax.add(pageList.get(i).getTaxAmount()); + hjje = hjje.add(pageList.get(i).getInvoiceAmount()); log.info("maxTax====>"+maxTax+",currentTax====>"+currentTax); if (maxTax.compareTo(currentTax) >0){ count++; log.info("count++{}",count); - BaseSggxCxRespVO vo = new BaseSggxCxRespVO(); - if (taxnoList.contains(pageList.get(i).getGfTaxNo())) { - vo.setUpgradeStatus("1"); - if (pageList.get(i).getDkTaxAmount() != null) { - vo.setDkse(AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getDkTaxAmount().toString()))); - } else { - vo.setDkse(AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString()))); - } - } else { - vo.setUpgradeStatus("0"); - if (pageList.get(i).getDkTaxAmount() != null) { - vo.setDkse(AmountFormatUtil - .fmtMicrometer(MathUtil.round(pageList.get(i).getDkTaxAmount().toString()))); - } else { - vo.setDkse(AmountFormatUtil - .fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString()))); - } - } - - String businessCode = pageList.get(i).getDeptId(); - String businessName = this.getBusinessName(businessCode, businessList); - -// log.info("businessName={}",businessName); - vo.setVoucherNumber(pageList.get(i).getVoucherNumber()); - vo.setSnVoucherNumber(pageList.get(i).getSnVoucherNumber()); - vo.setImageNumber(pageList.get(i).getImageNumber()); - vo.setPostingTime(pageList.get(i).getPostingTime()); - vo.setAccountPeriod(pageList.get(i).getAccountPeriod()); - vo.setId(String.valueOf(pageList.get(i).getId())); - vo.setXh(String.valueOf(count)); - vo.setInvoiceAmount( - AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getInvoiceAmount().toString()))); - vo.setInvoiceCode(pageList.get(i).getInvoiceCode()); - vo.setInvoiceDate(sdf.format(pageList.get(i).getInvoiceDate())); - vo.setInvoiceNo(pageList.get(i).getInvoiceNo()); - vo.setSettlementNo(pageList.get(i).getSettlementNo()); - vo.setTaxAmount( - AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString()))); - vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,pageList.get(i).getInvoiceStatus())); - vo.setInvoiceType(pageList.get(i).getInvoiceType()); - //报账单号和入账状态 -// vo.setInAccountStatus(pageList.get(i).getInvoiceStatus()); - vo.setBzdh(pageList.get(i).getBzdh()); - vo.setCompCode(pageList.get(i).getCompCode()); - // 签收方式为已经签收时展示签收信息 - if ("1".equals(pageList.get(i).getQsStatus())) { - if (pageList.get(i).getQsDate() != null) { - vo.setQsrq(sdf.format(pageList.get(i).getQsDate())); - } - if (pageList.get(i).getQsType() != null) { - vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE,pageList.get(i).getQsType())); - } - vo.setQsr(pageList.get(i).getQsName()); - } - if (pageList.get(i).getQsStatus() != null) { - vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS,pageList.get(i).getQsStatus())); - } - if ("1".equals(pageList.get(i).getInAccountStatus())) { - vo.setInAccountStatus("已入账"); - } else if ("0".equals(pageList.get(i).getInAccountStatus())) { - vo.setInAccountStatus("未入账"); - } - 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()); - vo.setBusinessName(businessName); - vo.setEleInvoiceNo(pageList.get(i).getEleInvoiceNo()); - vo.setSelect(true); - -// log.info("智能勾选查询返回对象VO {}",vo); - + //发票状态不能认证 String invoiceStatus="07"; if ( pageList.get(i).getInvoiceStatus() != null && !invoiceStatus.contains(pageList.get(i).getInvoiceStatus()) || pageList.get(i).getInvoiceAmount() != null && pageList.get(i).getInvoiceAmount().compareTo(new BigDecimal(0)) < 0 || pageList.get(i).getTaxAmount() != null && pageList.get(i).getTaxAmount().compareTo(new BigDecimal(0)) < 0) { - currentTax.subtract(pageList.get(i).getTaxAmount()); - hjje.subtract(pageList.get(i).getInvoiceAmount()); + currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); + hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); count--; log.info("count--{}",count); continue; } + //发票税号一申请抵扣统计 if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) { //该发票税号已申请抵扣统计 - currentTax.subtract(pageList.get(i).getTaxAmount()); - hjje.subtract(pageList.get(i).getInvoiceAmount()); + currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); + hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); count--; - log.info("count--{}",count); + log.info("已申请抵扣统计 count-- ==={}",count); continue; } -// if ("1".equals(qsflag) && !"1".equals(pageList.get(i).getQsStatus())) { -// vo.setSelect(false); -// vo.setBkgxts("该发票未签收"); -// voList.add(vo); -// continue; -// } + List businessList = (List)pramsMap.get("business"); + BaseSggxCxRespVO vo = getBaseSggxCxRespVO(pageList.get(i), count, taxnoList, businessList); + +// log.info("智能勾选查询返回对象VO {}",vo); + log.info("returnList添加vo"); returnList.add(vo); }else { log.info("统计税额超出税额上限减去最后一个,并结束循环遍历"); - currentTax.subtract(pageList.get(i).getTaxAmount()); - hjje.subtract(pageList.get(i).getInvoiceAmount()); + currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); + hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); + break; } @@ -630,4 +558,79 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl taxnoList, List businessList) { + BaseSggxCxRespVO vo = new BaseSggxCxRespVO(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (taxnoList.contains(baseTDxRecordInvoice.getGfTaxNo())) { + vo.setUpgradeStatus("1"); + if (baseTDxRecordInvoice.getDkTaxAmount() != null) { + vo.setDkse(AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getDkTaxAmount().toString()))); + } else { + vo.setDkse(AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getTaxAmount().toString()))); + } + } else { + vo.setUpgradeStatus("0"); + if (baseTDxRecordInvoice.getDkTaxAmount() != null) { + vo.setDkse(AmountFormatUtil + .fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getDkTaxAmount().toString()))); + } else { + vo.setDkse(AmountFormatUtil + .fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getTaxAmount().toString()))); + } + } + + String businessCode = baseTDxRecordInvoice.getDeptId(); + String businessName = this.getBusinessName(businessCode, businessList); + +// log.info("businessName={}",businessName); + vo.setVoucherNumber(baseTDxRecordInvoice.getVoucherNumber()); + vo.setSnVoucherNumber(baseTDxRecordInvoice.getSnVoucherNumber()); + vo.setImageNumber(baseTDxRecordInvoice.getImageNumber()); + vo.setPostingTime(baseTDxRecordInvoice.getPostingTime()); + vo.setAccountPeriod(baseTDxRecordInvoice.getAccountPeriod()); + vo.setId(String.valueOf(baseTDxRecordInvoice.getId())); + vo.setXh(String.valueOf(count)); + vo.setInvoiceAmount( + AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getInvoiceAmount().toString()))); + vo.setInvoiceCode(baseTDxRecordInvoice.getInvoiceCode()); + vo.setInvoiceDate(sdf.format(baseTDxRecordInvoice.getInvoiceDate())); + vo.setInvoiceNo(baseTDxRecordInvoice.getInvoiceNo()); + vo.setSettlementNo(baseTDxRecordInvoice.getSettlementNo()); + vo.setTaxAmount( + AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getTaxAmount().toString()))); + vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,baseTDxRecordInvoice.getInvoiceStatus())); + vo.setInvoiceType(baseTDxRecordInvoice.getInvoiceType()); + //报账单号和入账状态 +// vo.setInAccountStatus(pageList.get(i).getInvoiceStatus()); + vo.setBzdh(baseTDxRecordInvoice.getBzdh()); + vo.setCompCode(baseTDxRecordInvoice.getCompCode()); + // 签收方式为已经签收时展示签收信息 + if ("1".equals(baseTDxRecordInvoice.getQsStatus())) { + if (baseTDxRecordInvoice != null) { + vo.setQsrq(sdf.format(baseTDxRecordInvoice.getQsDate())); + } + if (baseTDxRecordInvoice.getQsType() != null) { + vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE,baseTDxRecordInvoice.getQsType())); + } + vo.setQsr(baseTDxRecordInvoice.getQsName()); + } + if (baseTDxRecordInvoice.getQsStatus() != null) { + vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS,baseTDxRecordInvoice.getQsStatus())); + } + if ("1".equals(baseTDxRecordInvoice.getInAccountStatus())) { + vo.setInAccountStatus("已入账"); + } else if ("0".equals(baseTDxRecordInvoice.getInAccountStatus())) { + vo.setInAccountStatus("未入账"); + } + vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,baseTDxRecordInvoice.getPaymentStatus())); + vo.setPaymentDate(baseTDxRecordInvoice.getPaymentDate()); + vo.setGfmc(baseTDxRecordInvoice.getGfName()); + vo.setXfmc(baseTDxRecordInvoice.getXfName()); + vo.setBusinessName(businessName); + vo.setEleInvoiceNo(baseTDxRecordInvoice.getEleInvoiceNo()); + vo.setSelect(true); + return vo; + } + }