Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zy_Java 5 years ago
parent
commit
01e1b3a2bd
  1. 7
      tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java
  2. 12
      tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java
  3. 33
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetail.java
  4. 180
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetailExample.java
  5. 9
      tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberRoleShowDao.java
  6. 8
      tall/src/main/java/com/ccsens/tall/service/IProjectService.java
  7. 15
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  8. 65
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  9. 3
      tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java
  10. 16
      tall/src/main/java/com/ccsens/tall/web/ProjectController.java
  11. 58
      tall/src/main/resources/mapper_raw/ProTaskDetailMapper.xml

7
tall/src/main/java/com/ccsens/tall/bean/dto/ProjectDto.java

@ -156,4 +156,11 @@ public class ProjectDto {
@ApiModelProperty("标签id")
private List<Long> labelList;
}
@Data
@ApiModel("项目转模板")
public static class ProjectToTemplate{
@ApiModelProperty("项目id")
private Long projectId;
}
}

12
tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java

@ -49,6 +49,12 @@ public class TaskDto {
private String milestone;
@ApiModelProperty("任务提醒消息")
private TaskRemindByAdd taskRemind;
@ApiModelProperty("上级任务详情id")
private Long lastTaskDetailId;
@ApiModelProperty("上级提醒类型(0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间)")
private Byte lastType;
@ApiModelProperty("两个任务时间差")
private Long timeDifference;
}
@ApiModel("批量添加任务")
@ -229,6 +235,12 @@ public class TaskDto {
private Long parentId;
@ApiModelProperty("所属项目id")
private Long projectId;
@ApiModelProperty("上级任务详情id")
private Long lastTaskDetailId;
@ApiModelProperty("上级提醒类型(0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间)")
private Byte lastType;
@ApiModelProperty("两个任务时间差")
private Long timeDifference;
}
@Data
@ApiModel("修改任务时修改交付物名称")

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

@ -62,6 +62,12 @@ public class ProTaskDetail implements Serializable {
private Long buildUser;
private Long lastTaskDetailId;
private Byte lastType;
private Long timeDifference;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -296,6 +302,30 @@ public class ProTaskDetail implements Serializable {
this.buildUser = buildUser;
}
public Long getLastTaskDetailId() {
return lastTaskDetailId;
}
public void setLastTaskDetailId(Long lastTaskDetailId) {
this.lastTaskDetailId = lastTaskDetailId;
}
public Byte getLastType() {
return lastType;
}
public void setLastType(Byte lastType) {
this.lastType = lastType;
}
public Long getTimeDifference() {
return timeDifference;
}
public void setTimeDifference(Long timeDifference) {
this.timeDifference = timeDifference;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -331,6 +361,9 @@ public class ProTaskDetail implements Serializable {
sb.append(", priority=").append(priority);
sb.append(", milestone=").append(milestone);
sb.append(", buildUser=").append(buildUser);
sb.append(", lastTaskDetailId=").append(lastTaskDetailId);
sb.append(", lastType=").append(lastType);
sb.append(", timeDifference=").append(timeDifference);
sb.append("]");
return sb.toString();
}

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

@ -1904,6 +1904,186 @@ public class ProTaskDetailExample {
addCriterion("build_user not between", value1, value2, "buildUser");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdIsNull() {
addCriterion("last_task_detail_id is null");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdIsNotNull() {
addCriterion("last_task_detail_id is not null");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdEqualTo(Long value) {
addCriterion("last_task_detail_id =", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdNotEqualTo(Long value) {
addCriterion("last_task_detail_id <>", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdGreaterThan(Long value) {
addCriterion("last_task_detail_id >", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdGreaterThanOrEqualTo(Long value) {
addCriterion("last_task_detail_id >=", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdLessThan(Long value) {
addCriterion("last_task_detail_id <", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdLessThanOrEqualTo(Long value) {
addCriterion("last_task_detail_id <=", value, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdIn(List<Long> values) {
addCriterion("last_task_detail_id in", values, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdNotIn(List<Long> values) {
addCriterion("last_task_detail_id not in", values, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdBetween(Long value1, Long value2) {
addCriterion("last_task_detail_id between", value1, value2, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTaskDetailIdNotBetween(Long value1, Long value2) {
addCriterion("last_task_detail_id not between", value1, value2, "lastTaskDetailId");
return (Criteria) this;
}
public Criteria andLastTypeIsNull() {
addCriterion("last_type is null");
return (Criteria) this;
}
public Criteria andLastTypeIsNotNull() {
addCriterion("last_type is not null");
return (Criteria) this;
}
public Criteria andLastTypeEqualTo(Byte value) {
addCriterion("last_type =", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeNotEqualTo(Byte value) {
addCriterion("last_type <>", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeGreaterThan(Byte value) {
addCriterion("last_type >", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("last_type >=", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeLessThan(Byte value) {
addCriterion("last_type <", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeLessThanOrEqualTo(Byte value) {
addCriterion("last_type <=", value, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeIn(List<Byte> values) {
addCriterion("last_type in", values, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeNotIn(List<Byte> values) {
addCriterion("last_type not in", values, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeBetween(Byte value1, Byte value2) {
addCriterion("last_type between", value1, value2, "lastType");
return (Criteria) this;
}
public Criteria andLastTypeNotBetween(Byte value1, Byte value2) {
addCriterion("last_type not between", value1, value2, "lastType");
return (Criteria) this;
}
public Criteria andTimeDifferenceIsNull() {
addCriterion("time_difference is null");
return (Criteria) this;
}
public Criteria andTimeDifferenceIsNotNull() {
addCriterion("time_difference is not null");
return (Criteria) this;
}
public Criteria andTimeDifferenceEqualTo(Long value) {
addCriterion("time_difference =", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceNotEqualTo(Long value) {
addCriterion("time_difference <>", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceGreaterThan(Long value) {
addCriterion("time_difference >", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceGreaterThanOrEqualTo(Long value) {
addCriterion("time_difference >=", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceLessThan(Long value) {
addCriterion("time_difference <", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceLessThanOrEqualTo(Long value) {
addCriterion("time_difference <=", value, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceIn(List<Long> values) {
addCriterion("time_difference in", values, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceNotIn(List<Long> values) {
addCriterion("time_difference not in", values, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceBetween(Long value1, Long value2) {
addCriterion("time_difference between", value1, value2, "timeDifference");
return (Criteria) this;
}
public Criteria andTimeDifferenceNotBetween(Long value1, Long value2) {
addCriterion("time_difference not between", value1, value2, "timeDifference");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

9
tall/src/main/java/com/ccsens/tall/persist/dao/ProMemberRoleShowDao.java

@ -0,0 +1,9 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.persist.mapper.ProMemberRoleShowMapper;
/**
* @author
*/
public interface ProMemberRoleShowDao extends ProMemberRoleShowMapper {
}

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

@ -3,6 +3,7 @@ package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.ProjectDto;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.util.bean.dto.QueryDto;
import java.util.List;
@ -56,4 +57,11 @@ public interface IProjectService {
* @return 返回项目信息
*/
ProjectVo.ProjectInfo createProject(Long currentUserId,ProjectDto.CreateProject createProject,String token);
/**
* 项目转模板
* @param param 项目id
* @param userId 当前用户id
*/
void projectToTemplate(ProjectDto.ProjectToTemplate param, Long userId);
}

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

@ -1503,9 +1503,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
taskDetail.setName(updateTaskInfo.getName());
}
//详情
if (StrUtil.isNotEmpty(updateTaskInfo.getDescription())) {
taskDetail.setDescription(updateTaskInfo.getDescription());
}
taskDetail.setDescription(updateTaskInfo.getDescription());
//负责人
if (ObjectUtil.isNotNull(updateTaskInfo.getExecutorRole())) {
taskDetail.setExecutorRole(updateTaskInfo.getExecutorRole());
@ -1531,7 +1530,15 @@ public class ProTaskDetailService implements IProTaskDetailService {
if (ObjectUtil.isNotNull(updateTaskInfo.getMilestone())) {
taskDetail.setMilestone(updateTaskInfo.getMilestone());
}
if (ObjectUtil.isNotNull(updateTaskInfo.getLastTaskDetailId())){
taskDetail.setLastTaskDetailId(updateTaskInfo.getLastTaskDetailId());
}
if(ObjectUtil.isNotNull(updateTaskInfo.getLastType())){
taskDetail.setLastType(updateTaskInfo.getLastType());
}
if (ObjectUtil.isNotNull(updateTaskInfo.getTimeDifference())){
taskDetail.setTimeDifference(updateTaskInfo.getTimeDifference());
}
// //父任务id
// if(null != updateTaskInfo.getParentId()){

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

@ -12,6 +12,7 @@ import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.LabelVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.tall.persist.mapper.ProMemberRoleMapper;
import com.ccsens.tall.persist.mapper.SysImitationMapper;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.DateUtil;
@ -47,6 +48,8 @@ public class ProjectService implements IProjectService {
@Resource
private ProMemberRoleDao memberRoleDao;
@Resource
private ProMemberRoleShowDao memberRoleShowDao;
@Resource
private TaskDetailDao taskDetailDao;
@Resource
private TaskSubTimeDao taskSubTimeDao;
@ -1248,4 +1251,66 @@ public class ProjectService implements IProjectService {
}
return getProjectInfoById(currentUserId,sysProject.getId(),token);
}
/**
* 项目转模板
* @param param 项目id
* @param userId 当前用户id
*/
@Override
public void projectToTemplate(ProjectDto.ProjectToTemplate param, Long userId) {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(userId, param.getProjectId());
if (WebConstant.ROLE_POWER.OPERATION_POWER.value < power){
SysProject sysProject = sysProjectDao.selectByPrimaryKey(param.getProjectId());
//将项目改为模板项目
sysProject.setTemplate((byte)1);
sysProjectDao.insertSelective(sysProject);
//查找成员相关-删除
//1.查找项目下成员
ProMemberExample proMemberExample = new ProMemberExample();
proMemberExample.createCriteria().andProjectIdEqualTo(param.getProjectId());
List<ProMember> proMembers = proMemberDao.selectByExample(proMemberExample);
for (ProMember proMember : proMembers) {
proMember.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
proMemberDao.updateByPrimaryKeySelective(proMember);
//2.删除成角色下的成员
ProMemberRoleExample proMemberRoleExample = new ProMemberRoleExample();
proMemberRoleExample.createCriteria().andMemberIdEqualTo(proMember.getId());
List<ProMemberRole> proMemberRoles = memberRoleDao.selectByExample(proMemberRoleExample);
proMemberRoles.forEach(proMemberRole -> {
proMemberRole.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
memberRoleDao.updateByPrimaryKeySelective(proMemberRole);
});
//3.删除成员角色展示表中的相关数据
ProMemberRoleShowExample proMemberRoleShowExample = new ProMemberRoleShowExample();
proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(proMember.getId());
List<ProMemberRoleShow> proMemberRoleShows = memberRoleShowDao.selectByExample(proMemberRoleShowExample);
for (ProMemberRoleShow proMemberRoleShow : proMemberRoleShows) {
proMemberRoleShow.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
memberRoleShowDao.updateByPrimaryKeySelective(proMemberRoleShow);
}
}
//4.查找关注者相关删除
UserAttentionExample userAttentionExample = new UserAttentionExample();
userAttentionExample.createCriteria().andProjectIdEqualTo(param.getProjectId());
List<UserAttention> userAttentions = userAttentionDao.selectByExample(userAttentionExample);
if (CollectionUtil.isNotEmpty(userAttentions)){
userAttentions.forEach(userAttention -> {
userAttention.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
userAttentionDao.updateByPrimaryKeySelective(userAttention);
});
}
}else{
throw new BaseException(CodeEnum.NOT_POWER);
}
}
}

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

@ -364,6 +364,9 @@ public class TaskSubTimeService implements ITaskSubTimeService {
detail.setExecutorRole(addTask.getExecutorId());
detail.setMilestone(addTask.getMilestone());
detail.setBuildUser(currentUserId);
detail.setLastTaskDetailId(addTask.getLastTaskDetailId());
detail.setLastType(addTask.getLastType());
detail.setTimeDifference(addTask.getTimeDifference());
//添加任务优先级
if(ObjectUtil.isNotNull(addTask.getPriority())){
detail.setPriority(addTask.getPriority());

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

@ -11,11 +11,9 @@ import com.ccsens.tall.service.IProjectService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.bean.dto.QueryDto;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -323,4 +321,14 @@ public class ProjectController {
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "将项目转化为模板", notes = "")
@RequestMapping(value = "/projectToTemplate", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse projectToTemplate(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.ProjectToTemplate> params) throws Exception {
log.info("将项目转化为模板:{}",params);
projectService.projectToTemplate(params.getParam(),params.getUserId());
log.info("项目转模板");
return JsonResponse.newInstance().ok();
}
}

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

@ -31,6 +31,9 @@
<result column="priority" jdbcType="TINYINT" property="priority" />
<result column="milestone" jdbcType="VARCHAR" property="milestone" />
<result column="build_user" jdbcType="BIGINT" property="buildUser" />
<result column="last_task_detail_id" jdbcType="BIGINT" property="lastTaskDetailId" />
<result column="last_type" jdbcType="TINYINT" property="lastType" />
<result column="time_difference" jdbcType="BIGINT" property="timeDifference" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -94,7 +97,8 @@
id, project_id, name, description, begin_time, end_time, cycle, parent_id, sub_task,
sub_project_id, sub_project, executor_role, checker_role, money, delay, delay_time,
loop_to, loop_times, virtual, level, has_group, finish_need_all, all_member, created_at,
updated_at, rec_status, priority, milestone, build_user
updated_at, rec_status, priority, milestone, build_user, last_task_detail_id, last_type,
time_difference
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProTaskDetailExample" resultMap="BaseResultMap">
select
@ -136,7 +140,8 @@
virtual, level, has_group,
finish_need_all, all_member, created_at,
updated_at, rec_status, priority,
milestone, build_user)
milestone, build_user, last_task_detail_id,
last_type, time_difference)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{beginTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
#{cycle,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, #{subTask,jdbcType=VARCHAR},
@ -146,7 +151,8 @@
#{virtual,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{hasGroup,jdbcType=TINYINT},
#{finishNeedAll,jdbcType=TINYINT}, #{allMember,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{priority,jdbcType=TINYINT},
#{milestone,jdbcType=VARCHAR}, #{buildUser,jdbcType=BIGINT})
#{milestone,jdbcType=VARCHAR}, #{buildUser,jdbcType=BIGINT}, #{lastTaskDetailId,jdbcType=BIGINT},
#{lastType,jdbcType=TINYINT}, #{timeDifference,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProTaskDetail">
insert into t_pro_task_detail
@ -238,6 +244,15 @@
<if test="buildUser != null">
build_user,
</if>
<if test="lastTaskDetailId != null">
last_task_detail_id,
</if>
<if test="lastType != null">
last_type,
</if>
<if test="timeDifference != null">
time_difference,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -327,6 +342,15 @@
<if test="buildUser != null">
#{buildUser,jdbcType=BIGINT},
</if>
<if test="lastTaskDetailId != null">
#{lastTaskDetailId,jdbcType=BIGINT},
</if>
<if test="lastType != null">
#{lastType,jdbcType=TINYINT},
</if>
<if test="timeDifference != null">
#{timeDifference,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProTaskDetailExample" resultType="java.lang.Long">
@ -425,6 +449,15 @@
<if test="record.buildUser != null">
build_user = #{record.buildUser,jdbcType=BIGINT},
</if>
<if test="record.lastTaskDetailId != null">
last_task_detail_id = #{record.lastTaskDetailId,jdbcType=BIGINT},
</if>
<if test="record.lastType != null">
last_type = #{record.lastType,jdbcType=TINYINT},
</if>
<if test="record.timeDifference != null">
time_difference = #{record.timeDifference,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -460,7 +493,10 @@
rec_status = #{record.recStatus,jdbcType=TINYINT},
priority = #{record.priority,jdbcType=TINYINT},
milestone = #{record.milestone,jdbcType=VARCHAR},
build_user = #{record.buildUser,jdbcType=BIGINT}
build_user = #{record.buildUser,jdbcType=BIGINT},
last_task_detail_id = #{record.lastTaskDetailId,jdbcType=BIGINT},
last_type = #{record.lastType,jdbcType=TINYINT},
time_difference = #{record.timeDifference,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -552,6 +588,15 @@
<if test="buildUser != null">
build_user = #{buildUser,jdbcType=BIGINT},
</if>
<if test="lastTaskDetailId != null">
last_task_detail_id = #{lastTaskDetailId,jdbcType=BIGINT},
</if>
<if test="lastType != null">
last_type = #{lastType,jdbcType=TINYINT},
</if>
<if test="timeDifference != null">
time_difference = #{timeDifference,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -584,7 +629,10 @@
rec_status = #{recStatus,jdbcType=TINYINT},
priority = #{priority,jdbcType=TINYINT},
milestone = #{milestone,jdbcType=VARCHAR},
build_user = #{buildUser,jdbcType=BIGINT}
build_user = #{buildUser,jdbcType=BIGINT},
last_task_detail_id = #{lastTaskDetailId,jdbcType=BIGINT},
last_type = #{lastType,jdbcType=TINYINT},
time_difference = #{timeDifference,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
Loading…
Cancel
Save