17 changed files with 966 additions and 60 deletions
@ -0,0 +1,131 @@ |
|||
package com.ccsens.cloudutil.bean.tall.dto; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.ccsens.util.exception.BaseException; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import lombok.NonNull; |
|||
|
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@ApiModel |
|||
public class TallTaskDto { |
|||
|
|||
@ApiModel |
|||
@Data |
|||
public static class AddTask { |
|||
@ApiModelProperty("关联项目Id") |
|||
private Long projectId; |
|||
@ApiModelProperty("关联的任务id(detailId)") |
|||
private Long parentTaskId; |
|||
@ApiModelProperty("任务名称") |
|||
@NotEmpty(message = "任务名不能为空") |
|||
private String taskName; |
|||
@ApiModelProperty("任务描述") |
|||
private String description; |
|||
@ApiModelProperty("负责人id") |
|||
@NotNull(message = "请选择负责人") |
|||
private Long executorId; |
|||
@ApiModelProperty("开始时间") |
|||
private Long beginTime; |
|||
@ApiModelProperty("结束时间") |
|||
private Long endTime; |
|||
@ApiModelProperty("重复周期") |
|||
private String cycle; |
|||
@ApiModelProperty("交付物") |
|||
private String taskDeliver; |
|||
@ApiModelProperty("插件") |
|||
private List<Long> pluginList; |
|||
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0") |
|||
private Byte priority; |
|||
@ApiModelProperty("任务提醒消息") |
|||
private TaskRemindByAdd taskRemind; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("添加时设置任务提醒") |
|||
public static class TaskRemindByAdd{ |
|||
@ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间") |
|||
private Byte remindTiming; |
|||
@ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空") |
|||
private Long duration = 0L; |
|||
@ApiModelProperty("时间单位 0分钟 1小时 2天") |
|||
private Byte unit; |
|||
|
|||
public Long getDuration(){ |
|||
if(ObjectUtil.isNull(unit)) { |
|||
throw new BaseException("时间单位不能为空"); |
|||
} |
|||
if(remindTiming == 7){ |
|||
return duration; |
|||
} |
|||
switch (unit) { |
|||
case 0: |
|||
return duration * 60 * 1000L; |
|||
case 1: |
|||
return duration * 60 * 60 * 1000L; |
|||
case 2: |
|||
return duration * 24 * 60 * 60 * 1000L; |
|||
default: |
|||
return duration; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("修改任务详细信息") |
|||
public static class UpdateTaskInfo{ |
|||
@ApiModelProperty("任务id") |
|||
private Long id; |
|||
@ApiModelProperty("任务名") |
|||
private String name; |
|||
@ApiModelProperty("任务详情") |
|||
private String description; |
|||
@ApiModelProperty("负责人") |
|||
private Long executorRole; |
|||
@ApiModelProperty("任务开始时间") |
|||
private Long beginTime; |
|||
@ApiModelProperty("任务结束时间") |
|||
private Long endTime; |
|||
@ApiModelProperty("重复频率") |
|||
private String cycle; |
|||
@ApiModelProperty("任务奖惩") |
|||
private Long money; |
|||
@ApiModelProperty("任务切换模式,0时间到立刻切换 1延迟delay_time切换 2手动切换") |
|||
private int delay; |
|||
@ApiModelProperty("延迟切换时间") |
|||
private Long delayTime; |
|||
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0") |
|||
private Byte priority; |
|||
@ApiModelProperty("是否是里程碑 0否 1是") |
|||
private Byte milestone; |
|||
@ApiModelProperty("需要修改的插件Id") |
|||
private List<Long> plugins; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("修改插件配置") |
|||
public static class UpdatePluginConfig { |
|||
@NonNull |
|||
@ApiModelProperty("任务id") |
|||
private Long taskId; |
|||
@ApiModelProperty("任务插件id") |
|||
private Long taskPluginId; |
|||
@ApiModelProperty("页面接口路径") |
|||
private String webPath; |
|||
@ApiModelProperty("入参") |
|||
private String importParam; |
|||
@ApiModelProperty("放置位置 默认0 ,0任务名 1详情页 2任务下") |
|||
private Byte placeLocation; |
|||
@ApiModelProperty("程序位置 0:tall内部,1外部") |
|||
private Byte routineLocation; |
|||
|
|||
public UpdatePluginConfig() { |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.ccsens.mt.persist.dao; |
|||
|
|||
import com.ccsens.mt.bean.vo.ProvinceCompeteVo; |
|||
import com.ccsens.mt.persist.mapper.CompeteJudgmentMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface CompeteJudgmentDao extends CompeteJudgmentMapper { |
|||
/** |
|||
* 查找裁判分配信息 |
|||
* @param competeTimeId 大赛id |
|||
* @return |
|||
*/ |
|||
List<ProvinceCompeteVo.QueryJudgment> queryJudgment(@Param("competeTimeId") Long competeTimeId); |
|||
} |
@ -0,0 +1,44 @@ |
|||
<?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.mt.persist.dao.CompeteJudgmentDao"> |
|||
|
|||
<resultMap id="queryJudgment" type="com.ccsens.mt.bean.vo.ProvinceCompeteVo$QueryJudgment"> |
|||
<id column="projectId" property="projectId"/> |
|||
<result column="projectName" property="projectName"/> |
|||
<result column="startTime" property="startTime"/> |
|||
<result column="endTime" property="endTime"/> |
|||
<collection property="siteList" ofType="com.ccsens.mt.bean.vo.ProvinceCompeteVo$ProjectSite"> |
|||
<id column="siteNum" property="siteNum"/> |
|||
<collection property="judgmentList" ofType="com.ccsens.mt.bean.vo.ProvinceCompeteVo$SiteJudgment"> |
|||
<id column="judgmentNum" property="judgmentNum"/> |
|||
<result column="judgmentName" property="judgmentName"/> |
|||
<result column="judgmentPhone" property="judgmentPhone"/> |
|||
<result column="remark" property="remark"/> |
|||
</collection> |
|||
</collection> |
|||
</resultMap> |
|||
|
|||
<select id="queryJudgment" resultMap="queryJudgment"> |
|||
SELECT |
|||
p.id as projectId, |
|||
p.`name` as projectName, |
|||
pc.start_time as startTime, |
|||
pc.end_time as endTime, |
|||
j.site as siteNum, |
|||
j.chief_judgment as judgmentNum, |
|||
j.`name` as judgmentName, |
|||
j.phone as judgmentPhone, |
|||
j.remark as remark |
|||
FROM |
|||
t_compete_project p LEFT JOIN t_compete_time ct on p.type = ct.type |
|||
LEFT JOIN t_compete_project_config pc on p.id = pc.project_id |
|||
LEFT JOIN t_compete_judgment j on j.project_id = p.id |
|||
WHERE |
|||
ct.id = #{competeTimeId} |
|||
and p.`level` = 2 |
|||
and p.rec_status = 0 |
|||
and (j.rec_status = 0 or j.rec_status is null) |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue