全所统计
This commit is contained in:
+10
-8
@@ -100,18 +100,20 @@ public class AllProjectStatisticsController {
|
||||
*/
|
||||
@GetMapping(value = "/statistics/excel")
|
||||
@ApiOperation(value = "所领导统计-导出统计", notes = "所领导统计-导出统计")
|
||||
public ModelAndView excel() {
|
||||
AllProjectStatisticsSearch allProjectStatisticsSearch = new AllProjectStatisticsSearch();
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
// allProjectStatisticsSearch.setYear(year);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
public ModelAndView excel(AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
if(constant.SLD.equals(roleCode)||constant.ADMIN.equals(roleCode)) {
|
||||
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch);
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
allProjectStatisticsSearch.setYear(year);
|
||||
}
|
||||
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch);
|
||||
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
|
||||
|
||||
}else {
|
||||
return new ModelAndView();
|
||||
return new ModelAndView();
|
||||
}
|
||||
}
|
||||
}
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
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.system.api.ISysBaseAPI;
|
||||
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.service.IPayWorkingGroupService;
|
||||
import com.jero.statistics.entity.*;
|
||||
import com.jero.util.AmountUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
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.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author zql
|
||||
* @date 2021/9/20 21:00:00
|
||||
*/
|
||||
@Api(tags="个人来款统计")
|
||||
@RestController
|
||||
@RequestMapping("/statistics/principalPeople")
|
||||
@Slf4j
|
||||
public class PrincipalPeopleStatisticsController {
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param principalPeopleSearch 全统计搜索
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*/
|
||||
@ApiOperation(value = "个人来款统计-分页列表查询", notes = "个人来款统计-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> list(PrincipalPeopleSearch principalPeopleSearch,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
||||
if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
principalPeopleSearch.setYear(year);
|
||||
}
|
||||
//根据不同角色加载不同列表的参数
|
||||
List<String> idList = new ArrayList<>();
|
||||
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
//科长
|
||||
if(constant.BMFZR.equals(roleCode)) {
|
||||
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 (constant.SLD.equals(roleCode)||constant.ADMIN.equals(roleCode)) {
|
||||
idList=null;
|
||||
//企业职员项目负责人
|
||||
}else if( constant.QYRY.equals(roleCode)){
|
||||
String userId = sysUser.getId();
|
||||
idList.add(userId);
|
||||
}
|
||||
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page,principalPeopleSearch,idList);
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
double sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null ? "0" : t.getAllMoney())).sum() : 0;
|
||||
double sum2 = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null ? "0" : t.getComeAllMoney())).sum() : 0;
|
||||
DecimalFormat df = new DecimalFormat("#.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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param principalPeopleDetailSearch 详情全统计搜索
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
*/
|
||||
@ApiOperation(value = "个人来款统计-详情分页列表查询", notes = "个人来款统计-详情分页列表查询")
|
||||
@GetMapping(value = "/listForDetail")
|
||||
public Result<?> listForDetail(PrincipalPeopleDetailSearch principalPeopleDetailSearch,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
||||
if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
principalPeopleDetailSearch.setYear(year);
|
||||
}
|
||||
Page<PrincipalPeopleDetail> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetail(page, principalPeopleDetailSearch);
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
double sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null ? "0" : t.getAllMoney())).sum() : 0;
|
||||
double sum2 = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null ? "0" : t.getComeAllMoney())).sum() : 0;
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
for(PrincipalPeopleDetail 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);
|
||||
}
|
||||
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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*个人来款统计导出
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/excel")
|
||||
@ApiOperation(value = "个人来款统计导出-导出统计", notes = "个人来款统计导出-导出统计")
|
||||
public ModelAndView excel( PrincipalPeopleSearch principalPeopleSearch) {
|
||||
if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
principalPeopleSearch.setYear(year);
|
||||
}
|
||||
//根据不同角色加载不同列表的参数
|
||||
List<String> idList = new ArrayList<>();
|
||||
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
|
||||
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String roleCode = sysUser.getRoleCode();
|
||||
//科长
|
||||
if(constant.BMFZR.equals(roleCode)) {
|
||||
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 (constant.SLD.equals(roleCode)||constant.ADMIN.equals(roleCode)) {
|
||||
idList=null;
|
||||
//企业职员项目负责人
|
||||
}else if( constant.QYRY.equals(roleCode)){
|
||||
String userId = sysUser.getId();
|
||||
idList.add(userId);
|
||||
}
|
||||
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch,idList);
|
||||
|
||||
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");
|
||||
}
|
||||
|
||||
/**
|
||||
*个人来款统详情计导出
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/excelDetail")
|
||||
@ApiOperation(value = "个人来款统详情计导出-导出统计", notes = "个人来款统详情计导出-导出统计")
|
||||
public ModelAndView excelDetail( PrincipalPeopleDetailSearch principalPeopleDetailSearch) {
|
||||
if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
principalPeopleDetailSearch.setYear(year);
|
||||
}
|
||||
List<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetailExcel(principalPeopleDetailSearch);
|
||||
|
||||
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
|
||||
}
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.jero.statistics.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
|
||||
/**
|
||||
* @author zql
|
||||
* @date 2021/9/22 11:43
|
||||
*/
|
||||
@Data
|
||||
public class PrincipalPeopleDetail {
|
||||
|
||||
@ApiModelProperty(value = "项目id")
|
||||
private String id;
|
||||
@Excel(name = "来款项目", width = 15)
|
||||
@ApiModelProperty(value = "来款项目")
|
||||
private String projectName;
|
||||
@Excel(name = "应收总金额", width = 15)
|
||||
@ApiModelProperty(value = "应收总金额")
|
||||
private String allMoney;
|
||||
@Excel(name = "实收总金额", width = 15)
|
||||
@ApiModelProperty(value = "实收总金额")
|
||||
private String comeAllMoney;
|
||||
@Excel(name = "来款用途", width = 15,dicCode = "charge_use")
|
||||
@ApiModelProperty(value = "来款用途编码")
|
||||
private String chargeUse;
|
||||
|
||||
@ApiModelProperty(value = "来款用途")
|
||||
private String chargeUse_text;
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.jero.statistics.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zql
|
||||
* @date 2021/9/22 11:38
|
||||
*/
|
||||
@Data
|
||||
public class PrincipalPeopleDetailSearch {
|
||||
|
||||
@ApiModelProperty(value = "项目负责人id")
|
||||
private String principalNameId;
|
||||
|
||||
@ApiModelProperty(value = "来款项目")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "来款年份")
|
||||
private String year;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "来款用途编码")
|
||||
private String chargeUse;
|
||||
|
||||
@ApiModelProperty(value = "付款状态")
|
||||
private String inAccountStatue;
|
||||
|
||||
@DecimalMax(value = "9999999999.99",message = "应收总金额(元)格式错误")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@ApiModelProperty(value = "应收总金额")
|
||||
private BigDecimal allMoney;
|
||||
|
||||
@DecimalMax(value = "9999999999.99",message = "应收总金额(元)格式错误")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@ApiModelProperty(value = "应收总金额范围")
|
||||
private BigDecimal allMoneyTwo;
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.jero.statistics.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
public class PrincipalPeopleList {
|
||||
@Excel(name = "项目负责人id", width = 15)
|
||||
@ApiModelProperty(value = "项目负责人id")
|
||||
private String principalId;
|
||||
|
||||
@Excel(name = "项目负责人", width = 15)
|
||||
@ApiModelProperty(value = "项目负责人")
|
||||
private String principalName;
|
||||
|
||||
@Excel(name = "来款项目", width = 15)
|
||||
@DecimalMax(value = "9999999999.99",message = "应收总金额(元)格式错误")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@ApiModelProperty(value = "应收总金额")
|
||||
private String allMoney;
|
||||
|
||||
@Excel(name = "实收总金额", width = 15)
|
||||
@DecimalMax(value = "9999999999.99",message = "实收总金额(元)格式错误")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@ApiModelProperty(value = "实收总金额")
|
||||
private String comeAllMoney;
|
||||
|
||||
@Excel(name = "个人完成率", width = 15)
|
||||
@ApiModelProperty(value = "个人完成率")
|
||||
private String finishRate;
|
||||
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.jero.statistics.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class PrincipalPeopleSearch {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "项目负责人id")
|
||||
private String principalId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "应收总金额")
|
||||
private String allMoney;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "应收总金额范围")
|
||||
private String allMoneyTwo;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "来款年份")
|
||||
private String year;
|
||||
|
||||
@ApiModelProperty(value = "部门编码")
|
||||
private String departCode;
|
||||
}
|
||||
Reference in New Issue
Block a user