diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteController.java index 5559ee0c..8e5425ba 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteController.java @@ -162,7 +162,7 @@ public class CompeteController { @MustLogin - @ApiOperation(value = "报名表", notes = "") + @ApiOperation(value = "报名表详情表", notes = "") @RequestMapping(value = "/enroll", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse enrollPlayInfo(@ApiParam @Validated @RequestBody QueryDto params) throws IOException { log.info("查询各个项目报名人员信息:{}",params); @@ -170,7 +170,13 @@ public class CompeteController { return JsonResponse.newInstance().ok(enrollPlayInfoList); } - + @ApiOperation(value = "报名表人数表下载", notes = "") + @RequestMapping(value = "/enrollCount", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse enrollPlayCount() throws IOException { +// log.info("查询各个项目报名人员信息:{}",); + String path = competeService.enrollPlayCount(); + return JsonResponse.newInstance().ok(path); + } // @MustLogin diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java index b6a06df8..df9d06bf 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java @@ -397,4 +397,32 @@ public class CompeteVo { @ApiModelProperty("团队下的参与者id") private long player_id; } + @Data + @ApiModel("参赛各组别数信息") + public static class Count{ + @ApiModelProperty("组别名") + private String group_name; + @ApiModelProperty("某组别人数") + private int count; + @ApiModelProperty("组别id") + private Long compete_group_id; + @ApiModelProperty("团队id") + private long team_id; + } + @Data + @ApiModel("参赛项目中组别人数信息") + public static class GroupNum{ + @ApiModelProperty("项目名") + private String name; + @ApiModelProperty("参赛各组别数信息") + private List countList; + } + @Data + @ApiModel("group中的组别id") + public static class GroupIdAndName{ + @ApiModelProperty("项目id") + private int id; + @ApiModelProperty("组别名") + private String group_name; + } } diff --git a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java index 7a1f276f..ef9dc8d3 100644 --- a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java +++ b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java @@ -52,5 +52,60 @@ public interface CompeteEnrollDao extends CompetePlayerMapper { */ List getTeamPlayerId(@Param("teamId")long teamId); + /** + * 查询个人项目的每个组别id和组别名 + * @param projectId 项目id + * @return 组别id + */ + List getGroupCount(@Param("projectId")long projectId); + + /** + * 查询个人项目的每个组别人数 + * @param competeGroupId 组别id + * @return 团队成员id + */ + int getGroupPlayCount(@Param("competeGroupId")long competeGroupId); + + /** + * 查询个人项目的每个组别id和组别名 + * @param projectId xiangmu id + * @return 团队成员id + */ + List getGroupIdFroPlayer(@Param("projectId")long projectId); + + /** + * 查询团队项目的每个组别id和组别名 + * @param projectId xiangmu id + * @return 团队成员id + */ + List getGroupIdFroTeam(@Param("projectId")long projectId); + + /** + * 查询团队项目的每个组别id和组别名 + * @param competeGroupId 组别id + * @return 团队id + */ + List getTeamIdByCompeteGroupId(@Param("competeGroupId")long competeGroupId); + + /** + * 查询团队项目组别下的人数 + * @param teamId 组别id + * @return renshu + */ + int getCountByTeamId(@Param("teamId")long teamId); + + /** + * 查询团队项目的每个组别参赛队伍数 + * @param competeGroupId 组别id + * @return 团队成员id + */ + int getTeamCount(@Param("competeGroupId")long competeGroupId); + + /** + * 查询团队项目的每个组别参赛队伍数 + * @param type 组别id + * @return 团队成员id + */ + List getGroupIdNameFromGroup(@Param("type")long type); } diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java index 21793177..9d6b16f6 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -22,8 +22,12 @@ import com.ccsens.util.*; import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.core.io.DefaultResourceLoader; +import org.springframework.core.io.ResourceLoader; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -618,6 +622,7 @@ public class CompeteService implements ICompeteService{ //查询报名信息 int typeId = competeType.getType(); ArrayList arrayList = new ArrayList(); + List string = null; //1:查询该类型下所有项目的id,name,team信息,排除level为1的 List projectInfoList = competeEnrollDao.getProject(typeId); //2:根据team字段判断是否为团队项目 @@ -686,7 +691,6 @@ public class CompeteService implements ICompeteService{ //8:关联金山在线文档 String name = "跳绳比赛报名表" + ".xlsx"; String filepath = "mt/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; - String path = PropUtil.path + filepath; File tmpFile = new File(path); if (!tmpFile.getParentFile().exists()) { @@ -720,7 +724,92 @@ public class CompeteService implements ICompeteService{ e.printStackTrace(); } return filePath.get(0); - } + } + @Override + public String enrollPlayCount() throws IOException { + //查询该类型下所有项目的id,name,team信息,排除level为1的的集合 + int typeId = 2; + //放总数据集合 + List list1 = new ArrayList<>(); + //根据type 查项目 + List projectInfoList = competeEnrollDao.getProject(typeId); + //根据type 查组别id,组别名 + List groupIdAndNameList = competeEnrollDao.getGroupIdNameFromGroup(typeId); + for (CompeteVo.ProjectInfo projectInfo : projectInfoList) { + CompeteVo.GroupNum groupNum = new CompeteVo.GroupNum(); + groupNum.setName(projectInfo.getName()); + //查询所有组别 + List countList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(groupIdAndNameList)) { + for (CompeteVo.Count groupIdAndName : groupIdAndNameList) { + CompeteVo.Count count1 = new CompeteVo.Count(); + count1.setGroup_name(groupIdAndName.getGroup_name()); +// groupIdAndNameList.forEach(groupIdAndName -> { + if (projectInfo.getTeam() == 0) { + CompeteProjectPlayerExample projectPlayerExample = new CompeteProjectPlayerExample(); + projectPlayerExample.createCriteria().andProjectIdEqualTo(projectInfo.getId()).andCompeteGroupIdEqualTo(groupIdAndName.getCompete_group_id()); + long count = competeProjectPlayerMapper.countByExample(projectPlayerExample); + count1.setCount((int) count); + } else { + CompeteTeamExample teamExample = new CompeteTeamExample(); + teamExample.createCriteria().andProjectIdEqualTo(projectInfo.getId()).andCompeteGroupIdEqualTo(groupIdAndName.getCompete_group_id()); + long count = competeTeamDao.countByExample(teamExample); + count1.setCount((int) count); + } +// }); + countList.add(count1); + } + } + groupNum.setCountList(countList); + list1.add(groupNum); + } + //7:将数据放入excel表格 + ResourceLoader resourceLoader = new DefaultResourceLoader(); + InputStream is = resourceLoader.getResource("classpath:template/competeCount.xlsx").getInputStream(); + Workbook workbook = new XSSFWorkbook(is); + //生成excel表格对象,并将数据放入 + List> list = new ArrayList<>(); + //生成行对象 + List poiUtilCellList1 = new ArrayList<>(); + List poiUtilCellList2 = new ArrayList<>(); + List poiUtilCellList3 = new ArrayList<>(); + list.add(poiUtilCellList1); + list.add(poiUtilCellList2); + list.add(poiUtilCellList3); + + list1.forEach(excelList ->{ + List title = new ArrayList<>(); + title.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL,1,1,null,null)); + title.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL,1,1,null,null)); + title.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL,1,1,null,null)); + excelList.getCountList().forEach(count -> { + PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(); + poiUtilCell.setValue(String.valueOf(count.getCount())); + poiUtilCell.setHeight(null); + poiUtilCell.setWight(null); + poiUtilCell.setNum((byte) 1); + title.add(poiUtilCell); + }); + list.add(title); + }); + Workbook wbs = PoiUtil.exportWB("统计表", list, workbook); + String name = "跳绳比赛报名人数统计表" + ".xlsx"; + String filepath = "mt/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; + String path = PropUtil.path + filepath; + File tmpFile = new File(path); + if (!tmpFile.getParentFile().exists()) { + tmpFile.getParentFile().mkdirs(); + } + File file = new File(path); + try { + OutputStream outputStream = new FileOutputStream(file); + wbs.write(outputStream); + outputStream.close(); + }catch (IOException e) { + e.printStackTrace(); + } + return PropUtil.imgDomain + filepath; + } } diff --git a/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java b/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java index 87c616c4..c9f20307 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java @@ -121,4 +121,13 @@ public interface ICompeteService { * @return 返回参赛者的详细信息 */ String enrollPlayInfo(QueryDto params) throws IOException; + + /** + * 根据项目类型查询参赛者信息 + * @return 返回参赛者数量 + */ + String enrollPlayCount() throws IOException; + } + + diff --git a/mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml b/mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml index 2572f53d..2260dcaa 100644 --- a/mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml @@ -20,6 +20,13 @@ + + + + + + + - \ No newline at end of file + + + + + + + + + diff --git a/mt/src/main/resources/template/competeCount.xlsx b/mt/src/main/resources/template/competeCount.xlsx new file mode 100644 index 00000000..932d956e Binary files /dev/null and b/mt/src/main/resources/template/competeCount.xlsx differ diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java index 93c90d82..e13f9595 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java @@ -73,6 +73,12 @@ public class ProjectDto { private Long beginTime; @ApiModelProperty("项目结束时间") private Long endTime; + @ApiModelProperty("父项目id") + private Long parentId; + @ApiModelProperty("是否首页展示 0否 1是") + private Byte homePageShow; + @ApiModelProperty("是否显示特殊样式(如:高亮) 0否 1是") + private Byte highlight; } @Data @@ -139,6 +145,12 @@ public class ProjectDto { private Long beginTime; @ApiModelProperty("结束时间") private Long endTime; + @ApiModelProperty("父项目id") + private Long parentId; + @ApiModelProperty("是否首页展示 0否 1是") + private Byte homePageShow; + @ApiModelProperty("是否显示特殊样式(如:高亮) 0否 1是") + private Byte highlight = 0; @ApiModelProperty("标签id") private List labelList; } diff --git a/tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java b/tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java index 06a49334..c0648abb 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java @@ -726,11 +726,11 @@ public class ExportWbsService implements IExportWbsService{ list.add(row1); list.add(row1); List row3 = new ArrayList<>(); - row3.add(new PoiUtil.PoiUtilCell("时间",null,null)); - row3.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis()),null,null)); + row3.add(new PoiUtil.PoiUtilCell("时间")); + row3.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis()))); row3.add(new PoiUtil.PoiUtilCell()); - row3.add(new PoiUtil.PoiUtilCell("项目",null,null)); - row3.add(new PoiUtil.PoiUtilCell(checklists.get(0).getProjectName(),null,null)); + row3.add(new PoiUtil.PoiUtilCell("项目")); + row3.add(new PoiUtil.PoiUtilCell(checklists.get(0).getProjectName())); list.add(row3); list.add(row1); int index = 1; @@ -745,28 +745,28 @@ public class ExportWbsService implements IExportWbsService{ } } List checkList = new ArrayList<>(); - checkList.add(new PoiUtil.PoiUtilCell(String.valueOf(index),null,null)); - checkList.add(new PoiUtil.PoiUtilCell(checklist.getTaskName(),null,null)); - checkList.add(new PoiUtil.PoiUtilCell(checklist.getRoleName(),null,null)); + checkList.add(new PoiUtil.PoiUtilCell(String.valueOf(index))); + checkList.add(new PoiUtil.PoiUtilCell(checklist.getTaskName())); + checkList.add(new PoiUtil.PoiUtilCell(checklist.getRoleName())); if(StrUtil.isNotEmpty(checklist.getCycle()) && !"不重复".equalsIgnoreCase(checklist.getCycle())){ checkList.add(new PoiUtil.PoiUtilCell()); checkList.add(new PoiUtil.PoiUtilCell(checklist.getCycle())); }else { - checkList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(checklist.getBeginTime()), null, null)); + checkList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(checklist.getBeginTime()))); String duration = null; if (checklist.getDuration() / 1000 / 3600 >= 2) { duration = checklist.getDuration() / 1000 / 3600 + "小时"; } else { duration = checklist.getDuration() / 1000 / 60 + "分钟"; } - checkList.add(new PoiUtil.PoiUtilCell(duration, null, null)); + checkList.add(new PoiUtil.PoiUtilCell(duration)); } if(ObjectUtil.isNotNull(checklist.getCompleteTime())) { - checkList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(checklist.getCompleteTime()), null, null)); + checkList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(checklist.getCompleteTime()))); }else { checkList.add(new PoiUtil.PoiUtilCell()); } - checkList.add(new PoiUtil.PoiUtilCell(checklist.getProcess(),null,null)); + checkList.add(new PoiUtil.PoiUtilCell(checklist.getProcess())); list.add(checkList); index++; } @@ -843,37 +843,37 @@ public class ExportWbsService implements IExportWbsService{ list.add(row1); list.add(row1); List row3 = new ArrayList<>(); - row3.add(new PoiUtil.PoiUtilCell("时间",null,null)); - row3.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis()),null,null)); + row3.add(new PoiUtil.PoiUtilCell("时间")); + row3.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis()))); row3.add(new PoiUtil.PoiUtilCell()); - row3.add(new PoiUtil.PoiUtilCell("项目",null,null)); - row3.add(new PoiUtil.PoiUtilCell(deliverWithExcelList.get(0).getProjectName(),null,null)); + row3.add(new PoiUtil.PoiUtilCell("项目")); + row3.add(new PoiUtil.PoiUtilCell(deliverWithExcelList.get(0).getProjectName())); list.add(row3); list.add(row1); int index = 1; for(WbsVo.DeliverWithExcel deliverWithExcel : deliverWithExcelList){ List mvpList = new ArrayList<>(); - mvpList.add(new PoiUtil.PoiUtilCell(String.valueOf(index),null,null)); + mvpList.add(new PoiUtil.PoiUtilCell(String.valueOf(index))); mvpList.add(new PoiUtil.PoiUtilCell(deliverWithExcel.getTaskName(),2,1,null,null)); mvpList.add(new PoiUtil.PoiUtilCell()); if(StrUtil.isNotEmpty(deliverWithExcel.getTaskCycle()) && !"不重复".equalsIgnoreCase(deliverWithExcel.getTaskCycle())){ mvpList.add(new PoiUtil.PoiUtilCell()); mvpList.add(new PoiUtil.PoiUtilCell(deliverWithExcel.getTaskCycle())); }else { - mvpList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(deliverWithExcel.getTaskBeginTime()), null, null)); + mvpList.add(new PoiUtil.PoiUtilCell(new SimpleDateFormat("yyyy/MM/dd HH:mm").format(deliverWithExcel.getTaskBeginTime()))); String duration = null; if (deliverWithExcel.getTaskDuration() / 1000 / 3600 >= 2) { duration = deliverWithExcel.getTaskDuration() / 1000 / 3600 + "小时"; } else { duration = deliverWithExcel.getTaskDuration() / 1000 / 60 + "分钟"; } - mvpList.add(new PoiUtil.PoiUtilCell(duration, null, null)); + mvpList.add(new PoiUtil.PoiUtilCell(duration)); } if(StrUtil.isEmpty(deliverWithExcel.getJumpPath())) { - mvpList.add(new PoiUtil.PoiUtilCell(deliverWithExcel.getDeliverName(), null, null)); + mvpList.add(new PoiUtil.PoiUtilCell(deliverWithExcel.getDeliverName())); }else { - PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(deliverWithExcel.getDeliverName(), null, null); + PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(deliverWithExcel.getDeliverName()); poiUtilCell.setPath(deliverWithExcel.getJumpPath()); mvpList.add(poiUtilCell); } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 2a2cadfa..bbc9ab52 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -1124,15 +1124,19 @@ public class ProTaskDetailService implements IProTaskDetailService { //当前用户是否是此任务的负责人 boolean flag = false; ProRole executorRole = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole()); - ProMemberExample memberExample = new ProMemberExample(); - memberExample.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(project.getId()); - List memberList = proMemberDao.selectByExample(memberExample); - if(CollectionUtil.isNotEmpty(memberList)){ - if(ObjectUtil.isNotNull(executorRole)){ - ProMemberRoleExample memberRoleExample = new ProMemberRoleExample(); - memberRoleExample.createCriteria().andRoleIdEqualTo(executorRole.getId()).andMemberIdEqualTo(memberList.get(0).getId()); - if(proMemberRoleDao.countByExample(memberRoleExample) != 0){ - flag = true; + if(executorRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)){ + flag = true; + }else { + ProMemberExample memberExample = new ProMemberExample(); + memberExample.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(project.getId()); + List memberList = proMemberDao.selectByExample(memberExample); + if (CollectionUtil.isNotEmpty(memberList)) { + if (ObjectUtil.isNotNull(executorRole)) { + ProMemberRoleExample memberRoleExample = new ProMemberRoleExample(); + memberRoleExample.createCriteria().andRoleIdEqualTo(executorRole.getId()).andMemberIdEqualTo(memberList.get(0).getId()); + if (proMemberRoleDao.countByExample(memberRoleExample) != 0) { + flag = true; + } } } } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProjectService.java b/tall/src/main/java/com/ccsens/tall/service/ProjectService.java index 5effaeb4..b5e7619c 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProjectService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProjectService.java @@ -893,6 +893,15 @@ public class ProjectService implements IProjectService { if(ObjectUtil.isNotNull(projectInfoDto.getEndTime())){ project.setEndTime(projectInfoDto.getEndTime()); } + if(ObjectUtil.isNotNull(projectInfoDto.getParentId())){ + project.setParentId(projectInfoDto.getParentId()); + } + if(ObjectUtil.isNotNull(projectInfoDto.getHomePageShow())){ + project.setHomePageShow(projectInfoDto.getHomePageShow()); + } + if(ObjectUtil.isNotNull(projectInfoDto.getHighlight())){ + project.setHighlight(projectInfoDto.getHighlight()); + } sysProjectDao.updateByPrimaryKeySelective(project); } else { throw new BaseException(CodeEnum.NOT_POWER); @@ -1024,6 +1033,17 @@ public class ProjectService implements IProjectService { sysProject.setBeginTime(beginTime); sysProject.setEndTime(endTime); sysProject.setCreatorId(currentUserId); + sysProject.setParentId(createProject.getParentId()); + Byte homePageShow = createProject.getHomePageShow(); + if(homePageShow == null){ + if(createProject.getParentId() != null){ + homePageShow = 0; + }else { + homePageShow = 1; + } + } + sysProject.setHomePageShow(homePageShow); + sysProject.setHighlight(createProject.getHighlight()); sysProjectDao.insertSelective(sysProject); //让当前用户关注项目 UserAttention userAttention = new UserAttention(); diff --git a/tall/src/main/java/com/ccsens/tall/service/UserInfoService.java b/tall/src/main/java/com/ccsens/tall/service/UserInfoService.java index d2e58728..f2979cf0 100644 --- a/tall/src/main/java/com/ccsens/tall/service/UserInfoService.java +++ b/tall/src/main/java/com/ccsens/tall/service/UserInfoService.java @@ -190,7 +190,7 @@ public class UserInfoService implements IUserInfoService{ selectUserInfo.setDayOfUseTall((int) ((now - selectUserInfo.getCreatedAt().getTime()) / 1000 / 3600 / 24)); } //获取标签信息 - selectUserInfo.setLabelList(sysLabelDao.selectLabelByUserId(currentUserId,null)); + selectUserInfo.setLabelList(sysLabelDao.selectLabelByUserId(currentUserId,null,null)); //获取空间使用信息 UserVo.Interspace interspace = sysUserDao.selectInterspace(currentUserId); selectUserInfo.setInterspace(interspace); diff --git a/util/src/main/java/com/ccsens/util/PoiUtil.java b/util/src/main/java/com/ccsens/util/PoiUtil.java index 9b6cd9a2..f347acb1 100644 --- a/util/src/main/java/com/ccsens/util/PoiUtil.java +++ b/util/src/main/java/com/ccsens/util/PoiUtil.java @@ -72,6 +72,11 @@ public class PoiUtil { */ private String function; + /** + * 是否是数字格式 0否 1是 + */ + private byte num = 0; + public PoiUtilCell() { } @@ -157,9 +162,12 @@ public class PoiUtil { List cells = rows.get(i); for (int j = 0; j < cells.size(); j++) { CellStyle style = wb.createCellStyle(); - //将内容按顺序赋给对应的列对象 PoiUtilCell cell = cells.get(j); + //如果value是cell_null代表次单元格不需要赋值 + if (cell.value.equals(WebConstant.CELL_NULL)){ + continue; + } Cell newCell = row.createCell(j); //设置行高 if (ObjectUtil.isNotNull(cell.height)) { @@ -167,7 +175,14 @@ public class PoiUtil { row.setHeight(cell.height.shortValue()); } } - newCell.setCellValue(cell.value); + + if(cell.num == 1){ +// newCell.setCellType(cell.cellType); + newCell.setCellValue(Integer.parseInt(cell.value)); + }else { + newCell.setCellValue(cell.value); + } + style.setAlignment(cell.style); style.setVerticalAlignment(cell.verticalAlignment); diff --git a/util/src/main/java/com/ccsens/util/WebConstant.java b/util/src/main/java/com/ccsens/util/WebConstant.java index 0165fe9a..f5efc75c 100644 --- a/util/src/main/java/com/ccsens/util/WebConstant.java +++ b/util/src/main/java/com/ccsens/util/WebConstant.java @@ -9,7 +9,8 @@ import java.io.File; public class WebConstant { - + /**cell内容不赋值*/ + public static final String CELL_NULL = "cell_null"; /**数据存在*/ public static final byte STATUS_EXIT = 0; /**数据已删除*/ @@ -188,6 +189,7 @@ public class WebConstant { public static final String IMG_PATH_PREFIX_SHARE_IMG = IMG_PATH_PREFIX + File.separator + "shareimg"; public static final String IMG_PATH_SHARE_IMG = "/shareimg"; + public static final String PATH_WX_CRET = "/home/packet/1513955071_20181128_cert.p12"; //public static final String WX_CRET_PWD = xxx;