add企业端资料批量下载
This commit is contained in:
+58
-17
@@ -5,6 +5,7 @@ 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.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.mail.commont.constant;
|
||||
@@ -87,6 +88,8 @@ public class AllProjectStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
@@ -160,6 +163,8 @@ public class AllProjectStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@@ -208,16 +213,33 @@ public class AllProjectStatisticsController {
|
||||
@GetMapping(value = "/statistics/excel")
|
||||
@ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计")
|
||||
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||
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 = 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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
allProjectStatisticsSearch.setYear(year);
|
||||
}
|
||||
List<String> idList =null;
|
||||
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch,idList);
|
||||
if (pageList != null) {
|
||||
for(AllProjectStatistics s: pageList){
|
||||
@@ -227,33 +249,52 @@ public class AllProjectStatisticsController {
|
||||
}
|
||||
}
|
||||
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
|
||||
}else {
|
||||
return new ModelAndView();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*企业来款统计
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企业来款统计-导出统计")
|
||||
@AutoLog(value = "企业项目统计-导出统计")
|
||||
@GetMapping(value = "/statistics/excelProject")
|
||||
@ApiOperation(value = "企业来款统计-导出统计", notes = "企业来款统计-导出统计")
|
||||
@ApiOperation(value = "企业项目统计-导出统计", notes = "企业项目统计-导出统计")
|
||||
public ModelAndView excelProject( AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||
List<String> idList =null;
|
||||
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String year = String.valueOf(calendar.get(Calendar.YEAR));
|
||||
allProjectStatisticsSearch.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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch,idList);
|
||||
if (pageList != null) {
|
||||
for(AllProjectStatistics s: pageList){
|
||||
String key = String.valueOf(s.getChargeUse());
|
||||
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
|
||||
s.setChargeUse_text(payment_charge_use);
|
||||
if (pageList != null) {
|
||||
for(AllProjectStatistics s: pageList){
|
||||
String key = String.valueOf(s.getChargeUse());
|
||||
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
|
||||
s.setChargeUse_text(payment_charge_use);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "企业来款统计");
|
||||
|
||||
}
|
||||
|
||||
+9
@@ -5,6 +5,7 @@ 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.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.mail.commont.constant;
|
||||
@@ -82,6 +83,8 @@ public class CompanyComeMoneyStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
|
||||
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,idList);
|
||||
@@ -147,6 +150,8 @@ public class CompanyComeMoneyStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
|
||||
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,idList);
|
||||
@@ -212,6 +217,8 @@ public class CompanyComeMoneyStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch,idList);
|
||||
|
||||
@@ -249,6 +256,8 @@ public class CompanyComeMoneyStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch,idList);
|
||||
for(CompanyComeMoneyDetail s: pageList){
|
||||
|
||||
+5
@@ -5,6 +5,7 @@ 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.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.ComboModel;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
@@ -93,6 +94,8 @@ public class PayWorkingGroupStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,idList);
|
||||
List<PayWorkingGroupStatistics> records = pageList.getRecords();
|
||||
@@ -160,6 +163,8 @@ public class PayWorkingGroupStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,idList);
|
||||
//处理为空数据为0
|
||||
|
||||
+5
@@ -6,6 +6,7 @@ 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.exception.JeroBootException;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
@@ -88,6 +89,8 @@ public class PrincipalPeopleStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
|
||||
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
|
||||
@@ -204,6 +207,8 @@ public class PrincipalPeopleStatisticsController {
|
||||
}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);
|
||||
}else {
|
||||
throw new JeroBootException("权限异常");
|
||||
}
|
||||
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch,idList);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user