add 统计报表-科室总体统计

This commit is contained in:
lijiarao
2022-06-11 17:25:14 +08:00
parent f6c9d003af
commit a01d0db2c8
10 changed files with 208 additions and 23 deletions
@@ -15,9 +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.statistics.entity.*;
import com.jero.util.AmountUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -131,7 +129,7 @@ public class AllProjectStatisticsController {
//部门负责人
} else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
List<String> allDepartIds = sysBaseAPI.getAllUserIdsByDepart(sysUser.getDepartIds(), idList);
//获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -260,7 +258,7 @@ public class AllProjectStatisticsController {
//部门负责人
} else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
List<String> allDepartIds = sysBaseAPI.getAllUserIdsByDepart(sysUser.getDepartIds(), idList);
//获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -299,4 +297,59 @@ public class AllProjectStatisticsController {
return Result.OK(pageList);
}
/**
* 科室统计——分页列表查询
*
* @param departStatisticsSearch 企业项目统计
* @param pageNo 页数
* @param pageSize 条数
*/
//@RequiresPermissions("projectPaymentStatistics:search")
@ApiOperation(value = "科室统计-分页列表查询", notes = "科室统计-详情分页列表查询")
@GetMapping(value = "/listDepartment")
public Result<?> listDepartment(DepartStatisticsSearch departStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//admin
if (roleCodes.contains(constant.ADMIN)) {
} else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门下全部子部门的id(包含本部门)
List<String> allDepartIds = sysBaseAPI.getAllDepartIdsByDepart(sysUser.getDepartIds(), idList);
idList.addAll(allDepartIds);
} else {
return Result.OK();
}
Page<DepartStatistics> page = new Page<>(pageNo, pageSize);
IPage<DepartStatistics> pageList = payWorkingGroupService.queryPageListDepartment(page, departStatisticsSearch, idList);
HashMap<String, Object> hashMap = new HashMap<>();
//处理为空数据为0
for (DepartStatistics 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");
}
}
AllMoney allMoney = payWorkingGroupService.queryPageListDepartment33(departStatisticsSearch, idList);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
}
@@ -1,25 +1,15 @@
package com.jero.statistics.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
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.aspect.annotation.DictPoint;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.ProjectDetailService;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.system.vo.SysDepartTreeModel;
import com.jero.common.vo.ProjectDetailVO;
import com.jero.mail.commont.constant;
import com.jero.mail.entity.PayMailBillProject;
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.PayWorkingGroupStatistics;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.*;
import com.jero.util.AmountUtil;
@@ -30,7 +20,6 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -81,7 +70,7 @@ public class PrincipalPeopleStatisticsController {
//部门负责人
} else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
List<String> allDepartIds = sysBaseAPI.getAllUserIdsByDepart(sysUser.getDepartIds(), idList);
//获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -186,7 +175,7 @@ public class PrincipalPeopleStatisticsController {
//部门负责人
} else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
List<String> allDepartIds = sysBaseAPI.getAllUserIdsByDepart(sysUser.getDepartIds(), idList);
//获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -10,6 +10,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
*/
@Data
public class DepartStatistics {
@Excel(name = "部门名称", width = 15)
@ApiModelProperty(value = "部门名称")
private String departName;
@Excel(name = "应收总金额", width = 15)
@ApiModelProperty(value = "应收总金额")
@@ -19,9 +22,15 @@ public class DepartStatistics {
@ApiModelProperty(value = "实收总金额")
private String comeAllMoney;
@Excel(name = "到账率", width = 15)
@ApiModelProperty(value = "到账率")
private String finishRate;
@Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额")
private String billMoney;
private String departName;
@Excel(name = "确认到账金额", width = 15)
@ApiModelProperty(value = "确认到账金额")
private String confirmAmount;
}
@@ -0,0 +1,21 @@
package com.jero.statistics.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
public class DepartStatisticsSearch {
@ApiModelProperty(value = "来款年份")
private String year;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
}