Browse Source

Merge branch 'pt' of https://gitee.com/ccsens_s/ccsenscloud into pt

master
zhizhi wu 5 years ago
parent
commit
4057ae4934
  1. 118
      cloudutil/src/main/resources/application-util-test.yml
  2. 26
      tall/src/main/java/com/ccsens/tall/bean/dto/ChartDto.java
  3. 5
      tall/src/main/java/com/ccsens/tall/bean/dto/LabelDto.java
  4. 11
      tall/src/main/java/com/ccsens/tall/bean/po/ProShow.java
  5. 70
      tall/src/main/java/com/ccsens/tall/bean/po/ProShowExample.java
  6. 199
      tall/src/main/java/com/ccsens/tall/bean/po/SysPlugin.java
  7. 1340
      tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java
  8. 114
      tall/src/main/java/com/ccsens/tall/bean/vo/ChartVo.java
  9. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/PluginVo.java
  10. 4
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  11. 10
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  12. 3
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  13. 2
      tall/src/main/java/com/ccsens/tall/persist/dao/ProTaskCommentDao.java
  14. 4
      tall/src/main/java/com/ccsens/tall/persist/dao/SysLabelDao.java
  15. 19
      tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java
  16. 59
      tall/src/main/java/com/ccsens/tall/persist/mapper/SysPluginMapper.java
  17. 146
      tall/src/main/java/com/ccsens/tall/service/ChartService.java
  18. 21
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  19. 19
      tall/src/main/java/com/ccsens/tall/service/IChartService.java
  20. 8
      tall/src/main/java/com/ccsens/tall/service/ILabelService.java
  21. 69
      tall/src/main/java/com/ccsens/tall/service/LabelService.java
  22. 9
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  23. 13
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  24. 7
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  25. 3
      tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java
  26. 22
      tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java
  27. 86
      tall/src/main/java/com/ccsens/tall/web/ChartController.java
  28. 22
      tall/src/main/java/com/ccsens/tall/web/LabelController.java
  29. 20
      tall/src/main/java/com/ccsens/tall/web/ProjectController.java
  30. 70
      tall/src/main/resources/application-test.yml
  31. 64
      tall/src/main/resources/druid-test.yml
  32. 3
      tall/src/main/resources/mapper_dao/ProTaskCommentDao.xml
  33. 6
      tall/src/main/resources/mapper_dao/SysLabelDao.xml
  34. 253
      tall/src/main/resources/mapper_dao/SysProjectDao.xml
  35. 4
      tall/src/main/resources/mapper_dao/SysUserDao.xml
  36. 37
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  37. 25
      tall/src/main/resources/mapper_raw/ProShowMapper.xml
  38. 499
      tall/src/main/resources/mapper_raw/SysPluginMapper.xml
  39. 9
      util/src/main/java/com/ccsens/util/DateUtil.java
  40. 34
      util/src/main/java/com/ccsens/util/StringUtil.java

118
cloudutil/src/main/resources/application-util-test.yml

@ -1,60 +1,60 @@
#服务端点暴露
management:
endpoints:
web:
exposure:
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
# # 不暴露哪些端点
# exclude: env,beans,configprops
endpoint:
health:
# 是否展示健康检查详情
show-details: always
health:
redis:
enabled: false
#eureka注册
eureka:
client:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
defaultZone: http://admin:admin@49.233.89.188:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true
metadata-map:
management:
context-path: ${server.servlet.context-path:}/actuator
home-page-url-path: ${server.servlet.context-path:}/
status-page-url-path: ${server.servlet.context-path:}/actuator/info
health-check-url-path: ${server.servlet.context-path:}/actuator/health
feign:
client:
config:
default:
connectTime: 5000
readTimeout: 5000
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
loggerLevel: basic
hystrix:
enabled: true
# sleuth
logging:
level:
root: info
org.springframework.cloud.sleuth: DEBUG
spring:
# zipkin:
# base-url: http://49.233.89.188:9411
# sleuth:
# sampler:
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
# probability: 1.0
cloud:
inetutils:
#服务端点暴露
management:
endpoints:
web:
exposure:
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
# # 不暴露哪些端点
# exclude: env,beans,configprops
endpoint:
health:
# 是否展示健康检查详情
show-details: always
health:
redis:
enabled: false
#eureka注册
eureka:
client:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true
metadata-map:
management:
context-path: ${server.servlet.context-path:}/actuator
home-page-url-path: ${server.servlet.context-path:}/
status-page-url-path: ${server.servlet.context-path:}/actuator/info
health-check-url-path: ${server.servlet.context-path:}/actuator/health
feign:
client:
config:
default:
connectTime: 5000
readTimeout: 5000
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
loggerLevel: basic
hystrix:
enabled: true
# sleuth
logging:
level:
root: info
org.springframework.cloud.sleuth: DEBUG
spring:
# zipkin:
# base-url: http://49.233.89.188:9411
# sleuth:
# sampler:
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
# probability: 1.0
cloud:
inetutils:
ignored-interfaces: ['VMware.*']

26
tall/src/main/java/com/ccsens/tall/bean/dto/ChartDto.java

@ -0,0 +1,26 @@
package com.ccsens.tall.bean.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class ChartDto {
@Data
public static class ProjectTrendDto{
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@NotEmpty
@ApiModelProperty("开始日期")
private String start;
@NotEmpty
@ApiModelProperty("结束日期")
private String end;
@ApiModelProperty("角色id")
private Long roleId;
}
}

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

@ -13,11 +13,12 @@ public class LabelDto {
@Data
@ApiModel("添加标签")
public static class AddLabel{
@NotEmpty
@NotEmpty(message = "请输入标签名")
@ApiModelProperty("标签名")
private String name;
@ApiModelProperty("标签code")
private String code;
@NotEmpty(message = "请选择颜色")
@ApiModelProperty("颜色")
private String color;
@ApiModelProperty("备注信息")
@ -57,7 +58,7 @@ public class LabelDto {
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("项目id")
@ApiModelProperty("标签id")
private List<Long> labelList;
}
}

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

@ -30,6 +30,8 @@ public class ProShow implements Serializable {
private Byte selectTaskType;
private String detailPath;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -136,6 +138,14 @@ public class ProShow implements Serializable {
this.selectTaskType = selectTaskType;
}
public String getDetailPath() {
return detailPath;
}
public void setDetailPath(String detailPath) {
this.detailPath = detailPath == null ? null : detailPath.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -155,6 +165,7 @@ public class ProShow implements Serializable {
sb.append(", duration=").append(duration);
sb.append(", showShortcuts=").append(showShortcuts);
sb.append(", selectTaskType=").append(selectTaskType);
sb.append(", detailPath=").append(detailPath);
sb.append("]");
return sb.toString();
}

70
tall/src/main/java/com/ccsens/tall/bean/po/ProShowExample.java

@ -894,6 +894,76 @@ public class ProShowExample {
addCriterion("select_task_type not between", value1, value2, "selectTaskType");
return (Criteria) this;
}
public Criteria andDetailPathIsNull() {
addCriterion("detail_path is null");
return (Criteria) this;
}
public Criteria andDetailPathIsNotNull() {
addCriterion("detail_path is not null");
return (Criteria) this;
}
public Criteria andDetailPathEqualTo(String value) {
addCriterion("detail_path =", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotEqualTo(String value) {
addCriterion("detail_path <>", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathGreaterThan(String value) {
addCriterion("detail_path >", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathGreaterThanOrEqualTo(String value) {
addCriterion("detail_path >=", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLessThan(String value) {
addCriterion("detail_path <", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLessThanOrEqualTo(String value) {
addCriterion("detail_path <=", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLike(String value) {
addCriterion("detail_path like", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotLike(String value) {
addCriterion("detail_path not like", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathIn(List<String> values) {
addCriterion("detail_path in", values, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotIn(List<String> values) {
addCriterion("detail_path not in", values, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathBetween(String value1, String value2) {
addCriterion("detail_path between", value1, value2, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotBetween(String value1, String value2) {
addCriterion("detail_path not between", value1, value2, "detailPath");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

199
tall/src/main/java/com/ccsens/tall/bean/po/SysPlugin.java

@ -1,95 +1,106 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysPlugin implements Serializable {
private Long id;
private String name;
private String description;
private Byte scene;
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 String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getScene() {
return scene;
}
public void setScene(Byte scene) {
this.scene = scene;
}
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(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", scene=").append(scene);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysPlugin implements Serializable {
private Long id;
private String name;
private String description;
private Byte scene;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte showType;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getScene() {
return scene;
}
public void setScene(Byte scene) {
this.scene = scene;
}
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;
}
public Byte getShowType() {
return showType;
}
public void setShowType(Byte showType) {
this.showType = showType;
}
@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(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", scene=").append(scene);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", showType=").append(showType);
sb.append("]");
return sb.toString();
}
}

1340
tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java

File diff suppressed because it is too large

114
tall/src/main/java/com/ccsens/tall/bean/vo/ChartVo.java

@ -0,0 +1,114 @@
package com.ccsens.tall.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ChartVo {
@Data
public static class ExecutorChart{
@ApiModelProperty("查询类型")
private int type;
@ApiModelProperty("查询类型")
private List<__ExecutorChart> executorChart;
}
@Data
public static class __ExecutorChart{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("value")
private Integer value;
}
@Data
public static class CompleteTaskNum{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("完成数量")
private Integer value;
@ApiModelProperty("任务总数")
private Integer total;
}
@Data
public static class ProjectTrendVo {
@ApiModelProperty("日期")
private String date;
@ApiModelProperty("当天任务总数")
private Integer total;
@ApiModelProperty("当天已完成的任务数")
private Integer completed;
}
@Data
public static class ProjectOverview {
@ApiModelProperty("任务总数")
private Integer total;
@ApiModelProperty("已完成的任务数")
private Integer completed;
@ApiModelProperty("未完成的任务数")
private Integer undone;
@ApiModelProperty("按时完成")
private Integer completedOnTime;
@ApiModelProperty("逾期完成")
private Integer completedOverTime;
@ApiModelProperty("今天任务总数")
private Integer today;
@ApiModelProperty("今日已完成")
private Integer todayCompleted;
@ApiModelProperty("今日未完成")
private Integer todayUndone;
public Integer getUndone(){
if(ObjectUtil.isNotNull(total) && ObjectUtil.isNotNull(completed)){
return total - completed;
}
return null;
}
public Integer getCompletedOverTime(){
if(ObjectUtil.isNotNull(completed) && ObjectUtil.isNotNull(completedOnTime)){
return completed - completedOnTime;
}
return null;
}
public Integer getTodayUndone(){
if(ObjectUtil.isNotNull(today) && ObjectUtil.isNotNull(todayCompleted)){
return today - todayCompleted;
}
return null;
}
}
@Data
public static class BurnoutFigure {
@ApiModelProperty("日期 MM-DD")
private String date;
@ApiModelProperty("理想的剩余任务数,回出现小数 保留1位小数")
private BigDecimal ideal;
@ApiModelProperty("计划的剩余任务数")
private Integer planned;
@ApiModelProperty("实际的剩余任务数")
private Integer realistic;
@JsonIgnore//任务总数
private Integer total;
@JsonIgnore//每天的任务数
private Integer totalDay;
@JsonIgnore//每天完成的任务数量
private Integer completed;
}
}

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

@ -59,6 +59,8 @@ public class PluginVo {
private Long commentTime;
@ApiModelProperty("评论内容")
private String description;
@ApiModelProperty("是否属于自己的评论,0否 1是")
private int mine;
}
}

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

@ -96,9 +96,11 @@ public class ProjectVo {
@ApiModelProperty("是否展示MVP 0:不展示 1:展示")
private int showMvp = 1;
@JsonIgnore//0日程,1天,2周,3月
private int selectTaskType = 0;
private int selectTaskType = 1;
@ApiModelProperty("查询任务类型")
private String selectType;
@ApiModelProperty("第三列展示页面的路径")
private String detailPath = "/project";
public String getSelectType(){
if(ObjectUtil.isNull(selectTaskType)) {

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

@ -96,12 +96,6 @@ public class TaskVo {
private Long endTime;
@ApiModelProperty("时长")
private Long duration;
// @ApiModelProperty("显示的日期格式")
// private String showTimeFormat;
// @ApiModelProperty("是否展示快捷方式(交付物硬件按钮)0不展示 1展示")
// private int showShortcuts;
// @ApiModelProperty("是否展示添加任务的按钮 0不展示 1展示")
// private int createTask;
@ApiModelProperty("循环周期")
private String cycle;
@ApiModelProperty("跳转模式 0自动,1延迟,2手动")
@ -120,6 +114,8 @@ public class TaskVo {
private BigDecimal money;
@ApiModelProperty("状态:0-未开始,1-进行中,2-已完成")
private int process;
@ApiModelProperty("子项目id")
private Long subProjectId;
@ApiModelProperty("服务器时间")
private Long serverTime;
@ApiModelProperty("任务类型 0普通任务 1虚拟任务")
@ -213,6 +209,8 @@ public class TaskVo {
private String name;
@ApiModelProperty("插件描述")
private String description;
@ApiModelProperty("显示分类")
private String showType;
@JsonIgnore
private Long roleId;
}

3
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -154,7 +154,8 @@ public class SpringConfig implements WebMvcConfigurer {
.addPathPatterns("/members/**")
.addPathPatterns("/templates/**")
.addPathPatterns("/hardware/**")
.addPathPatterns("/labels/**");
.addPathPatterns("/labels/**")
.addPathPatterns("/charts/**");
//super.addInterceptors(registry);
}

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

@ -9,6 +9,6 @@ import java.util.List;
@Repository
public interface ProTaskCommentDao extends ProTaskCommentMapper {
List<PluginVo.CommentInfo> getCommentByTaskId(@Param("taskId") Long taskId);
List<PluginVo.CommentInfo> getCommentByTaskId(@Param("userId")Long userId,@Param("taskId") Long taskId);
}

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

@ -9,7 +9,7 @@ import java.util.List;
@Repository
public interface SysLabelDao extends SysLabelMapper {
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId);
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId,@Param("key")String key);
List<LabelVo.SelectLabel> selectLabelByProjectId(@Param("projectId")Long projectId);
List<LabelVo.SelectLabel> selectLabelByProjectId(@Param("userId")Long userId,@Param("projectId")Long projectId);
}

19
tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java

@ -1,6 +1,7 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.persist.mapper.SysProjectMapper;
import org.apache.ibatis.annotations.Param;
@ -22,5 +23,21 @@ public interface SysProjectDao extends SysProjectMapper{
List<ProjectVo.ProjectInfo> selectByLabelName(@Param("userId")Long currentUserId, @Param("labelName")String labelName);
List<ProjectVo.RelevanceProject> selectRelevanceProject(@Param("labelName")Long projectId);
List<ProjectVo.RelevanceProject> selectRelevanceProject(@Param("projectId")Long projectId);
List<ChartVo.__ExecutorChart> getExecutorChart(@Param("projectId")Long projectId,@Param("type")Integer type);
List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(@Param("projectId")Long projectId);
List<ChartVo.ProjectTrendVo> getProjectTrend(@Param("projectId")Long projectId, @Param("start")Long start, @Param("end")Long end, @Param("roleId")Long roleId);
ChartVo.ProjectOverview getOverview(@Param("projectId")Long projectId);
List<ChartVo.BurnoutFigure> getBurnoutFigure(@Param("projectId")Long projectId,
@Param("start")Long start, @Param("end")Long end,
@Param("roleId")Long roleIdm,@Param("type") Integer type);
Integer getTaskTotalByProjectId(@Param("projectId")Long projectId, @Param("start")Long start, @Param("end")Long end, @Param("roleId")Long roleId);
ChartVo.ProjectOverview getOverviewByToDay(@Param("projectId")Long projectId, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
}

59
tall/src/main/java/com/ccsens/tall/persist/mapper/SysPluginMapper.java

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

146
tall/src/main/java/com/ccsens/tall/service/ChartService.java

@ -0,0 +1,146 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.persist.dao.SysProjectDao;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@Service
public class ChartService implements IChartService{
@Autowired
private SysProjectDao sysProjectDao;
/**
* 任务执行者分布图
* @param currentUserId
* @param type
* @return
*/
@Override
public ChartVo.ExecutorChart getExecutorChart(Long currentUserId,Long projectId,Integer type) {
SysProject sysProject = sysProjectDao.selectByPrimaryKey(projectId);
if(ObjectUtil.isNull(sysProject)){
throw new BaseException(CodeEnum.NOT_PROJECT);
}
List<ChartVo.__ExecutorChart> executorChartList = sysProjectDao.getExecutorChart(projectId,type);
ChartVo.ExecutorChart executorChart = new ChartVo.ExecutorChart();
executorChart.setType(type);
executorChart.setExecutorChart(executorChartList);
return executorChart;
}
/**
* 计划时间内完成任务
* @param currentUserId
* @param projectId
* @return
*/
@Override
public List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(Long currentUserId, Long projectId) {
//查找所有角色及任务数量
List<ChartVo.CompleteTaskNum> completeTaskNumList = sysProjectDao.getCompleteTaskByTime(projectId);
return completeTaskNumList;
}
/**
* 项目进展趋势图
* @param currentUserId
* @param projectTrendDto
* @return
*/
@Override
public List<ChartVo.ProjectTrendVo> getProjectTrend(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto) {
Long start = DateUtil.parse(projectTrendDto.getStart()).getTime();
Long end = DateUtil.parse(projectTrendDto.getEnd()).getTime();
List<ChartVo.ProjectTrendVo> projectTrendVoList = sysProjectDao.getProjectTrend(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId());
return projectTrendVoList;
}
/**
* 概览报表
* @param currentUserId
* @param projectId
* @return
*/
@Override
public ChartVo.ProjectOverview getOverview(Long currentUserId, Long projectId) throws Exception {
//获取全部的数据
ChartVo.ProjectOverview projectOverview = sysProjectDao.getOverview(projectId);
//获取当天零点和二十四点的时间
Long startTime = DateUtil.beginOfDay(new Date()).getTime();
Long endTime = DateUtil.endOfDay(new Date()).getTime();
//获取当天的数据
ChartVo.ProjectOverview projectOverview1 = sysProjectDao.getOverviewByToDay(projectId,startTime,endTime);
//将数据整合在一起
projectOverview.setTodayCompleted(projectOverview1.getTodayCompleted() == null ? 0 : projectOverview1.getTodayCompleted());
projectOverview.setToday(projectOverview1.getToday());
return projectOverview;
}
/**
* 燃尽图
* @param currentUserId
* @param projectTrendDto
* @return
*/
@Override
public List<ChartVo.BurnoutFigure> getBurnoutFigure(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto) {
Long start = DateUtil.parse(projectTrendDto.getStart()).getTime();
Long end = DateUtil.parse(projectTrendDto.getEnd()).getTime();
//获取任务总数(如果type传1 查询规定条件内的任务总数,若传null,则按天分组查找)
List<ChartVo.BurnoutFigure> totalList = sysProjectDao.getBurnoutFigure(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId(),1);
//理想
AtomicReference<BigDecimal> idealTotal = new AtomicReference<>();
BigDecimal idealTotalInt = new BigDecimal(0);
//计划
AtomicInteger plannedTotal = new AtomicInteger();
//实际
AtomicInteger realTotal = new AtomicInteger();
if(CollectionUtil.isNotEmpty(totalList)) {
idealTotal.set(BigDecimal.valueOf(totalList.get(0).getTotalDay()));
idealTotalInt = BigDecimal.valueOf(totalList.get(0).getTotalDay());
plannedTotal.set(totalList.get(0).getTotalDay());
realTotal.set(totalList.get(0).getTotalDay());
}
//按天获取信息
List<ChartVo.BurnoutFigure> burnoutFigureList = sysProjectDao.getBurnoutFigure(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId(),null);
if(CollectionUtil.isNotEmpty(burnoutFigureList)){
//每天理想完成数,总数/天数=每天理想完成数
BigDecimal idealFinish = idealTotalInt.divide(BigDecimal.valueOf(burnoutFigureList.size()),1,BigDecimal.ROUND_HALF_UP);
burnoutFigureList.forEach(burnoutFigure -> {
//理想剩余数量
idealTotal.set(idealTotal.get().subtract(idealFinish));
if(idealTotal.get().compareTo(BigDecimal.valueOf(0)) < 1){
burnoutFigure.setIdeal(BigDecimal.valueOf(0));
}else {
burnoutFigure.setIdeal(idealTotal.get());
}
//计划剩余数量
plannedTotal.set(plannedTotal.get() - burnoutFigure.getTotalDay());
burnoutFigure.setPlanned(plannedTotal.get());
//实际剩余数量
if(ObjectUtil.isNotNull(burnoutFigure.getCompleted())){
realTotal.set(realTotal.get() - burnoutFigure.getCompleted());
burnoutFigure.setRealistic(realTotal.get());
}else{
burnoutFigure.setRealistic(realTotal.get());
}
});
}
return burnoutFigureList;
}
}

21
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -15,8 +15,6 @@ import com.ccsens.util.cron.CronConstant;
import com.ccsens.util.cron.NatureToDate;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.expression.LongValue;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
@ -28,8 +26,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.FileInputStream;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@ -690,13 +686,18 @@ public class ExcelService implements IExcelService {
taskDetail.setAllMember((byte) 1);
//子项目
if (StrUtil.isNotEmpty(subProject)) {
subProject = StringUtil.replaceComma(subProject);
List<String> projectId = StringUtil.extractMessage(subProject);
if(CollectionUtil.isNotEmpty(projectId)) {
Long projectId1 = Long.valueOf(projectId.get(0));
// SysProject project = projectService.selectByNameAndUserId(subProject, currentUserId);
SysProject project = sysProjectDao.selectByPrimaryKey(Long.valueOf(subProject));
if (ObjectUtil.isNotNull(project)) {
taskDetail.setSubProjectId(project.getId());
taskDetail.setSubProject(project.getName());
project.setParentTaskId(taskDetail.getId());
projectService.updateProject(project);
SysProject project = sysProjectDao.selectByPrimaryKey(projectId1);
if (ObjectUtil.isNotNull(project)) {
taskDetail.setSubProjectId(project.getId());
taskDetail.setSubProject(project.getName());
project.setParentTaskId(taskDetail.getId());
projectService.updateProject(project);
}
}
}
//负责人

19
tall/src/main/java/com/ccsens/tall/service/IChartService.java

@ -0,0 +1,19 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.vo.ChartVo;
import java.util.List;
public interface IChartService {
ChartVo.ExecutorChart getExecutorChart(Long currentUserId,Long projectId, Integer type);
List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(Long currentUserId, Long projectId);
List<ChartVo.ProjectTrendVo> getProjectTrend(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto);
ChartVo.ProjectOverview getOverview(Long currentUserId, Long projectId) throws Exception;
List<ChartVo.BurnoutFigure> getBurnoutFigure(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto);
}

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

@ -6,15 +6,15 @@ import com.ccsens.tall.bean.vo.LabelVo;
import java.util.List;
public interface ILabelService {
List<LabelVo.SelectLabel> addLabel(Long userId,List<LabelDto.AddLabel> labelList);
List<LabelVo.SelectLabel> addLabel(Long userId,LabelDto.AddLabel labelList);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key);
void delLabel(Long currentUserId, LabelDto.DelLabel delLabel);
void changeLabel(Long currentUserId, LabelDto.ChangeLabel changeLabel);
void projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
void projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
}

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

@ -17,6 +17,7 @@ import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@ -34,26 +35,24 @@ public class LabelService implements ILabelService{
/**
* 添加标签
* @param labelList 添加的标签信息
* @param label 添加的标签信息
*/
@Override
public List<LabelVo.SelectLabel> addLabel(Long userId,List<LabelDto.AddLabel> labelList) {
if(CollectionUtil.isNotEmpty(labelList)){
labelList.forEach(label->{
SysLabelExample sysLabelExample = new SysLabelExample();
sysLabelExample.createCriteria().andNameEqualTo(label.getName());
List<SysLabel> sysLabels = sysLabelDao.selectByExample(sysLabelExample);
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);
sysLabelDao.insertSelective(sysLabel);
});
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);
List<SysLabel> sysLabels = sysLabelDao.selectByExample(sysLabelExample);
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);
sysLabelDao.insertSelective(sysLabel);
}
return sysLabelDao.selectLabelByUserId(userId);
return sysLabelDao.selectLabelByUserId(userId,null);
}
/**
@ -62,8 +61,8 @@ public class LabelService implements ILabelService{
* @return 返回该用户添加的所有标签
*/
@Override
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId) {
return sysLabelDao.selectLabelByUserId(currentUserId);
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key) {
return sysLabelDao.selectLabelByUserId(currentUserId,key);
}
/**
@ -123,12 +122,13 @@ public class LabelService implements ILabelService{
* @param projectLabel 项目id和标签id
*/
@Override
public void projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
public List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
List<LabelVo.SelectLabel> selectLabelList = new ArrayList<>();
SysProject project = sysProjectDao.selectByPrimaryKey(projectLabel.getProjectId());
if (ObjectUtil.isNotNull(project)) {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
if (power > 1) {
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId->{
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
@ -146,12 +146,15 @@ public class LabelService implements ILabelService{
sysProjectLabelDao.insertSelective(sysProjectLabel);
});
}
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
// } else {
// throw new BaseException(CodeEnum.NOT_POWER);
// }
} else {
throw new BaseException(CodeEnum.NOT_PROJECT);
}
return selectLabelList;
}
/**
@ -160,12 +163,13 @@ public class LabelService implements ILabelService{
* @param projectLabel 项目id和被删除的标签的id
*/
@Override
public void projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
public List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
List<LabelVo.SelectLabel> selectLabelList = new ArrayList<>();
SysProject project = sysProjectDao.selectByPrimaryKey(projectLabel.getProjectId());
if (ObjectUtil.isNotNull(project)) {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
if (power > 1) {
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
@ -187,11 +191,14 @@ public class LabelService implements ILabelService{
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
} else {
throw new BaseException(CodeEnum.NOT_PROJECT);
}
// } else {
// throw new BaseException(CodeEnum.NOT_PROJECT);
// }
return selectLabelList;
}
}

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

@ -23,6 +23,7 @@ import com.ccsens.util.cron.CronConstant;
import com.ccsens.util.cron.NatureToDate;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.apache.bcel.classfile.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -453,6 +454,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
String[] pluginIds = pluginVo.getId().split(",");
String[] pluginNames = pluginVo.getName().split(",");
String[] pluginDescription = pluginVo.getDescription().split(",");
String[] pluginShowType = pluginVo.getShowType().split(",");
TaskVo.PluginVo plugin = null;
for(int i = 0;i<pluginIds.length;i++){
@ -460,6 +462,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
plugin.setId(pluginIds[i]);
plugin.setName(pluginNames[i]);
plugin.setDescription(pluginDescription[i]);
plugin.setShowType(pluginShowType[i]);
pluginVoList.add(plugin);
}
}
@ -929,7 +932,13 @@ public class ProTaskDetailService implements IProTaskDetailService {
public ProSubTimeMember getProcessByUserIdAndTask(Long userId, Long subTimeId) throws Exception {
ProSubTimeMember subTimeMember = null;
ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(subTimeId);
if(ObjectUtil.isNull(subTime)){
throw new BaseException(CodeEnum.NOT_TASK);
}
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(subTime.getTaskDetailId());
if(ObjectUtil.isNull(taskDetail)){
throw new BaseException(CodeEnum.NOT_TASK);
}
if (taskDetail.getFinishNeedAll() == 0) {
ProSubTimeMemberExample subTimeMemberExample = new ProSubTimeMemberExample();
subTimeMemberExample.createCriteria().andTaskSubTimeIdEqualTo(subTimeId).andComplatedStatusEqualTo((byte) 2);

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

@ -186,12 +186,10 @@ public class ProjectService implements IProjectService {
projectConfig.setFilter(proShowList.get(0).getFilter());
projectConfig.setShowMvp(proShowList.get(0).getIsShowMvp());
projectConfig.setSelectTaskType(proShowList.get(0).getSelectTaskType());
projectConfig.setDetailPath(proShowList.get(0).getDetailPath());
projectInfo.setProjectConfig(projectConfig);
} else {
ProjectVo.ProjectConfig projectConfig = new ProjectVo.ProjectConfig();
projectConfig.setFilter(0);
projectConfig.setSlide(0);
projectConfig.setCreateTask(1);
projectInfo.setProjectConfig(projectConfig);
}
});
@ -245,7 +243,7 @@ public class ProjectService implements IProjectService {
projectInfo.setProjectConfig(projectConfig);
}
//获取项目下的标签信息
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(project.getId());
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
if(CollectionUtil.isNotEmpty(labelList)){
projectInfo.setLabelList(labelList);
}
@ -301,16 +299,14 @@ public class ProjectService implements IProjectService {
projectConfig.setCreateTask(proShowList.get(0).getCreateTask());
projectConfig.setShowMvp(proShowList.get(0).getIsShowMvp());
projectConfig.setSelectTaskType(proShowList.get(0).getSelectTaskType());
projectConfig.setDetailPath(proShowList.get(0).getDetailPath());
projectInfo.setProjectConfig(projectConfig);
} else {
ProjectVo.ProjectConfig projectConfig = new ProjectVo.ProjectConfig();
projectConfig.setSlide(0);
projectConfig.setFilter(0);
projectConfig.setCreateTask(1);
projectInfo.setProjectConfig(projectConfig);
}
//获取项目下的标签信息
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(projectId);
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(userId,projectId);
if(CollectionUtil.isNotEmpty(labelList)){
projectInfo.setLabelList(labelList);
}
@ -329,7 +325,6 @@ public class ProjectService implements IProjectService {
PageHelper.startPage(1, 4);
List<ProjectVo.TemplateStatus> templateProject = sysProjectDao.selectByTemplateStatus(1);
PageHelper.startPage(1, 2);
List<ProjectVo.TemplateStatus> commonProject = sysProjectDao.selectByTemplateStatus(0);
// PageInfo pageInfo =new PageInfo<>(project);

7
tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

@ -780,9 +780,10 @@ public class TaskDeliverService implements ITaskDeliverService {
for(ProTaskDeliverPostLog deliverPostLog : postLogList){
//删除文件
SysCommitedFile file = commitedFileDao.selectByPrimaryKey(deliverPostLog.getFileId());
file.setRecStatus((byte) 2);
commitedFileDao.updateByPrimaryKeySelective(file);
if(ObjectUtil.isNotNull(file)) {
file.setRecStatus((byte) 2);
commitedFileDao.updateByPrimaryKeySelective(file);
}
// deleteFile(file.getPath());
// commitedFileDao.deleteByPrimaryKey(deliverPostLog.getId());
//删除交付物和文件、检查人的关联信息

3
tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java

@ -136,6 +136,7 @@ public class TaskPluginService implements ITaskPluginService{
commentInfo.setTaskId(proTaskComment.getTaskSubTimeId());
commentInfo.setCommentTime(proTaskComment.getTime());
commentInfo.setDescription(proTaskComment.getDescription());
commentInfo.setMine(1);
//查询用户头像和昵称
SysUser sysUser = sysUserDao.selectByPrimaryKey(userId);
commentInfo.setAvatarUrl(sysUser.getAvatarUrl());
@ -158,7 +159,7 @@ public class TaskPluginService implements ITaskPluginService{
@Override
public List<PluginVo.CommentInfo> getComment(Long currentUserId, Long taskId) {
List<PluginVo.CommentInfo> commentInfoList = proTaskCommentDao.getCommentByTaskId(taskId);
List<PluginVo.CommentInfo> commentInfoList = proTaskCommentDao.getCommentByTaskId(currentUserId,taskId);
return commentInfoList;
}

22
tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java

@ -557,17 +557,19 @@ public class WbsSubSheetService implements IWbsSubSheetService {
XSSFSheet relevanceSheet = xssfWorkbook.getSheet("关联项目表");
if(ObjectUtil.isNotNull(relevanceSheet)){
for (int i = 1; i <= relevanceSheet.getLastRowNum(); i++) {
String relevanceProjectId = ExcelUtil.getCellValue(relevanceSheet.getRow(i).getCell(2));
if(StrUtil.isNotEmpty(relevanceProjectId)){
SysProject sysProject = sysProjectDao.selectByPrimaryKey(Long.valueOf(relevanceProjectId));
if(ObjectUtil.isNull(sysProject)){
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg("关联项目表" + i));
if (ObjectUtil.isNotNull(relevanceSheet.getRow(i))){
String relevanceProjectId = ExcelUtil.getCellValue(relevanceSheet.getRow(i).getCell(2));
if (StrUtil.isNotEmpty(relevanceProjectId)) {
SysProject sysProject = sysProjectDao.selectByPrimaryKey(Long.valueOf(relevanceProjectId));
if (ObjectUtil.isNull(sysProject)) {
throw new BaseException(CodeEnum.NOT_PROJECT.addMsg("关联项目表" + i));
}
SysRelevanceProject sysRelevanceProject = new SysRelevanceProject();
sysRelevanceProject.setId(snowflake.nextId());
sysRelevanceProject.setProjectId(projectId);
sysRelevanceProject.setRelevanceProjectId(Long.valueOf(relevanceProjectId));
relevanceProjectDao.insertSelective(sysRelevanceProject);
}
SysRelevanceProject sysRelevanceProject = new SysRelevanceProject();
sysRelevanceProject.setId(snowflake.nextId());
sysRelevanceProject.setProjectId(projectId);
sysRelevanceProject.setRelevanceProjectId(Long.valueOf(relevanceProjectId));
relevanceProjectDao.insertSelective(sysRelevanceProject);
}
}
}

86
tall/src/main/java/com/ccsens/tall/web/ChartController.java

@ -0,0 +1,86 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.dto.TaskDto;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.service.IChartService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import jdk.internal.dynalink.linker.LinkerServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(tags = "图表相关API", description = "")
@RestController
@RequestMapping("/charts")
public class ChartController {
@Autowired
private IChartService chartService;
@ApiOperation(value = "任务执行者分布图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/executor", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ChartVo.ExecutorChart> getTasksByTaskId(HttpServletRequest request,
@RequestParam(required = true)Long projectId,
@RequestParam(required = false)Integer type) throws Exception{
type = type == null ? 0 : type;
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ChartVo.ExecutorChart executorChart = chartService.getExecutorChart(currentUserId,projectId,type);
return JsonResponse.newInstance().ok(executorChart);
}
@ApiOperation(value = "计划时间内完成任务",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/complete", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.CompleteTaskNum>> getCompleteTaskByTime(HttpServletRequest request,
@RequestParam(required = true)Long projectId) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.CompleteTaskNum> completeTaskNumList = chartService.getCompleteTaskByTime(currentUserId,projectId);
return JsonResponse.newInstance().ok(completeTaskNumList);
}
@ApiOperation(value = "项目进展趋势图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/trend", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.ProjectTrendVo>> getProjectTrend(HttpServletRequest request,
@Validated @RequestBody ChartDto.ProjectTrendDto projectTrendDto) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.ProjectTrendVo> projectTrendVoList = chartService.getProjectTrend(currentUserId,projectTrendDto);
return JsonResponse.newInstance().ok(projectTrendVoList);
}
@ApiOperation(value = "概览报表",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/overview", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ChartVo.ProjectOverview> getOverview(HttpServletRequest request,
@RequestParam(required = true)Long projectId) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ChartVo.ProjectOverview projectOverview = chartService.getOverview(currentUserId,projectId);
return JsonResponse.newInstance().ok(projectOverview);
}
@ApiOperation(value = "燃尽图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/burnout", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.BurnoutFigure>> getBurnoutFigure(HttpServletRequest request,
@Validated @RequestBody ChartDto.ProjectTrendDto projectTrendDto) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.BurnoutFigure> burnoutFigure = chartService.getBurnoutFigure(currentUserId,projectTrendDto);
return JsonResponse.newInstance().ok(burnoutFigure);
}
}

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

@ -4,6 +4,7 @@ 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;
@ -30,9 +31,10 @@ public class LabelController {
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> selectLabel(HttpServletRequest request) throws Exception {
public JsonResponse<List<LabelVo.SelectLabel>> selectLabel(HttpServletRequest request,
@RequestParam(required = false)String key) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId);
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId,key);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ -41,7 +43,7 @@ public class LabelController {
})
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> addLabel(HttpServletRequest request,
@Validated @RequestBody List<LabelDto.AddLabel> labelList ) throws Exception {
@Validated @RequestBody LabelDto.AddLabel labelList ) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.addLabel(currentUserId,labelList);
return JsonResponse.newInstance().ok(selectLabelList);
@ -73,22 +75,22 @@ public class LabelController {
@ApiImplicitParams({
})
@RequestMapping(value = "/project", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse projectAddLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
public JsonResponse<List<LabelVo.SelectLabel>> projectAddLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
labelService.projectAddLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok();
List<LabelVo.SelectLabel> selectLabelList = labelService.projectAddLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ApiOperation(value = "删除项目关联的标签",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/project/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse projectRemoveLabel(HttpServletRequest request,
public JsonResponse<List<LabelVo.SelectLabel>> projectRemoveLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
labelService.projectRemoveLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok();
List<LabelVo.SelectLabel> selectLabelList = labelService.projectRemoveLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
}

20
tall/src/main/java/com/ccsens/tall/web/ProjectController.java

@ -237,15 +237,15 @@ public class ProjectController {
return JsonResponse.newInstance().ok(projectInfoList);
}
// @ApiOperation(value = "查找关联的项目",notes = "")
// @ApiImplicitParams({
// })
// @RequestMapping(value = "/relevance", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<ProjectVo.RelevanceProject>> selectRelevanceProject(HttpServletRequest request,
// @RequestParam(required = false) Long projectId) throws Exception {
// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
// List<ProjectVo.RelevanceProject> projectInfoList = projectService.selectRelevanceProject(currentUserId,projectId);
// return JsonResponse.newInstance().ok(projectInfoList);
// }
@ApiOperation(value = "查找关联的项目",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/relevance", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.RelevanceProject>> selectRelevanceProject(HttpServletRequest request,
@RequestParam(required = true) Long projectId) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ProjectVo.RelevanceProject> projectInfoList = projectService.selectRelevanceProject(currentUserId,projectId);
return JsonResponse.newInstance().ok(projectInfoList);
}
}

70
tall/src/main/resources/application-test.yml

@ -1,35 +1,35 @@
server:
port: 7030
servlet:
context-path: /v1.0
spring:
snowflake:
datacenterId: 1
workerId: 1
application:
name: tall
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: api.ccsens.com
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 49.233.89.188
gatewayUrl: https://test.tall.wiki/gateway/
server:
port: 7030
servlet:
context-path: /v1.0
spring:
snowflake:
datacenterId: 1
workerId: 1
application:
name: tall
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 192.168.0.99
gatewayUrl: http://192.168.0.99/gateway/

64
tall/src/main/resources/druid-test.yml

@ -1,33 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188/tall?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

3
tall/src/main/resources/mapper_dao/ProTaskCommentDao.xml

@ -10,7 +10,8 @@
s.avatar_url as avatarUrl,
c.task_sub_time_id as taskId,
c.`time` as commentTime,
c.description as description
c.description as description,
if(c.user_id = #{userId},1,0) as mine
FROM
`t_pro_task_comment` c left join t_sys_user s on c.user_id = s.id left join t_sys_auth a on s.id = a.user_id and a.identify_type = 3
WHERE

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

@ -8,6 +8,10 @@
rec_status = 0
and
user_id = #{userId}
<if test="key != null and key != ''">
and
`name` like concat('%',#{key},'%')
</if>
</select>
<select id="selectLabelByProjectId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
@ -26,6 +30,8 @@
l.rec_status = 0
and
p.project_id = #{projectId}
and
l.user_id = #{userId}
</select>
</mapper>

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

@ -55,6 +55,15 @@
<result column="pName" property="name" />
</resultMap>
<!-- <resultMap id="ChartVo_CompleteTaskNum" type="com.ccsens.tall.bean.vo.ChartVo$CompleteTaskNum">-->
<!-- <id column="roleId" property="roleId" />-->
<!-- <result column="roleName" property="roleName" />-->
<!-- <result column="total" property="total" />-->
<!-- <collection property="taskDetailId" ofType="java.lang.Long">-->
<!-- <id column="dId" property="taskDetailId"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<select id="findProjectIdByUserId" parameterType="java.util.Map"
resultMap="resultMap_ProjectInfo">
SELECT
@ -208,17 +217,27 @@
<select id="selectRelevanceProject" parameterType="java.util.Map" resultMap="resultMap_Relevance_Project">
SELECT
*
p.id AS pId,
p.NAME AS pName,
p.address AS pAddress,
p.begin_time AS pBeginTime,
p.end_time AS pEndTime,
l.id as lId,
l.name as lName,
l.code as lCode,
l.color as lColor,
l.level as lLevle,
l.description as lDescription
FROM
t_sys_project p LEFT JOIN
(SELECT
r.relevance_project_id as rProjectId
FROM
t_sys_relevance_project r left JOIN t_sys_project sp ON r.project_id = sp.id
WHERE
r.project_id = #{projectId}
) t
on p.id = t.rProjectId left join t_sys_project_label pl on pl.project_id = p.id
(
SELECT
r.relevance_project_id as rProjectId
FROM
t_sys_relevance_project r left JOIN t_sys_project sp ON r.project_id = sp.id
WHERE
r.project_id = #{projectId}
) t
LEFT JOIN t_sys_project p on p.id = t.rProjectId left join t_sys_project_label pl on pl.project_id = p.id
left join t_sys_label l on pl.label_id = l.id
WHERE
p.rec_status = 0
@ -228,6 +247,220 @@
(pl.rec_status = 0 or pl.rec_status is null)
AND
p.template = 0
</select>
<select id="getExecutorChart" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$__ExecutorChart">
SELECT
r.id as roleId,
r.`name` as roleName,
if(#{type}=0,count(d.id),SUM(d.end_time - d.begin_time)/6000) as `value`
FROM
`t_pro_role` r LEFT JOIN `t_pro_task_detail` d on r.id = d.executor_role
WHERE
r.project_id = #{projectId}
and
(SELECT name FROM t_pro_role pr WHERE r.parent_id = pr.id) in ('PM','Member')
AND
r.name not IN ('观众','MVP')
GROUP BY r.`name`
</select>
<select id="getCompleteTaskByTime" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$CompleteTaskNum">
SELECT
r.id as roleId,
r.`name` as roleName,
d.`name` as dId,
count(d.id) as total,
sum(a.finish=1) as value
FROM
`t_pro_role` r LEFT JOIN `t_pro_task_detail` d on r.id = d.executor_role
LEFT JOIN(
SELECT
td.id as dId,
if(sum(t.isFinish) = 0,true,false) as finish
FROM
t_pro_task_detail td LEFT JOIN
(
SELECT
s.id as sId,
s.task_detail_id as sTaskId,
m.real_finish_time,
m.complated_status,
if(count(m.id)=0,true,FALSE) as isFinish
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_sub_time_member m on s.id = m.task_sub_time_id
WHERE
(
(
m.real_finish_time > s.begin_time
and
m.real_finish_time &lt;= s.end_time
and
m.complated_status = 2
)
or
(m.real_finish_time is null))
GROUP BY s.id
) t on td.id = t.sTaskId
WHERE
td.`level` in (2,3)
GROUP BY td.Id
) a on a.dId = d.id
WHERE
r.project_id = #{projectId}
and
d.`level` in (2,3)
and
(SELECT name FROM t_pro_role pr WHERE r.parent_id = pr.id) in ('PM','Member')
AND
r.name not IN ('观众','MVP')
GROUP BY r.`id`
</select>
<select id="getProjectTrend" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$ProjectTrendVo">
SELECT
FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d') as date,
count(s.id) as total,
sum(t.isFinish) as completed
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN
(
SELECT
st.id as sId,
st.task_detail_id,
m.real_finish_time,
m.complated_status,
m.id as mId,
if(count(m.id)=0,FALSE,true) as isFinish
FROM
t_pro_task_sub_time st LEFT JOIN t_pro_sub_time_member m on st.id = m.task_sub_time_id
WHERE
m.complated_status = 2
or
m.complated_status is null
GROUP BY st.id
) t on s.id = t.sId
WHERE
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
group by FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
</select>
<select id="getOverview" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$ProjectOverview">
SELECT
count(td.id) as total,
sum(t.isFinish) as completed,
sum(t.completedOnTime) as completedOnTime
FROM
t_pro_task_detail td LEFT JOIN
(
SELECT
st.id as sId,
st.task_detail_id as sTaskId,
if(count(m.id)=0,FALSE,true) as isFinish,
if(count(m.id)>0
and m.real_finish_time &gt; st.begin_time
and m.real_finish_time &lt;= st.end_time,true,false) as completedOnTime
FROM
t_pro_task_sub_time st LEFT JOIN t_pro_sub_time_member m on st.id = m.task_sub_time_id
WHERE
(m.complated_status = 2
or
m.complated_status is null)
GROUP BY st.task_detail_id
) t on t.sTaskId = td.id
WHERE
td.project_id = #{projectId}
and
td.`level` in (2,3)
</select>
<select id="getOverviewByToDay" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$ProjectOverview">
SELECT
count(td.id) as today,
sum(t.isFinish) as todayCompleted
FROM
t_pro_task_detail td LEFT JOIN
(
SELECT
st.id as sId,
st.task_detail_id as sTaskId,
if(count(m.id)=0,FALSE,true) as isFinish,
if(count(m.id)>0
and m.real_finish_time &gt; st.begin_time
and m.real_finish_time &lt;= st.end_time,true,false) as completedOnTime
FROM
t_pro_task_sub_time st LEFT JOIN t_pro_sub_time_member m on st.id = m.task_sub_time_id
WHERE
(m.complated_status = 2
or
m.complated_status is null)
GROUP BY st.task_detail_id
) t on t.sTaskId = td.id
WHERE
td.project_id = #{projectId}
and
td.`level` in (2,3)
and
td.begin_time &lt; #{endTime}
and
td.end_time &gt; #{startTime}
</select>
<select id="getBurnoutFigure" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$BurnoutFigure">
SELECT
<if test="type == null">
FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d') as `date`,
</if>
count(s.id) as totalDay,
t.completed as completed
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN
(
SELECT
count(s.id) as completed,
FROM_UNIXTIME(m.real_finish_time/1000,'%Y-%m-%d') as `finishTime`
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN t_pro_sub_time_member m on s.id = m.task_sub_time_id
WHERE
m.complated_status = 2
AND
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
group by FROM_UNIXTIME(m.real_finish_time/1000,'%Y-%m-%d')
) t on t.finishTime = FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
WHERE
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
<if test="type == null">
group by FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
</if>
</select>
</mapper>

4
tall/src/main/resources/mapper_dao/SysUserDao.xml

@ -76,9 +76,9 @@
AND a.identify_type = 3
WHERE
u.rec_status = 0
and
and
a.rec_status = 0
and
and
u.id = #{userId}
limit 1
</select>

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

@ -27,6 +27,7 @@
<result column="tRealBeginTime" property="realBeginTime" />
<result column="tRealEndTime" property="realEndTime" />
<result column="tProcess" property="process" />
<result column="tSubProjectId" property="subProjectId" />
<result column="tMoney" property="money" />
<result column="tVirtual" property="virtual" />
<result column="tDelay" property="delay" />
@ -38,6 +39,7 @@
<id column="pId" property="id"/>
<result column="pName" property="name"/>
<result column="pDescription" property="description"/>
<result column="pShowType" property="showType"/>
</collection>
</resultMap>
@ -57,7 +59,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -72,6 +75,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -82,7 +86,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -130,7 +135,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -145,6 +151,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -155,7 +162,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -200,7 +208,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -215,6 +224,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -222,7 +232,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -251,7 +262,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -266,6 +278,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -273,7 +286,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -329,7 +343,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -344,6 +359,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -351,7 +367,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id

25
tall/src/main/resources/mapper_raw/ProShowMapper.xml

@ -15,6 +15,7 @@
<result column="duration" jdbcType="TINYINT" property="duration" />
<result column="show_shortcuts" jdbcType="TINYINT" property="showShortcuts" />
<result column="select_task_type" jdbcType="TINYINT" property="selectTaskType" />
<result column="detail_path" jdbcType="VARCHAR" property="detailPath" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -76,7 +77,7 @@
</sql>
<sql id="Base_Column_List">
id, project_id, slide, filter, is_show_mvp, create_task, created_at, updated_at,
rec_status, time_show, duration, show_shortcuts, select_task_type
rec_status, time_show, duration, show_shortcuts, select_task_type, detail_path
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProShowExample" resultMap="BaseResultMap">
select
@ -113,12 +114,12 @@
filter, is_show_mvp, create_task,
created_at, updated_at, rec_status,
time_show, duration, show_shortcuts,
select_task_type)
select_task_type, detail_path)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{slide,jdbcType=TINYINT},
#{filter,jdbcType=TINYINT}, #{isShowMvp,jdbcType=TINYINT}, #{createTask,jdbcType=TINYINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{timeShow,jdbcType=VARCHAR}, #{duration,jdbcType=TINYINT}, #{showShortcuts,jdbcType=TINYINT},
#{selectTaskType,jdbcType=TINYINT})
#{selectTaskType,jdbcType=TINYINT}, #{detailPath,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProShow">
insert into t_pro_show
@ -162,6 +163,9 @@
<if test="selectTaskType != null">
select_task_type,
</if>
<if test="detailPath != null">
detail_path,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -203,6 +207,9 @@
<if test="selectTaskType != null">
#{selectTaskType,jdbcType=TINYINT},
</if>
<if test="detailPath != null">
#{detailPath,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProShowExample" resultType="java.lang.Long">
@ -253,6 +260,9 @@
<if test="record.selectTaskType != null">
select_task_type = #{record.selectTaskType,jdbcType=TINYINT},
</if>
<if test="record.detailPath != null">
detail_path = #{record.detailPath,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -272,7 +282,8 @@
time_show = #{record.timeShow,jdbcType=VARCHAR},
duration = #{record.duration,jdbcType=TINYINT},
show_shortcuts = #{record.showShortcuts,jdbcType=TINYINT},
select_task_type = #{record.selectTaskType,jdbcType=TINYINT}
select_task_type = #{record.selectTaskType,jdbcType=TINYINT},
detail_path = #{record.detailPath,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -316,6 +327,9 @@
<if test="selectTaskType != null">
select_task_type = #{selectTaskType,jdbcType=TINYINT},
</if>
<if test="detailPath != null">
detail_path = #{detailPath,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -332,7 +346,8 @@
time_show = #{timeShow,jdbcType=VARCHAR},
duration = #{duration,jdbcType=TINYINT},
show_shortcuts = #{showShortcuts,jdbcType=TINYINT},
select_task_type = #{selectTaskType,jdbcType=TINYINT}
select_task_type = #{selectTaskType,jdbcType=TINYINT},
detail_path = #{detailPath,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

499
tall/src/main/resources/mapper_raw/SysPluginMapper.xml

@ -1,243 +1,258 @@
<?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.SysPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="scene" jdbcType="TINYINT" property="scene" />
<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, name, description, scene, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_plugin
<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_sys_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample">
delete from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin (id, name, description,
scene, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{scene,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="scene != null">
scene,
</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="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
#{scene,jdbcType=TINYINT},
</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.SysPluginExample" resultType="java.lang.Long">
select count(*) from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.scene != null">
scene = #{record.scene,jdbcType=TINYINT},
</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_sys_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=TINYINT},
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.SysPlugin">
update t_sys_plugin
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
scene = #{scene,jdbcType=TINYINT},
</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.SysPlugin">
update t_sys_plugin
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
scene = #{scene,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
<?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.SysPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="scene" jdbcType="TINYINT" property="scene" />
<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="show_type" jdbcType="TINYINT" property="showType" />
</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, name, description, scene, created_at, updated_at, rec_status, show_type
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_plugin
<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_sys_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample">
delete from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin (id, name, description,
scene, created_at, updated_at,
rec_status, show_type)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{scene,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT}, #{showType,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="scene != null">
scene,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
<if test="showType != null">
show_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
#{scene,jdbcType=TINYINT},
</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>
<if test="showType != null">
#{showType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultType="java.lang.Long">
select count(*) from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.scene != null">
scene = #{record.scene,jdbcType=TINYINT},
</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>
<if test="record.showType != null">
show_type = #{record.showType,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
show_type = #{record.showType,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
scene = #{scene,jdbcType=TINYINT},
</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>
<if test="showType != null">
show_type = #{showType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
scene = #{scene,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
show_type = #{showType,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

9
util/src/main/java/com/ccsens/util/DateUtil.java

@ -1,5 +1,6 @@
package com.ccsens.util;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.ccsens.util.exception.BaseException;
@ -153,10 +154,12 @@ public class DateUtil extends cn.hutool.core.date.DateUtil {
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime().getTime();
}
//
// public static void main(String[] args) throws Exception {
//
// System.out.println(getZeroTime(new Date()));
// DateTime endTime = cn.hutool.core.date.DateUtil.endOfDay(new Date());
// DateTime beginTime = cn.hutool.core.date.DateUtil.beginOfDay(new Date());
// System.out.println(endTime);
// System.out.println(beginTime);
// }
}

34
util/src/main/java/com/ccsens/util/StringUtil.java

@ -13,7 +13,7 @@ import java.util.regex.Pattern;
public class StringUtil {
public final static String WEEK_DAY = "(每?隔\\d周)|(每?隔\\d星期)|(每?周[0-7]+)|(每?星期[0-7]+)|(每?周一)|(每?周二)|(每?周三)|(每?周四)|(每?周五)|(每?周六)|(每?周日)|(每?周天)";
public final static String DAY = "(每?隔\\d+天)|(每?隔\\d+日)|(\\d+号)|(\\d+日)|(\\d+\\-\\d+号)|(\\d+\\-\\d+日)|(\\d+到\\d+号)|(\\d+到\\d+日)";
public final static String DAY = "(每\\d+天)|(每\\d+日)|(每?隔\\d+天)|(每?隔\\d+日)|(\\d+号)|(\\d+日)|(\\d+\\-\\d+号)|(\\d+\\-\\d+日)|(\\d+到\\d+号)|(\\d+到\\d+日)";
public final static String CONTINUE_RANGE = ".*(到|\\-|至).*";
@ -59,21 +59,21 @@ public class StringUtil {
return matcher.matches();
}
public static void main(String[] args) {
// matchSingle("每天5分", MINUTE_REGEXP);
// public static void main(String[] args) {
//// matchSingle("每天5分", MINUTE_REGEXP);
////
//// String[] split = "a至b".split("[到\\-至]");
//// for (String s: split) {
//// System.out.println("split:" + s);
//// }
//// System.out.println(isMatch("3到5",CONTINUE_RANGE));
//// System.out.println("------------------------------------------------" + (null + "hello wold"));
//// match("3-5小时", "(每隔?\\d*小?时)|(\\d+\\-\\d+小?时)|(\\d*点)|(\\d*时)");
//
// String[] split = "a至b".split("[到\\-至]");
// for (String s: split) {
// System.out.println("split:" + s);
// }
// System.out.println(isMatch("3到5",CONTINUE_RANGE));
// System.out.println("------------------------------------------------" + (null + "hello wold"));
// match("3-5小时", "(每隔?\\d*小?时)|(\\d+\\-\\d+小?时)|(\\d*点)|(\\d*时)");
// System.out.println(isMatch("每周一5点", EVERY_WEEK_MORE));
// System.out.println(isMatch("每周5点", EVERY_WEEK_MORE));
System.out.println(matchSingle("第一百零三个", CHINESE_NUM));
}
//// System.out.println(isMatch("每周一5点", EVERY_WEEK_MORE));
//// System.out.println(isMatch("每周5点", EVERY_WEEK_MORE));
// System.out.println(matchSingle("第一百零三个", CHINESE_NUM));
// }
@ -235,7 +235,9 @@ public class StringUtil {
}
// public static void main(String[] args) {
// List<String> list = extractMessage("");
// String a = "员工成长(112333)";
//
// List<String> list = extractMessage(a);
// for(String s : list){
// System.out.println(s);
// }

Loading…
Cancel
Save