Browse Source

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

Lijy 2 years ago
parent
commit
591d83aa93

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/StageCost.java

@@ -8,4 +8,5 @@ public class StageCost {
     public Double cost;
     public Double workingTime;
     public float stagesTime;
+    public Integer projectId;
 }

+ 5 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.management.platform.entity.Project;
 import com.management.platform.entity.vo.CustomerProject;
 import com.management.platform.entity.vo.ProjectWithStage;
+import com.management.platform.entity.vo.StageCost;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Update;
 
@@ -68,7 +69,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map> getTaskPlanByProject(@Param("projectIds") List<Integer> projectIds, @Param("startDate") String startDate,
                                 @Param("endDate") String endDate, @Param("companyId") Integer companyId);
 
-    List<ProjectWithStage> selectWithStage(Integer companyId, Integer startIndex, Integer endIndex, Integer projectId,List<Integer> inchagerIds,String startDate,String endDate);
+    List<ProjectWithStage> selectWithStage(Integer companyId, Integer startIndex, Integer endIndex, Integer projectId,String inchargerId,String startDate,String endDate);
 
     List<Map<String, Object>> getTimeCostReport(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
                                           @Param("projectId") Integer projectId,@Param("deptIds")List<Integer> deptIds);
@@ -144,4 +145,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map<String, Object>> getSubProjectTimeCost(Integer companyId, String startDate, String endDate, Integer projectId,Integer start,Integer size, List<Integer> inchagerIds);
 
     long countWithSubProjectTimeCost(Integer companyId, String startDate, String endDate, Integer projectId, Integer start,Integer size, List<Integer> inchagerIds);
+
+    List<StageCost> selectStageSum(List<Integer> projectIds,Integer projectId, String  inchargerId, String startDate, String endDate);
+
 }

+ 1 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -273,9 +273,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 case 2 :
                     item.add("驳回");
                     break;
-                case 3 :
-                    item.add("导入待审核");
-                    break;
                 default:
                     item.add("_");
             }
@@ -536,7 +533,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 item.setCompanyId(companyId);
                 item.setCreatorId(user.getId());
                 item.setIndate(LocalDate.now());
-                item.setStatus(3);
+                item.setStatus(1);
                 //时间转化
                 DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-M-d");
                 if (StringUtils.isNotBlank(startDate)){

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -62,7 +62,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
     public HttpRespMsg exportGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, String downloadPath) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String resp = ExcelUtil.exportGeneralExcelByTitleAndList(title, list, downloadPath);
-        String fileUrlSuffix = title + ".xls";
+        String fileUrlSuffix = title + ".xlsx";
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
             String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
             String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
@@ -143,7 +143,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
     public  HttpRespMsg exportMultiSheetGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo,String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String resp = ExcelUtil.exportMultiSheetGeneralExcelByTitleAndList(title,multiSheetList, downloadPath,sheetsName);
-        String fileUrlSuffix = title + ".xls";
+        String fileUrlSuffix = title + ".xlsx";
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
             String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
             String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);

+ 26 - 24
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -2625,33 +2625,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         int startIndex = (pageIndex-1)*pageSize;
         int endIndex = pageSize*pageIndex;
         HttpRespMsg msg = new HttpRespMsg();
-        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
         List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部项目阶段工时表");
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目阶段工时表");
         //判断查看权限
-        List<Integer> inchagerIds=null;
+        List<ProjectWithStage> record = projectMapper.selectWithStage(companyId, startIndex, endIndex, projectId,null,startDate,endDate);
+        List<Integer> projectIds = record.stream().map(ProjectWithStage::getId).distinct().collect(Collectors.toList());
+        List<StageCost> allStageCostList = projectMapper.selectStageSum(projectIds,projectId,null,startDate,endDate);
+        String inchargerId=null;
         if(functionAllList.size()==0){
-            inchagerIds=new ArrayList<>();
             if(functionInchargeList.size()>0){
-                List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
-                if(list!=null){
-                    List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
-                    inchagerIds.addAll(collect);
-                }
-            }else {
-                inchagerIds.add(-1);
+                record = projectMapper.selectWithStage(companyId, startIndex, endIndex, projectId,user.getId(),startDate,endDate);
+                projectIds = record.stream().map(ProjectWithStage::getId).distinct().collect(Collectors.toList());
+                allStageCostList = projectMapper.selectStageSum(projectIds,projectId,user.getId(),startDate,endDate);
+                inchargerId=user.getId();
             }
         }
         QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
         if (projectId != null) {
             queryWrapper.eq("id", projectId);
         }
-        if(inchagerIds!=null){
-            queryWrapper.in("id",inchagerIds);
+        if(inchargerId!=null){
+            queryWrapper.eq("incharger_id",inchargerId);
         }
         Integer total = projectMapper.selectCount(queryWrapper);
-        List<ProjectWithStage> record = projectMapper.selectWithStage(companyId, startIndex, endIndex, projectId,inchagerIds,startDate,endDate);
         List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看阶段成本");
+        List<StageCost> finalAllStageCostList = allStageCostList;
+        record.forEach(re->{
+            List<StageCost> stageCosts = finalAllStageCostList.stream().filter(al -> al.getProjectId().equals(re.id)).collect(Collectors.toList());
+            re.setStageCostList(stageCosts);
+        });
         if (functionList.size() == 0) {
             //去掉成本
             record.forEach(re->{
@@ -2692,24 +2694,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
         HttpRespMsg msg = new HttpRespMsg();
-        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
         List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部项目任务报表");
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务报表");
         //判断查看权限
+        List<ProjectWithStage> record = projectMapper.selectWithStage(companyId, null, null, null,null,startDate,endDate);
+        List<StageCost> allStageCostList = projectMapper.selectStageSum(null,null,null,startDate,endDate);
         List<Integer> inchagerIds=null;
         if(functionAllList.size()==0){
-            inchagerIds=new ArrayList<>();
             if(functionInchargeList.size()>0){
-                List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
-                if(list!=null){
-                    List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
-                    inchagerIds.addAll(collect);
-                }
-            }else {
-                inchagerIds.add(-1);
+                 record = projectMapper.selectWithStage(companyId, null, null, null,user.getId(),startDate,endDate);
+                 allStageCostList = projectMapper.selectStageSum(null,null,user.getId(),startDate,endDate);
             }
         }
-        List<ProjectWithStage> record = projectMapper.selectWithStage(companyId, null, null, null,inchagerIds,startDate,endDate);
+
         //获取全部的列
         List<Integer> collect = record.stream().map(ProjectWithStage::getId).collect(Collectors.toList());
         final List<String> stageList = new ArrayList<>();
@@ -2733,6 +2730,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<List<String>> dataList = new ArrayList<>();
         dataList.add(titleList);
         List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看阶段成本");
+        List<StageCost> finalAllStageCostList = allStageCostList;
+        record.forEach(re->{
+            List<StageCost> stageCosts = finalAllStageCostList.stream().filter(al -> al.getProjectId().equals(re.id)).collect(Collectors.toList());
+            re.setStageCostList(stageCosts);
+        });
         if (functionList.size() == 0) {
             //去掉成本
             record.forEach(re->{
@@ -2763,7 +2765,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目阶段工时报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.ProPeriodWork")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList2(wxCorpInfo,fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList2(null,fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 47 - 44
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java

@@ -7,6 +7,7 @@ import com.management.platform.service.CorpwxJobResultService;
 import com.management.platform.service.WxCorpInfoService;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -27,7 +28,7 @@ public class ExcelUtil {
 
     public static String exportGeneralExcelByTitleAndList(String title, List<List<String>> list, String downloadPath) {
         String result="系统提示:Excel文件导出成功!";
-        String fileName= title+".xls";
+        String fileName= title+".xlsx";
         try {
 //            response.reset();
 //            response.setHeader("Content-disposition",
@@ -36,25 +37,26 @@ public class ExcelUtil {
 //            response.setContentType("APPLICATION/OCTET-STREAM;charset=UTF-8");//设置类型
 //            response.setHeader("Cache-Control","no-cache");//设置头
 //            response.setDateHeader("Expires", 0);//设置日期头
-            // 创建工作簿
-            HSSFWorkbook workBook = new HSSFWorkbook();
+            // 创建工作簿, 换成XSSSF 来支持万以上的数据
+            SXSSFWorkbook workBook = new SXSSFWorkbook();
+//            HSSFWorkbook workBook = new HSSFWorkbook();
             // 创建工作类
-            HSSFSheet sheet = workBook.createSheet();
+            Sheet sheet = workBook.createSheet();
             //设置首行冻结
             sheet.createFreezePane(0, 1);
             sheet.setDefaultColumnWidth(16);
             //设置字体样式
-            HSSFFont headFont = workBook.createFont();
+            Font headFont = workBook.createFont();
             headFont.setBold(true);
             headFont.setFontHeightInPoints((short) 10);
             headFont.setFontName("黑体");
 
-            HSSFFont titleFont = workBook.createFont();
+            Font titleFont = workBook.createFont();
             titleFont.setBold(true);
             titleFont.setFontHeightInPoints((short) 10);
             titleFont.setFontName("黑体");
 
-            HSSFFont font = workBook.createFont();
+            Font font = workBook.createFont();
             font.setFontHeightInPoints((short) 10);
             font.setFontName("宋体");
 
@@ -76,9 +78,9 @@ public class ExcelUtil {
             int b = Integer.parseInt((color.substring(4,6)),16);
 
             //自定义cell颜色
-            HSSFPalette palette = workBook.getCustomPalette();
+//            HSSFPalette palette = workBook.getCustomPalette();
             //这里的9是索引
-            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
+//            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
 
             CellStyle titleStyle = workBook.createCellStyle();
             titleStyle.setFont(titleFont);
@@ -122,11 +124,11 @@ public class ExcelUtil {
                 */
                 int start = 0;
                 for(List<String> rowList : list) {
-                    HSSFRow row = sheet.createRow(start);
+                    Row row = sheet.createRow(start);
                     row.setHeightInPoints(24);
 
                     for(int i = 0; i < rowList.size(); i++) {
-                        HSSFCell cell = row.createCell(i);
+                        Cell cell = row.createCell(i);
                         if(start == 0) {
                             cell.setCellStyle(titleStyle);
                         }else {
@@ -173,29 +175,30 @@ public class ExcelUtil {
 //            response.setHeader("Cache-Control","no-cache");//设置头
 //            response.setDateHeader("Expires", 0);//设置日期头
             // 创建工作簿
-            XSSFWorkbook workBook = new XSSFWorkbook();
+            SXSSFWorkbook workBook = new SXSSFWorkbook();
+//            XSSFWorkbook workBook = new XSSFWorkbook();
             // 创建工作类
-            XSSFSheet sheet = workBook.createSheet();
+            Sheet sheet = workBook.createSheet();
             //设置首行冻结
             sheet.createFreezePane(0, 1);
             sheet.setDefaultColumnWidth(16);
             //设置字体样式
-            XSSFFont headFont = workBook.createFont();
+            Font headFont = workBook.createFont();
             headFont.setBold(true);
             headFont.setFontHeightInPoints((short) 10);
             headFont.setFontName("黑体");
 
-            XSSFFont titleFont = workBook.createFont();
+            Font titleFont = workBook.createFont();
             titleFont.setBold(true);
             titleFont.setFontHeightInPoints((short) 10);
             titleFont.setFontName("黑体");
 
-            XSSFFont font = workBook.createFont();
+            Font font = workBook.createFont();
             font.setFontHeightInPoints((short) 10);
             font.setFontName("宋体");
 
             //设置单元格样式
-            XSSFCellStyle headStyle = workBook.createCellStyle();
+            CellStyle headStyle = workBook.createCellStyle();
             headStyle.setFont(headFont);
             headStyle.setAlignment(HorizontalAlignment.CENTER);
             headStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
@@ -206,7 +209,7 @@ public class ExcelUtil {
             headStyle.setBorderRight(BorderStyle.THIN);//右边框
 
 
-            XSSFCellStyle titleStyle = workBook.createCellStyle();
+            CellStyle titleStyle = workBook.createCellStyle();
             titleStyle.setFont(titleFont);
             titleStyle.setAlignment(HorizontalAlignment.CENTER);
             titleStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
@@ -218,7 +221,7 @@ public class ExcelUtil {
             titleStyle.setBorderTop(BorderStyle.THIN);//上边框
             titleStyle.setBorderRight(BorderStyle.THIN);//右边框
 
-            XSSFCellStyle cellStyle = workBook.createCellStyle();
+            CellStyle cellStyle = workBook.createCellStyle();
             cellStyle.setFont(font);
             cellStyle.setAlignment(HorizontalAlignment.CENTER);
             cellStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
@@ -248,11 +251,11 @@ public class ExcelUtil {
                 */
                 int start = 0;
                 for(List<String> rowList : list) {
-                    XSSFRow row = sheet.createRow(start);
+                    Row row = sheet.createRow(start);
                     row.setHeightInPoints(24);
 
                     for(int i = 0; i < rowList.size(); i++) {
-                        XSSFCell cell = row.createCell(i);
+                        Cell cell = row.createCell(i);
                         if(start == 0) {
                             cell.setCellStyle(titleStyle);
                         }else {
@@ -289,29 +292,29 @@ public class ExcelUtil {
 
     public static String exportTwoSheetGeneralExcelByTitleAndList(String title, List<List<String>> sheetOneList,List<List<String>> sheetTwoList, String downloadPath,String sheetOneName,String sheetTwoName) {
         String result="系统提示:Excel文件导出成功!";
-        String fileName= title+".xls";
+        String fileName= title+".xlsx";
         try {
             // 创建工作簿
-            HSSFWorkbook workBook = new HSSFWorkbook();
+            SXSSFWorkbook workBook = new SXSSFWorkbook();
             // 创建工作类
-            HSSFSheet sheetOne = workBook.createSheet();
+            Sheet sheetOne = workBook.createSheet();
             workBook.setSheetName(0,sheetOneName);
-            HSSFSheet sheetTwo = workBook.createSheet();
+            Sheet sheetTwo = workBook.createSheet();
             workBook.setSheetName(1,sheetTwoName);
             sheetOne.setDefaultColumnWidth(16);
             sheetTwo.setDefaultColumnWidth(16);
             //设置字体样式
-            HSSFFont headFont = workBook.createFont();
+            Font headFont = workBook.createFont();
             headFont.setBold(true);
             headFont.setFontHeightInPoints((short) 10);
             headFont.setFontName("黑体");
 
-            HSSFFont titleFont = workBook.createFont();
+            Font titleFont = workBook.createFont();
             titleFont.setBold(true);
             titleFont.setFontHeightInPoints((short) 10);
             titleFont.setFontName("黑体");
 
-            HSSFFont font = workBook.createFont();
+            Font font = workBook.createFont();
             font.setFontHeightInPoints((short) 10);
             font.setFontName("宋体");
 
@@ -333,9 +336,9 @@ public class ExcelUtil {
             int b = Integer.parseInt((color.substring(4,6)),16);
 
             //自定义cell颜色
-            HSSFPalette palette = workBook.getCustomPalette();
+//            HSSFPalette palette = workBook.getCustomPalette();
             //这里的9是索引
-            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
+//            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
 
             CellStyle titleStyle = workBook.createCellStyle();
             titleStyle.setFont(titleFont);
@@ -379,10 +382,10 @@ public class ExcelUtil {
                 */
                 int start = 0;
                 for(List<String> rowList : sheetOneList) {
-                    HSSFRow row = sheetOne.createRow(start);
+                    Row row = sheetOne.createRow(start);
                     row.setHeightInPoints(24);
                     for(int i = 0; i < rowList.size(); i++) {
-                        HSSFCell cell = row.createCell(i);
+                        Cell cell = row.createCell(i);
                         if(start == 0) {
                             cell.setCellStyle(titleStyle);
                         }else {
@@ -396,10 +399,10 @@ public class ExcelUtil {
             if(sheetTwoList.size()>0){
                 int start = 0;
                 for(List<String> rowList : sheetTwoList) {
-                    HSSFRow row = sheetTwo.createRow(start);
+                    Row row = sheetTwo.createRow(start);
                     row.setHeightInPoints(24);
                     for(int i = 0; i < rowList.size(); i++) {
-                        HSSFCell cell = row.createCell(i);
+                        Cell cell = row.createCell(i);
                         if(start == 0) {
                             cell.setCellStyle(titleStyle);
                         }else {
@@ -428,28 +431,28 @@ public class ExcelUtil {
 
     public static String exportMultiSheetGeneralExcelByTitleAndList(String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) {
         String result="系统提示:Excel文件导出成功!";
-        String fileName= title+".xls";
+        String fileName= title+".xlsx";
         try {
             // 创建工作簿
-            HSSFWorkbook workBook = new HSSFWorkbook();
+            SXSSFWorkbook workBook = new SXSSFWorkbook();
             // 创建工作类
             for (int sheetIndex=0;sheetIndex<multiSheetList.length; sheetIndex++) {
-                HSSFSheet sheetOne = workBook.createSheet();
+                Sheet sheetOne = workBook.createSheet();
                 workBook.setSheetName(sheetIndex,sheetsName[sheetIndex]);
                 sheetOne.setDefaultColumnWidth(16);
 
                 //设置字体样式
-                HSSFFont headFont = workBook.createFont();
+                Font headFont = workBook.createFont();
                 headFont.setBold(true);
                 headFont.setFontHeightInPoints((short) 10);
                 headFont.setFontName("黑体");
 
-                HSSFFont titleFont = workBook.createFont();
+                Font titleFont = workBook.createFont();
                 titleFont.setBold(true);
                 titleFont.setFontHeightInPoints((short) 10);
                 titleFont.setFontName("黑体");
 
-                HSSFFont font = workBook.createFont();
+                Font font = workBook.createFont();
                 font.setFontHeightInPoints((short) 10);
                 font.setFontName("宋体");
 
@@ -471,9 +474,9 @@ public class ExcelUtil {
                 int b = Integer.parseInt((color.substring(4,6)),16);
 
                 //自定义cell颜色
-                HSSFPalette palette = workBook.getCustomPalette();
+//                HSSFPalette palette = workBook.getCustomPalette();
                 //这里的9是索引
-                palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
+//                palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
 
                 CellStyle titleStyle = workBook.createCellStyle();
                 titleStyle.setFont(titleFont);
@@ -500,10 +503,10 @@ public class ExcelUtil {
                 if(multiSheetList[sheetIndex].size() > 0) {
                     int start = 0;
                     for(List<String> rowList : multiSheetList[sheetIndex]) {
-                        HSSFRow row = sheetOne.createRow(start);
+                        Row row = sheetOne.createRow(start);
                         row.setHeightInPoints(24);
                         for(int i = 0; i < rowList.size(); i++) {
-                            HSSFCell cell = row.createCell(i);
+                            Cell cell = row.createCell(i);
                             if(start == 0) {
                                 cell.setCellStyle(titleStyle);
                             }else {

+ 16 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -76,18 +76,15 @@
         <result column="project_ids" property="projectIds" />
         <result column="project_names" property="projectNames" />
     </resultMap>
-    <select id="selectWithStage" resultMap="BaseResultMap2" >
+    <select id="selectWithStage" resultType="com.management.platform.entity.vo.ProjectWithStage">
         select id, project_code, project_name,#{startDate} as startDate,#{endDate} as endDate
         from project
         where company_id = #{companyId}
         <if test="projectId != null">
             and id = #{projectId}
         </if>
-        <if test="inchagerIds!=null and inchagerIds.size()>0">
-            and id in
-            <foreach collection="inchagerIds" open="(" close=")" separator="," item="item">
-                #{item}
-            </foreach>
+        <if test="inchargerId!=null">
+            and incharger_id = #{inchargerId}
         </if>
         order by is_public desc, id asc
         <if test="startIndex != null">
@@ -97,12 +94,22 @@
     <select id="selectStageSum" resultType="com.management.platform.entity.vo.StageCost">
         select IFNULL(report.stage, '-') AS stage_name, IFNULL(SUM(report.`cost`),0) AS cost,
         IFNULL(SUM(report.`working_time`), 0) AS working_time,
-		IFNULL((SELECT SUM(stages.`stages_time`) from stages WHERE stages.stages_name = report.stage  GROUP BY stages_name), 0)  AS stages_time
+		IFNULL((SELECT SUM(stages.`stages_time`) from stages WHERE stages.stages_name = report.stage  GROUP BY stages_name), 0)  AS stages_time,report.`project_id` as projectId
         FROM report
-				where report.state = 1 and report.`project_id` = #{projectId}
+        left join project p on p.id=report.`project_id`
+				where report.state = 1
+        <if test="inchargerId!=null">
+            and p.incharger_id = #{inchargerId}
+        </if>
+        <if test="projectIds!=null and projectIds.size()>0">
+            and p.id in
+            <foreach collection="projectIds" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
 				and report.create_date &gt;= #{startDate}
                 and report.create_date &lt;= #{endDate}
-        GROUP BY report.stage
+        GROUP BY report.`project_id`,report.stage
     </select>
     <!--获取查询者所在公司每个项目的工时成本-->
     <select id="getParticipatedProject" resultType="java.util.Map">

+ 19 - 19
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -1490,25 +1490,25 @@ export default {
         var fName = "";
         var sl = {}
         if (this.ins == 0) {  
-          fName = this.$t('projectreport') + '.xls';
+          fName = this.$t('projectreport') + '.xlsx';
           url += "/exportProject";
         } else if (this.ins == 1) {
-          fName = this.$t('projectTaskReport') + '.xls';
+          fName = this.$t('projectTaskReport') + '.xlsx';
           url += "/exportProjectTask";
           if(this.taskTypeId != 'null' && this.taskTypeId != null && this.taskTypeId != '') {
             sl.taskType = this.taskTypeId
           }
         } else if (this.ins == 2) {
-          fName = this.$t('projectcoststatement') + '.xls';
+          fName = this.$t('projectcoststatement') + '.xlsx';
           url += "/exportAllProjectCost";
         } else if (this.ins == 3) {
-          fName = this.$t('projectbalancesheet') + '.xls';
+          fName = this.$t('projectbalancesheet') + '.xlsx';
           url += "/exportProjectInAndOut";
         } else if (this.ins == 4) {
-          fName = this.$t('customerprojectprofitstatement') + '.xls';
+          fName = this.$t('customerprojectprofitstatement') + '.xlsx';
           url += "/exportCustomerProjectInAndOut";
         } else if (this.ins == 5) {
-          fName = this.$t('projectphasetimereport') + '.xls';
+          fName = this.$t('projectphasetimereport') + '.xlsx';
           url += "/exportProjectStagesCost";
           if(this.stageNames.length){
             let stagestr = ''
@@ -1521,7 +1521,7 @@ export default {
             sl.endDate = this.rangeDatas[1]
           }
         } else if (this.ins == 6) {
-          fName = this.$t('statisticalreportofovertimework')  + '.xls';
+          fName = this.$t('statisticalreportofovertimework')  + '.xlsx';
           url += "/exportOvertimeList";
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
@@ -1532,10 +1532,10 @@ export default {
           }
           sl.departmentId = deptid
         } else if (this.ins == 7) {
-          fName = this.$t('timecostearlywarningtable')  + '.xls';
+          fName = this.$t('timecostearlywarningtable')  + '.xlsx';
           url += "/exportBaseCostAndRealCost";
         } else if (this.ins == 8) {
-          fName = this.$t('personneltimeallocationtable')  + '.xls'
+          fName = this.$t('personneltimeallocationtable')  + '.xlsx'
           url += "/exportUserWorkingTimeList"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
@@ -1546,12 +1546,12 @@ export default {
             sl.userId = this.userId
           }
         } else if (this.ins == 9) {
-          fName = this.$t('personnelfillingtimelyratestatistics')  + '.xls'
+          fName = this.$t('personnelfillingtimelyratestatistics')  + '.xlsx'
           url += "/exportReportTimelinessRate"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
         } else if (this.ins == 10) {
-          fName = this.$t('dailyreporttobereviewedstatistics')  + '.xls'
+          fName = this.$t('dailyreporttobereviewedstatistics')  + '.xlsx'
           url += "/exportWaitingReviewList"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
@@ -1560,7 +1560,7 @@ export default {
             sl.userId = this.userId
           }
         } else if(this.ins == 11){
-          fName = this.$t('personnelhourstatistics')  + '.xls'
+          fName = this.$t('personnelhourstatistics')  + '.xlsx'
           url += "/exportUserWorkingTimeStatic"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
@@ -1571,33 +1571,33 @@ export default {
             sl.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
           }
         }else if(this.ins == 12){
-          fName = this.$t('timestatisticsofaskgroups') + '.xls'
+          fName = this.$t('timestatisticsofaskgroups') + '.xlsx'
           url += "/exportGroupWithProjectTimeCost"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
         }else if(this.ins == 13){
-          fName = this.$t('projectcostbaselinetable') + '.xls'
+          fName = this.$t('projectcostbaselinetable') + '.xlsx'
           url += "/exportProjectBaseCost"
         } else if(this.ins == 14) {
-          fName = this.$t('ren-yuan-yue-du-gong-shi-biao') + '.xls'
+          fName = this.$t('ren-yuan-yue-du-gong-shi-biao') + '.xlsx'
           url += "/exportEmpMonthHours"
           sl.userId= this.userId,
           sl.departmentId = this.departmentIdArray.length > 0 ? this.departmentIdArray[this.departmentIdArray.length - 1] : '',
           sl.month = this.monthPersonnel + '-01',
           sl.whether = this.whether
         } else if(this.ins == 15) {
-          fName = this.$t('bumenchanyuqingkuang') + '.xls'
+          fName = this.$t('bumenchanyuqingkuang') + '.xlsx'
           url += "/exportDeptPartInProjects"
           sl.month = this.monthPersonnel + '-01'
           sl.departmentId = this.departmentIdArray.length > 0 ? this.departmentIdArray[this.departmentIdArray.length - 1] : ''
         } else if(this.ins == 16) {
-          fName = this.$t('ge-fen-zu-jie-duan-gong-shi-biao') + '.xls'
+          fName = this.$t('ge-fen-zu-jie-duan-gong-shi-biao') + '.xlsx'
           url += "/exportProjectGroupAndCategoryWorkTime"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
           sl.projectId = this.proJuctId
         } else if(this.ins == 17) {
-          fName = '子项目工时成本表' + '.xls'
+          fName = '子项目工时成本表' + '.xlsx'
           url += "/exportSubProjectTimeCost"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
@@ -1634,7 +1634,7 @@ export default {
             res => {
                 if (res.code == "ok") {
                     var filePath = res.data;
-                    var fName = this.$t('personnelfillingtimelyratestatistics') + '(' + this.quarterParameter.year + this.$t('di') + this.quarterParameter.quarter  + '季度).xls'
+                    var fName = this.$t('personnelfillingtimelyratestatistics') + '(' + this.quarterParameter.year + this.$t('di') + this.quarterParameter.quarter  + '季度).xlsx'
                     const a = document.createElement('a'); // 创建a标签
                     a.setAttribute('download', fName);// download属性
                     a.setAttribute('href', filePath);// href链接