|
@@ -9,6 +9,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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.google.common.collect.ImmutableMap;
|
|
|
import com.management.platform.entity.*;
|
|
|
import com.management.platform.entity.Task;
|
|
|
import com.management.platform.entity.vo.*;
|
|
@@ -254,6 +255,422 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
private String path;
|
|
|
@Value("${configEnv.isDev}")
|
|
|
public boolean isDev;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getProjectListByPage(Integer pageIndex, Integer pageSize, String infoString, Integer id, Integer forReport, HttpServletRequest request) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ try {
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
+ if (forReport == 1) {
|
|
|
+ if (!sysFunctionService.hasPriviledge(user.getRoleId(), "可填报全部项目")) {
|
|
|
+ //只能看本人参与的项目
|
|
|
+ pageIndex=(pageIndex-1)*pageSize;
|
|
|
+ List<Map<String, Object>> data = projectMapper.getOnlyJoinProjectsPage(user.getId(), user.getCompanyId(),pageIndex,pageSize,infoString);
|
|
|
+ Integer total = projectMapper.getOnlyJoinProjectsTotal(user.getId(), user.getCompanyId(),pageIndex,pageSize,infoString);
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("total", total);
|
|
|
+ if (id!=null){
|
|
|
+ List<Map<String, Object>> dataByID = projectMapper.getOnlyJoinProjectsById(user.getId(), user.getCompanyId(),id);
|
|
|
+ data.addAll(0,dataByID);
|
|
|
+ }
|
|
|
+ resultMap.put("data", data);
|
|
|
+
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //有权限的填报全部的进行中项目
|
|
|
+ QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
|
|
|
+ if (!StringUtils.isEmpty(infoString)){
|
|
|
+ queryWrapper.eq("company_id", user.getCompanyId())
|
|
|
+ .eq("status", 1)
|
|
|
+ .and(i->i.like("project_name",infoString).or()
|
|
|
+ .like("project_code",infoString))
|
|
|
+ .orderByDesc("is_public")
|
|
|
+ .orderByAsc("id")
|
|
|
+ .select("id", "project_code", "project_name");
|
|
|
+ }else {
|
|
|
+ queryWrapper.eq("company_id", user.getCompanyId())
|
|
|
+ .eq("status", 1)
|
|
|
+ .orderByDesc("is_public")
|
|
|
+ .orderByAsc("id")
|
|
|
+ .select("id", "project_code", "project_name");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Page<Project> projectPage = new Page<>(pageIndex, pageSize);
|
|
|
+ IPage<Project> projectIPage = projectMapper.selectPage(projectPage, queryWrapper);
|
|
|
+
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("total", projectIPage.getTotal());
|
|
|
+ List<Project> projectList = projectIPage.getRecords();
|
|
|
+ if (id!=null){
|
|
|
+ Project project = projectMapper.selectOne(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).eq("status", 1).eq("id", id).select("id", "project_code", "project_name"));
|
|
|
+ if (project!=null){
|
|
|
+ projectList.add(0,project);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("data", projectList);
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部项目")) {
|
|
|
+ //只能看本人相关的项目
|
|
|
+ pageIndex=(pageIndex-1)*pageSize;
|
|
|
+ List<Map<String, Object>> data = projectMapper.getParticipatedProjectPage(user.getId(), user.getCompanyId(),pageIndex,pageSize,infoString);
|
|
|
+ Integer total = projectMapper.getParticipatedProjectTotal(user.getId(), user.getCompanyId(),pageIndex,pageSize,infoString);
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("total", total);
|
|
|
+ if (id!=null){
|
|
|
+ List<Map<String, Object>> dataByID = projectMapper.getParticipatedProjectById(user.getId(), user.getCompanyId(),id);
|
|
|
+ data.addAll(0,dataByID);
|
|
|
+ }
|
|
|
+ resultMap.put("data", data);
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
+ } else {
|
|
|
+ //有权限的看全部的
|
|
|
+ httpRespMsg.data = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).orderByDesc("is_public").orderByAsc("id"));
|
|
|
+ QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
|
|
|
+ if (!StringUtils.isEmpty(infoString)){
|
|
|
+ queryWrapper.eq("company_id", user.getCompanyId())
|
|
|
+ .and(i->i.like("project_name",infoString).or().like("project_code",infoString))
|
|
|
+ .orderByDesc("is_public").orderByAsc("id")
|
|
|
+ .select("id", "project_code", "project_name");
|
|
|
+ }else {
|
|
|
+ queryWrapper.eq("company_id", user.getCompanyId())
|
|
|
+ .orderByDesc("is_public").orderByAsc("id")
|
|
|
+ .select("id", "project_code", "project_name");
|
|
|
+ }
|
|
|
+ Page<Project> projectPage =new Page<>(pageIndex, pageSize);
|
|
|
+ IPage<Project> projectIPage = projectMapper.selectPage(projectPage, queryWrapper);
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("total", projectIPage.getTotal());
|
|
|
+ List<Project> projectList = projectIPage.getRecords();
|
|
|
+ if (id!=null){
|
|
|
+ Project project = projectMapper.selectOne(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).eq("id", id).select("id", "project_code", "project_name"));
|
|
|
+ if (project!=null){
|
|
|
+ projectList.add(0,project);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("data", projectList);
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (NullPointerException e) {
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg exportTimeByProjectAndEmployee(String date, HttpServletRequest request) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ String[] strings = date.split("-");
|
|
|
+ int year = Integer.parseInt(strings[0]);
|
|
|
+ int month = Integer.parseInt(strings[1]);
|
|
|
+ YearMonth yearMonth = YearMonth.of((year), month);
|
|
|
+ int daysInMonth = yearMonth.lengthOfMonth();
|
|
|
+
|
|
|
+ // 获取该月份的第一天
|
|
|
+ String startDate = String.format("%04d-%02d-01", year, month);
|
|
|
+ // 获取下个月的第一天
|
|
|
+ LocalDate lastDate = LocalDate.of(year, month, 1).plusDays(LocalDate.of(year, month, 1).lengthOfMonth() - 1);
|
|
|
+ String endDate = String.format("%04d-%02d-%02d", year, month, lastDate.getDayOfMonth());
|
|
|
+ try {
|
|
|
+ User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
|
+ Integer companyId = targetUser.getCompanyId();
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
|
+ CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+
|
|
|
+//当前用户管理部门
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id", companyId));
|
|
|
+ List<Department> allDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", targetUser.getCompanyId()));
|
|
|
+ Department[] deptArray = allDepartmentList.toArray(new Department[0]);
|
|
|
+
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ List<List<String>> allList = null;
|
|
|
+ List<String> sumRow = null;
|
|
|
+
|
|
|
+ List<String> headList = new ArrayList<String>();
|
|
|
+ //headList.add("项目编号");
|
|
|
+ headList.add(MessageUtils.message("entry.projectId"));
|
|
|
+ //headList.add("项目名称");
|
|
|
+ headList.add(MessageUtils.message("entry.projectName"));
|
|
|
+ //headList.add("项目分类");
|
|
|
+ headList.add(MessageUtils.message("entry.projectType"));
|
|
|
+ //headList.add("人员");
|
|
|
+ headList.add(MessageUtils.message("entry.personnel"));
|
|
|
+ //headList.add("部门");
|
|
|
+ headList.add(MessageUtils.message("excel.department"));
|
|
|
+ headList.add("月度总工时(h)");
|
|
|
+ for (int i = 1; i <= daysInMonth; i++) {
|
|
|
+ headList.add(i+"日");
|
|
|
+ }
|
|
|
+
|
|
|
+ allList = new ArrayList<>();
|
|
|
+ allList.add(headList);
|
|
|
+ double totalCostTime = 0;
|
|
|
+
|
|
|
+ //查询到的前六个字段
|
|
|
+ List<Map<String, Object>> dataList = projectMapper.getTimeCostGroupByProjectUserSumTime(companyId,startDate, endDate);
|
|
|
+ for (Map<String, Object> membMap : dataList) {
|
|
|
+ Department dept = null;
|
|
|
+ Department targetDept = new Department();
|
|
|
+ if (membMap.get("deptId") != null) {
|
|
|
+ targetDept.setDepartmentId(Integer.valueOf(membMap.get("deptId").toString()));
|
|
|
+ int index = Arrays.binarySearch(deptArray, targetDept, Comparator.comparing(Department::getDepartmentId));
|
|
|
+ if (index >= 0) {
|
|
|
+ dept = deptArray[index];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ if(membMap.get("departmentName").equals("未分配")){
|
|
|
+ membMap.put("departmentNameComplete","未分配");
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.exportWxDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ if(membMap.get("departmentName").equals("未分配")){
|
|
|
+ membMap.put("departmentNameComplete","未分配");
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.exportDdDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.getSupDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //抽取出来项目编号,项目名称
|
|
|
+ List<Map<String, Object>> uniqueDataList = dataList.stream()
|
|
|
+ .distinct() // 确保唯一性
|
|
|
+ .map(item -> ImmutableMap.of(
|
|
|
+ "id", item.get("id"),
|
|
|
+ "projectCode", item.get("projectCode"),
|
|
|
+ "departmentName", item.get("departmentName")
|
|
|
+ ))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ //查询项目对应人员填写的每次工时时长
|
|
|
+ List<Map<String, Object>> dataDetailList = projectMapper.getTimeCostProjectUserWorkTime(companyId,startDate, endDate);
|
|
|
+
|
|
|
+
|
|
|
+ for (Map<String, Object> map : uniqueDataList) {
|
|
|
+ //每个项目的统计
|
|
|
+ List<String> rowList = new ArrayList<String>();
|
|
|
+ rowList.add(map.get("projectCode")==null?"":map.get("projectCode").toString());
|
|
|
+ rowList.add(map.get("departmentName")==null?"":map.get("departmentName").toString());
|
|
|
+ rowList.add("");//项目分类
|
|
|
+ rowList.add("");//人员
|
|
|
+ rowList.add("");//部门
|
|
|
+ double sumCost = dataList.stream().filter(d -> d.get("id").toString().equals(map.get("id").toString()))
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString())) // 映射到 cost
|
|
|
+ .sum();// 计算总和
|
|
|
+ rowList.add(sumCost+"");//月度总工时
|
|
|
+ for (int i = 1; i <= daysInMonth; i++) {
|
|
|
+ int finalI = i;
|
|
|
+ double sumDay=0;
|
|
|
+ sumDay = dataDetailList.stream().filter(d -> d.get("id").toString().equals(map.get("id").toString())&&d.get("dayOnly")!=null && d.get("dayOnly").toString().equals("" + finalI))
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString())) // 映射到 cost
|
|
|
+ .sum();
|
|
|
+ if (sumDay==0){
|
|
|
+ rowList.add("");//每天填报总工时
|
|
|
+ }else {
|
|
|
+ rowList.add(sumDay+"");//每天的该项目的填报总工时
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ allList.add(rowList);
|
|
|
+
|
|
|
+ //项目下每个员工的记录
|
|
|
+ List<Map<String, Object>> userDataList = dataList.stream().filter(d -> d.get("id").toString().equals(map.get("id").toString())).collect(Collectors.toList());
|
|
|
+ for (Map<String, Object> objectMap : userDataList) {
|
|
|
+ List<String> rowUserList = new ArrayList<String>();
|
|
|
+ rowUserList.add("");//项目编号
|
|
|
+ rowUserList.add("");//项目名称
|
|
|
+ rowUserList.add(objectMap.get("categoryName")==null?"":objectMap.get("categoryName").toString());
|
|
|
+ rowUserList.add(objectMap.get("name")==null?"":objectMap.get("name").toString());
|
|
|
+ rowUserList.add(objectMap.get("departmentNameComplete")==null?"":objectMap.get("departmentNameComplete").toString());
|
|
|
+ rowUserList.add(objectMap.get("cost")==null?"":objectMap.get("cost").toString());
|
|
|
+ for (int i = 1; i <= daysInMonth; i++) {
|
|
|
+ int finalI = i;
|
|
|
+ double sumDay=0;
|
|
|
+ sumDay = dataDetailList.stream().filter(
|
|
|
+ d -> d.get("id").toString().equals(objectMap.get("id").toString())
|
|
|
+ &&d.get("dayOnly")!=null
|
|
|
+ && d.get("dayOnly").toString().equals("" + finalI)
|
|
|
+ && d.get("userId").toString().equals(objectMap.get("userId").toString())
|
|
|
+ )
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString())) // 映射到 cost
|
|
|
+ .sum();
|
|
|
+ if (sumDay==0){
|
|
|
+ rowUserList.add("");//每天填报总工时
|
|
|
+ }else {
|
|
|
+ rowUserList.add(sumDay+"");//每天的该项目的填报总工时
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ allList.add(rowUserList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> rowEndList = new ArrayList<String>();
|
|
|
+ rowEndList.add("总计");
|
|
|
+ rowEndList.add("");
|
|
|
+ rowEndList.add("");
|
|
|
+ rowEndList.add("");
|
|
|
+ rowEndList.add("");
|
|
|
+ double totalCost = dataList.stream()
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString())) // 映射到 cost
|
|
|
+ .sum();
|
|
|
+ rowEndList.add(""+totalCost);//月度总工时
|
|
|
+ for (int i = 1; i <= daysInMonth; i++) {
|
|
|
+ int finalI = i;
|
|
|
+ double sumDay=0;
|
|
|
+ sumDay = dataDetailList.stream().filter(
|
|
|
+ d -> d.get("dayOnly")!=null&& d.get("dayOnly").toString().equals("" + finalI)
|
|
|
+ )
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString())) // 映射到 cost
|
|
|
+ .sum();
|
|
|
+ if (sumDay==0){
|
|
|
+ rowEndList.add("");//每天填报总工时
|
|
|
+ }else {
|
|
|
+ rowEndList.add(sumDay+"");//每天填报总工时
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ allList.add(rowEndList);
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String, Object>> costTimeByUser=projectMapper.getCostTimeByUserSum(companyId,startDate, endDate);
|
|
|
+ List<Map<String, Object>> costTimeByUserForDay=projectMapper.getCostTimeByUserForDay(companyId,startDate, endDate);
|
|
|
+ List<Map<String, Object>> allProjectNew=projectMapper.getTotalProjectByTime(companyId,startDate, endDate);
|
|
|
+ for (Map<String, Object> membMap : costTimeByUser) {
|
|
|
+ Department dept = null;
|
|
|
+ Department targetDept = new Department();
|
|
|
+ if (membMap.get("deptId") != null) {
|
|
|
+ targetDept.setDepartmentId(Integer.valueOf(membMap.get("deptId").toString()));
|
|
|
+ int index = Arrays.binarySearch(deptArray, targetDept, Comparator.comparing(Department::getDepartmentId));
|
|
|
+ if (index >= 0) {
|
|
|
+ dept = deptArray[index];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ if(membMap.get("departmentName").equals("未分配")){
|
|
|
+ membMap.put("departmentNameComplete","未分配");
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.exportWxDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ if(membMap.get("departmentName").equals("未分配")){
|
|
|
+ membMap.put("departmentNameComplete","未分配");
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.exportDdDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ membMap.put("departmentNameComplete",departmentService.getSupDepartment(dept,allDepartmentList));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<List<String>> secondList = new ArrayList<>();
|
|
|
+ List<String> headsecondList = new ArrayList<String>();
|
|
|
+ headsecondList.add("工号");
|
|
|
+ headsecondList.add("姓名");
|
|
|
+ headsecondList.add("部门");
|
|
|
+ headsecondList.add("月度总工时(h)");
|
|
|
+ headsecondList.add(month+"月");
|
|
|
+ for (int i = 2; i <= daysInMonth; i++) {
|
|
|
+ headsecondList.add("");
|
|
|
+ }
|
|
|
+ if (!allProjectNew.isEmpty()){
|
|
|
+ headsecondList.add("项目工时分配");
|
|
|
+ for (int i = 1; i < allProjectNew.size()-1; i++) {
|
|
|
+ headsecondList.add("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ secondList.add(headsecondList);
|
|
|
+
|
|
|
+ List<String> headsecondList_new = new ArrayList<String>();
|
|
|
+ headsecondList_new.add("");
|
|
|
+ headsecondList_new.add("");
|
|
|
+ headsecondList_new.add("");
|
|
|
+ headsecondList_new.add("");
|
|
|
+ for (int i = 1; i <= daysInMonth; i++) {
|
|
|
+ headsecondList_new.add(i+"日");
|
|
|
+ }
|
|
|
+ if (!allProjectNew.isEmpty()){
|
|
|
+ for (Map<String, Object> map : allProjectNew) {
|
|
|
+ headsecondList_new.add(map.get("projectName")==null?"":map.get("projectName").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ secondList.add(headsecondList_new);
|
|
|
+
|
|
|
+ if (!costTimeByUser.isEmpty()){
|
|
|
+ for (Map<String, Object> map : costTimeByUser) {
|
|
|
+ List<String> row = new ArrayList<String>();
|
|
|
+ row.add(map.get("jobNumber")==null?"":map.get("jobNumber").toString());
|
|
|
+ row.add(map.get("name")==null?"":map.get("name").toString());
|
|
|
+ row.add(map.get("departmentNameComplete")==null?"":map.get("departmentNameComplete").toString());
|
|
|
+ row.add(map.get("cost")==null?"":map.get("cost").toString());
|
|
|
+ for (int i = 1; i <=daysInMonth; i++) {
|
|
|
+ double sum=0;
|
|
|
+ int finalI = i;
|
|
|
+ sum = costTimeByUserForDay.stream().filter(c -> c.get("userId").toString().equals(map.get("userId").toString())
|
|
|
+ && c.get("dayOnly") != null && c.get("dayOnly").toString().equals(finalI + ""))
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString()))
|
|
|
+ .sum();
|
|
|
+ if (sum==0){
|
|
|
+ row.add("");
|
|
|
+ }else {
|
|
|
+ row.add(sum+"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map<String, Object> objectMap : allProjectNew) {
|
|
|
+ double sum=0;
|
|
|
+ sum = costTimeByUserForDay.stream().filter(c -> c.get("projectId").toString().equals(objectMap.get("projectId").toString())
|
|
|
+ && c.get("userId").toString().equals(map.get("userId").toString()))
|
|
|
+ .mapToDouble(d -> Double.parseDouble(d.get("cost").toString()))
|
|
|
+ .sum();
|
|
|
+ if (sum==0){
|
|
|
+ row.add("");
|
|
|
+ }else {
|
|
|
+ row.add(sum+"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ secondList.add(row);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List[] totalList = new ArrayList[2];
|
|
|
+ totalList[0] = allList;
|
|
|
+ totalList[1] = secondList;
|
|
|
+
|
|
|
+ String[] sheetNames = new String[2];
|
|
|
+ sheetNames[0] = "项目统计表";
|
|
|
+ sheetNames[1] = "人员统计表";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,"月度工时统计表" , allList, path);
|
|
|
+// return excelExportService.exportMultiSheetGeneralExcelByTitleAndList(wxCorpInfo,dingding,"月度工时统计表" , totalList, path,sheetNames);
|
|
|
+ return excelExportService.exportMultiSheetGeneralExcelByTitleAndListNew(wxCorpInfo,dingding,"月度工时统计表" , totalList, path,sheetNames);
|
|
|
+ } catch (NullPointerException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
+ return httpRespMsg;
|
|
|
+ } catch (Exception exception) {
|
|
|
+ exception.printStackTrace();
|
|
|
+ httpRespMsg.setError(exception.getMessage());
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
//获取项目列表
|
|
|
@Override
|
|
|
public HttpRespMsg getProjectList(Integer forReport, HttpServletRequest request) {
|