全所统计
This commit is contained in:
+41
-22
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.mail.commont.constant;
|
||||
@@ -61,16 +62,33 @@ public class AllProjectStatisticsController {
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*/
|
||||
@ApiOperation(value = "全统计搜索-分页列表查询", notes = "全统计搜索-详情分页列表查询")
|
||||
@ApiOperation(value = "全所统计搜索-分页列表查询", notes = "全所统计搜索-详情分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
|
||||
if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
|
||||
List<String> idList = null;
|
||||
|
||||
//根据不同角色加载不同列表的参数
|
||||
List<String> idList = new ArrayList<>();
|
||||
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
|
||||
|
||||
//科长
|
||||
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
|
||||
String orgCode = sysUser.getOrgCode();
|
||||
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
|
||||
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
//所领导或者超级管理员
|
||||
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
|
||||
idList=null;
|
||||
//企业职员项目负责人
|
||||
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
|
||||
String userId = sysUser.getId();
|
||||
idList.add(userId);
|
||||
}
|
||||
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
@@ -93,23 +111,21 @@ public class AllProjectStatisticsController {
|
||||
s.setChargeUse_text(payment_charge_use);
|
||||
}
|
||||
}
|
||||
//处理为空数据为0
|
||||
for(AllProjectStatistics s: pageList.getRecords()){
|
||||
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
|
||||
s.setAllMoney("0.00");
|
||||
//处理为空数据为0
|
||||
for(AllProjectStatistics s: pageList.getRecords()){
|
||||
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
|
||||
s.setAllMoney("0.00");
|
||||
}
|
||||
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
|
||||
s.setComeAllMoney("0.00");
|
||||
}
|
||||
|
||||
}
|
||||
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
|
||||
s.setComeAllMoney("0.00");
|
||||
}
|
||||
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
|
||||
hashMap.put("sumOfReallyMoney", sum2==0.0?sum2:df.format(sum2));
|
||||
hashMap.put("pageList",pageList);
|
||||
return Result.OK(hashMap);
|
||||
|
||||
}
|
||||
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
|
||||
hashMap.put("sumOfReallyMoney", sum2==0.0?sum2:df.format(sum2));
|
||||
hashMap.put("pageList",pageList);
|
||||
return Result.OK(hashMap);
|
||||
}else {
|
||||
return Result.OK("权限不足");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,6 +135,7 @@ public class AllProjectStatisticsController {
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*/
|
||||
|
||||
@ApiOperation(value = "企业项目统计-分页列表查询", notes = "企业项目统计-详情分页列表查询")
|
||||
@GetMapping(value = "/listProject")
|
||||
public Result<?> listProject(AllProjectStatisticsSearch allProjectStatisticsSearch,
|
||||
@@ -187,8 +204,9 @@ public class AllProjectStatisticsController {
|
||||
*所领导统计导出
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "全所统计导出-导出统计")
|
||||
@GetMapping(value = "/statistics/excel")
|
||||
@ApiOperation(value = "所领导统计导出-导出统计", notes = "所领导统计导出-导出统计")
|
||||
@ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计")
|
||||
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
@@ -218,6 +236,7 @@ public class AllProjectStatisticsController {
|
||||
*企业来款统计
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企业来款统计-导出统计")
|
||||
@GetMapping(value = "/statistics/excelProject")
|
||||
@ApiOperation(value = "企业来款统计-导出统计", notes = "企业来款统计-导出统计")
|
||||
public ModelAndView excelProject( AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||
|
||||
+3
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.mail.commont.constant;
|
||||
@@ -184,6 +185,7 @@ public class CompanyComeMoneyStatisticsController {
|
||||
*企业来款统计
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企业来款统计-导出统计")
|
||||
@GetMapping(value = "/excel")
|
||||
@ApiOperation(value = "企业来款统计-导出统计", notes = "企业来款统计-导出统计")
|
||||
public ModelAndView excel(CompanyComeMoneySearch companyComeMoneySearch) {
|
||||
@@ -220,6 +222,7 @@ public class CompanyComeMoneyStatisticsController {
|
||||
*企业来款统计
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企业来款详情统计-导出统计")
|
||||
@GetMapping(value = "/excelDetail")
|
||||
@ApiOperation(value = "企业来款详情统计-导出统计", notes = "企业来款详情统计-导出统计")
|
||||
public ModelAndView excelDetail( CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) {
|
||||
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
package com.jero.statistics.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.project.entity.PayWorkingGroupStatistics;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.statistics.entity.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zql
|
||||
* @date 2021/9/24 16:08
|
||||
*/
|
||||
@Api(tags="首页前十统计")
|
||||
@RestController
|
||||
@RequestMapping("/statistics/principalPeople")
|
||||
@Slf4j
|
||||
public class FirstPageStatisticsController {
|
||||
@Autowired
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
@GetMapping(value = "/firstPage")
|
||||
@ApiOperation(value = "首页统计", notes = "首页统计")
|
||||
public Result<?> getFirstPage() {
|
||||
|
||||
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalFirstPage();
|
||||
List<PayWorkingGroupStatistics> pageList2 = payWorkingGroupService.queryPageListForStatisticsFirstPage();
|
||||
List<CompanyComeMoneyList> pageList3 = payWorkingGroupService.queryPageListForCompanyFirstPage();
|
||||
List<DepartStatistics> pageList4 = payWorkingGroupService.queryPageListForDepartFirstPage();
|
||||
ArrayList<PrincipalPeopleList> list = new ArrayList<>();
|
||||
for(PrincipalPeopleList s: pageList){
|
||||
if(!(s.getComeAllMoney()== null || s.getComeAllMoney().equals("")|| s.getComeAllMoney().equals("0") )) {
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
ArrayList<PayWorkingGroupStatistics> list2 = new ArrayList<>();
|
||||
for(PayWorkingGroupStatistics s: pageList2){
|
||||
if(!(s.getComeAllMoney()== null || s.getComeAllMoney().equals("")|| s.getComeAllMoney().equals("0") )) {
|
||||
list2.add(s);
|
||||
}
|
||||
}
|
||||
ArrayList<CompanyComeMoneyList> list3 = new ArrayList<>();
|
||||
for(CompanyComeMoneyList s: pageList3){
|
||||
if(!(s.getComeAllMoney()== null || s.getComeAllMoney().equals("")|| s.getComeAllMoney().equals("0") ) ){
|
||||
list3.add(s);
|
||||
}
|
||||
}
|
||||
ArrayList<DepartStatistics> list4 = new ArrayList<>();
|
||||
for(DepartStatistics s: pageList4){
|
||||
if(!(s.getComeAllMoney()== null || s.getComeAllMoney().equals("")|| s.getComeAllMoney().equals("0") ) ){
|
||||
list4.add(s);
|
||||
}
|
||||
}
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("principalPeople",list);
|
||||
hashMap.put("payWorkingGroup",list2);
|
||||
hashMap.put("company",list3);
|
||||
hashMap.put("depart",list4);
|
||||
return Result.OK(hashMap);
|
||||
}
|
||||
}
|
||||
+265
@@ -0,0 +1,265 @@
|
||||
package com.jero.statistics.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.ComboModel;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.mail.commont.constant;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
import com.jero.project.entity.PayWorkGroupSubletStatistics;
|
||||
import com.jero.project.entity.PayWorkingGroupSearch;
|
||||
import com.jero.project.entity.PayWorkingGroupStatistics;
|
||||
import com.jero.project.entity.PayWorkingGroupSubletSearch;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
||||
import com.jero.util.AmountUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.hssf.record.DVALRecord;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zql
|
||||
* @date 2021/9/15 8:54
|
||||
*/
|
||||
@Api(tags="工作组统计")
|
||||
@RestController
|
||||
@RequestMapping("/project/payWorkingGroupStatistics")
|
||||
@Slf4j
|
||||
public class PayWorkingGroupStatisticsController {
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IPayWorkingGroupSubItemService payWorkingGroupSubItemService;
|
||||
@Autowired
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
|
||||
/**
|
||||
* 工作组项目统计-统计分页列表查询
|
||||
*
|
||||
* @param payWorkingGroupSearch 工作组项目
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*
|
||||
*/
|
||||
@ApiOperation(value="工作组项目统计-统计分页列表查询", notes="工作组项目统计-统计分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> list(PayWorkingGroupSearch payWorkingGroupSearch,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
|
||||
|
||||
Page<PayWorkingGroupStatistics> page = new Page<>(pageNo, pageSize);
|
||||
if(payWorkingGroupSearch.getYear()==null|| payWorkingGroupSearch.getYear().equals("")){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
payWorkingGroupSearch.setYear(year);
|
||||
}
|
||||
//根据不同角色加载不同列表的参数
|
||||
List<String> idList = new ArrayList<>();
|
||||
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
|
||||
//科长
|
||||
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
|
||||
String orgCode = sysUser.getOrgCode();
|
||||
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
|
||||
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
//所领导或者超级管理员
|
||||
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)||roleCodes.contains(constant.QYXXWHRY)) {
|
||||
idList=null;
|
||||
//企业职员项目负责人
|
||||
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
|
||||
String userId = sysUser.getId();
|
||||
idList.add(userId);
|
||||
}
|
||||
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,idList);
|
||||
List<PayWorkingGroupStatistics> records = pageList.getRecords();
|
||||
for (PayWorkingGroupStatistics payWorkingGroupStatistics:records){
|
||||
if(payWorkingGroupStatistics.getComeAllMoney()==null||payWorkingGroupStatistics.getComeAllMoney()==""){
|
||||
payWorkingGroupStatistics.setComeAllMoney("0.00");
|
||||
}
|
||||
}
|
||||
|
||||
//计算应收和实收总金额
|
||||
double sum=0;
|
||||
double sum2 =0;
|
||||
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
|
||||
sum = records.stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0.00" : t.getAllMoney())).sum();
|
||||
sum2 = records.stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0.00" : t.getComeAllMoney())).sum();
|
||||
}
|
||||
//处理为空数据为0
|
||||
for(PayWorkingGroupStatistics s: pageList.getRecords()){
|
||||
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
|
||||
s.setAllMoney("0.00");
|
||||
}
|
||||
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
|
||||
s.setComeAllMoney("0.00");
|
||||
}
|
||||
if(s.getMoneyRate()== null || s.getMoneyRate().equals("") ) {
|
||||
s.setMoneyRate("0.00%");
|
||||
}
|
||||
}
|
||||
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
objectObjectHashMap.put("pageList",pageList.setRecords(records));
|
||||
objectObjectHashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
|
||||
objectObjectHashMap.put("sumOfReallyMoney", sum2==0.0?sum2:df.format(sum2));
|
||||
return Result.OK(objectObjectHashMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作组项目统计-统计导出excel
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "工作组项目统计-统计导出excel")
|
||||
@GetMapping(value = "/exportXls2")
|
||||
@ApiOperation(value="工作组项目统计-统计导出excel", notes="工作组项目统计-统计导出excel")
|
||||
public ModelAndView exportXls2( PayWorkingGroupSearch payWorkingGroupSearch) {
|
||||
if(payWorkingGroupSearch.getYear()==null|| payWorkingGroupSearch.getYear().equals("")){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
payWorkingGroupSearch.setYear(year);
|
||||
}
|
||||
//根据不同角色加载不同列表的参数
|
||||
List<String> idList = new ArrayList<>();
|
||||
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
|
||||
//科长
|
||||
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
|
||||
String orgCode = sysUser.getOrgCode();
|
||||
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
|
||||
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
//所领导或者超级管理员
|
||||
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
|
||||
idList=null;
|
||||
//企业职员项目负责人
|
||||
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
|
||||
String userId = sysUser.getId();
|
||||
idList.add(userId);
|
||||
}
|
||||
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,idList);
|
||||
//处理为空数据为0
|
||||
for(PayWorkingGroupStatistics s: pageList){
|
||||
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
|
||||
s.setAllMoney("0.00");
|
||||
}
|
||||
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
|
||||
s.setComeAllMoney("0.00");
|
||||
}
|
||||
if(s.getMoneyRate()== null || s.getMoneyRate().equals("") ) {
|
||||
s.setMoneyRate("0.00%");
|
||||
}
|
||||
}
|
||||
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class,"工作组项目统计");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工作组成员统计-详情分页列表查询(传工作组id)
|
||||
*
|
||||
* @param payWorkingGroupSubletSearch 工作组成员统计搜索
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*
|
||||
*/
|
||||
@ApiOperation(value = "工作组成员统计-详情分页列表查询(传工作组id)", notes = "工作组成员统计-详情分页列表查询(传工作组id)")
|
||||
@GetMapping(value = "/listSub")
|
||||
@ApiImplicitParam(name = "id", value = "工作组id", dataType = "String", required = true)
|
||||
public Result<?> list2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "id") String id,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize);
|
||||
if(payWorkingGroupSubletSearch.getYear()==null|| payWorkingGroupSubletSearch.getYear().equals("")){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
payWorkingGroupSubletSearch.setYear(year);
|
||||
}
|
||||
IPage<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.queryPageList2(page, payWorkingGroupSubletSearch,id);
|
||||
double sum=0;
|
||||
double sum2 =0;
|
||||
if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
|
||||
sum = pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0.0" : t.getAllMoney())).sum();
|
||||
sum2 = pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0.0" : t.getComeAllMoney())).sum();
|
||||
}
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
// 转义来款用途
|
||||
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){
|
||||
String key = String.valueOf(s.getChargeUse());
|
||||
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
|
||||
s.setChargeUse_text(payment_charge_use);
|
||||
}
|
||||
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){
|
||||
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
|
||||
s.setAllMoney("0.0");
|
||||
}
|
||||
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
|
||||
s.setComeAllMoney("0.0");
|
||||
}
|
||||
}
|
||||
|
||||
hashMap.put("pageList",pageList);
|
||||
hashMap.put("sumOfMoney", sum==0.0?sum:df.format(sum));
|
||||
hashMap.put("sumOfReallyMoney", sum2==0.0?sum2:df.format(sum2));
|
||||
return Result.OK(hashMap);
|
||||
}
|
||||
|
||||
/**
|
||||
*导出
|
||||
* @param id
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "工作组成员统计-导出统计(传工作组id)")
|
||||
@GetMapping(value = "/excelSub")
|
||||
@ApiOperation(value = "工作组成员统计-导出统计(传工作组id)", notes = "工作组成员统计-导出统计(传工作组id)")
|
||||
@ApiImplicitParam(name = "id", value = "工作组id", dataType = "String", required = true)
|
||||
public ModelAndView excelSub(
|
||||
PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
if(payWorkingGroupSubletSearch.getYear()==null|| payWorkingGroupSubletSearch.getYear().equals("")){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
payWorkingGroupSubletSearch.setYear(year);
|
||||
}
|
||||
List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics(payWorkingGroupSubletSearch,id);
|
||||
//处理为空数据为0
|
||||
for(PayWorkGroupSubletStatistics 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, PayWorkGroupSubletStatistics.class, "工作组成员统计");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+4
-14
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
@@ -170,25 +171,13 @@ public class PrincipalPeopleStatisticsController {
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* 项目详情
|
||||
*
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="个人来款统计-项目详情", notes="个人来款统计-项目详情")
|
||||
@PostMapping(value = "/getProjectDetail")
|
||||
@Transactional
|
||||
public Result<?> getProjectDetail(@RequestParam(name="projectId") String projectId
|
||||
) {
|
||||
ProjectDetailVO projectDetailVO = projectDetailService.getProjectDetail(projectId);
|
||||
return Result.OK(projectDetailVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*个人来款统计导出
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "个人来款统计导出-导出统计")
|
||||
@GetMapping(value = "/excel")
|
||||
@ApiOperation(value = "个人来款统计导出-导出统计", notes = "个人来款统计导出-导出统计")
|
||||
public ModelAndView excel( PrincipalPeopleSearch principalPeopleSearch) {
|
||||
@@ -225,6 +214,7 @@ public class PrincipalPeopleStatisticsController {
|
||||
*个人来款统详情计导出
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "个人来款统详情计导出-导出统计")
|
||||
@GetMapping(value = "/excelDetail")
|
||||
@ApiOperation(value = "个人来款统详情计导出-导出统计", notes = "个人来款统详情计导出-导出统计")
|
||||
public ModelAndView excelDetail( PrincipalPeopleDetailSearch principalPeopleDetailSearch) {
|
||||
|
||||
Reference in New Issue
Block a user