From 7c712afcc15fc0351696af0cf59329913ec5be6d Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Tue, 22 Sep 2020 18:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E8=B5=9B=E6=B7=BB=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=A7=86=E9=A2=91=E6=8E=A5=E5=8F=A3=E2=80=94=E2=80=94?= =?UTF-8?q?1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/mt/api/CompeteController.java | 18 + .../com/ccsens/mt/api/VideoController.java | 56 ++ .../com/ccsens/mt/bean/dto/CompeteDto.java | 11 + .../java/com/ccsens/mt/bean/dto/VideoDto.java | 40 + .../com/ccsens/mt/bean/po/CompeteVideo.java | 150 +++ .../mt/bean/po/CompeteVideoExample.java | 941 ++++++++++++++++++ .../java/com/ccsens/mt/bean/vo/CompeteVo.java | 58 +- .../java/com/ccsens/mt/bean/vo/VideoVo.java | 24 + .../ccsens/mt/persist/dao/CompeteTeamDao.java | 13 + .../mt/persist/mapper/CompeteVideoMapper.java | 30 + .../com/ccsens/mt/service/CompeteService.java | 21 + .../ccsens/mt/service/ICompeteService.java | 7 + .../com/ccsens/mt/service/IVideoService.java | 26 + .../com/ccsens/mt/service/VideoService.java | 87 ++ .../resources/mapper_dao/CompeteTeamDao.xml | 51 + .../mapper_raw/CompeteVideoMapper.xml | 323 ++++++ pom.xml | 3 +- .../com/ccsens/tall/bean/dto/TaskDto.java | 5 +- .../com/ccsens/tall/bean/vo/ProjectVo.java | 2 + .../ccsens/tall/service/ProRoleService.java | 3 + .../tall/service/ProTaskDetailService.java | 16 +- .../com/ccsens/tall/service/UserService.java | 147 ++- tall/src/main/resources/application.yml | 4 +- .../main/resources/mapper_dao/ProRoleDao.xml | 2 +- 24 files changed, 1930 insertions(+), 108 deletions(-) create mode 100644 mt/src/main/java/com/ccsens/mt/api/VideoController.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/vo/VideoVo.java create mode 100644 mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteVideoMapper.java create mode 100644 mt/src/main/java/com/ccsens/mt/service/IVideoService.java create mode 100644 mt/src/main/java/com/ccsens/mt/service/VideoService.java create mode 100644 mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteController.java index 06c55498..b26d25eb 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteController.java @@ -131,4 +131,22 @@ public class CompeteController { CompeteVo.CompeteTeamProject competeTeamProject = competeService.joinCompeteGroup(params); return JsonResponse.newInstance().ok(competeTeamProject); } + + @MustLogin + @ApiOperation(value = "查询比赛项目上的参赛选手列表", notes = "") + @RequestMapping(value = "/get/players", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse queryPlayerList(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("查询比赛项目上的参赛选手列表:{}",params); + CompeteVo.QueryPlayerList playerList = competeService.queryPlayerList(params); + return JsonResponse.newInstance().ok(playerList); + } + +// @MustLogin +// @ApiOperation(value = "查询比赛项目上的参赛选手列表", notes = "") +// @RequestMapping(value = "/get/players", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) +// public JsonResponse getPlayerList(@ApiParam @Validated @RequestBody QueryDto params) { +// log.info("扫码加入团队:{}",params); +// CompeteVo.QueryPlayerList playerList = competeService.queryPlayerList(params); +// return JsonResponse.newInstance().ok(playerList); +// } } diff --git a/mt/src/main/java/com/ccsens/mt/api/VideoController.java b/mt/src/main/java/com/ccsens/mt/api/VideoController.java new file mode 100644 index 00000000..f670643e --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/api/VideoController.java @@ -0,0 +1,56 @@ +package com.ccsens.mt.api; + +import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.mt.bean.dto.TopicDto; +import com.ccsens.mt.bean.dto.VideoDto; +import com.ccsens.mt.bean.vo.VideoVo; +import com.ccsens.mt.service.IVideoService; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.bean.dto.QueryDto; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author 逗 + */ +@Slf4j +@Api(tags = "报表相关api") +@RestController +@RequestMapping("/video") +public class VideoController { + @Resource + private IVideoService videoService; + + @MustLogin + @ApiOperation(value = "查看选手上传的视频信息", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/get", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse> getVideoByPlayerId(@RequestBody @ApiParam @Validated QueryDto params) { + log.info("查看选手上传的视频信息:{}",params.toString()); + List getVideoInfoList = videoService.getVideoByPlayerId(params); + return JsonResponse.newInstance().ok(getVideoInfoList); + } + + @MustLogin + @ApiOperation(value = "上传的视频信息", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/get", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse> uploadVideo(@RequestBody @ApiParam @Validated QueryDto params) { + log.info("查看选手上传的视频信息:{}",params.toString()); + List getVideoInfoList = videoService.uploadVideo(params); + return JsonResponse.newInstance().ok(getVideoInfoList); + } +} diff --git a/mt/src/main/java/com/ccsens/mt/bean/dto/CompeteDto.java b/mt/src/main/java/com/ccsens/mt/bean/dto/CompeteDto.java index 1424d088..2412af6c 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/dto/CompeteDto.java +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/CompeteDto.java @@ -28,6 +28,17 @@ public class CompeteDto { @ApiModelProperty("第几届信息的id") private Long competeTimeId; } + + @Data + @ApiModel("查询项目下的选手列表") + public static class CompeteProjectId{ + @NotNull + @ApiModelProperty("第几届信息的id") + private Long competeTimeId; + @NotNull + @ApiModelProperty("比赛项目id(二级的)") + private Long competeProjectId; + } @Data @ApiModel public static class CompeteProjectPlayer{ diff --git a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java new file mode 100644 index 00000000..cd498b32 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java @@ -0,0 +1,40 @@ +package com.ccsens.mt.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * @author 逗 + */ +@Data +public class VideoDto { + @Data + @ApiModel("查看上传视频的信息") + public static class GetVideo{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + @ApiModelProperty("查询的是单人还是团队 0个人 1团队") + private byte team = 0; + @ApiModelProperty("如果查询的是单人则是选手id。查询团队则传入团队id") + private Long playerId; + } + + @Data + @ApiModel("上传视频信息") + public static class UploadVideo{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + @ApiModelProperty("上传的是单人还是团队 0个人 1团队") + private byte team = 0; + @ApiModelProperty("如果上传的是单人则是选手id。上传团队则传入团队id") + private Long playerId; + @ApiModelProperty("视频文件id") + private Long videoFileId; + } +} diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java new file mode 100644 index 00000000..3996360b --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java @@ -0,0 +1,150 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class CompeteVideo implements Serializable { + private Long id; + + private Long competeTimeId; + + private String competeCode; + + private Byte team; + + private Long playerId; + + private Long fileId; + + private String videoUrl; + + private Long time; + + private Long uploadUserId; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompeteTimeId() { + return competeTimeId; + } + + public void setCompeteTimeId(Long competeTimeId) { + this.competeTimeId = competeTimeId; + } + + public String getCompeteCode() { + return competeCode; + } + + public void setCompeteCode(String competeCode) { + this.competeCode = competeCode == null ? null : competeCode.trim(); + } + + public Byte getTeam() { + return team; + } + + public void setTeam(Byte team) { + this.team = team; + } + + public Long getPlayerId() { + return playerId; + } + + public void setPlayerId(Long playerId) { + this.playerId = playerId; + } + + public Long getFileId() { + return fileId; + } + + public void setFileId(Long fileId) { + this.fileId = fileId; + } + + public String getVideoUrl() { + return videoUrl; + } + + public void setVideoUrl(String videoUrl) { + this.videoUrl = videoUrl == null ? null : videoUrl.trim(); + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } + + public Long getUploadUserId() { + return uploadUserId; + } + + public void setUploadUserId(Long uploadUserId) { + this.uploadUserId = uploadUserId; + } + + 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(", competeTimeId=").append(competeTimeId); + sb.append(", competeCode=").append(competeCode); + sb.append(", team=").append(team); + sb.append(", playerId=").append(playerId); + sb.append(", fileId=").append(fileId); + sb.append(", videoUrl=").append(videoUrl); + sb.append(", time=").append(time); + sb.append(", uploadUserId=").append(uploadUserId); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java new file mode 100644 index 00000000..71b1ac9a --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java @@ -0,0 +1,941 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CompeteVideoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public CompeteVideoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNull() { + addCriterion("compete_time_id is null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNotNull() { + addCriterion("compete_time_id is not null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdEqualTo(Long value) { + addCriterion("compete_time_id =", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotEqualTo(Long value) { + addCriterion("compete_time_id <>", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThan(Long value) { + addCriterion("compete_time_id >", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThanOrEqualTo(Long value) { + addCriterion("compete_time_id >=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThan(Long value) { + addCriterion("compete_time_id <", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThanOrEqualTo(Long value) { + addCriterion("compete_time_id <=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIn(List values) { + addCriterion("compete_time_id in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotIn(List values) { + addCriterion("compete_time_id not in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdBetween(Long value1, Long value2) { + addCriterion("compete_time_id between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotBetween(Long value1, Long value2) { + addCriterion("compete_time_id not between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIsNull() { + addCriterion("compete_code is null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIsNotNull() { + addCriterion("compete_code is not null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeEqualTo(String value) { + addCriterion("compete_code =", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotEqualTo(String value) { + addCriterion("compete_code <>", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeGreaterThan(String value) { + addCriterion("compete_code >", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeGreaterThanOrEqualTo(String value) { + addCriterion("compete_code >=", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLessThan(String value) { + addCriterion("compete_code <", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLessThanOrEqualTo(String value) { + addCriterion("compete_code <=", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLike(String value) { + addCriterion("compete_code like", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotLike(String value) { + addCriterion("compete_code not like", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIn(List values) { + addCriterion("compete_code in", values, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotIn(List values) { + addCriterion("compete_code not in", values, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeBetween(String value1, String value2) { + addCriterion("compete_code between", value1, value2, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotBetween(String value1, String value2) { + addCriterion("compete_code not between", value1, value2, "competeCode"); + return (Criteria) this; + } + + public Criteria andTeamIsNull() { + addCriterion("team is null"); + return (Criteria) this; + } + + public Criteria andTeamIsNotNull() { + addCriterion("team is not null"); + return (Criteria) this; + } + + public Criteria andTeamEqualTo(Byte value) { + addCriterion("team =", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotEqualTo(Byte value) { + addCriterion("team <>", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThan(Byte value) { + addCriterion("team >", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamGreaterThanOrEqualTo(Byte value) { + addCriterion("team >=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThan(Byte value) { + addCriterion("team <", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamLessThanOrEqualTo(Byte value) { + addCriterion("team <=", value, "team"); + return (Criteria) this; + } + + public Criteria andTeamIn(List values) { + addCriterion("team in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotIn(List values) { + addCriterion("team not in", values, "team"); + return (Criteria) this; + } + + public Criteria andTeamBetween(Byte value1, Byte value2) { + addCriterion("team between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andTeamNotBetween(Byte value1, Byte value2) { + addCriterion("team not between", value1, value2, "team"); + return (Criteria) this; + } + + public Criteria andPlayerIdIsNull() { + addCriterion("player_id is null"); + return (Criteria) this; + } + + public Criteria andPlayerIdIsNotNull() { + addCriterion("player_id is not null"); + return (Criteria) this; + } + + public Criteria andPlayerIdEqualTo(Long value) { + addCriterion("player_id =", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotEqualTo(Long value) { + addCriterion("player_id <>", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdGreaterThan(Long value) { + addCriterion("player_id >", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdGreaterThanOrEqualTo(Long value) { + addCriterion("player_id >=", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdLessThan(Long value) { + addCriterion("player_id <", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdLessThanOrEqualTo(Long value) { + addCriterion("player_id <=", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdIn(List values) { + addCriterion("player_id in", values, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotIn(List values) { + addCriterion("player_id not in", values, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdBetween(Long value1, Long value2) { + addCriterion("player_id between", value1, value2, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotBetween(Long value1, Long value2) { + addCriterion("player_id not between", value1, value2, "playerId"); + return (Criteria) this; + } + + public Criteria andFileIdIsNull() { + addCriterion("file_id is null"); + return (Criteria) this; + } + + public Criteria andFileIdIsNotNull() { + addCriterion("file_id is not null"); + return (Criteria) this; + } + + public Criteria andFileIdEqualTo(Long value) { + addCriterion("file_id =", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdNotEqualTo(Long value) { + addCriterion("file_id <>", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdGreaterThan(Long value) { + addCriterion("file_id >", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdGreaterThanOrEqualTo(Long value) { + addCriterion("file_id >=", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdLessThan(Long value) { + addCriterion("file_id <", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdLessThanOrEqualTo(Long value) { + addCriterion("file_id <=", value, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdIn(List values) { + addCriterion("file_id in", values, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdNotIn(List values) { + addCriterion("file_id not in", values, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdBetween(Long value1, Long value2) { + addCriterion("file_id between", value1, value2, "fileId"); + return (Criteria) this; + } + + public Criteria andFileIdNotBetween(Long value1, Long value2) { + addCriterion("file_id not between", value1, value2, "fileId"); + return (Criteria) this; + } + + public Criteria andVideoUrlIsNull() { + addCriterion("video_url is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlIsNotNull() { + addCriterion("video_url is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlEqualTo(String value) { + addCriterion("video_url =", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlNotEqualTo(String value) { + addCriterion("video_url <>", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlGreaterThan(String value) { + addCriterion("video_url >", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlGreaterThanOrEqualTo(String value) { + addCriterion("video_url >=", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlLessThan(String value) { + addCriterion("video_url <", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlLessThanOrEqualTo(String value) { + addCriterion("video_url <=", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlLike(String value) { + addCriterion("video_url like", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlNotLike(String value) { + addCriterion("video_url not like", value, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlIn(List values) { + addCriterion("video_url in", values, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlNotIn(List values) { + addCriterion("video_url not in", values, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlBetween(String value1, String value2) { + addCriterion("video_url between", value1, value2, "videoUrl"); + return (Criteria) this; + } + + public Criteria andVideoUrlNotBetween(String value1, String value2) { + addCriterion("video_url not between", value1, value2, "videoUrl"); + return (Criteria) this; + } + + public Criteria andTimeIsNull() { + addCriterion("time is null"); + return (Criteria) this; + } + + public Criteria andTimeIsNotNull() { + addCriterion("time is not null"); + return (Criteria) this; + } + + public Criteria andTimeEqualTo(Long value) { + addCriterion("time =", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotEqualTo(Long value) { + addCriterion("time <>", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeGreaterThan(Long value) { + addCriterion("time >", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeGreaterThanOrEqualTo(Long value) { + addCriterion("time >=", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeLessThan(Long value) { + addCriterion("time <", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeLessThanOrEqualTo(Long value) { + addCriterion("time <=", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeIn(List values) { + addCriterion("time in", values, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotIn(List values) { + addCriterion("time not in", values, "time"); + return (Criteria) this; + } + + public Criteria andTimeBetween(Long value1, Long value2) { + addCriterion("time between", value1, value2, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotBetween(Long value1, Long value2) { + addCriterion("time not between", value1, value2, "time"); + return (Criteria) this; + } + + public Criteria andUploadUserIdIsNull() { + addCriterion("upload_user_id is null"); + return (Criteria) this; + } + + public Criteria andUploadUserIdIsNotNull() { + addCriterion("upload_user_id is not null"); + return (Criteria) this; + } + + public Criteria andUploadUserIdEqualTo(Long value) { + addCriterion("upload_user_id =", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdNotEqualTo(Long value) { + addCriterion("upload_user_id <>", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdGreaterThan(Long value) { + addCriterion("upload_user_id >", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("upload_user_id >=", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdLessThan(Long value) { + addCriterion("upload_user_id <", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdLessThanOrEqualTo(Long value) { + addCriterion("upload_user_id <=", value, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdIn(List values) { + addCriterion("upload_user_id in", values, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdNotIn(List values) { + addCriterion("upload_user_id not in", values, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdBetween(Long value1, Long value2) { + addCriterion("upload_user_id between", value1, value2, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andUploadUserIdNotBetween(Long value1, Long value2) { + addCriterion("upload_user_id not between", value1, value2, "uploadUserId"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java index f30e8bf4..810cfac3 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java @@ -142,18 +142,7 @@ public class CompeteVo { private String qrCode; @ApiModelProperty("团队内的成员") private List members; -// -// public CompeteTeamProject(Long teamId, byte type, String parentProjectName, String secondProjectName, byte certificate, byte creator, int memberMin, int memberMax, String qrCode) { -// this.teamId = teamId; -// this.type = type; -// this.parentProjectName = parentProjectName; -// this.secondProjectName = secondProjectName; -// this.certificate = certificate; -// this.creator = creator; -// this.memberMin = memberMin; -// this.memberMax = memberMax; -// this.qrCode = qrCode; -// } + public CompeteTeamProject() { } @@ -307,4 +296,49 @@ public class CompeteVo { private String mixedName; } + @Data + @ApiModel("查询项目下的选手列表") + public static class QueryPlayerList{ + @ApiModelProperty("个人信息") + private List playerList; + @ApiModelProperty("团队信息") + private List teamList; + } + + @Data + @ApiModel("比赛项目下的个人信息") + public static class PlayerInfoByProject{ + @ApiModelProperty("id") + private Long playerId; + @ApiModelProperty("姓名") + private String name; + @ApiModelProperty("性别 0女 1男") + private int gender; + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("参加的组别的id") + private Long groupId; + @ApiModelProperty("参加的组别的名字") + private String groupName; + @ApiModelProperty("参赛单位的名字") + private String companyName; + @ApiModelProperty("是否通级 0否 1是") + private byte certificate; + } + @Data + @ApiModel("比赛项目下的个人信息") + public static class TeamInfoByProject{ + @ApiModelProperty("团队表Id") + private Long teamId; + @ApiModelProperty("创建者id") + private Long creatorId; + @ApiModelProperty("创建者姓名") + private String creatorName; + @ApiModelProperty("是否通级 0否 1是") + private byte certificate; + @ApiModelProperty("当前人数") + private int memberNums; + @ApiModelProperty("团队内的成员") + private List members; + } } diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/VideoVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoVo.java new file mode 100644 index 00000000..ff0ae772 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoVo.java @@ -0,0 +1,24 @@ +package com.ccsens.mt.bean.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author 逗 + */ +@Data +public class VideoVo { + @Data + @ApiModel("查看选手上传的视频的信息") + public static class GetVideoInfo{ + @ApiModelProperty("选手上传视频记录id") + private Long videoId; + @ApiModelProperty("文件id") + private Long fileId; +// @ApiModelProperty("视频地址") +// private String videoUrl; + @ApiModelProperty("上传时间") + private Long uploadTime; + } +} diff --git a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteTeamDao.java b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteTeamDao.java index d86f85d1..4351f731 100644 --- a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteTeamDao.java +++ b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteTeamDao.java @@ -67,4 +67,17 @@ public interface CompeteTeamDao extends CompeteTeamMapper { * @return */ long countTiwnTeam(@Param("playerId") Long playerId, @Param("competeTimeId") Long competeTimeId); + + /** + * 通过比赛项目id查找项目下的团队信息 + * @param competeProjectId + * @return + */ + List getTeamByProjectId(@Param("competeProjectId")Long competeProjectId,@Param("competeTimeId")Long competeTimeId); + /** + * 通过比赛项目id查找项目下的选手id + * @param competeProjectId + * @return + */ + List getPlayerByProjectId(@Param("competeProjectId")Long competeProjectId, @Param("competeTimeId")Long competeTimeId); } diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteVideoMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteVideoMapper.java new file mode 100644 index 00000000..c76461e3 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteVideoMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.CompeteVideo; +import com.ccsens.mt.bean.po.CompeteVideoExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface CompeteVideoMapper { + long countByExample(CompeteVideoExample example); + + int deleteByExample(CompeteVideoExample example); + + int deleteByPrimaryKey(Long id); + + int insert(CompeteVideo record); + + int insertSelective(CompeteVideo record); + + List selectByExample(CompeteVideoExample example); + + CompeteVideo selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") CompeteVideo record, @Param("example") CompeteVideoExample example); + + int updateByExample(@Param("record") CompeteVideo record, @Param("example") CompeteVideoExample example); + + int updateByPrimaryKeySelective(CompeteVideo record); + + int updateByPrimaryKey(CompeteVideo record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java index 2561ae62..3737ecdc 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -401,4 +401,25 @@ public class CompeteService implements ICompeteService{ throw new BaseException(CodeEnum.JOINED_SAME); } } + + @Override + public CompeteVo.QueryPlayerList queryPlayerList(QueryDto params) { + CompeteDto.CompeteProjectId competeTimeAndType = params.getParam(); + CompeteVo.QueryPlayerList queryPlayerList = new CompeteVo.QueryPlayerList(); + //查找项目信息 + CompeteProject competeProject = competeProjectMapper.selectByPrimaryKey(competeTimeAndType.getCompeteProjectId()); + if(ObjectUtil.isNull(competeProject)){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } + if(competeProject.getTeam() == 0){ + List playerInfoByProjectList = + competeTeamDao.getPlayerByProjectId(competeTimeAndType.getCompeteProjectId(),competeTimeAndType.getCompeteTimeId()); + queryPlayerList.setPlayerList(playerInfoByProjectList); + }else { + List teamInfoByProjectList = + competeTeamDao.getTeamByProjectId(competeTimeAndType.getCompeteProjectId(),competeTimeAndType.getCompeteTimeId()); + queryPlayerList.setTeamList(teamInfoByProjectList); + } + return queryPlayerList; + } } diff --git a/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java b/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java index 0646b98a..017d6cdb 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ICompeteService.java @@ -86,4 +86,11 @@ public interface ICompeteService { * @return */ CompeteVo.CompeteTeamProject joinCompeteGroup(QueryDto params); + + /** + * 查询比赛项目下的参赛人员列表 + * @param params 大赛id和比赛项目id + * @return 返回参赛人员或团队的列表 + */ + CompeteVo.QueryPlayerList queryPlayerList(QueryDto params); } diff --git a/mt/src/main/java/com/ccsens/mt/service/IVideoService.java b/mt/src/main/java/com/ccsens/mt/service/IVideoService.java new file mode 100644 index 00000000..dfd61d38 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/service/IVideoService.java @@ -0,0 +1,26 @@ +package com.ccsens.mt.service; + +import com.ccsens.mt.bean.dto.VideoDto; +import com.ccsens.mt.bean.vo.VideoVo; +import com.ccsens.util.bean.dto.QueryDto; + +import java.util.List; + +/** + * @author 逗 + */ +public interface IVideoService { + /** + * 查看某个用户上传的比赛视频信息 + * @param params 比赛id和选手id + * @return 返回上传到视频文件信息 + */ + List getVideoByPlayerId(QueryDto params); + + /** + * 选手或团队上传视频 + * @param params 选手id或团队id + * @return 返回上传的文件信息 + */ + List uploadVideo(QueryDto params); +} diff --git a/mt/src/main/java/com/ccsens/mt/service/VideoService.java b/mt/src/main/java/com/ccsens/mt/service/VideoService.java new file mode 100644 index 00000000..4ddc1aea --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/service/VideoService.java @@ -0,0 +1,87 @@ +package com.ccsens.mt.service; + + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.lang.Snowflake; +import com.ccsens.mt.bean.dto.VideoDto; +import com.ccsens.mt.bean.po.CompeteVideo; +import com.ccsens.mt.bean.po.CompeteVideoExample; +import com.ccsens.mt.bean.vo.VideoVo; +import com.ccsens.mt.persist.mapper.CompeteVideoMapper; +import com.ccsens.util.bean.dto.QueryDto; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 逗 + */ +public class VideoService implements IVideoService{ + @Resource + private Snowflake snowflake; + @Resource + private CompeteVideoMapper competeVideoMapper; + + /** + * 查看某个用户上传的比赛视频信息 + * @param params 比赛id和选手id + * @return 返回上传到视频文件信息 + */ + @Override + public List getVideoByPlayerId(QueryDto params) { + VideoDto.GetVideo getVideo = params.getParam(); + List getVideoInfoList = new ArrayList<>(); + CompeteVideoExample videoExample = new CompeteVideoExample(); + videoExample.createCriteria().andCompeteCodeEqualTo(getVideo.getCompeteCode()).andCompeteTimeIdEqualTo(getVideo.getCompeteTimeId()) + .andPlayerIdEqualTo(getVideo.getPlayerId()); + List competeVideoList = competeVideoMapper.selectByExample(videoExample); + if(CollectionUtil.isNotEmpty(competeVideoList)){ + competeVideoList.forEach(competeVideo -> { + VideoVo.GetVideoInfo getVideoInfo = new VideoVo.GetVideoInfo(); + getVideoInfo.setFileId(competeVideo.getFileId()); + getVideoInfo.setVideoId(competeVideo.getId()); + getVideoInfo.setUploadTime(competeVideo.getTime()); + getVideoInfoList.add(getVideoInfo); + }); + } + return getVideoInfoList; + } + + /** + * 选手上传比赛视频信息 + * @param params 选手id或团队id + * @return + */ + @Override + public List uploadVideo(QueryDto params) { + VideoDto.UploadVideo uploadVideo = params.getParam(); + //将视频信息储存数据库 + CompeteVideo competeVideo = new CompeteVideo(); + competeVideo.setId(snowflake.nextId()); + competeVideo.setCompeteCode(uploadVideo.getCompeteCode()); + competeVideo.setCompeteTimeId(uploadVideo.getCompeteTimeId()); + competeVideo.setTeam(uploadVideo.getTeam()); + competeVideo.setPlayerId(uploadVideo.getPlayerId()); + competeVideo.setFileId(uploadVideo.getVideoFileId()); + competeVideo.setUploadUserId(params.getUserId()); + competeVideo.setTime(System.currentTimeMillis()); + competeVideoMapper.insertSelective(competeVideo); + //返回 + List getVideoInfoList = new ArrayList<>(); + CompeteVideoExample videoExample = new CompeteVideoExample(); + videoExample.createCriteria().andCompeteCodeEqualTo(uploadVideo.getCompeteCode()).andCompeteTimeIdEqualTo(uploadVideo.getCompeteTimeId()) + .andPlayerIdEqualTo(uploadVideo.getPlayerId()); + List competeVideoList = competeVideoMapper.selectByExample(videoExample); + if(CollectionUtil.isNotEmpty(competeVideoList)){ + competeVideoList.forEach(video -> { + VideoVo.GetVideoInfo getVideoInfo = new VideoVo.GetVideoInfo(); + getVideoInfo.setFileId(video.getFileId()); + getVideoInfo.setVideoId(video.getId()); + getVideoInfo.setUploadTime(video.getTime()); + getVideoInfoList.add(getVideoInfo); + }); + } + return getVideoInfoList; + } +} diff --git a/mt/src/main/resources/mapper_dao/CompeteTeamDao.xml b/mt/src/main/resources/mapper_dao/CompeteTeamDao.xml index 624accff..0257c97f 100644 --- a/mt/src/main/resources/mapper_dao/CompeteTeamDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteTeamDao.xml @@ -15,6 +15,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml b/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml new file mode 100644 index 00000000..541d081e --- /dev/null +++ b/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, compete_time_id, compete_code, team, player_id, file_id, video_url, time, upload_user_id, + created_at, updated_at, rec_status + + + + + delete from t_compete_video + where id = #{id,jdbcType=BIGINT} + + + delete from t_compete_video + + + + + + insert into t_compete_video (id, compete_time_id, compete_code, + team, player_id, file_id, + video_url, time, upload_user_id, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{competeCode,jdbcType=VARCHAR}, + #{team,jdbcType=TINYINT}, #{playerId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT}, + #{videoUrl,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, #{uploadUserId,jdbcType=BIGINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_compete_video + + + id, + + + compete_time_id, + + + compete_code, + + + team, + + + player_id, + + + file_id, + + + video_url, + + + time, + + + upload_user_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{competeTimeId,jdbcType=BIGINT}, + + + #{competeCode,jdbcType=VARCHAR}, + + + #{team,jdbcType=TINYINT}, + + + #{playerId,jdbcType=BIGINT}, + + + #{fileId,jdbcType=BIGINT}, + + + #{videoUrl,jdbcType=VARCHAR}, + + + #{time,jdbcType=BIGINT}, + + + #{uploadUserId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_compete_video + + + id = #{record.id,jdbcType=BIGINT}, + + + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + + + team = #{record.team,jdbcType=TINYINT}, + + + player_id = #{record.playerId,jdbcType=BIGINT}, + + + file_id = #{record.fileId,jdbcType=BIGINT}, + + + video_url = #{record.videoUrl,jdbcType=VARCHAR}, + + + time = #{record.time,jdbcType=BIGINT}, + + + upload_user_id = #{record.uploadUserId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_compete_video + set id = #{record.id,jdbcType=BIGINT}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + team = #{record.team,jdbcType=TINYINT}, + player_id = #{record.playerId,jdbcType=BIGINT}, + file_id = #{record.fileId,jdbcType=BIGINT}, + video_url = #{record.videoUrl,jdbcType=VARCHAR}, + time = #{record.time,jdbcType=BIGINT}, + upload_user_id = #{record.uploadUserId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_compete_video + + + compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{competeCode,jdbcType=VARCHAR}, + + + team = #{team,jdbcType=TINYINT}, + + + player_id = #{playerId,jdbcType=BIGINT}, + + + file_id = #{fileId,jdbcType=BIGINT}, + + + video_url = #{videoUrl,jdbcType=VARCHAR}, + + + time = #{time,jdbcType=BIGINT}, + + + upload_user_id = #{uploadUserId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_compete_video + set compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + compete_code = #{competeCode,jdbcType=VARCHAR}, + team = #{team,jdbcType=TINYINT}, + player_id = #{playerId,jdbcType=BIGINT}, + file_id = #{fileId,jdbcType=BIGINT}, + video_url = #{videoUrl,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + upload_user_id = #{uploadUserId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index d1934888..b02c402d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,9 +12,10 @@ ht game mt + pims - + com.ccsens diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java index 248e283e..b9bb2ced 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java @@ -150,7 +150,7 @@ public class TaskDto { // } @Data - @ApiModel + @ApiModel("修改任务详细信息") public static class UpdateTaskInfo{ @ApiModelProperty("任务id") private Long id; @@ -179,7 +179,7 @@ public class TaskDto { @ApiModelProperty("需要修改的插件Id") private List plugins; @ApiModelProperty("任务提醒信息") - private List taskRemindList; + private List taskRemindList; } @Data @ApiModel("修改任务时修改交付物名称") @@ -267,7 +267,6 @@ public class TaskDto { @Data @ApiModel("给任务添加提醒") public static class TaskRemind{ - @NotNull @ApiModelProperty("任务日期id(subTimeId)") private Long taskId; @ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间") diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java index 60a7c0e5..de12db5b 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java @@ -160,6 +160,8 @@ public class ProjectVo { private boolean pm; @ApiModelProperty("当前用户是否属于该角色") private boolean mine; + @ApiModelProperty("是否是变身后 0否 1是") + private byte imitation = 0; @ApiModelProperty("是否是当前角色的奖惩干系人") private boolean stakeholder; @ApiModelProperty("该角色是否显示") diff --git a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java index 813e5989..d336d0a9 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java @@ -108,6 +108,9 @@ public class ProRoleService implements IProRoleService { if (memberRole.getId().equals(role.getId())) { memberRole.setMine(true); memberRole.setIsShow(true); + if(imitation != null && imitation == 1){ + memberRole.setImitation((byte) 1); + } break; } else { memberRole.setMine(false); diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 93bb5dfc..0dcbf31c 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -1227,8 +1227,22 @@ public class ProTaskDetailService implements IProTaskDetailService { taskDetailDao.updateByPrimaryKeySelective(taskDetail); //修改提醒信息 if(CollectionUtil.isNotEmpty(updateTaskInfo.getTaskRemindList())){ + //删除之前的提醒信息 + ProRemindExample proRemindExample = new ProRemindExample(); + proRemindExample.createCriteria().andSubTaskIdEqualTo(updateTaskInfo.getId()); + List proRemindList = proRemindDao.selectByExample(proRemindExample); + if(CollectionUtil.isNotEmpty(proRemindList)){ + proRemindList.forEach(proRemind -> { + proRemind.setRecStatus((byte) 2); + proRemindDao.updateByPrimaryKeySelective(proRemind); + }); + } updateTaskInfo.getTaskRemindList().forEach(updateTaskRemind -> { - taskSubTimeService.updateRemind(currentUserId,updateTaskRemind); + try { + taskSubTimeService.saveRemind(currentUserId,updateTaskRemind); + } catch (Exception e) { + e.printStackTrace(); + } }); } //返回的任务详细信息 diff --git a/tall/src/main/java/com/ccsens/tall/service/UserService.java b/tall/src/main/java/com/ccsens/tall/service/UserService.java index 6791c5ac..fdff1a78 100644 --- a/tall/src/main/java/com/ccsens/tall/service/UserService.java +++ b/tall/src/main/java/com/ccsens/tall/service/UserService.java @@ -30,12 +30,16 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.sql.Struct; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * @author 逗 + */ @Slf4j @Service @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @@ -57,8 +61,6 @@ public class UserService implements IUserService { @Resource private RedisUtil redisUtil; @Resource - private SysWxDao sysWxDao; - @Resource private SysProjectDao sysProjectDao; @Resource private UserAttentionDao userAttentionDao; @@ -307,15 +309,6 @@ public class UserService implements IUserService { return userSignVo; } -// public void __addSigninRecord(WebConstant.CLIENT_TYPE clientType, String clientIp, Long authId) { -// SigninLog siginLog = new SigninLog(); -// siginLog.setId(snowflake.nextId()); -// siginLog.setAuthId(authId); -// siginLog.setClient((byte) clientType.value); -// siginLog.setSigninIp(clientIp); -// siginLog.setSigninTime(DateUtil.date()); -// signinLogDao.insertSelective(siginLog); -// } /** * 手机号登陆 @@ -328,8 +321,8 @@ public class UserService implements IUserService { UserVo.UserSign userSignVo; if (isSmsCodeCorrect(phone, smsVerifyCode)) { //1.查找对应账户,不存在则注册 - List authList = null; - SysAuth theAuth = null; + List authList; + SysAuth theAuth; SysAuthExample authExample = new SysAuthExample(); authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) .andIdentifierEqualTo(phone); @@ -348,9 +341,7 @@ public class UserService implements IUserService { return userSignVo; } -// private UserVo.UserSign emailLogin(String phone, String emailVerifyCode) { -// return null; -// } + /** * 账号登录 @@ -397,12 +388,12 @@ public class UserService implements IUserService { } - @Data - private static class WxEnterpriseParam { - private String suiteAccessToken; - private String userTicket; - private String redirect; - } +// @Data +// private static class WxEnterpriseParam { +// private String suiteAccessToken; +// private String userTicket; +// private String redirect; +// } /** @@ -498,11 +489,11 @@ public class UserService implements IUserService { /** * 获取企业微信信息,并绑定用户 - * @param identifyType - * @param userid - * @param corpId - * @param redirect - * @param user + * @param identifyType 登录类型 + * @param userid userId + * @param corpId corpId + * @param redirect redirect + * @param user 用户信息 */ private void getUserDetail(byte identifyType, String userid, String corpId, String redirect, SysUser user) { if (identifyType == WebConstant.IDENTIFY_TYPE.WxEnterprise.value && StrUtil.isNotBlank(redirect)) { @@ -1169,75 +1160,54 @@ public class UserService implements IUserService { public UserVo.TokenBean getUserInfoAndToken(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType,UserVo.UserSign userSignVo, Map theMap) { long start = System.currentTimeMillis(); UserVo.TokenBean tokenBean = userDao.getTokenBeanByUserId(userSignVo.getUserId()); + //如果只有手机号没有账号信息,则将手机号脱敏当成账号 + if (StrUtil.isEmpty(tokenBean.getAccount()) && StrUtil.isNotEmpty(tokenBean.getPhone())){ + String phoneNumber = tokenBean.getPhone().substring(0, 3) + "****" + tokenBean.getPhone().substring(7, tokenBean.getPhone().length()); + tokenBean.setAccount(phoneNumber); + } long end1 = System.currentTimeMillis(); log.info("查询用户信息用了:{}",end1 - start); UserVo.TokenBean tokenBean1 = generateToken(clientType, userSignVo.getUserId(), theMap); - tokenBean.setToken(tokenBean1.getToken()); tokenBean.setRefresh_token(tokenBean1.getRefresh_token()); -// //获取手机号 -// String phone = getPhoneByRegisterType(userSignVo.getUserId(),identifyType); -// long end2 = System.currentTimeMillis(); -// log.info("查询手机号:{}",end2 - end1); -// //获取账号 -// String account = selectAccountByUserId(userSignVo.getUserId()); -// if(StrUtil.isEmpty(account)){ -// account = WebConstant.DEFAULT_NICKNAME; -// } -// long end3 = System.currentTimeMillis(); -// log.info("查询账号:{}",end3 - end2); -// //获取用户的基本信息、 -// UserVo.WxInfo wxInfo = null; -// SysUser user = userDao.selectByPrimaryKey(userSignVo.getUserId()); -// if (ObjectUtil.isNotNull(user)) { -// wxInfo = new UserVo.WxInfo(); -// BeanUtil.copyProperties(user, wxInfo); -// wxInfo.setSex(user.getGender()); -// wxInfo.setHeadImgUrl(user.getAvatarUrl()); -// } -// long end4 = System.currentTimeMillis(); -// log.info("查询信息:{}",end4 - end3); -// tokenBean.setId(userSignVo.getUserId()); -// tokenBean.setPhone(phone); -// tokenBean.setAccount(account); -// tokenBean.setWxInfo(wxInfo); - return tokenBean; - } - /** - * 通过userId查找账号 - * @param userId userId - * @return 账号 - */ - private String selectAccountByUserId(Long userId) { - String account = null; - SysAuthExample sysAuthExample = new SysAuthExample(); - sysAuthExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); - List authList = authDao.selectByExample(sysAuthExample); - if(CollectionUtil.isNotEmpty(authList)){ - account = authList.get(0).getIdentifier(); - } - return account; + return tokenBean; } - private String getPhoneByRegisterType(Long userId, WebConstant.IDENTIFY_TYPE identifyType) { - SysAuthExample authExample = new SysAuthExample(); - authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); - List sysAuthList = authDao.selectByExample(authExample); - if (CollectionUtil.isNotEmpty(sysAuthList)) { - return sysAuthList.get(0).getIdentifier(); - } else { - SysAuthExample authExampleType = new SysAuthExample(); - authExampleType.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) identifyType.value); - List sysAuthList1 = authDao.selectByExample(authExampleType); - if (CollectionUtil.isNotEmpty(sysAuthList1)){ - if(sysAuthList1.get(0).getRegisterType() == 1){ - return "1"; - } - } - return null; - } - } +// /** +// * 通过userId查找账号 +// * @param userId userId +// * @return 账号 +// */ +// private String selectAccountByUserId(Long userId) { +// String account = null; +// SysAuthExample sysAuthExample = new SysAuthExample(); +// sysAuthExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// List authList = authDao.selectByExample(sysAuthExample); +// if(CollectionUtil.isNotEmpty(authList)){ +// account = authList.get(0).getIdentifier(); +// } +// return account; +// } +// +// private String getPhoneByRegisterType(Long userId, WebConstant.IDENTIFY_TYPE identifyType) { +// SysAuthExample authExample = new SysAuthExample(); +// authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); +// List sysAuthList = authDao.selectByExample(authExample); +// if (CollectionUtil.isNotEmpty(sysAuthList)) { +// return sysAuthList.get(0).getIdentifier(); +// } else { +// SysAuthExample authExampleType = new SysAuthExample(); +// authExampleType.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) identifyType.value); +// List sysAuthList1 = authDao.selectByExample(authExampleType); +// if (CollectionUtil.isNotEmpty(sysAuthList1)){ +// if(sysAuthList1.get(0).getRegisterType() == 1){ +// return "1"; +// } +// } +// return null; +// } +// } /** * 合并账号 @@ -1283,6 +1253,7 @@ public class UserService implements IUserService { oldUser.setRecStatus((byte) 2); userDao.updateByPrimaryKeySelective(oldUser); + } else { throw new BaseException(CodeEnum.PARAM_ERROR); } diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index b2acd365..c88e995d 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: util-dev,common + active: test + include: util-test,common diff --git a/tall/src/main/resources/mapper_dao/ProRoleDao.xml b/tall/src/main/resources/mapper_dao/ProRoleDao.xml index c2621faa..2514abbf 100644 --- a/tall/src/main/resources/mapper_dao/ProRoleDao.xml +++ b/tall/src/main/resources/mapper_dao/ProRoleDao.xml @@ -55,7 +55,7 @@