Browse Source

修改poi工具类

tiaosheng
zy_Java 5 years ago
parent
commit
d3e75a1d85
  1. 10
      mt/src/main/java/com/ccsens/mt/api/CompeteController.java
  2. 28
      mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java
  3. 55
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java
  4. 93
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  5. 9
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java
  6. 67
      mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml
  7. BIN
      mt/src/main/resources/template/competeCount.xlsx
  8. 12
      tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java
  9. 40
      tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java
  10. 10
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  11. 20
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  12. 2
      tall/src/main/java/com/ccsens/tall/service/UserInfoService.java
  13. 17
      util/src/main/java/com/ccsens/util/PoiUtil.java
  14. 4
      util/src/main/java/com/ccsens/util/WebConstant.java

10
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<CompeteDto.CompeteType> 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

28
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<CompeteVo.Count> countList;
}
@Data
@ApiModel("group中的组别id")
public static class GroupIdAndName{
@ApiModelProperty("项目id")
private int id;
@ApiModelProperty("组别名")
private String group_name;
}
}

55
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteEnrollDao.java

@ -52,5 +52,60 @@ public interface CompeteEnrollDao extends CompetePlayerMapper {
*/
List<CompeteVo.Team> getTeamPlayerId(@Param("teamId")long teamId);
/**
* 查询个人项目的每个组别id和组别名
* @param projectId 项目id
* @return 组别id
*/
List<CompeteVo.Count> getGroupCount(@Param("projectId")long projectId);
/**
* 查询个人项目的每个组别人数
* @param competeGroupId 组别id
* @return 团队成员id
*/
int getGroupPlayCount(@Param("competeGroupId")long competeGroupId);
/**
* 查询个人项目的每个组别id和组别名
* @param projectId xiangmu id
* @return 团队成员id
*/
List<CompeteVo.Count> getGroupIdFroPlayer(@Param("projectId")long projectId);
/**
* 查询团队项目的每个组别id和组别名
* @param projectId xiangmu id
* @return 团队成员id
*/
List<CompeteVo.Count> getGroupIdFroTeam(@Param("projectId")long projectId);
/**
* 查询团队项目的每个组别id和组别名
* @param competeGroupId 组别id
* @return 团队id
*/
List<CompeteVo.Count> 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<CompeteVo.Count> getGroupIdNameFromGroup(@Param("type")long type);
}

93
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<CompeteVo.EnrollPlayInfo> arrayList = new ArrayList();
List<String> string = null;
//1:查询该类型下所有项目的id,name,team信息,排除level为1的
List<CompeteVo.ProjectInfo> 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<CompeteVo.GroupNum> list1 = new ArrayList<>();
//根据type 查项目
List<CompeteVo.ProjectInfo> projectInfoList = competeEnrollDao.getProject(typeId);
//根据type 查组别id,组别名
List<CompeteVo.Count> groupIdAndNameList = competeEnrollDao.getGroupIdNameFromGroup(typeId);
for (CompeteVo.ProjectInfo projectInfo : projectInfoList) {
CompeteVo.GroupNum groupNum = new CompeteVo.GroupNum();
groupNum.setName(projectInfo.getName());
//查询所有组别
List<CompeteVo.Count> 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<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
//生成行对象
List<PoiUtil.PoiUtilCell> poiUtilCellList1 = new ArrayList<>();
List<PoiUtil.PoiUtilCell> poiUtilCellList2 = new ArrayList<>();
List<PoiUtil.PoiUtilCell> poiUtilCellList3 = new ArrayList<>();
list.add(poiUtilCellList1);
list.add(poiUtilCellList2);
list.add(poiUtilCellList3);
list1.forEach(excelList ->{
List<PoiUtil.PoiUtilCell> 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;
}
}

9
mt/src/main/java/com/ccsens/mt/service/ICompeteService.java

@ -121,4 +121,13 @@ public interface ICompeteService {
* @return 返回参赛者的详细信息
*/
String enrollPlayInfo(QueryDto<CompeteDto.CompeteType> params) throws IOException;
/**
* 根据项目类型查询参赛者信息
* @return 返回参赛者数量
*/
String enrollPlayCount() throws IOException;
}

67
mt/src/main/resources/mapper_dao/CompeteEnrollDao.xml

@ -20,6 +20,13 @@
<result column="id" property="id"/>
<result column="player_id" property="player_id"/>
</resultMap>
<resultMap id="getGroupCount" type="com.ccsens.mt.bean.vo.CompeteVo$Count">
<result column="group_name" property="group_name"/>
<result column="compete_group_id" property="compete_group_id"/>
<result column="team_id" property="team_id"/>
</resultMap>
<resultMap id="getGroupIdFromGroup" type="com.ccsens.mt.bean.vo.CompeteVo$Count">
</resultMap>
<select id="getProject" parameterType="java.util.Map" resultMap="getProject">
SELECT
a.id,
@ -31,6 +38,7 @@
a.type = #{type}
AND level != 1
AND rec_status = 0
ORDER BY id
</select>
<select id="getProjectPlayer" parameterType="java.util.Map" resultMap="getProjectPlayer">
SELECT
@ -102,4 +110,63 @@
a.compete_team_id = #{teamId}
AND rec_status = 0
</select>
<select id="getGroupPlayCount" parameterType="java.util.Map" resultType="int">
SELECT COUNT(player_id) as count,
b.group_name
FROM
t_compete_project_player a LEFT JOIN t_compete_group b ON a.compete_group_id = b.id
WHERE a.compete_group_id = #{competeGroupId}
</select>
<select id="getGroupCount" parameterType="java.util.Map" resultMap="getGroupCount">
SELECT compete_group_id
FROM t_compete_project_player a
WHERE a.project_id = #{projectId}
</select>
<select id="getGroupIdFroPlayer" parameterType="java.util.Map" resultMap="getGroupCount">
select
DISTINCT(a.compete_group_id),
b.group_name
from
t_compete_project_player a LEFT JOIN t_compete_group b ON a.compete_group_id = b.id
where project_id = #{projectId}
ORDER BY a.compete_group_id
</select>
<select id="getGroupIdFroTeam" parameterType="java.util.Map" resultMap="getGroupCount">
select
DISTINCT(a.compete_group_id),
b.group_name
from
t_compete_team a LEFT JOIN t_compete_group b ON a.compete_group_id = b.id
where project_id = #{projectId}
ORDER BY a.compete_group_id
</select>
<select id="getTeamIdByCompeteGroupId" parameterType="java.util.Map" resultMap="getGroupCount">
select
id as team_id
from
t_compete_team
where compete_group_id = #{competeGroupId}
</select>
<select id="getCountByTeamId" parameterType="java.util.Map" resultType="int">
select
count(player_id)
from t_compete_team_member
WHERE compete_team_id = #{teamId}
</select>
<select id="getTeamCount" parameterType="java.util.Map" resultType="int">
SELECT COUNT(creator) as count,
b.group_name
FROM
t_compete_team a LEFT JOIN t_compete_group b ON a.compete_group_id = b.id
WHERE a.compete_group_id = #{competeGroupId}
</select>
<select id="getGroupIdNameFromGroup" parameterType="java.util.Map" resultMap="getGroupCount">
SELECT
id as compete_group_id,
group_name
FROM
t_compete_group
WHERE type = #{type}
ORDER BY id
</select>
</mapper>

BIN
mt/src/main/resources/template/competeCount.xlsx

Binary file not shown.

12
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<Long> labelList;
}

40
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<PoiUtil.PoiUtilCell> 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<PoiUtil.PoiUtilCell> 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<PoiUtil.PoiUtilCell> 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<PoiUtil.PoiUtilCell> 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);
}

10
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -1124,18 +1124,22 @@ public class ProTaskDetailService implements IProTaskDetailService {
//当前用户是否是此任务的负责人
boolean flag = false;
ProRole executorRole = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole());
if(executorRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)){
flag = true;
}else {
ProMemberExample memberExample = new ProMemberExample();
memberExample.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(project.getId());
List<ProMember> memberList = proMemberDao.selectByExample(memberExample);
if(CollectionUtil.isNotEmpty(memberList)){
if(ObjectUtil.isNotNull(executorRole)){
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){
if (proMemberRoleDao.countByExample(memberRoleExample) != 0) {
flag = true;
}
}
}
}
if (power > 1 || flag) {
//任务名

20
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();

2
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);

17
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<PoiUtilCell> 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());
}
}
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);

4
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;

Loading…
Cancel
Save