add:统计变更

This commit is contained in:
zhangqinlin
2022-03-30 18:39:22 +08:00
parent 16ee8693a1
commit b7ae0ac05e
12 changed files with 1760 additions and 436 deletions
@@ -15,6 +15,7 @@ import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysDepartService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.AllMoney;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.jero.util.AmountUtil;
@@ -96,12 +97,12 @@ public class AllProjectStatisticsController {
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, null );
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
}
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
DecimalFormat df = new DecimalFormat("#,##0.00");
if (pageList.getRecords() != null) {
for(AllProjectStatistics s: pageList.getRecords()){
@@ -120,8 +121,10 @@ public class AllProjectStatisticsController {
}
}
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
hashMap.put("sumOfReallyMoney", sumTwo==0.0?sumTwo:df.format(sumTwo));
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch);
hashMap.put("sumOfMoney", allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
@@ -170,13 +173,13 @@ public class AllProjectStatisticsController {
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,idList);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
}
DecimalFormat df = new DecimalFormat("#,##0.00");
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
// DecimalFormat df = new DecimalFormat("#,##0.00");
if (pageList.getRecords() != null) {
for(AllProjectStatistics s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
@@ -194,8 +197,10 @@ public class AllProjectStatisticsController {
}
}
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
hashMap.put("sumOfReallyMoney", sumTwo==0.0?sumTwo:df.format(sumTwo));
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch);
hashMap.put("sumOfMoney", allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
@@ -86,12 +86,12 @@ public class CompanyComeMoneyStatisticsController {
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,null);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
}
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
//处理为空数据为0
for(CompanyComeMoneyList s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
@@ -103,8 +103,10 @@ public class CompanyComeMoneyStatisticsController {
}
DecimalFormat df = new DecimalFormat("#,##0.00");
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
hashMap.put("sumOfReallyMoney", sumTwo==0.0?sumTwo:df.format(sumTwo));
AllMoney allMoney = payWorkingGroupService.queryPageListForCompany33(companyComeMoneySearch,null);
hashMap.put("sumOfMoney",allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
@@ -160,13 +162,13 @@ public class CompanyComeMoneyStatisticsController {
s.setChargeCompanyName(byId.getCompanyName());
}
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
}
DecimalFormat df = new DecimalFormat("#,##0.00");
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
// DecimalFormat df = new DecimalFormat("#,##0.00");
for(CompanyComeMoneyDetail s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
@@ -181,8 +183,9 @@ public class CompanyComeMoneyStatisticsController {
s.setComeAllMoney("0.00");
}
}
hashMap.put("sumOfMoney", sum == 0.0 ? sum : df.format(sum));
hashMap.put("sumOfReallyMoney", sumTwo == 0.0 ? sumTwo : df.format(sumTwo));
AllMoney allMoney = payWorkingGroupService.queryPageListForCompanyDetail33(companyComeMoneyDetailSearch,null);
hashMap.put("sumOfMoney",allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
@@ -103,7 +103,7 @@ public class PrincipalPeopleStatisticsController {
sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
}
//处理为空数据为0
for(PrincipalPeopleList s: Objects.requireNonNull(pageList.getRecords())) {
for(PrincipalPeopleList s: pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
@@ -207,6 +207,16 @@ public class PrincipalPeopleStatisticsController {
return AmountUtil.exportListXls(objects, PrincipalPeopleList.class, "个人来款");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
//处理为空数据为0
for(PrincipalPeopleList s: pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");
}
@@ -229,6 +239,12 @@ public class PrincipalPeopleStatisticsController {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
}
@@ -0,0 +1,13 @@
package com.jero.statistics.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
public class AllMoney {
private String allMoney;
private String comeAllMoney;
}
@@ -25,4 +25,7 @@ public class CompanyComeMoneyList {
@Excel(name = "实收总金额", width = 15)
@ApiModelProperty(value = "实收总金额")
private String comeAllMoney;
@Excel(name = "实收完成率", width = 15)
@ApiModelProperty(value = "实收完成率")
private String finishRate;
}