Lihong@123456 5 years ago
parent
commit
0082861635
  1. 6
      mt/src/main/java/com/ccsens/mt/api/CompeteController.java
  2. 27
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  3. 3
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java
  4. BIN
      mt/src/main/resources/template/competeCount.xlsx
  5. 14
      tall/src/main/java/com/ccsens/tall/bean/dto/LabelDto.java
  6. 12
      tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java
  7. 84
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskLabel.java
  8. 561
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskLabelExample.java
  9. 11
      tall/src/main/java/com/ccsens/tall/bean/po/SysLabel.java
  10. 60
      tall/src/main/java/com/ccsens/tall/bean/po/SysLabelExample.java
  11. 33
      tall/src/main/java/com/ccsens/tall/bean/po/SysProject.java
  12. 180
      tall/src/main/java/com/ccsens/tall/bean/po/SysProjectExample.java
  13. 9
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  14. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  15. 2
      tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java
  16. 10
      tall/src/main/java/com/ccsens/tall/persist/dao/SysLabelDao.java
  17. 30
      tall/src/main/java/com/ccsens/tall/persist/mapper/ProTaskLabelMapper.java
  18. 40
      tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java
  19. 18
      tall/src/main/java/com/ccsens/tall/service/ILabelService.java
  20. 2
      tall/src/main/java/com/ccsens/tall/service/IProRoleService.java
  21. 245
      tall/src/main/java/com/ccsens/tall/service/LabelService.java
  22. 39
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  23. 22
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  24. 58
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  25. 2
      tall/src/main/java/com/ccsens/tall/service/UserInfoService.java
  26. 32
      tall/src/main/java/com/ccsens/tall/web/LabelController.java
  27. 9
      tall/src/main/java/com/ccsens/tall/web/RoleController.java
  28. 4
      tall/src/main/resources/application.yml
  29. 26
      tall/src/main/resources/mapper_dao/ProRoleDao.xml
  30. 33
      tall/src/main/resources/mapper_dao/SysLabelDao.xml
  31. 9
      tall/src/main/resources/mapper_dao/SysProjectDao.xml
  32. 1
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  33. 228
      tall/src/main/resources/mapper_raw/ProTaskLabelMapper.xml
  34. 26
      tall/src/main/resources/mapper_raw/SysLabelMapper.xml
  35. 58
      tall/src/main/resources/mapper_raw/SysProjectMapper.xml
  36. 18
      util/src/main/java/com/ccsens/util/PoiUtil.java
  37. 4
      util/src/main/java/com/ccsens/util/WebConstant.java

6
mt/src/main/java/com/ccsens/mt/api/CompeteController.java

@ -172,9 +172,9 @@ public class CompeteController {
@ApiOperation(value = "报名表人数表下载", notes = "")
@RequestMapping(value = "/enrollCount", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayCount(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteType> params) throws IOException {
log.info("查询各个项目报名人员信息:{}",params);
String path = competeService.enrollPlayCount(params);
public JsonResponse enrollPlayCount() throws IOException {
// log.info("查询各个项目报名人员信息:{}",);
String path = competeService.enrollPlayCount();
return JsonResponse.newInstance().ok(path);
}

27
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -22,6 +22,8 @@ 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;
@ -546,6 +548,11 @@ public class CompeteService implements ICompeteService{
if (project == null) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
CompeteProjectGroupExample projectGroupExample = new CompeteProjectGroupExample();
projectGroupExample.createCriteria().andProjectIdEqualTo(project.getId()).andGroupIdEqualTo(projectAndGroup.getGroupId());
if(competeProjectGroupMapper.countByExample(projectGroupExample) == 0){
throw new BaseException(CodeEnum.PARAM_ERROR);
}
//单人项目直接添加信息和分组
if (project.getTeam() == Constant.Compete.TEAM_NO) {
// 个人赛
@ -721,7 +728,7 @@ public class CompeteService implements ICompeteService{
}
@Override
public String enrollPlayCount(QueryDto<CompeteDto.CompeteType> params) throws IOException {
public String enrollPlayCount() throws IOException {
//查询该类型下所有项目的id,name,team信息,排除level为1的的集合
int typeId = 2;
//放总数据集合
@ -762,7 +769,6 @@ public class CompeteService implements ICompeteService{
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<>();
@ -772,13 +778,18 @@ public class CompeteService implements ICompeteService{
list.add(poiUtilCellList2);
list.add(poiUtilCellList3);
list1.forEach(excelist ->{
list1.forEach(excelList ->{
List<PoiUtil.PoiUtilCell> title = new ArrayList<>();
title.add(new PoiUtil.PoiUtilCell());
title.add(new PoiUtil.PoiUtilCell());
title.add(new PoiUtil.PoiUtilCell());
excelist.getCountList().forEach(count -> {
title.add(new PoiUtil.PoiUtilCell(String.valueOf(count.getCount())));
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);
});

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

@ -124,10 +124,9 @@ public interface ICompeteService {
/**
* 根据项目类型查询参赛者信息
* @param params
* @return 返回参赛者数量
*/
String enrollPlayCount(QueryDto<CompeteDto.CompeteType> params) throws IOException;
String enrollPlayCount() throws IOException;
}

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

Binary file not shown.

14
tall/src/main/java/com/ccsens/tall/bean/dto/LabelDto.java

@ -25,6 +25,8 @@ public class LabelDto {
private String description;
@ApiModelProperty("优先级")
private int level;
@ApiModelProperty("标签类型 0项目标签 1任务标签")
private byte type = 0;
}
@Data
@ApiModel("删除标签")
@ -50,6 +52,8 @@ public class LabelDto {
private String description;
@ApiModelProperty("优先级")
private int level;
@ApiModelProperty("标签类型 0项目标签 1任务标签")
private Byte type;
}
@Data
@ -61,4 +65,14 @@ public class LabelDto {
@ApiModelProperty("标签id")
private List<Long> labelList;
}
@Data
@ApiModel("给项目添加标签")
public static class TaskLabel{
@NotNull
@ApiModelProperty("项目id")
private Long taskId;
@ApiModelProperty("标签id")
private List<Long> labelList;
}
}

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

84
tall/src/main/java/com/ccsens/tall/bean/po/ProTaskLabel.java

@ -0,0 +1,84 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class ProTaskLabel implements Serializable {
private Long id;
private Long taskDetailId;
private Long labelId;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTaskDetailId() {
return taskDetailId;
}
public void setTaskDetailId(Long taskDetailId) {
this.taskDetailId = taskDetailId;
}
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", taskDetailId=").append(taskDetailId);
sb.append(", labelId=").append(labelId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

561
tall/src/main/java/com/ccsens/tall/bean/po/ProTaskLabelExample.java

@ -0,0 +1,561 @@
package com.ccsens.tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ProTaskLabelExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ProTaskLabelExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTaskDetailIdIsNull() {
addCriterion("task_detail_id is null");
return (Criteria) this;
}
public Criteria andTaskDetailIdIsNotNull() {
addCriterion("task_detail_id is not null");
return (Criteria) this;
}
public Criteria andTaskDetailIdEqualTo(Long value) {
addCriterion("task_detail_id =", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdNotEqualTo(Long value) {
addCriterion("task_detail_id <>", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdGreaterThan(Long value) {
addCriterion("task_detail_id >", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_detail_id >=", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdLessThan(Long value) {
addCriterion("task_detail_id <", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdLessThanOrEqualTo(Long value) {
addCriterion("task_detail_id <=", value, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdIn(List<Long> values) {
addCriterion("task_detail_id in", values, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdNotIn(List<Long> values) {
addCriterion("task_detail_id not in", values, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdBetween(Long value1, Long value2) {
addCriterion("task_detail_id between", value1, value2, "taskDetailId");
return (Criteria) this;
}
public Criteria andTaskDetailIdNotBetween(Long value1, Long value2) {
addCriterion("task_detail_id not between", value1, value2, "taskDetailId");
return (Criteria) this;
}
public Criteria andLabelIdIsNull() {
addCriterion("label_id is null");
return (Criteria) this;
}
public Criteria andLabelIdIsNotNull() {
addCriterion("label_id is not null");
return (Criteria) this;
}
public Criteria andLabelIdEqualTo(Long value) {
addCriterion("label_id =", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdNotEqualTo(Long value) {
addCriterion("label_id <>", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdGreaterThan(Long value) {
addCriterion("label_id >", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdGreaterThanOrEqualTo(Long value) {
addCriterion("label_id >=", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdLessThan(Long value) {
addCriterion("label_id <", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdLessThanOrEqualTo(Long value) {
addCriterion("label_id <=", value, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdIn(List<Long> values) {
addCriterion("label_id in", values, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdNotIn(List<Long> values) {
addCriterion("label_id not in", values, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdBetween(Long value1, Long value2) {
addCriterion("label_id between", value1, value2, "labelId");
return (Criteria) this;
}
public Criteria andLabelIdNotBetween(Long value1, Long value2) {
addCriterion("label_id not between", value1, value2, "labelId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

11
tall/src/main/java/com/ccsens/tall/bean/po/SysLabel.java

@ -24,6 +24,8 @@ public class SysLabel implements Serializable {
private Byte recStatus;
private Byte businessType;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -106,6 +108,14 @@ public class SysLabel implements Serializable {
this.recStatus = recStatus;
}
public Byte getBusinessType() {
return businessType;
}
public void setBusinessType(Byte businessType) {
this.businessType = businessType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -122,6 +132,7 @@ public class SysLabel implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", businessType=").append(businessType);
sb.append("]");
return sb.toString();
}

60
tall/src/main/java/com/ccsens/tall/bean/po/SysLabelExample.java

@ -744,6 +744,66 @@ public class SysLabelExample {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andBusinessTypeIsNull() {
addCriterion("business_type is null");
return (Criteria) this;
}
public Criteria andBusinessTypeIsNotNull() {
addCriterion("business_type is not null");
return (Criteria) this;
}
public Criteria andBusinessTypeEqualTo(Byte value) {
addCriterion("business_type =", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotEqualTo(Byte value) {
addCriterion("business_type <>", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeGreaterThan(Byte value) {
addCriterion("business_type >", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("business_type >=", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeLessThan(Byte value) {
addCriterion("business_type <", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeLessThanOrEqualTo(Byte value) {
addCriterion("business_type <=", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeIn(List<Byte> values) {
addCriterion("business_type in", values, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotIn(List<Byte> values) {
addCriterion("business_type not in", values, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeBetween(Byte value1, Byte value2) {
addCriterion("business_type between", value1, value2, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotBetween(Byte value1, Byte value2) {
addCriterion("business_type not between", value1, value2, "businessType");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

33
tall/src/main/java/com/ccsens/tall/bean/po/SysProject.java

@ -32,6 +32,12 @@ public class SysProject implements Serializable {
private Byte recStatus;
private Long parentId;
private Byte homePageShow;
private Byte highlight;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -146,6 +152,30 @@ public class SysProject implements Serializable {
this.recStatus = recStatus;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Byte getHomePageShow() {
return homePageShow;
}
public void setHomePageShow(Byte homePageShow) {
this.homePageShow = homePageShow;
}
public Byte getHighlight() {
return highlight;
}
public void setHighlight(Byte highlight) {
this.highlight = highlight;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -166,6 +196,9 @@ public class SysProject implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", parentId=").append(parentId);
sb.append(", homePageShow=").append(homePageShow);
sb.append(", highlight=").append(highlight);
sb.append("]");
return sb.toString();
}

180
tall/src/main/java/com/ccsens/tall/bean/po/SysProjectExample.java

@ -974,6 +974,186 @@ public class SysProjectExample {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(Long value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(Long value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(Long value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(Long value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<Long> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<Long> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(Long value1, Long value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andHomePageShowIsNull() {
addCriterion("home_page_show is null");
return (Criteria) this;
}
public Criteria andHomePageShowIsNotNull() {
addCriterion("home_page_show is not null");
return (Criteria) this;
}
public Criteria andHomePageShowEqualTo(Byte value) {
addCriterion("home_page_show =", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowNotEqualTo(Byte value) {
addCriterion("home_page_show <>", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowGreaterThan(Byte value) {
addCriterion("home_page_show >", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowGreaterThanOrEqualTo(Byte value) {
addCriterion("home_page_show >=", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowLessThan(Byte value) {
addCriterion("home_page_show <", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowLessThanOrEqualTo(Byte value) {
addCriterion("home_page_show <=", value, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowIn(List<Byte> values) {
addCriterion("home_page_show in", values, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowNotIn(List<Byte> values) {
addCriterion("home_page_show not in", values, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowBetween(Byte value1, Byte value2) {
addCriterion("home_page_show between", value1, value2, "homePageShow");
return (Criteria) this;
}
public Criteria andHomePageShowNotBetween(Byte value1, Byte value2) {
addCriterion("home_page_show not between", value1, value2, "homePageShow");
return (Criteria) this;
}
public Criteria andHighlightIsNull() {
addCriterion("highlight is null");
return (Criteria) this;
}
public Criteria andHighlightIsNotNull() {
addCriterion("highlight is not null");
return (Criteria) this;
}
public Criteria andHighlightEqualTo(Byte value) {
addCriterion("highlight =", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightNotEqualTo(Byte value) {
addCriterion("highlight <>", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightGreaterThan(Byte value) {
addCriterion("highlight >", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightGreaterThanOrEqualTo(Byte value) {
addCriterion("highlight >=", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightLessThan(Byte value) {
addCriterion("highlight <", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightLessThanOrEqualTo(Byte value) {
addCriterion("highlight <=", value, "highlight");
return (Criteria) this;
}
public Criteria andHighlightIn(List<Byte> values) {
addCriterion("highlight in", values, "highlight");
return (Criteria) this;
}
public Criteria andHighlightNotIn(List<Byte> values) {
addCriterion("highlight not in", values, "highlight");
return (Criteria) this;
}
public Criteria andHighlightBetween(Byte value1, Byte value2) {
addCriterion("highlight between", value1, value2, "highlight");
return (Criteria) this;
}
public Criteria andHighlightNotBetween(Byte value1, Byte value2) {
addCriterion("highlight not between", value1, value2, "highlight");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

9
tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java

@ -45,6 +45,15 @@ public class ProjectVo {
@ApiModelProperty("WPS文件信息")
private List<String> wpsFilePaths;
@ApiModelProperty("子项目信息")
private List<ProjectInfo> subProjectList;
@ApiModelProperty("是否在首页展示 0否 1是")
private byte homePageShow;
@ApiModelProperty("是否高亮展示 0否 1是")
private byte highlight;
@ApiModelProperty("父项目id")
private Long parentId;
public Long getTotalDuration(){
if(ObjectUtil.isNotNull(endTime) && ObjectUtil.isNotNull(beginTime)){
return endTime - beginTime;

2
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -86,6 +86,8 @@ public class TaskVo {
private String name;
@ApiModelProperty("详细描述")
private String description;
@ApiModelProperty("父任务名称")
private String parentName;
@ApiModelProperty("所属项目id")
private Long projectId;
@ApiModelProperty("所属项目名称")

2
tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java

@ -50,7 +50,7 @@ public interface ProRoleDao extends ProRoleMapper{
*/
String getMemberNameByProjectId(@Param("projectId")Long projectId,@Param("parentRoleName")String parentRoleName);
// ProjectVo.RoleInfo getRoleInfoByRoleId(Long roleId);
ProjectVo.RoleInfo getRoleInfoByRoleId(@Param("roleId")Long roleId);
// /**
// * 查找项目下的所有成员的名字用“,”分隔

10
tall/src/main/java/com/ccsens/tall/persist/dao/SysLabelDao.java

@ -9,7 +9,15 @@ import java.util.List;
@Repository
public interface SysLabelDao extends SysLabelMapper {
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId,@Param("key")String key);
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId,@Param("key")String key,@Param("type")Byte type);
List<LabelVo.SelectLabel> selectLabelByProjectId(@Param("userId")Long userId,@Param("projectId")Long projectId);
/**
* 查询任务下的标签信息
* @param userId
* @param taskId
* @return
*/
List<LabelVo.SelectLabel> selectLabelByTaskId(@Param("userId")Long userId, @Param("taskId")Long taskId);
}

30
tall/src/main/java/com/ccsens/tall/persist/mapper/ProTaskLabelMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.ProTaskLabel;
import com.ccsens.tall.bean.po.ProTaskLabelExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ProTaskLabelMapper {
long countByExample(ProTaskLabelExample example);
int deleteByExample(ProTaskLabelExample example);
int deleteByPrimaryKey(Long id);
int insert(ProTaskLabel record);
int insertSelective(ProTaskLabel record);
List<ProTaskLabel> selectByExample(ProTaskLabelExample example);
ProTaskLabel selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ProTaskLabel record, @Param("example") ProTaskLabelExample example);
int updateByExample(@Param("record") ProTaskLabel record, @Param("example") ProTaskLabelExample example);
int updateByPrimaryKeySelective(ProTaskLabel record);
int updateByPrimaryKey(ProTaskLabel record);
}

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

18
tall/src/main/java/com/ccsens/tall/service/ILabelService.java

@ -8,7 +8,7 @@ import java.util.List;
public interface ILabelService {
List<LabelVo.SelectLabel> addLabel(Long userId,LabelDto.AddLabel labelList);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key,Byte type);
void delLabel(Long currentUserId, LabelDto.DelLabel delLabel);
@ -17,4 +17,20 @@ public interface ILabelService {
List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
/**
* 给任务添加标签
* @param currentUserId userId
* @param taskLabel 标签信息
* @return 返回标签信息
*/
List<LabelVo.SelectLabel> taskAddLabel(Long currentUserId, LabelDto.TaskLabel taskLabel);
/**
* 删除任务的标签
* @param currentUserId
* @param taskLabel
* @return
*/
List<LabelVo.SelectLabel> taskRemoveLabel(Long currentUserId, LabelDto.TaskLabel taskLabel);
}

2
tall/src/main/java/com/ccsens/tall/service/IProRoleService.java

@ -40,7 +40,7 @@ public interface IProRoleService {
* @param projectId 项目id
* @return 返回一级任务和里程碑
*/
List<TaskVo.TaskListByProjectId> queryByProjectVirtualRole(RoleDto.ProjectId projectId);
List<TaskVo.NormalTask> queryByProjectVirtualRole(RoleDto.ProjectId projectId);
// /**
// * 查找项目下的角色包含“全体成员”

245
tall/src/main/java/com/ccsens/tall/service/LabelService.java

@ -8,76 +8,86 @@ import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.dto.LabelDto;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.LabelVo;
import com.ccsens.tall.persist.dao.SysLabelDao;
import com.ccsens.tall.persist.dao.SysProjectDao;
import com.ccsens.tall.persist.dao.SysProjectLabelDao;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.tall.persist.mapper.ProTaskLabelMapper;
import com.ccsens.tall.persist.mapper.ProTaskSubTimeMapper;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.annotation.Recover;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class LabelService implements ILabelService{
@Autowired
public class LabelService implements ILabelService {
@Resource
private Snowflake snowflake;
@Autowired
@Resource
private SysLabelDao sysLabelDao;
@Autowired
@Resource
private SysProjectDao sysProjectDao;
@Autowired
@Resource
private SysProjectLabelDao sysProjectLabelDao;
@Autowired
private ProRoleService proRoleService;
@Resource
private ProTaskLabelMapper proTaskLabelMapper;
@Resource
private ProTaskSubTimeMapper taskSubTimeMapper;
@Resource
private TaskDetailDao taskDetailDao;
/**
* 添加标签
*
* @param label 添加的标签信息
*/
@Override
public List<LabelVo.SelectLabel> addLabel(Long userId,LabelDto.AddLabel label) {
if(ObjectUtil.isNotNull(label)){
public List<LabelVo.SelectLabel> addLabel(Long userId, LabelDto.AddLabel label) {
if (ObjectUtil.isNotNull(label)) {
SysLabelExample sysLabelExample = new SysLabelExample();
sysLabelExample.createCriteria().andNameEqualTo(label.getName()).andUserIdEqualTo(userId);
sysLabelExample.createCriteria().andNameEqualTo(label.getName()).andUserIdEqualTo(userId).andBusinessTypeEqualTo(label.getType());
List<SysLabel> sysLabels = sysLabelDao.selectByExample(sysLabelExample);
if(CollectionUtil.isNotEmpty(sysLabels)){
if (CollectionUtil.isNotEmpty(sysLabels)) {
throw new BaseException(CodeEnum.REPEAT_LABEL);
}
SysLabel sysLabel = new SysLabel();
sysLabel.setId(snowflake.nextId());
sysLabel.setUserId(userId);
BeanUtil.copyProperties(label,sysLabel);
sysLabel.setBusinessType(label.getType());
BeanUtil.copyProperties(label, sysLabel);
sysLabelDao.insertSelective(sysLabel);
}
return sysLabelDao.selectLabelByUserId(userId,null);
return sysLabelDao.selectLabelByUserId(userId, null, label.getType());
}
/**
* 查找此用户的所有标签
*
* @param currentUserId userId
* @param key 标签名包含的关键字
* @param key 标签名包含的关键字
* @return 返回该用户添加的所有标签
*/
@Override
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key) {
return sysLabelDao.selectLabelByUserId(currentUserId,key);
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId, String key, Byte type) {
return sysLabelDao.selectLabelByUserId(currentUserId, key, type);
}
/**
* 删除标签
*
* @param currentUserId userID
* @param delLabel 被删除的标签id
* @param delLabel 被删除的标签id
*/
@Override
public void delLabel(Long currentUserId, LabelDto.DelLabel delLabel) {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(delLabel.getId());
if(ObjectUtil.isNull(sysLabel)){
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if(sysLabel.getUserId().longValue() != currentUserId){
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
sysLabel.setRecStatus((byte) 2);
@ -86,41 +96,46 @@ public class LabelService implements ILabelService{
/**
* 修改标签
*
* @param currentUserId userid
* @param changeLabel 修改后的标签信息
* @param changeLabel 修改后的标签信息
*/
@Override
public void changeLabel(Long currentUserId, LabelDto.ChangeLabel changeLabel) {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(changeLabel.getId());
if(ObjectUtil.isNull(sysLabel)){
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if(sysLabel.getUserId().longValue() != currentUserId){
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
if(StrUtil.isNotEmpty(changeLabel.getName())){
if (StrUtil.isNotEmpty(changeLabel.getName())) {
sysLabel.setName(changeLabel.getName());
}
if(StrUtil.isNotEmpty(changeLabel.getCode())){
if (StrUtil.isNotEmpty(changeLabel.getCode())) {
sysLabel.setCode(changeLabel.getCode());
}
if(StrUtil.isNotEmpty(changeLabel.getColor())){
if (StrUtil.isNotEmpty(changeLabel.getColor())) {
sysLabel.setColor(changeLabel.getColor());
}
if(StrUtil.isNotEmpty(changeLabel.getDescription())){
if (StrUtil.isNotEmpty(changeLabel.getDescription())) {
sysLabel.setDescription(changeLabel.getDescription());
}
if(ObjectUtil.isNotNull(changeLabel.getLevel())){
if (ObjectUtil.isNotNull(changeLabel.getLevel())) {
sysLabel.setLevel((byte) changeLabel.getLevel());
}
if (ObjectUtil.isNotNull(changeLabel.getType())) {
sysLabel.setBusinessType(changeLabel.getType());
}
sysLabelDao.updateByPrimaryKeySelective(sysLabel);
}
/**
* 给项目添加标签
*
* @param currentUserId userid
* @param projectLabel 项目id和标签id
* @param projectLabel 项目id和标签id
*/
@Override
public List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
@ -130,25 +145,25 @@ public class LabelService implements ILabelService{
//用户在项目中的最高权限
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId->{
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if(ObjectUtil.isNull(sysLabel)){
throw new BaseException(CodeEnum.NOT_LABEL);
}
if(sysLabel.getUserId().longValue() != currentUserId){
throw new BaseException(CodeEnum.NOT_POWER);
}
//添加项目和标签的关联信息
SysProjectLabel sysProjectLabel = new SysProjectLabel();
sysProjectLabel.setId(snowflake.nextId());
sysProjectLabel.setProjectId(projectLabel.getProjectId());
sysProjectLabel.setLabelId(labelId);
sysProjectLabelDao.insertSelective(sysProjectLabel);
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
if (CollectionUtil.isNotEmpty(projectLabel.getLabelList())) {
projectLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//添加项目和标签的关联信息
SysProjectLabel sysProjectLabel = new SysProjectLabel();
sysProjectLabel.setId(snowflake.nextId());
sysProjectLabel.setProjectId(projectLabel.getProjectId());
sysProjectLabel.setLabelId(labelId);
sysProjectLabelDao.insertSelective(sysProjectLabel);
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId, project.getId());
// } else {
// throw new BaseException(CodeEnum.NOT_POWER);
// }
@ -160,8 +175,9 @@ public class LabelService implements ILabelService{
/**
* 删除项目关联的标签
*
* @param currentUserId userID
* @param projectLabel 项目id和被删除的标签的id
* @param projectLabel 项目id和被删除的标签的id
*/
@Override
public List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
@ -171,35 +187,110 @@ public class LabelService implements ILabelService{
//用户在项目中的最高权限
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if(ObjectUtil.isNull(sysLabel)){
throw new BaseException(CodeEnum.NOT_LABEL);
}
if(sysLabel.getUserId().longValue() != currentUserId){
throw new BaseException(CodeEnum.NOT_POWER);
}
//添加项目和标签的关联信息
SysProjectLabelExample sysProjectLabelExample = new SysProjectLabelExample();
sysProjectLabelExample.createCriteria().andProjectIdEqualTo(projectLabel.getProjectId()).andLabelIdEqualTo(labelId);
List<SysProjectLabel> sysProjectLabelList = sysProjectLabelDao.selectByExample(sysProjectLabelExample);
if(CollectionUtil.isNotEmpty(sysProjectLabelList)){
sysProjectLabelList.forEach(label -> {
label.setRecStatus((byte) 2);
sysProjectLabelDao.updateByPrimaryKeySelective(label);
});
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
} else {
throw new BaseException(CodeEnum.NOT_POWER);
if (CollectionUtil.isNotEmpty(projectLabel.getLabelList())) {
projectLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//项目和标签的关联信息
SysProjectLabelExample sysProjectLabelExample = new SysProjectLabelExample();
sysProjectLabelExample.createCriteria().andProjectIdEqualTo(projectLabel.getProjectId()).andLabelIdEqualTo(labelId);
List<SysProjectLabel> sysProjectLabelList = sysProjectLabelDao.selectByExample(sysProjectLabelExample);
if (CollectionUtil.isNotEmpty(sysProjectLabelList)) {
sysProjectLabelList.forEach(label -> {
label.setRecStatus((byte) 2);
sysProjectLabelDao.updateByPrimaryKeySelective(label);
});
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId, project.getId());
// } else {
// throw new BaseException(CodeEnum.NOT_PROJECT);
// throw new BaseException(CodeEnum.NOT_POWER);
// }
} else {
throw new BaseException(CodeEnum.NOT_PROJECT);
}
return selectLabelList;
}
@Override
public List<LabelVo.SelectLabel> taskAddLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
Long taskId = taskLabel.getTaskId();
ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId());
if (ObjectUtil.isNotNull(proTaskSubTime)) {
taskId = proTaskSubTime.getTaskDetailId();
}
List<LabelVo.SelectLabel> selectLabelList;
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNull(taskDetail)) {
throw new BaseException(CodeEnum.NOT_TASK);
}
if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
Long finalTaskId = taskId;
taskLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//添加项目和标签的关联信息
ProTaskLabel proTaskLabel = new ProTaskLabel();
proTaskLabel.setId(snowflake.nextId());
proTaskLabel.setTaskDetailId(finalTaskId);
proTaskLabel.setLabelId(labelId);
proTaskLabelMapper.insertSelective(proTaskLabel);
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
return selectLabelList;
}
@Override
public List<LabelVo.SelectLabel> taskRemoveLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
Long taskId = taskLabel.getTaskId();
ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId());
if (ObjectUtil.isNotNull(proTaskSubTime)) {
taskId = proTaskSubTime.getTaskDetailId();
}
List<LabelVo.SelectLabel> selectLabelList;
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNull(taskDetail)) {
throw new BaseException(CodeEnum.NOT_TASK);
}
if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
Long finalTaskId = taskId;
taskLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//项目和标签的关联信息
ProTaskLabelExample taskLabelExample = new ProTaskLabelExample();
taskLabelExample.createCriteria().andTaskDetailIdEqualTo(finalTaskId).andLabelIdEqualTo(labelId);
List<ProTaskLabel> proTaskLabelList = proTaskLabelMapper.selectByExample(taskLabelExample);
if (CollectionUtil.isNotEmpty(proTaskLabelList)) {
proTaskLabelList.forEach(label -> {
label.setRecStatus((byte) 2);
proTaskLabelMapper.updateByPrimaryKeySelective(label);
});
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
return selectLabelList;
}
}

39
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -1,5 +1,6 @@
package com.ccsens.tall.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
@ -387,6 +388,10 @@ public class ProRoleService implements IProRoleService {
}
//修改关联项目id
if(ObjectUtil.isNotNull(updateRole.getRelevanceProjectId())){
SysProject project = sysProjectDao.selectByPrimaryKey(updateRole.getRelevanceProjectId());
if(ObjectUtil.isNull(project)){
throw new BaseException(CodeEnum.NOT_PROJECT);
}
//检查角色是否是角色项目
ProRole parentRole = proRoleDao.selectByPrimaryKey(proRole.getParentId());
if(parentRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.ProjectVirtualRole.value)){
@ -394,8 +399,7 @@ public class ProRoleService implements IProRoleService {
}
}
proRoleDao.updateByPrimaryKeySelective(proRole);
return null;
return getRoleInfoByRoleId(proRole.getId());
}
@Override
@ -448,8 +452,8 @@ public class ProRoleService implements IProRoleService {
}
@Override
public List<TaskVo.TaskListByProjectId> queryByProjectVirtualRole(RoleDto.ProjectId projectId) {
List<TaskVo.TaskListByProjectId> taskList = new ArrayList<>();
public List<TaskVo.NormalTask> queryByProjectVirtualRole(RoleDto.ProjectId projectId) {
List<TaskVo.NormalTask> taskList = new ArrayList<>();
//查找项目
SysProject project = sysProjectDao.selectByPrimaryKey(projectId.getProjectId());
if (ObjectUtil.isNull(project)) {
@ -462,21 +466,32 @@ public class ProRoleService implements IProRoleService {
log.info("查找到一级任务:{}",firstTaskDetailList);
if (CollectionUtil.isNotEmpty(firstTaskDetailList)) {
firstTaskDetailList.forEach(firstTaskDetail -> {
TaskVo.TaskListByProjectId firstTask = taskDetailDao.getTaskById(firstTaskDetail.getId());
int sequence = 1;
TaskVo.NormalTask normalTask = new TaskVo.NormalTask();
BeanUtil.copyProperties(firstTaskDetail, normalTask);
normalTask.setDetailId(firstTaskDetail.getId());
normalTask.setSequence(sequence);
List<TaskVo.TaskListByProjectId> secondTaskList = taskDetailDao.getTaskByParentId(firstTaskDetail.getId(),1);
List<TaskVo.NormalTask> secondList = new ArrayList<>();
if(CollectionUtil.isNotEmpty(secondTaskList)){
secondTaskList.forEach(secondTask -> secondTask.setParentName(firstTaskDetail.getName()));
secondTaskList.forEach(secondTask -> {
TaskVo.NormalTask second = new TaskVo.NormalTask();
BeanUtil.copyProperties(secondTask, second);
second.setParentName(firstTaskDetail.getName());
secondList.add(second);
});
}
firstTask.setSecondTasks(secondTaskList);
taskList.add(firstTask);
normalTask.setSecondTasks(secondList);
taskList.add(normalTask);
});
}
return taskList;
}
//
// private ProjectVo.RoleInfo getRoleInfoByRoleId(Long roleId){
// return proRoleDao.getRoleInfoByRoleId(roleId);
// }
private ProjectVo.RoleInfo getRoleInfoByRoleId(Long roleId){
return proRoleDao.getRoleInfoByRoleId(roleId);
}
// @Override
// public RoleVo.RoleByProjectId queryRoleByProjectId(Long projectId) {

22
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<ProMember> 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<ProMember> 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;
}
}
}
}

58
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -174,6 +174,7 @@ public class ProjectService implements IProjectService {
//查找此用户关注的项目
List<ProjectVo.ProjectInfo> projectInfoList = sysProjectDao.findProjectIdByUserId01(currentUserId, startMillisTime, endMillisTime,orderType,order);
projectByProject(projectInfoList,currentUserId,token);
return projectInfoList;
}
private void projectByProject(List<ProjectVo.ProjectInfo> projectInfoList, Long currentUserId,String token){
@ -219,6 +220,12 @@ public class ProjectService implements IProjectService {
projectInfo.setProjectUnreadMsg(unreadMsg);
//获取wps文件路径
projectInfo.setWpsFilePaths(wpsService.queryVisitUrls(projectInfo.getId(), (byte) 0,token, null));
//子项目
projectInfo.setSubProjectList(queryProjectInfoByParentId(currentUserId,projectInfo.getId(),token));
//是否首页展示
if(projectInfo.getParentId() == 0 || projectInfo.getParentId() == null){
projectInfo.setHomePageShow((byte) 1);
}
});
}
}
@ -300,13 +307,41 @@ public class ProjectService implements IProjectService {
/**
* 通过项目id查询项目
*
* @param userId 用户id
* @param projectId 项目id
* @return 返回项目信息
*/
@Override
public ProjectVo.ProjectInfo getProjectInfoById(Long userId, Long projectId,String token) {
ProjectVo.ProjectInfo projectInfo = getProjectInfoByProjectId(userId,projectId,token);
projectInfo.setHomePageShow((byte) 1);
//TODO 查看项目下的子任务
projectInfo.setSubProjectList(queryProjectInfoByParentId(userId,projectInfo.getId(),token));
return projectInfo;
}
/**
* 查看项目下的子项目信息
*/
private List<ProjectVo.ProjectInfo> queryProjectInfoByParentId(Long userId,Long parentId,String token){
List<ProjectVo.ProjectInfo> projectInfoList = new ArrayList<>();
//查询改项目下的子项目
SysProjectExample sysProjectExample = new SysProjectExample();
sysProjectExample.createCriteria().andParentIdEqualTo(parentId);
List<SysProject> sysProjectList = sysProjectDao.selectByExample(sysProjectExample);
if(CollectionUtil.isNotEmpty(sysProjectList)){
sysProjectList.forEach(project ->{
ProjectVo.ProjectInfo projectInfo = getProjectInfoByProjectId(userId,project.getId(),token);
projectInfoList.add(projectInfo);
});
}
return projectInfoList;
}
/**
* 通过项目id查询项目信息
*/
private ProjectVo.ProjectInfo getProjectInfoByProjectId(Long userId, Long projectId,String token){
SysProject sysProject = sysProjectDao.selectByPrimaryKey(projectId);
if(ObjectUtil.isNull(sysProject)){
throw new BaseException(CodeEnum.NOT_PROJECT);
@ -361,6 +396,7 @@ public class ProjectService implements IProjectService {
return projectInfo;
}
/**
* 根据类型查项目 项目类型 0普通项目 1模板项目 2常驻项目
* @return 返回项目信息
@ -857,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);
@ -988,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);

32
tall/src/main/java/com/ccsens/tall/web/LabelController.java

@ -1,10 +1,7 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.LabelDto;
import com.ccsens.tall.bean.dto.ProjectDto;
import com.ccsens.tall.bean.vo.DomainVo;
import com.ccsens.tall.bean.vo.LabelVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.service.ILabelService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
@ -29,12 +26,14 @@ public class LabelController {
@ApiOperation(value = "搜索标签",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "标签类型 0项目标签 1任务标签", required = true, paramType = "query"),
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> selectLabel(HttpServletRequest request,
@RequestParam(required = false)String key) throws Exception {
@RequestParam(required = false)String key,Byte type) throws Exception {
type = type == null ? 0 : type;
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId,key);
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId,key,type);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ -93,4 +92,27 @@ public class LabelController {
return JsonResponse.newInstance().ok(selectLabelList);
}
@ApiOperation(value = "给任务添加标签",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/task", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> taskAddLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.TaskLabel taskLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.taskAddLabel(currentUserId,taskLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ApiOperation(value = "删除项目关联的标签",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/task/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> taskRemoveLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.TaskLabel taskLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.taskRemoveLabel(currentUserId,taskLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
}

9
tall/src/main/java/com/ccsens/tall/web/RoleController.java

@ -2,7 +2,6 @@ package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.RoleDto;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.bean.vo.RoleVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.service.IProRoleService;
import com.ccsens.util.JsonResponse;
@ -57,7 +56,7 @@ public class RoleController {
@ApiParam @Validated @RequestBody RoleDto.UpdateRole updateRole) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ProjectVo.RoleInfo roleInfo = proRoleService.updateRole(currentUserId,updateRole);
return JsonResponse.newInstance().ok();
return JsonResponse.newInstance().ok(roleInfo);
}
@ApiOperation(value = "给角色添加成员",notes = "")
@ -97,10 +96,10 @@ public class RoleController {
@ApiImplicitParams({
})
@RequestMapping(value = "/ProjectVirtualRole", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<TaskVo.TaskListByProjectId>> queryByProjectVirtualRole(HttpServletRequest request,
@ApiParam @Validated @RequestBody RoleDto.ProjectId projectId) throws Exception {
public JsonResponse<List<TaskVo.NormalTask>> queryByProjectVirtualRole(HttpServletRequest request,
@ApiParam @Validated @RequestBody RoleDto.ProjectId projectId) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<TaskVo.TaskListByProjectId> taskListByProjectIdList = proRoleService.queryByProjectVirtualRole(projectId);
List<TaskVo.NormalTask> taskListByProjectIdList = proRoleService.queryByProjectVirtualRole(projectId);
return JsonResponse.newInstance().ok(taskListByProjectIdList);
}

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

26
tall/src/main/resources/mapper_dao/ProRoleDao.xml

@ -14,6 +14,8 @@
<result column="rName" property="name"/>
<result column="parentId" property="parentId"/>
<result column="projectRole" property="projectRole"/>
<result column="relevanceProjectId" property="relevanceProjectId"/>
<result column="relevanceProjectName" property="relevanceProjectName"/>
<collection property="members" ofType="com.ccsens.tall.bean.vo.ProjectVo$ProMemberVo">
<id column="mId" property="mId"/>
<result column="mName" property="mName"/>
@ -209,6 +211,28 @@
AND
r1.`name` = #{parentRoleName}
</select>
<select id="getRoleInfoByRoleId" resultMap="resultMap_ProRoleInfo">
select
pr.id as rId,
pr.name as rName,
pr.parent_id as parentId,
m.id as mId,
m.nickname as mName,
m.phone as mPhone,
m.user_id as mUserId,
m.stakeholder_id as stakeholderId,
if((SELECT `name` FROM t_pro_role WHERE id = pr.parent_id) = 'ProjectVirtualRole',1,0) as projectRole,
pr.relevance_project_id as relevanceProjectId,
(SELECT `name` FROM t_sys_project WHERE id = pr.relevance_project_id) as relevanceProjectName
from
t_pro_role pr
LEFT JOIN t_pro_member_role mr ON mr.role_id = pr.id
LEFT JOIN t_pro_member m ON mr.member_id = m.id
where
pr.id = #{roleId}
AND pr.rec_status = 0
AND (mr.rec_status = 0 or mr.rec_status is null)
AND (m.rec_status = 0 or m.rec_status is null)
</select>
</mapper>

33
tall/src/main/resources/mapper_dao/SysLabelDao.xml

@ -3,11 +3,21 @@
<mapper namespace="com.ccsens.tall.persist.dao.SysLabelDao">
<select id="selectLabelByUserId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
select * from t_sys_label
select
*
id,
`name`,
code,
color,
description,
`level`
from t_sys_label
where
user_id = #{userId}
and
rec_status = 0
and
user_id = #{userId}
business_type = #{type}
<if test="key != null and key != ''">
and
`name` like concat('%',#{key},'%')
@ -33,5 +43,24 @@
and
l.user_id = #{userId}
</select>
<select id="selectLabelByTaskId" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
select
l.id as id,
l.`name` as `name`,
l.code as code,
l.color as color,
l.description as description,
l.`level` as `level`
from
t_sys_label l join t_pro_task_label p on l.id = p.label_id
where
p.rec_status = 0
and
l.rec_status = 0
and
p.task_detail_id = #{taskId}
and
l.user_id = #{userId}
</select>
</mapper>

9
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -18,6 +18,9 @@
<result column="pBeginTime" property="beginTime" />
<result column="pEndTime" property="endTime" />
<result column="pCreator" property="creator" />
<result column="homePageShow" property="homePageShow" />
<result column="highlight" property="highlight" />
<result column="parentId" property="parentId" />
<collection property="labelList" ofType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
<id column="lId" property="id"/>
<result column="lName" property="name"/>
@ -131,6 +134,9 @@
p.address AS pAddress,
p.begin_time AS pBeginTime,
p.end_time AS pEndTime,
p.home_page_show as homePageShow,
p.highlight as highlight,
p.parent_id as parentId,
if(p.creator_id = #{userId},true,false) as pCreator,
l.id as lId,
l.name as lName,
@ -190,6 +196,9 @@
p.address AS pAddress,
p.begin_time AS pBeginTime,
p.end_time AS pEndTime,
p.home_page_show as homePageShow,
p.highlight as highlight,
p.parent_id as parentId,
if(p.creator_id = #{userId},true,false) as pCreator,
l.id as lId,
l.name as lName,

1
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -551,6 +551,7 @@
t.cycle as cycle,
t.money as money,
t.project_id as projectId,
t.milestone as milestone,
(SELECT `name` FROM t_sys_project WHERE id = t.project_id) as projectName,
t.executor_role as executorRole,
(SELECT `name` FROM t_pro_role WHERE id = t.executor_role) as executorRoleName,

228
tall/src/main/resources/mapper_raw/ProTaskLabelMapper.xml

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.mapper.ProTaskLabelMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProTaskLabel">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="task_detail_id" jdbcType="BIGINT" property="taskDetailId" />
<result column="label_id" jdbcType="BIGINT" property="labelId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, task_detail_id, label_id, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProTaskLabelExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_pro_task_label
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_pro_task_label
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_pro_task_label
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.ProTaskLabelExample">
delete from t_pro_task_label
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProTaskLabel">
insert into t_pro_task_label (id, task_detail_id, label_id,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{taskDetailId,jdbcType=BIGINT}, #{labelId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProTaskLabel">
insert into t_pro_task_label
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskDetailId != null">
task_detail_id,
</if>
<if test="labelId != null">
label_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="taskDetailId != null">
#{taskDetailId,jdbcType=BIGINT},
</if>
<if test="labelId != null">
#{labelId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProTaskLabelExample" resultType="java.lang.Long">
select count(*) from t_pro_task_label
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_pro_task_label
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.taskDetailId != null">
task_detail_id = #{record.taskDetailId,jdbcType=BIGINT},
</if>
<if test="record.labelId != null">
label_id = #{record.labelId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_pro_task_label
set id = #{record.id,jdbcType=BIGINT},
task_detail_id = #{record.taskDetailId,jdbcType=BIGINT},
label_id = #{record.labelId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProTaskLabel">
update t_pro_task_label
<set>
<if test="taskDetailId != null">
task_detail_id = #{taskDetailId,jdbcType=BIGINT},
</if>
<if test="labelId != null">
label_id = #{labelId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProTaskLabel">
update t_pro_task_label
set task_detail_id = #{taskDetailId,jdbcType=BIGINT},
label_id = #{labelId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

26
tall/src/main/resources/mapper_raw/SysLabelMapper.xml

@ -12,6 +12,7 @@
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="business_type" jdbcType="TINYINT" property="businessType" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -72,7 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, code, color, description, level, user_id, created_at, updated_at, rec_status
id, name, code, color, description, level, user_id, created_at, updated_at, rec_status,
business_type
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysLabelExample" resultMap="BaseResultMap">
select
@ -108,11 +110,11 @@
insert into t_sys_label (id, name, code,
color, description, level,
user_id, created_at, updated_at,
rec_status)
rec_status, business_type)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{color,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{level,jdbcType=TINYINT},
#{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{recStatus,jdbcType=TINYINT}, #{businessType,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysLabel">
insert into t_sys_label
@ -147,6 +149,9 @@
<if test="recStatus != null">
rec_status,
</if>
<if test="businessType != null">
business_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -179,6 +184,9 @@
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="businessType != null">
#{businessType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysLabelExample" resultType="java.lang.Long">
@ -220,6 +228,9 @@
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.businessType != null">
business_type = #{record.businessType,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -236,7 +247,8 @@
user_id = #{record.userId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
rec_status = #{record.recStatus,jdbcType=TINYINT},
business_type = #{record.businessType,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -271,6 +283,9 @@
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="businessType != null">
business_type = #{businessType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -284,7 +299,8 @@
user_id = #{userId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
rec_status = #{recStatus,jdbcType=TINYINT},
business_type = #{businessType,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

58
tall/src/main/resources/mapper_raw/SysProjectMapper.xml

@ -16,6 +16,9 @@
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="home_page_show" jdbcType="TINYINT" property="homePageShow" />
<result column="highlight" jdbcType="TINYINT" property="highlight" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,7 +80,8 @@
</sql>
<sql id="Base_Column_List">
id, creator_id, parent_task_id, scene_id, name, description, begin_time, end_time,
address, published, template, created_at, updated_at, rec_status
address, published, template, created_at, updated_at, rec_status, parent_id, home_page_show,
highlight
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysProjectExample" resultMap="BaseResultMap">
select
@ -114,12 +118,14 @@
scene_id, name, description,
begin_time, end_time, address,
published, template, created_at,
updated_at, rec_status)
updated_at, rec_status, parent_id,
home_page_show, highlight)
values (#{id,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT}, #{parentTaskId,jdbcType=BIGINT},
#{sceneId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{beginTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{published,jdbcType=TINYINT}, #{template,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{parentId,jdbcType=BIGINT},
#{homePageShow,jdbcType=TINYINT}, #{highlight,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysProject">
insert into t_sys_project
@ -166,6 +172,15 @@
<if test="recStatus != null">
rec_status,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="homePageShow != null">
home_page_show,
</if>
<if test="highlight != null">
highlight,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -210,6 +225,15 @@
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
<if test="homePageShow != null">
#{homePageShow,jdbcType=TINYINT},
</if>
<if test="highlight != null">
#{highlight,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysProjectExample" resultType="java.lang.Long">
@ -263,6 +287,15 @@
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=BIGINT},
</if>
<if test="record.homePageShow != null">
home_page_show = #{record.homePageShow,jdbcType=TINYINT},
</if>
<if test="record.highlight != null">
highlight = #{record.highlight,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -283,7 +316,10 @@
template = #{record.template,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
rec_status = #{record.recStatus,jdbcType=TINYINT},
parent_id = #{record.parentId,jdbcType=BIGINT},
home_page_show = #{record.homePageShow,jdbcType=TINYINT},
highlight = #{record.highlight,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -330,6 +366,15 @@
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="homePageShow != null">
home_page_show = #{homePageShow,jdbcType=TINYINT},
</if>
<if test="highlight != null">
highlight = #{highlight,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -347,7 +392,10 @@
template = #{template,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
rec_status = #{recStatus,jdbcType=TINYINT},
parent_id = #{parentId,jdbcType=BIGINT},
home_page_show = #{homePageShow,jdbcType=TINYINT},
highlight = #{highlight,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

18
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,10 +162,10 @@ 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);
if (StrUtil.isEmpty(cell.value)){
//如果value是cell_null代表次单元格不需要赋值
if (cell.value.equals(WebConstant.CELL_NULL)){
continue;
}
Cell newCell = row.createCell(j);
@ -170,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);

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