From 145580fd820bb31334f2e71643413e846b7ce904 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 30 十月 2026 15:53:20 +0800
Subject: [PATCH] feat:统计内容1-8页
---
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java | 1272 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 976 insertions(+), 296 deletions(-)
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
index 211fc29..1d3d727 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
@@ -1,8 +1,12 @@
package com.by4cloud.platformx.business.service.impl;
+import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.by4cloud.platformx.admin.api.entity.SysDept;
@@ -12,6 +16,7 @@
import com.by4cloud.platformx.business.dto.AgingQueryDTO;
import com.by4cloud.platformx.business.dto.AnalysisCommonDTO;
import com.by4cloud.platformx.business.dto.HomeQueryDTO;
+import com.by4cloud.platformx.business.dto.HomeZbjtDTO;
import com.by4cloud.platformx.business.entity.*;
import com.by4cloud.platformx.business.mapper.*;
import com.by4cloud.platformx.business.service.StatisticService;
@@ -29,9 +34,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -47,6 +50,8 @@
private final ContractInvoiceMapper contractInvoiceMapper;
private final CurrentOverdueMapper currentOverdueMapper;
private final HistoryOverdueMapper historyOverdueMapper;
+ private final AnnualPlanMapper annualPlanMapper;
+ private final PaymentReceiveMapper paymentReceiveMapper;
private final RemoteDeptService remoteDeptService;
private final RemoteDictService remoteDictService;
@@ -72,7 +77,7 @@
compIds.add(Long.valueOf(tfgs));
compIds.add(Long.valueOf(ymj));
compIds.add(Long.valueOf(jxc));
- List<ContractAmountAnalysisVo> contractAmountAnalysisVoList = contractMapper.contractAmountAnalysis(commonDTO,compIds);
+ List<ContractAmountAnalysisVo> contractAmountAnalysisVoList = contractMapper.contractAmountAnalysis(commonDTO, compIds);
return R.ok(contractAmountAnalysisVoList);
}
@@ -90,22 +95,22 @@
compIds.add(Long.valueOf(tfgs));
compIds.add(Long.valueOf(ymj));
compIds.add(Long.valueOf(jxc));
- List<ContractIncomeAnalysisVo> contractIncomeAnalysisVoList = contractMapper.contractIncomeAnalysis(commonDTO,compIds);
- if (CollUtil.isNotEmpty(contractIncomeAnalysisVoList)){
+ List<ContractIncomeAnalysisVo> contractIncomeAnalysisVoList = contractMapper.contractIncomeAnalysis(commonDTO, compIds);
+ if (CollUtil.isNotEmpty(contractIncomeAnalysisVoList)) {
contractIncomeAnalysisVoList.stream().forEach(contractIncomeAnalysisVo -> {
- if(StrUtil.equals(contractIncomeAnalysisVo.getCompId(),sgb)){
+ if (StrUtil.equals(contractIncomeAnalysisVo.getCompId(), sgb)) {
contractIncomeAnalysisVo.setCompName("鐭冲伐娉�");
}
- if(StrUtil.equals(contractIncomeAnalysisVo.getCompId(),smj)){
+ if (StrUtil.equals(contractIncomeAnalysisVo.getCompId(), smj)) {
contractIncomeAnalysisVo.setCompName("鐭崇叅鏈�");
}
- if(StrUtil.equals(contractIncomeAnalysisVo.getCompId(),ymj)){
+ if (StrUtil.equals(contractIncomeAnalysisVo.getCompId(), ymj)) {
contractIncomeAnalysisVo.setCompName("涓�鐓ゆ満");
}
- if(StrUtil.equals(contractIncomeAnalysisVo.getCompId(),tfgs)){
+ if (StrUtil.equals(contractIncomeAnalysisVo.getCompId(), tfgs)) {
contractIncomeAnalysisVo.setCompName("閫氭柟鍏徃");
}
- if(StrUtil.equals(contractIncomeAnalysisVo.getCompId(),jxc)){
+ if (StrUtil.equals(contractIncomeAnalysisVo.getCompId(), jxc)) {
contractIncomeAnalysisVo.setCompName("鏈烘鍘�");
}
});
@@ -123,7 +128,7 @@
public R contractAmountAnalysisByArea(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("company_area");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("鍦板尯瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<Long> compIds = new ArrayList<>();
@@ -139,10 +144,10 @@
return analysisAreaVo;
}).collect(Collectors.toList());
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisByArea(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -163,7 +168,7 @@
public R contractAmountAnalysisByIndustry(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("industry_sector");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("琛屼笟瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<Long> compIds = new ArrayList<>();
@@ -179,10 +184,10 @@
return analysisAreaVo;
}).collect(Collectors.toList());
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisByIndustry(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -203,7 +208,7 @@
public R contractAmountAnalysisByMarket(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("market_type");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("甯傚満绫诲瀷瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<Long> compIds = new ArrayList<>();
@@ -219,10 +224,10 @@
return analysisAreaVo;
}).collect(Collectors.toList());
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisByMarket(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -243,7 +248,7 @@
public R contractAmountAnalysisBySpcBus(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("supply_attribute");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("渚涘簲灞炴�у瓧鍏稿垎绫昏幏鍙栧紓甯�");
}
List<Long> compIds = new ArrayList<>();
@@ -259,10 +264,10 @@
return analysisAreaVo;
}).collect(Collectors.toList());
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisBySpcBus(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -283,7 +288,7 @@
public R contractAmountAnalysisByExportBus(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("export_attr");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("鍖哄煙瀛楁鑾峰彇寮傚父");
}
List<Long> compIds = new ArrayList<>();
@@ -299,10 +304,10 @@
return analysisAreaVo;
}).collect(Collectors.toList());
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisByExportBus(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -324,7 +329,7 @@
public R contractAmountAnalysisBySaleModel(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("sales_model");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("閿�鍞ā寮忓瓧鍏稿垎绫昏幏鍙栧紓甯�");
}
List<Long> compIds = new ArrayList<>();
@@ -341,10 +346,10 @@
}).collect(Collectors.toList());
contractMapper.setSession();
List<ContractIncomeAnalysisAreaVo> statisticList = contractMapper.contractAmountAnalysisBySaleModel(commonDTO
- ,compIds,Long.valueOf(smj),Long.valueOf(sgb),Long.valueOf(jxc),Long.valueOf(tfgs),Long.valueOf(ymj));
- contractIncomeAnalysisVoList.stream().forEach(vo1->{
- statisticList.stream().forEach(vo2->{
- if (StrUtil.equals(vo1.getAreaId(),vo2.getAreaId())){
+ , compIds, Long.valueOf(smj), Long.valueOf(sgb), Long.valueOf(jxc), Long.valueOf(tfgs), Long.valueOf(ymj));
+ contractIncomeAnalysisVoList.stream().forEach(vo1 -> {
+ statisticList.stream().forEach(vo2 -> {
+ if (StrUtil.equals(vo1.getAreaId(), vo2.getAreaId())) {
vo1.setJxczb(vo2.getJxczb());
vo1.setJxcze(vo2.getJxcze());
vo1.setSgbzb(vo2.getSgbzb());
@@ -365,7 +370,7 @@
public R agingAnalysisByArea(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("company_area");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("鍦板尯瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
// List<AgingCompanyVo> companys = contractPaymentScheduleMapper.selectAgingCompany(DataScope.of("comp_id"));
@@ -381,54 +386,54 @@
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
- if (CollUtil.contains(compIds,SecurityUtils.getUser().getCompId())){
+ if (CollUtil.contains(compIds, SecurityUtils.getUser().getCompId())) {
queryDTO.setCompanyId(SecurityUtils.getUser().getCompId());
}
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotal(queryDTO);
- items.stream().forEach(item->{
+ items.stream().forEach(item -> {
AgingAnalysisVo agingAnalysisVo = new AgingAnalysisVo();
agingAnalysisVo.setCompanyName(item.getLabel());
queryDTO.setAreaId(item.getItemValue());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotal(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -458,7 +463,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -472,7 +477,7 @@
public R agingAnalysisByIndustry(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("industry_sector");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("琛屼笟瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<Long> compIds = new ArrayList<>();
@@ -485,54 +490,54 @@
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
- if (CollUtil.contains(compIds,SecurityUtils.getUser().getCompId())){
+ if (CollUtil.contains(compIds, SecurityUtils.getUser().getCompId())) {
queryDTO.setCompanyId(SecurityUtils.getUser().getCompId());
}
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotal(queryDTO);
- items.stream().forEach(item->{
+ items.stream().forEach(item -> {
AgingAnalysisVo agingAnalysisVo = new AgingAnalysisVo();
agingAnalysisVo.setCompanyName(item.getLabel());
queryDTO.setIndustryId(item.getItemValue());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotal(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -562,7 +567,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -584,9 +589,9 @@
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotalShip(null);
- compIds.stream().forEach(compId->{
+ compIds.stream().forEach(compId -> {
R<SysDept> r = remoteDeptService.getById(compId);
- if (!r.isOk()){
+ if (!r.isOk()) {
return;
}
SysDept dept = r.getData();
@@ -595,44 +600,44 @@
queryDTO.setCompanyId(dept.getDeptId());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotalShip(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -662,7 +667,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -681,9 +686,9 @@
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotalInvoice(null);
- compIds.stream().forEach(compId->{
+ compIds.stream().forEach(compId -> {
R<SysDept> r = remoteDeptService.getById(compId);
- if (!r.isOk()){
+ if (!r.isOk()) {
return;
}
SysDept dept = r.getData();
@@ -692,44 +697,44 @@
queryDTO.setCompanyId(dept.getDeptId());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotalInvoice(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -759,7 +764,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -775,56 +780,56 @@
public R agingAnalysisByMarket(AnalysisCommonDTO commonDTO) {
R<List<SysDictItem>> r = remoteDictService.getDictByType("market_type");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("甯傚満绫诲瀷瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotal(null);
- items.stream().forEach(item->{
+ items.stream().forEach(item -> {
AgingAnalysisVo agingAnalysisVo = new AgingAnalysisVo();
agingAnalysisVo.setCompanyName(item.getLabel());
queryDTO.setClassId(item.getItemValue());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotal(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -854,7 +859,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -876,9 +881,9 @@
List<AgingAnalysisVo> result = new ArrayList<>();
AgingQueryDTO queryDTO = new AgingQueryDTO();
List<AgingVo> agingVoList = contractPaymentScheduleMapper.selectAgingTotalScale(null);
- compIds.stream().forEach(compId->{
+ compIds.stream().forEach(compId -> {
R<SysDept> r = remoteDeptService.getById(compId);
- if (!r.isOk()){
+ if (!r.isOk()) {
return;
}
SysDept dept = r.getData();
@@ -887,44 +892,44 @@
queryDTO.setCompanyId(dept.getDeptId());
List<AgingVo> companyAgingVo = contractPaymentScheduleMapper.selectAgingTotalScale(queryDTO);
//琛ュ叏鏁版嵁
- if (CollUtil.isEmpty(companyAgingVo)){
+ if (CollUtil.isEmpty(companyAgingVo)) {
companyAgingVo = new ArrayList<>();
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
companyAgingVo.add(agingVo2);
companyAgingVo.add(agingVo3);
companyAgingVo.add(agingVo4);
companyAgingVo.add(agingVo5);
companyAgingVo.add(agingVo6);
- }else {
+ } else {
List<String> overdueRanges = companyAgingVo.stream().map(AgingVo::getOverdueRange).collect(Collectors.toList());
- if (!CollUtil.contains(overdueRanges,"0-30澶�")){
- AgingVo agingVo1 = new AgingVo(1L,"0-30澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "0-30澶�")) {
+ AgingVo agingVo1 = new AgingVo(1L, "0-30澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo1);
}
- if (!CollUtil.contains(overdueRanges,"31-60澶�")){
- AgingVo agingVo2 = new AgingVo(2L,"31-60澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "31-60澶�")) {
+ AgingVo agingVo2 = new AgingVo(2L, "31-60澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo2);
}
- if (!CollUtil.contains(overdueRanges,"61-90澶�")){
- AgingVo agingVo3 = new AgingVo(3L,"61-90澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "61-90澶�")) {
+ AgingVo agingVo3 = new AgingVo(3L, "61-90澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo3);
}
- if (!CollUtil.contains(overdueRanges,"91-180澶�")){
- AgingVo agingVo4 = new AgingVo(4L,"91-180澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "91-180澶�")) {
+ AgingVo agingVo4 = new AgingVo(4L, "91-180澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo4);
}
- if (!CollUtil.contains(overdueRanges,"181-365澶�")){
- AgingVo agingVo5 = new AgingVo(5L,"181-365澶�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "181-365澶�")) {
+ AgingVo agingVo5 = new AgingVo(5L, "181-365澶�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo5);
}
- if (!CollUtil.contains(overdueRanges,"1骞翠互涓�")){
- AgingVo agingVo6 = new AgingVo(6L,"1骞翠互涓�",new BigDecimal("0"),null);
+ if (!CollUtil.contains(overdueRanges, "1骞翠互涓�")) {
+ AgingVo agingVo6 = new AgingVo(6L, "1骞翠互涓�", new BigDecimal("0"), null);
companyAgingVo.add(agingVo6);
}
}
@@ -954,7 +959,7 @@
if (agingAnalysisVo.getAmount().get(i) == null || agingAnalysisVo.getAmount().get(i).compareTo(BigDecimal.ZERO) == 0) {
return null;
- }else {
+ } else {
return new BigDecimal("100");
}
})
@@ -965,22 +970,183 @@
}
@Override
+ public R homeZbjtChart(HomeZbjtDTO queryDTO) {
+ if (StrUtil.isBlank(queryDTO.getType())) {
+ return R.failed("璇蜂紶type");
+ }
+ JSONObject result = new JSONObject();
+ HomeZbjtVo kp = contractInvoiceMapper.homeZbjt();
+ result.put("chart-sr", handleChart(kp, queryDTO.getType()));
+ HomeZbjtVo hk = paymentSlipMapper.homeZbjt();
+ result.put("chart-hk", handleChart(hk, queryDTO.getType()));
+ HomeZbjtVo htqd = contractMapper.homeZbjt();
+ result.put("chart-ht", handleChart(htqd, queryDTO.getType()));
+ return R.ok(result);
+ }
+
+// private JSONArray handleTable(HomeZbjtVo kp, String type) {
+// kp.calcZbjt(kp);
+// JSONArray array = new JSONArray();
+// if (StrUtil.equals(type, "1")) {
+// JSONObject smj = new JSONObject();
+// smj.put("name", "鐭崇叅鏈�");
+// smj.put("lj", kp.getSmjby() == null ? BigDecimal.ZERO : kp.getSmjby());
+// smj.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// smj.put("zb", smj.getBigDecimal("lj").divide(kp.getZbby(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// smj.put("tb", "");
+// array.add(smj);
+// JSONObject sgb = new JSONObject();
+// sgb.put("name", "鐭冲伐娉�");
+// sgb.put("lj", kp.getSgbby() == null ? BigDecimal.ZERO : kp.getSgbby());
+// sgb.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// sgb.put("zb", sgb.getBigDecimal("lj").divide(kp.getZbby(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// sgb.put("tb", "");
+// array.add(sgb);
+// JSONObject tf = new JSONObject();
+// tf.put("name", "閫氭柟鍏徃");
+// tf.put("lj", kp.getTfby() == null ? BigDecimal.ZERO : kp.getTfby());
+// tf.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// tf.put("zb", tf.getBigDecimal("lj").divide(kp.getZbby(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// tf.put("tb", "");
+// array.add(tf);
+// JSONObject jxc = new JSONObject();
+// jxc.put("name", "鏈烘鍘�");
+// jxc.put("lj", kp.getJxcby() == null ? BigDecimal.ZERO : kp.getJxcby());
+//
+// jxc.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// jxc.put("zb", jxc.getBigDecimal("lj").divide(kp.getZbby(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// jxc.put("tb", "");
+// array.add(jxc);
+// JSONObject ymj = new JSONObject();
+// ymj.put("name", "涓�鐓ゆ満");
+// ymj.put("lj", kp.getYmjby() == null ? BigDecimal.ZERO : kp.getYmjby());
+// ymj.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// ymj.put("zb", ymj.getBigDecimal("lj").divide(kp.getZbby(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+//
+// ymj.put("tb", "");
+// array.add(ymj);
+// }
+// if (StrUtil.equals(type, "2")) {
+// JSONObject smj = new JSONObject();
+// smj.put("name", "鐭崇叅鏈�");
+// smj.put("lj", kp.getSmjbn() == null ? BigDecimal.ZERO : kp.getSmjbn());
+// smj.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// smj.put("zb", smj.getBigDecimal("lj").divide(kp.getZbbn(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// smj.put("tb", "");
+// array.add(smj);
+// JSONObject sgb = new JSONObject();
+// sgb.put("name", "鐭冲伐娉�");
+// sgb.put("lj", kp.getSgbbn() == null ? BigDecimal.ZERO : kp.getSgbbn());
+// sgb.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// sgb.put("zb", sgb.getBigDecimal("lj").divide(kp.getZbbn(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// sgb.put("tb", "");
+// array.add(sgb);
+// JSONObject tf = new JSONObject();
+// tf.put("name", "閫氭柟鍏徃");
+// tf.put("lj", kp.getTfbn() == null ? BigDecimal.ZERO : kp.getTfbn());
+// tf.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// tf.put("zb", tf.getBigDecimal("lj").divide(kp.getZbbn(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// tf.put("tb", "");
+// array.add(tf);
+// JSONObject jxc = new JSONObject();
+// jxc.put("name", "鏈烘鍘�");
+// jxc.put("lj", kp.getJxcbn() == null ? BigDecimal.ZERO : kp.getJxcbn());
+// jxc.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// jxc.put("zb", jxc.getBigDecimal("lj").divide(kp.getZbbn(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// jxc.put("tb", "");
+// array.add(jxc);
+// JSONObject ymj = new JSONObject();
+// ymj.put("name", "涓�鐓ゆ満");
+// ymj.put("lj", kp.getYmjbn() == null ? BigDecimal.ZERO : kp.getYmjbn());
+// ymj.put("zb", "");
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// ymj.put("zb", ymj.getBigDecimal("lj").divide(kp.getZbbn(), 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// ymj.put("tb", "");
+// array.add(ymj);
+// }
+// return array;
+// }
+
+ private List<BigDecimal> handleChart(HomeZbjtVo htqd, String type) {
+ if (StrUtil.equals(type, "1")) {
+ List<BigDecimal> srList = new ArrayList<>();
+ srList.add(htqd.getSmjby() == null ? BigDecimal.ZERO : htqd.getSmjby());
+ srList.add(htqd.getSgbby() == null ? BigDecimal.ZERO : htqd.getSgbby());
+ srList.add(htqd.getTfby() == null ? BigDecimal.ZERO : htqd.getTfby());
+ srList.add(htqd.getJxcby() == null ? BigDecimal.ZERO : htqd.getJxcby());
+ srList.add(htqd.getYmjby() == null ? BigDecimal.ZERO : htqd.getYmjby());
+ return srList;
+ }
+ if (StrUtil.equals(type, "2")) {
+ List<BigDecimal> srList = new ArrayList<>();
+ srList.add(htqd.getSmjbn() == null ? BigDecimal.ZERO : htqd.getSmjbn());
+ srList.add(htqd.getSgbbn() == null ? BigDecimal.ZERO : htqd.getSgbbn());
+ srList.add(htqd.getTfbn() == null ? BigDecimal.ZERO : htqd.getTfbn());
+ srList.add(htqd.getJxcbn() == null ? BigDecimal.ZERO : htqd.getJxcbn());
+ srList.add(htqd.getYmjbn() == null ? BigDecimal.ZERO : htqd.getYmjbn());
+ return srList;
+ }
+ return null;
+ }
+
+ @Override
public R homeZbjt() {
- List<HomeZbjtVo> homeZbjtVoList = new ArrayList<>();
+// List<HomeZbjtVo> homeZbjtVoList = new ArrayList<>();
+// String curYear = DateUtil.year(new Date()) + "";
+// String curMonth = DateUtil.month(new Date()) + "";
//鍑鸿揣
// HomeZbjtVo ch = contractOutBoundMapper.homeZbjt();
// homeZbjtVoList.add(ch);
//鍙繚鐣欓攢鍞敹鍏� 鍥炴 鏂板鍚堝悓
//寮�绁�
- HomeZbjtVo kp = contractInvoiceMapper.homeZbjt();
- homeZbjtVoList.add(kp);
+// HomeZbjtVo kp = contractInvoiceMapper.homeZbjt();
+// kp.calcZbjt(kp);
+//
+// kp = handleWCAndTB("2", curMonth, curYear, kp);
+//
+// homeZbjtVoList.add(kp);
//鍥炴
- HomeZbjtVo hk = paymentSlipMapper.homeZbjt();
- homeZbjtVoList.add(hk);
+// HomeZbjtVo hk = paymentSlipMapper.homeZbjt();
+// hk.calcZbjt(hk);
+// hk = handleWCAndTB("3", curMonth, curYear, hk);
+//
+// homeZbjtVoList.add(hk);
//鍚堝悓绛捐 sgb smj jxc tfgs ymj
- HomeZbjtVo htqd = contractMapper.homeZbjt();
- homeZbjtVoList.add(htqd);
+// HomeZbjtVo htqd = contractMapper.homeZbjt();
+// htqd.calcZbjt(htqd);
+// hk = handleWCAndTB("1", curMonth, curYear, htqd);
+// homeZbjtVoList.add(htqd);
//璧婇攢浜х敓鍊� 浠婂ぉ鍙戣揣鍔犱粖澶╁紑绁ㄩ
// if (ObjUtil.isNotNull(ch)&&ObjUtil.isNotNull(kp)){
// HomeZbjtVo sxsy = ch.add(kp);
@@ -1010,7 +1176,116 @@
// //閫炬湡浜х敓鍊� 浠婂ぉ浜х敓-浠婂ぉ宸蹭粯
//
// homeZbjtVoList.add(yq);
- return R.ok(homeZbjtVoList);
+ return R.ok();
+ }
+
+ private HomeZbjtVo handleWCAndTB(String planType, String curMonth, String curYear, HomeZbjtVo kp) {
+ List<Long> compIds = new ArrayList<>();
+ compIds.add(2089995177814495234L);
+ compIds.add(2089996921978040321L);
+ compIds.add(2089997578009128962L);
+ compIds.add(2101966257365045249L);
+ //瑁呭
+// AnnualPlanTotalVo planListZB = annualPlanMapper.selectPlanYear(curYear, planType);
+// if (ObjUtil.isNotNull(planListZB)) {
+// AnnualPlanTotalVo planzb = BeanUtil.copyProperties(planListZB, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planzb.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getZbby()) && kp.getZbby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getZbby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = planzb.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getZbbn()) && kp.getZbbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getZbbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// //鐭崇叅鏈烘敹鍏�
+// AnnualPlan planListSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSMJ)) {
+// AnnualPlanTotalVo plansmj = BeanUtil.copyProperties(planListSMJ, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plansmj.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getSmjby()) && kp.getSmjby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getSmjby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = plansmj.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getSmjbn()) && kp.getSmjbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getSmjbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// //鐭冲伐娉垫敹鍏�
+// AnnualPlan planListSRSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRSGB)) {
+// AnnualPlanTotalVo plansgb = BeanUtil.copyProperties(planListSRSGB, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plansgb.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getSgbby()) && kp.getSgbby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getSgbby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = plansgb.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getSgbbn()) && kp.getSgbbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getSgbbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// //閫氭柟鍏徃鏀跺叆
+// AnnualPlan planListSRTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRTFGS)) {
+// AnnualPlanTotalVo plantf = BeanUtil.copyProperties(planListSRTFGS, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = plantf.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getTfby()) && kp.getTfby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getTfby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = plantf.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getTfbn()) && kp.getTfbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getTfbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// //鏈烘鍘傛敹鍏�
+// AnnualPlan planListSRJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListSRJXC)) {
+// AnnualPlanTotalVo planjxc = BeanUtil.copyProperties(planListSRJXC, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planjxc.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getJxcby()) && kp.getJxcby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getJxcby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = planjxc.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getJxcbn()) && kp.getJxcbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getJxcbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+// //涓�鐓ゆ満鏀跺叆
+// AnnualPlan planListHYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+// .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, planType)
+// .eq(AnnualPlan::getCompId, 2056556535640576002L).last("limit 1"));
+// if (ObjUtil.isNotNull(planListHYMJ)) {
+// AnnualPlanTotalVo planymj = BeanUtil.copyProperties(planListHYMJ, AnnualPlanTotalVo.class);
+// BigDecimal curMonAmount = planymj.getMonthAmount(curMonth);
+// if (ObjUtil.isNotNull(kp.getYmjby()) && kp.getYmjby().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getYmjby().divide(curMonAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// BigDecimal yearAmount = planymj.getTotalAmount();
+// if (ObjUtil.isNotNull(kp.getYmjbn()) && kp.getYmjbn().compareTo(new BigDecimal("0")) > 0) {
+// kp.setSmjbywc(kp.getYmjbn().divide(yearAmount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))
+// .setScale(2, RoundingMode.HALF_UP) + "%");
+// }
+// }
+ return kp;
}
@Override
@@ -1072,9 +1347,10 @@
compIds.add(Long.valueOf(tfgs));
compIds.add(Long.valueOf(ymj));
compIds.add(Long.valueOf(jxc));
- if (compIds.contains(userId)){
+ if (compIds.contains(userId)) {
return R.ok(false);
- };
+ }
+ ;
return R.ok(true);
}
@@ -1098,19 +1374,18 @@
LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX);
MPJLambdaWrapper<Contract> wrapper = new MPJLambdaWrapper<Contract>()
- .selectAll(Contract.class)
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),Contract::getSignDate,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),Contract::getSignDate,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),Contract::getSignDate,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),Contract::getSignDate,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),Contract::getSignDate,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),Contract::getSignDate,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(Contract::getCreateTime)
- ;
+ .selectAll(Contract.class)
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, Contract::getPartyAId)
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), Contract::getSignDate, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), Contract::getSignDate, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), Contract::getSignDate, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), Contract::getSignDate, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), Contract::getSignDate, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), Contract::getSignDate, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(Contract::getCreateTime);
return R.ok(contractMapper.selectList(wrapper));
}
@@ -1134,18 +1409,17 @@
LocalDateTime endOfYear = today.withDayOfYear(today.lengthOfYear()).atTime(LocalTime.MAX);
MPJLambdaWrapper<PaymentSlip> wrapper = new MPJLambdaWrapper<PaymentSlip>()
.selectAll(PaymentSlip.class)
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,PaymentSlip::getBusGuestId)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),PaymentSlip::getPaymentTime,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),PaymentSlip::getPaymentTime,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),PaymentSlip::getPaymentTime,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),PaymentSlip::getPaymentTime,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),PaymentSlip::getPaymentTime,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),PaymentSlip::getPaymentTime,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(PaymentSlip::getCreateTime)
- ;
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, PaymentSlip::getBusGuestId)
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), PaymentSlip::getPaymentTime, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), PaymentSlip::getPaymentTime, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), PaymentSlip::getPaymentTime, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), PaymentSlip::getPaymentTime, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), PaymentSlip::getPaymentTime, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), PaymentSlip::getPaymentTime, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(PaymentSlip::getCreateTime);
return R.ok(paymentSlipMapper.selectList(wrapper));
}
@@ -1170,26 +1444,25 @@
MPJLambdaWrapper<ContractOutBound> wrapper = new MPJLambdaWrapper<ContractOutBound>()
.selectAll(ContractOutBound.class)
.select(Contract::getContractNo)
- .selectAs(BusinessCustomer::getCompanyName,"busGuestName")
+ .selectAs(BusinessCustomer::getCompanyName, "busGuestName")
.select(ContractSubjectMatter::getUnitPrice)
- .leftJoin(Contract.class,Contract::getId,ContractOutBound::getContractId)
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,ContractOutBound::getBusGuestId)
- .leftJoin(ContractSubjectMatter.class, on->
- on.eq(ContractSubjectMatter::getContractId,ContractOutBound::getContractId)
- .eq(ContractSubjectMatter::getMaterialCode,ContractOutBound::getSubjectMatterCode)
+ .leftJoin(Contract.class, Contract::getId, ContractOutBound::getContractId)
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, ContractOutBound::getBusGuestId)
+ .leftJoin(ContractSubjectMatter.class, on ->
+ on.eq(ContractSubjectMatter::getContractId, ContractOutBound::getContractId)
+ .eq(ContractSubjectMatter::getMaterialCode, ContractOutBound::getSubjectMatterCode)
)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(ContractOutBound::getCreateTime)
- ;
- return R.ok(contractOutBoundMapper.selectJoinList(HomeOutBoundVo.class,wrapper));
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractOutBound::getOutBoundTime, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractOutBound::getOutBoundTime, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractOutBound::getOutBoundTime, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractOutBound::getOutBoundTime, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractOutBound::getOutBoundTime, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractOutBound::getOutBoundTime, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(ContractOutBound::getCreateTime);
+ return R.ok(contractOutBoundMapper.selectJoinList(HomeOutBoundVo.class, wrapper));
}
@Override
@@ -1213,21 +1486,20 @@
MPJLambdaWrapper<ContractInvoice> wrapper = new MPJLambdaWrapper<ContractInvoice>()
.selectAll(ContractInvoice.class)
.select(Contract::getContractNo)
- .selectAs(BusinessCustomer::getCompanyName,"busGuestName")
- .leftJoin(Contract.class,Contract::getId,ContractInvoice::getContractId)
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractInvoice::getInvoiceTime,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractInvoice::getInvoiceTime,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractInvoice::getInvoiceTime,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractInvoice::getInvoiceTime,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractInvoice::getInvoiceTime,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractInvoice::getInvoiceTime,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(ContractInvoice::getCreateTime)
- ;
- return R.ok(contractInvoiceMapper.selectJoinList(HomeInvoiceVo.class,wrapper));
+ .selectAs(BusinessCustomer::getCompanyName, "busGuestName")
+ .leftJoin(Contract.class, Contract::getId, ContractInvoice::getContractId)
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, Contract::getPartyAId)
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractInvoice::getInvoiceTime, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractInvoice::getInvoiceTime, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractInvoice::getInvoiceTime, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractInvoice::getInvoiceTime, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractInvoice::getInvoiceTime, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractInvoice::getInvoiceTime, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(ContractInvoice::getCreateTime);
+ return R.ok(contractInvoiceMapper.selectJoinList(HomeInvoiceVo.class, wrapper));
}
@Override
@@ -1251,26 +1523,25 @@
MPJLambdaWrapper<ContractOutBound> wrapper = new MPJLambdaWrapper<ContractOutBound>()
.selectAll(ContractOutBound.class)
.select(Contract::getContractNo)
- .selectAs(BusinessCustomer::getCompanyName,"busGuestName")
+ .selectAs(BusinessCustomer::getCompanyName, "busGuestName")
.select(ContractSubjectMatter::getUnitPrice)
- .leftJoin(Contract.class,Contract::getId,ContractOutBound::getContractId)
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,Contract::getPartyAId)
- .leftJoin(ContractSubjectMatter.class, on->
- on.eq(ContractSubjectMatter::getContractId,ContractOutBound::getContractId)
- .eq(ContractSubjectMatter::getMaterialCode,ContractOutBound::getSubjectMatterCode)
+ .leftJoin(Contract.class, Contract::getId, ContractOutBound::getContractId)
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, Contract::getPartyAId)
+ .leftJoin(ContractSubjectMatter.class, on ->
+ on.eq(ContractSubjectMatter::getContractId, ContractOutBound::getContractId)
+ .eq(ContractSubjectMatter::getMaterialCode, ContractOutBound::getSubjectMatterCode)
)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),ContractOutBound::getOutBoundTime,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),ContractOutBound::getOutBoundTime,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),ContractOutBound::getOutBoundTime,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(ContractOutBound::getCreateTime)
- ;
- return R.ok(contractOutBoundMapper.selectJoinList(HomeCreditSaleVo.class,wrapper));
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractOutBound::getOutBoundTime, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), ContractOutBound::getOutBoundTime, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractOutBound::getOutBoundTime, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), ContractOutBound::getOutBoundTime, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractOutBound::getOutBoundTime, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), ContractOutBound::getOutBoundTime, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(ContractOutBound::getCreateTime);
+ return R.ok(contractOutBoundMapper.selectJoinList(HomeCreditSaleVo.class, wrapper));
}
@Override
@@ -1294,33 +1565,32 @@
MPJLambdaWrapper<CurrentOverdue> wrapper = new MPJLambdaWrapper<CurrentOverdue>()
.selectAll(CurrentOverdue.class)
.select(Contract::getContractNo)
- .selectAs(BusinessCustomer::getCompanyName,"busGuestName")
- .leftJoin(BusinessCustomer.class,BusinessCustomer::getId,CurrentOverdue::getBusGuestId)
- .leftJoin(Contract.class,Contract::getId,CurrentOverdue::getContractId)
- .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()),Contract::getCompId,queryDTO.getQueryCompId())
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),CurrentOverdue::getContractExpirTime,startOfDay)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"1"),CurrentOverdue::getContractExpirTime,endOfDay)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),CurrentOverdue::getContractExpirTime,startOfMonth)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"2"),CurrentOverdue::getContractExpirTime,endOfMonth)
- .ge(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),CurrentOverdue::getContractExpirTime,startOfYear)
- .le(StrUtil.isNotEmpty(queryDTO.getQueryType())&&StrUtil.equals(queryDTO.getQueryType(),"3"),CurrentOverdue::getContractExpirTime,endOfYear)
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()),BusinessCustomer::getAreaId,queryDTO.getQueryArea())
- .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()),BusinessCustomer::getExportServiceAttr,queryDTO.getQueryServiceAttr())
- .orderByDesc(CurrentOverdue::getCreateTime)
- ;
- return R.ok(currentOverdueMapper.selectJoinList(HomeOverdueVo.class,wrapper));
+ .selectAs(BusinessCustomer::getCompanyName, "busGuestName")
+ .leftJoin(BusinessCustomer.class, BusinessCustomer::getId, CurrentOverdue::getBusGuestId)
+ .leftJoin(Contract.class, Contract::getId, CurrentOverdue::getContractId)
+ .eq(ObjUtil.isNotNull(queryDTO.getQueryCompId()), Contract::getCompId, queryDTO.getQueryCompId())
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), CurrentOverdue::getContractExpirTime, startOfDay)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "1"), CurrentOverdue::getContractExpirTime, endOfDay)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), CurrentOverdue::getContractExpirTime, startOfMonth)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "2"), CurrentOverdue::getContractExpirTime, endOfMonth)
+ .ge(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), CurrentOverdue::getContractExpirTime, startOfYear)
+ .le(StrUtil.isNotEmpty(queryDTO.getQueryType()) && StrUtil.equals(queryDTO.getQueryType(), "3"), CurrentOverdue::getContractExpirTime, endOfYear)
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryArea()), BusinessCustomer::getAreaId, queryDTO.getQueryArea())
+ .eq(StrUtil.isNotEmpty(queryDTO.getQueryServiceAttr()), BusinessCustomer::getExportServiceAttr, queryDTO.getQueryServiceAttr())
+ .orderByDesc(CurrentOverdue::getCreateTime);
+ return R.ok(currentOverdueMapper.selectJoinList(HomeOverdueVo.class, wrapper));
}
@Override
public R homeOverdueHis(HomeQueryDTO queryDTO) {
List<HomeOverdueStaVo> homeOverdueVos = new ArrayList<>();
HomeOverdueStaVo current = currentOverdueMapper.selectCurrentOverdue(queryDTO);
- if (ObjUtil.isNotNull(current)){
+ if (ObjUtil.isNotNull(current)) {
current.setOverdueType("褰撳墠");
homeOverdueVos.add(current);
}
HomeOverdueStaVo history = historyOverdueMapper.selectHistoryOverdue(queryDTO);
- if (ObjUtil.isNotNull(history)){
+ if (ObjUtil.isNotNull(history)) {
history.setOverdueType("鍘嗗彶");
homeOverdueVos.add(history);
}
@@ -1331,27 +1601,437 @@
public R homeZgsColum() {
R<List<SysDictItem>> r = remoteDictService.getDictByType("province");
List<SysDictItem> items = r.getData();
- if (CollUtil.isEmpty(items)){
+ if (CollUtil.isEmpty(items)) {
return R.failed("瀹㈠晢鐪佷唤瀛楀吀鍒嗙被鑾峰彇寮傚父");
}
List<HomeZgsData> list = new ArrayList<>();
List<String> contractProvinces = contractMapper.homeZgsColum(SecurityUtils.getUser().getCompId());
- if (CollUtil.isNotEmpty(contractProvinces)){
- contractProvinces.stream().forEach(province->{
- HomeZgsData homeZgsData = contractInvoiceMapper.homeZgsData(SecurityUtils.getUser().getCompId(),province);
- SysDictItem result = items.stream()
- .filter(item -> item != null && province.equals(item.getItemValue()))
- .findFirst()
- .orElse(null);
- homeZgsData.setProvinceCode(province);
- if (ObjUtil.isNotNull(result)){
+ if (CollUtil.isNotEmpty(contractProvinces)) {
+ contractProvinces.stream().forEach(province -> {
+ HomeZgsData homeZgsData = contractInvoiceMapper.homeZgsData(SecurityUtils.getUser().getCompId(), province);
+ if (ObjUtil.isNotNull(homeZgsData)) {
+ SysDictItem result = items.stream()
+ .filter(item -> item != null && province.equals(item.getItemValue()))
+ .findFirst()
+ .orElse(null);
+ homeZgsData.setProvinceCode(province);
+ if (ObjUtil.isNotNull(result)) {
- homeZgsData.setProvinceName(result.getLabel());
+ homeZgsData.setProvinceName(result.getLabel());
+ }
+ list.add(homeZgsData);
}
- list.add(homeZgsData);
});
return R.ok(list);
}
return R.ok();
}
+
+ @Override
+ public R zbjtStatistic() {
+ List<ZbjtStatisticVo> statisticVoList = new ArrayList<>();
+ String curYear = DateUtil.year(new Date()) + "";
+ String curMonth = DateUtil.month(new Date()) + "";
+ //鍚堝悓
+ ZbjtStatisticVo htVo = contractMapper.zbjtStatisticByContract();
+ AnnualPlanTotalVo planListHt = annualPlanMapper.selectPlanYear(curYear, "1");
+ if (ObjUtil.isNotNull(htVo) && ObjUtil.isNotNull(planListHt)) {
+ BigDecimal monAmount = planListHt.getMonthAmount(curMonth);
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ htVo.setBmwc(new BigDecimal(htVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ BigDecimal yearAmount = planListHt.getTotalAmount();
+ if (ObjUtil.isNotNull(yearAmount) && yearAmount.compareTo(new BigDecimal("0")) > 0) {
+ htVo.setBnwc(new BigDecimal(htVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ statisticVoList.add(htVo);
+ //寮�绁�
+ ZbjtStatisticVo kpVo = contractInvoiceMapper.zbjtStatisticByInvoice();
+ AnnualPlanTotalVo planListFP = annualPlanMapper.selectPlanYear(curYear, "2");
+ if (ObjUtil.isNotNull(kpVo) && ObjUtil.isNotNull(planListFP)) {
+ BigDecimal monAmount = planListFP.getMonthAmount(curMonth);
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ kpVo.setBmwc(new BigDecimal(kpVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ BigDecimal yearAmount = planListFP.getTotalAmount();
+ if (ObjUtil.isNotNull(yearAmount) && yearAmount.compareTo(new BigDecimal("0")) > 0) {
+ kpVo.setBnwc(new BigDecimal(kpVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ statisticVoList.add(kpVo);
+ //鍥炴
+ ZbjtStatisticVo hkVo = paymentSlipMapper.zbjtStatisticByPayment();
+ AnnualPlanTotalVo planListHK = annualPlanMapper.selectPlanYear(curYear, "2");
+ if (ObjUtil.isNotNull(hkVo) && ObjUtil.isNotNull(planListHK)) {
+ BigDecimal monAmount = planListHK.getMonthAmount(curMonth);
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ hkVo.setBmwc(new BigDecimal(hkVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ BigDecimal yearAmount = planListHK.getTotalAmount();
+ if (ObjUtil.isNotNull(yearAmount) && yearAmount.compareTo(new BigDecimal("0")) > 0) {
+ hkVo.setBnwc(new BigDecimal(hkVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ }
+ statisticVoList.add(hkVo);
+ return R.ok(statisticVoList);
+ }
+
+ @Override
+ public R zbjtStatisticContractAmount() {
+ JSONObject jsonObject = new JSONObject();
+ ZbjtStatisticByContractAmountVo hte = contractMapper.zbjtStatisticByContractAmount();
+ jsonObject.put("hte", hte);
+ ZbjtStatisticByContractAmountProVo htp = contractMapper.zbjtStatisticByContractAmountPro();
+ jsonObject.put("cpbk", htp);
+ ZbjtStatisticByContractAmountClassVo sc = contractMapper.zbjtStatisticByContractAmountClass();
+ jsonObject.put("sczb", sc);
+ ZbjtStatisticByContractAmountSupplyVo yw = contractMapper.zbjtStatisticByContractAmountSupply();
+ jsonObject.put("ywzb", yw);
+ ZbjtStatisticByContractAmountClassVo ys = contractMapper.zbjtStatisticByContractAmountYS();
+ jsonObject.put("yszb", ys);
+ return R.ok(jsonObject);
+ }
+
+ @Override
+ public R zbjtIndicatorTrend() {
+ JSONObject jsonObject = new JSONObject();
+ Integer curYear = DateUtil.year(new Date());
+ String startMon = (curYear - 3) + "-01-01";
+ String endMon = curYear + "-12-01";
+ List<ZbjtIndicatorTrendVo> trendList = contractMapper.zbjtIndicatorTrend(startMon, endMon);
+ JSONObject zbqs_ht = new JSONObject();
+ zbqs_ht.put((curYear - 3) + "", trendList.stream().filter(item -> item.getYearMon().startsWith((curYear - 3) + "")).collect(Collectors.toList()));
+ zbqs_ht.put((curYear - 2) + "", trendList.stream().filter(item -> item.getYearMon().startsWith((curYear - 2) + "")).collect(Collectors.toList()));
+ zbqs_ht.put((curYear - 1) + "", trendList.stream().filter(item -> item.getYearMon().startsWith((curYear - 1) + "")).collect(Collectors.toList()));
+ zbqs_ht.put(curYear + "", trendList.stream().filter(item -> item.getYearMon().startsWith(curYear + "")).collect(Collectors.toList()));
+ jsonObject.put("zbqs-ht", zbqs_ht);
+ List<ZbjtIndicatorTrendVo> trendInvoiceList = contractInvoiceMapper.zbjtIndicatorTrend(startMon, endMon);
+ JSONObject zbqs_sr = new JSONObject();
+ zbqs_sr.put((curYear - 3) + "", trendInvoiceList.stream().filter(item -> item.getYearMon().startsWith((curYear - 3) + "")).collect(Collectors.toList()));
+ zbqs_sr.put((curYear - 2) + "", trendInvoiceList.stream().filter(item -> item.getYearMon().startsWith((curYear - 2) + "")).collect(Collectors.toList()));
+ zbqs_sr.put((curYear - 1) + "", trendInvoiceList.stream().filter(item -> item.getYearMon().startsWith((curYear - 1) + "")).collect(Collectors.toList()));
+ zbqs_sr.put(curYear + "", trendInvoiceList.stream().filter(item -> item.getYearMon().startsWith(curYear + "")).collect(Collectors.toList()));
+ jsonObject.put("zbqs-sr", zbqs_sr);
+ List<ZbjtIndicatorTrendVo> trendSlipList = paymentSlipMapper.zbjtIndicatorTrend(startMon, endMon);
+ JSONObject zbqs_hs = new JSONObject();
+ zbqs_hs.put((curYear - 3) + "", trendSlipList.stream().filter(item -> item.getYearMon().startsWith((curYear - 3) + "")).collect(Collectors.toList()));
+ zbqs_hs.put((curYear - 2) + "", trendSlipList.stream().filter(item -> item.getYearMon().startsWith((curYear - 2) + "")).collect(Collectors.toList()));
+ zbqs_hs.put((curYear - 1) + "", trendSlipList.stream().filter(item -> item.getYearMon().startsWith((curYear - 1) + "")).collect(Collectors.toList()));
+ zbqs_hs.put(curYear + "", trendSlipList.stream().filter(item -> item.getYearMon().startsWith(curYear + "")).collect(Collectors.toList()));
+ jsonObject.put("zbqs-hk", zbqs_hs);
+ return R.ok(jsonObject);
+ }
+
+ @Override
+ public R zbjtPlanAchieced() {
+ String curYear = DateUtil.year(new Date()) + "";
+ JSONObject jsonObject = new JSONObject();
+ JSONObject ht = new JSONObject();
+ AnnualPlanTotalVo planListHt = annualPlanMapper.selectPlanYear(curYear, "1");
+ List<ZbjtIndicatorTrendVo> trendVoList = contractMapper.zbjtPlanAchieced(null);
+ if (ObjUtil.isNotNull(planListHt) && CollUtil.isNotEmpty(trendVoList)) {
+ trendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHt.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ ht.put("zb", trendVoList);
+ List<Long> compIds = new ArrayList<>();
+ compIds.add(2089995177814495234L);
+ compIds.add(2089996921978040321L);
+ compIds.add(2089997578009128962L);
+ compIds.add(2101966257365045249L);
+
+ AnnualPlan planListHtSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> smjtrendVoList = contractMapper.zbjtPlanAchiecedSmj();
+ if (ObjUtil.isNotNull(planListHtSMJ) && CollUtil.isNotEmpty(smjtrendVoList)) {
+ smjtrendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHtSMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ ht.put("smj", smjtrendVoList);
+ AnnualPlan planListHtSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> sgbtrendVoList = contractMapper.zbjtPlanAchieced(2056556196124250113L);
+ if (ObjUtil.isNotNull(planListHtSGB) && CollUtil.isNotEmpty(sgbtrendVoList)) {
+ sgbtrendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHtSGB.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ ht.put("sgb", sgbtrendVoList);
+ AnnualPlan planListHTfgs = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> tfgstrendVoList = contractMapper.zbjtPlanAchieced(2056556421857497090L);
+ if (ObjUtil.isNotNull(planListHTfgs) && CollUtil.isNotEmpty(tfgstrendVoList)) {
+ tfgstrendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHTfgs.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ ht.put("tfgs", tfgstrendVoList);
+ AnnualPlan planListHjxc = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> jxctrendVoList = contractMapper.zbjtPlanAchieced(2056556317461270529L);
+ if (ObjUtil.isNotNull(planListHjxc) && CollUtil.isNotEmpty(jxctrendVoList)) {
+ jxctrendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHjxc.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ ht.put("jxc", jxctrendVoList);
+ AnnualPlan planListHYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556535640576002L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> ymjtrendVoList = contractMapper.zbjtPlanAchieced(2056556535640576002L);
+ if (ObjUtil.isNotNull(planListHYMJ) && CollUtil.isNotEmpty(ymjtrendVoList)) {
+ ymjtrendVoList.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHYMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ ht.put("ymj", ymjtrendVoList);
+ jsonObject.put("ht", ht);
+ JSONObject sr = new JSONObject();
+ AnnualPlanTotalVo planLisSR = annualPlanMapper.selectPlanYear(curYear, "1");
+ List<ZbjtIndicatorTrendVo> trendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(null);
+ if (ObjUtil.isNotNull(planLisSR) && CollUtil.isNotEmpty(trendVoList1)) {
+ trendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planLisSR.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ sr.put("zb", trendVoList1);
+
+ AnnualPlan planListSRSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "2")
+ .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> smjtrendVoList1 = contractInvoiceMapper.zbjtPlanAchiecedSmj();
+ if (ObjUtil.isNotNull(planListSRSMJ) && CollUtil.isNotEmpty(smjtrendVoList1)) {
+ smjtrendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListSRSMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ sr.put("smj", smjtrendVoList1);
+ //鐭冲伐娉垫敹鍏�
+ AnnualPlan planListSRSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> sgbtrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556196124250113L);
+ if (ObjUtil.isNotNull(planListSRSGB) && CollUtil.isNotEmpty(sgbtrendVoList1)) {
+ sgbtrendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListSRSGB.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ sr.put("sgb", sgbtrendVoList1);
+ //閫氭柟鍏徃鏀跺叆
+ AnnualPlan planListSRTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> tfgstrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556421857497090L);
+
+ if (ObjUtil.isNotNull(planListSRTFGS) && CollUtil.isNotEmpty(tfgstrendVoList1)) {
+ tfgstrendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListSRTFGS.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ sr.put("tfgs", tfgstrendVoList1);
+ //鏈烘鍘傛敹鍏�
+ AnnualPlan planListSRJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> jxctrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556317461270529L);
+
+
+ if (ObjUtil.isNotNull(planListSRJXC) && CollUtil.isNotEmpty(jxctrendVoList1)) {
+ jxctrendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListSRJXC.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ sr.put("jxc", jxctrendVoList1);
+ //涓�鐓ゆ満鏀跺叆
+ AnnualPlan planListSRYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> ymjtrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556535640576002L);
+
+
+ if (ObjUtil.isNotNull(planListSRYMJ) && CollUtil.isNotEmpty(ymjtrendVoList1)) {
+ ymjtrendVoList1.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListSRYMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ sr.put("ymj", ymjtrendVoList1);
+ jsonObject.put("sr", sr);
+
+ JSONObject hk = new JSONObject();
+ //鍥炴
+ AnnualPlanTotalVo planLisHK = annualPlanMapper.selectPlanYear(curYear, "1");
+ List<ZbjtIndicatorTrendVo> trendVoList2 = paymentSlipMapper.zbjtPlanAchieced(null);
+ if (ObjUtil.isNotNull(planLisHK) && CollUtil.isNotEmpty(trendVoList2)) {
+ trendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planLisHK.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+ hk.put("zb", trendVoList2);
+ //鐭崇叅鏈哄洖娆�
+ AnnualPlan planListHKSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "2")
+ .in(AnnualPlan::getCompId, compIds).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> smjtrendVoList2 = paymentSlipMapper.zbjtPlanAchiecedSmj();
+ if (ObjUtil.isNotNull(planListHKSMJ) && CollUtil.isNotEmpty(smjtrendVoList2)) {
+ smjtrendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHKSMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ hk.put("smj", smjtrendVoList2);
+ //鐭冲伐娉靛洖娆�
+ AnnualPlan planListHKSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556196124250113L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> sgbtrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556196124250113L);
+
+
+ if (ObjUtil.isNotNull(planListHKSGB) && CollUtil.isNotEmpty(sgbtrendVoList2)) {
+ sgbtrendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHKSGB.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ hk.put("sgb", sgbtrendVoList2);
+ //tfgs鍥炴
+ AnnualPlan planListHKTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556421857497090L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> tfgstrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556421857497090L);
+
+ if (ObjUtil.isNotNull(planListHKTFGS) && CollUtil.isNotEmpty(tfgstrendVoList2)) {
+ tfgstrendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHKTFGS.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ hk.put("tfgs", tfgstrendVoList2);
+ //鏈烘鍘傚洖娆�
+ AnnualPlan planListHKJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556317461270529L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> jxctrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556317461270529L);
+
+ if (ObjUtil.isNotNull(planListHKJXC) && CollUtil.isNotEmpty(jxctrendVoList2)) {
+ jxctrendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHKJXC.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+
+ hk.put("jxc", jxctrendVoList2);
+ //涓�鐓ゆ満鍥炴
+ AnnualPlan planListHKYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery()
+ .eq(AnnualPlan::getPlanYear, curYear).eq(AnnualPlan::getPlanType, "1")
+ .eq(AnnualPlan::getCompId, 2056556535640576002L).last("limit 1"));
+ List<ZbjtIndicatorTrendVo> ymjtrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556535640576002L);
+
+ if (ObjUtil.isNotNull(planListHKYMJ) && CollUtil.isNotEmpty(ymjtrendVoList2)) {
+ ymjtrendVoList2.stream().forEach(trendVo -> {
+ BigDecimal monAmount = planListHKYMJ.getMonthAmount(trendVo.getYearMon());
+ if (ObjUtil.isNotNull(monAmount) && monAmount.compareTo(new BigDecimal("0")) > 0) {
+ trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount, 2, RoundingMode.HALF_UP) + "%");
+ }
+ });
+ }
+
+ hk.put("ymj", ymjtrendVoList2);
+ jsonObject.put("hk", hk);
+ return R.ok(jsonObject);
+ }
+
+ @Override
+ public R zbjtReceiveScale() {
+
+ JSONObject hk = new JSONObject();
+ //鍥炴
+ List<ZbjtIndicatorTrendVo> trendVoList = paymentReceiveMapper.zbjtReceiveScale(null);
+ hk.put("zb", trendVoList);
+ //鐭崇叅鏈哄洖娆�
+
+ List<Long> compIds = new ArrayList<>();
+ compIds.add(2089995177814495234L);
+ compIds.add(2089996921978040321L);
+ compIds.add(2089997578009128962L);
+ compIds.add(2101966257365045249L);
+
+ List<ZbjtIndicatorTrendVo> trendVoListSMJ = paymentReceiveMapper.zbjtReceiveScaleSMJ();
+ hk.put("smj", trendVoListSMJ);
+ //鐭冲伐娉靛洖娆�
+ List<ZbjtIndicatorTrendVo> trendVoListSGB = paymentReceiveMapper.zbjtReceiveScale(2056556196124250113L);
+
+ hk.put("sgb", trendVoListSGB);
+ //tfgs
+ List<ZbjtIndicatorTrendVo> trendVoListTFGS = paymentReceiveMapper.zbjtReceiveScale(2056556421857497090L);
+ hk.put("tfgs", trendVoListTFGS);
+ //鏈烘鍘傚洖娆�
+ List<ZbjtIndicatorTrendVo> trendVoListJXC = paymentReceiveMapper.zbjtReceiveScale(2056556317461270529L);
+ hk.put("jxc", trendVoListJXC);
+ //涓�鐓ゆ満鍥炴
+ List<ZbjtIndicatorTrendVo> trendVoListYMJ = paymentReceiveMapper.zbjtReceiveScale(2056556535640576002L);
+ hk.put("ymj", trendVoListYMJ);
+ return R.ok(hk);
+ }
}
--
Gitblit v1.9.1