添加打印日志

release
yishiqihuasheng 2 years ago
parent 5dbe330f01
commit 04608d285d
  1. 185
      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.constant.DictConstant;
import com.dxhy.common.utils.DateUtils; import com.dxhy.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -435,9 +436,8 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String menuId = (String)pramsMap.get("menuId"); String menuId = (String)pramsMap.get("menuId");
json = tabulateRedisService.getTabulateMenu(company, menuId); json = tabulateRedisService.getTabulateMenu(company, menuId);
List<BaseSggxCxRespVO> voList = new ArrayList<>();
List<String> gfshList = (List<String>)pramsMap.get("gfsh"); List<String> gfshList = (List<String>)pramsMap.get("gfsh");
String qsflag = (String)pramsMap.get("qsflag");
List<String> gfshList1 = new ArrayList<>(); List<String> gfshList1 = new ArrayList<>();
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap); List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap);
@ -486,7 +486,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
//统计金额 //统计金额
BigDecimal hjje = new BigDecimal("0"); BigDecimal hjje = new BigDecimal("0");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (pageList.size() > 0) { if (pageList.size() > 0) {
List<Tax> taxList = (List<Tax>)pramsMap.get("taxList"); List<Tax> taxList = (List<Tax>)pramsMap.get("taxList");
List<String> taxnoList = new ArrayList<>(); List<String> taxnoList = new ArrayList<>();
@ -498,119 +497,48 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} }
} }
} }
List<Business> businessList = (List<Business>)pramsMap.get("business");
for (int i = 0; i < pageList.size(); i++) { for (int i = 0; i < pageList.size(); i++) {
currentTax.add(pageList.get(i).getTaxAmount()); currentTax = currentTax.add(pageList.get(i).getTaxAmount());
hjje.add(pageList.get(i).getInvoiceAmount()); hjje = hjje.add(pageList.get(i).getInvoiceAmount());
log.info("maxTax====>"+maxTax+",currentTax====>"+currentTax); log.info("maxTax====>"+maxTax+",currentTax====>"+currentTax);
if (maxTax.compareTo(currentTax) >0){ if (maxTax.compareTo(currentTax) >0){
count++; count++;
log.info("count++{}",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"; String invoiceStatus="07";
if ( pageList.get(i).getInvoiceStatus() != null && !invoiceStatus.contains(pageList.get(i).getInvoiceStatus()) 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).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) { || pageList.get(i).getTaxAmount() != null && pageList.get(i).getTaxAmount().compareTo(new BigDecimal(0)) < 0) {
currentTax.subtract(pageList.get(i).getTaxAmount()); currentTax = currentTax.subtract(pageList.get(i).getTaxAmount());
hjje.subtract(pageList.get(i).getInvoiceAmount()); hjje = hjje.subtract(pageList.get(i).getInvoiceAmount());
count--; count--;
log.info("count--{}",count); log.info("count--{}",count);
continue; continue;
} }
//发票税号一申请抵扣统计
if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) { if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) {
//该发票税号已申请抵扣统计 //该发票税号已申请抵扣统计
currentTax.subtract(pageList.get(i).getTaxAmount()); currentTax = currentTax.subtract(pageList.get(i).getTaxAmount());
hjje.subtract(pageList.get(i).getInvoiceAmount()); hjje = hjje.subtract(pageList.get(i).getInvoiceAmount());
count--; count--;
log.info("count--{}",count); log.info("已申请抵扣统计 count-- ==={}",count);
continue; continue;
} }
// if ("1".equals(qsflag) && !"1".equals(pageList.get(i).getQsStatus())) { List<Business> businessList = (List<Business>)pramsMap.get("business");
// vo.setSelect(false); BaseSggxCxRespVO vo = getBaseSggxCxRespVO(pageList.get(i), count, taxnoList, businessList);
// vo.setBkgxts("该发票未签收");
// voList.add(vo); // log.info("智能勾选查询返回对象VO {}",vo);
// continue;
// }
log.info("returnList添加vo"); log.info("returnList添加vo");
returnList.add(vo); returnList.add(vo);
}else { }else {
log.info("统计税额超出税额上限减去最后一个,并结束循环遍历"); log.info("统计税额超出税额上限减去最后一个,并结束循环遍历");
currentTax.subtract(pageList.get(i).getTaxAmount()); currentTax = currentTax.subtract(pageList.get(i).getTaxAmount());
hjje.subtract(pageList.get(i).getInvoiceAmount()); hjje = hjje.subtract(pageList.get(i).getInvoiceAmount());
break; break;
} }
@ -630,4 +558,79 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
return super.responseResult(json); return super.responseResult(json);
} }
@NotNull
public BaseSggxCxRespVO getBaseSggxCxRespVO(BaseTDxRecordInvoice baseTDxRecordInvoice, int count, List<String> taxnoList, List<Business> 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;
}
} }

Loading…
Cancel
Save