Browse Source

比赛添加上传视频接口——1.0

master
zy_Java 5 years ago
parent
commit
7c712afcc1
  1. 18
      mt/src/main/java/com/ccsens/mt/api/CompeteController.java
  2. 56
      mt/src/main/java/com/ccsens/mt/api/VideoController.java
  3. 11
      mt/src/main/java/com/ccsens/mt/bean/dto/CompeteDto.java
  4. 40
      mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java
  5. 150
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java
  6. 941
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java
  7. 58
      mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java
  8. 24
      mt/src/main/java/com/ccsens/mt/bean/vo/VideoVo.java
  9. 13
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteTeamDao.java
  10. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteVideoMapper.java
  11. 21
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  12. 7
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java
  13. 26
      mt/src/main/java/com/ccsens/mt/service/IVideoService.java
  14. 87
      mt/src/main/java/com/ccsens/mt/service/VideoService.java
  15. 51
      mt/src/main/resources/mapper_dao/CompeteTeamDao.xml
  16. 323
      mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml
  17. 3
      pom.xml
  18. 5
      tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java
  19. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  20. 3
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  21. 16
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  22. 147
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  23. 4
      tall/src/main/resources/application.yml

18
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<CompeteVo.QueryPlayerList> queryPlayerList(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteProjectId> 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<CompeteVo.QueryPlayerList> getPlayerList(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteTimeAndType> params) {
// log.info("扫码加入团队:{}",params);
// CompeteVo.QueryPlayerList playerList = competeService.queryPlayerList(params);
// return JsonResponse.newInstance().ok(playerList);
// }
}

56
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<List<VideoVo.GetVideoInfo>> getVideoByPlayerId(@RequestBody @ApiParam @Validated QueryDto<VideoDto.GetVideo> params) {
log.info("查看选手上传的视频信息:{}",params.toString());
List<VideoVo.GetVideoInfo> 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<List<VideoVo.GetVideoInfo>> uploadVideo(@RequestBody @ApiParam @Validated QueryDto<VideoDto.UploadVideo> params) {
log.info("查看选手上传的视频信息:{}",params.toString());
List<VideoVo.GetVideoInfo> getVideoInfoList = videoService.uploadVideo(params);
return JsonResponse.newInstance().ok(getVideoInfoList);
}
}

11
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{

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

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

941
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<Criteria> oredCriteria;
public CompeteVideoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria 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<Long> values) {
addCriterion("compete_time_id in", values, "competeTimeId");
return (Criteria) this;
}
public Criteria andCompeteTimeIdNotIn(List<Long> 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<String> values) {
addCriterion("compete_code in", values, "competeCode");
return (Criteria) this;
}
public Criteria andCompeteCodeNotIn(List<String> 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<Byte> values) {
addCriterion("team in", values, "team");
return (Criteria) this;
}
public Criteria andTeamNotIn(List<Byte> 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<Long> values) {
addCriterion("player_id in", values, "playerId");
return (Criteria) this;
}
public Criteria andPlayerIdNotIn(List<Long> 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<Long> values) {
addCriterion("file_id in", values, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotIn(List<Long> 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<String> values) {
addCriterion("video_url in", values, "videoUrl");
return (Criteria) this;
}
public Criteria andVideoUrlNotIn(List<String> 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<Long> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<Long> 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<Long> values) {
addCriterion("upload_user_id in", values, "uploadUserId");
return (Criteria) this;
}
public Criteria andUploadUserIdNotIn(List<Long> 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<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

58
mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java

@ -142,18 +142,7 @@ public class CompeteVo {
private String qrCode;
@ApiModelProperty("团队内的成员")
private List<CompeteTeamProjectMember> 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<PlayerInfoByProject> playerList;
@ApiModelProperty("团队信息")
private List<TeamInfoByProject> 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<CompeteTeamProjectMember> members;
}
}

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

13
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<CompeteVo.TeamInfoByProject> getTeamByProjectId(@Param("competeProjectId")Long competeProjectId,@Param("competeTimeId")Long competeTimeId);
/**
* 通过比赛项目id查找项目下的选手id
* @param competeProjectId
* @return
*/
List<CompeteVo.PlayerInfoByProject> getPlayerByProjectId(@Param("competeProjectId")Long competeProjectId, @Param("competeTimeId")Long competeTimeId);
}

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

21
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<CompeteDto.CompeteProjectId> 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<CompeteVo.PlayerInfoByProject> playerInfoByProjectList =
competeTeamDao.getPlayerByProjectId(competeTimeAndType.getCompeteProjectId(),competeTimeAndType.getCompeteTimeId());
queryPlayerList.setPlayerList(playerInfoByProjectList);
}else {
List<CompeteVo.TeamInfoByProject> teamInfoByProjectList =
competeTeamDao.getTeamByProjectId(competeTimeAndType.getCompeteProjectId(),competeTimeAndType.getCompeteTimeId());
queryPlayerList.setTeamList(teamInfoByProjectList);
}
return queryPlayerList;
}
}

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

@ -86,4 +86,11 @@ public interface ICompeteService {
* @return
*/
CompeteVo.CompeteTeamProject joinCompeteGroup(QueryDto<CompeteDto.CompeteGroup> params);
/**
* 查询比赛项目下的参赛人员列表
* @param params 大赛id和比赛项目id
* @return 返回参赛人员或团队的列表
*/
CompeteVo.QueryPlayerList queryPlayerList(QueryDto<CompeteDto.CompeteProjectId> params);
}

26
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<VideoVo.GetVideoInfo> getVideoByPlayerId(QueryDto<VideoDto.GetVideo> params);
/**
* 选手或团队上传视频
* @param params 选手id或团队id
* @return 返回上传的文件信息
*/
List<VideoVo.GetVideoInfo> uploadVideo(QueryDto<VideoDto.UploadVideo> params);
}

87
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<VideoVo.GetVideoInfo> getVideoByPlayerId(QueryDto<VideoDto.GetVideo> params) {
VideoDto.GetVideo getVideo = params.getParam();
List<VideoVo.GetVideoInfo> getVideoInfoList = new ArrayList<>();
CompeteVideoExample videoExample = new CompeteVideoExample();
videoExample.createCriteria().andCompeteCodeEqualTo(getVideo.getCompeteCode()).andCompeteTimeIdEqualTo(getVideo.getCompeteTimeId())
.andPlayerIdEqualTo(getVideo.getPlayerId());
List<CompeteVideo> 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<VideoVo.GetVideoInfo> uploadVideo(QueryDto<VideoDto.UploadVideo> 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<VideoVo.GetVideoInfo> getVideoInfoList = new ArrayList<>();
CompeteVideoExample videoExample = new CompeteVideoExample();
videoExample.createCriteria().andCompeteCodeEqualTo(uploadVideo.getCompeteCode()).andCompeteTimeIdEqualTo(uploadVideo.getCompeteTimeId())
.andPlayerIdEqualTo(uploadVideo.getPlayerId());
List<CompeteVideo> 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;
}
}

51
mt/src/main/resources/mapper_dao/CompeteTeamDao.xml

@ -15,6 +15,19 @@
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<resultMap id="getTeamByProjectId" type="com.ccsens.mt.bean.vo.CompeteVo$TeamInfoByProject">
<id column="teamId" jdbcType="BIGINT" property="teamId" />
<result column="creatorId" jdbcType="BIGINT" property="creatorId" />
<result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
<result column="certificate" jdbcType="TINYINT" property="certificate" />
<result column="memberNums" jdbcType="INT" property="memberNums" />
<collection property="members" ofType="com.ccsens.mt.bean.vo.CompeteVo$CompeteTeamProjectMember">
<id column="memberId" property="memberId"/>
<result column="memberName" property="memberName"/>
<result column="captain" property="captain"/>
</collection>
</resultMap>
<select id="countJoinTeam" resultType="java.lang.Long">
SELECT
@ -139,4 +152,42 @@
AND p.rec_status = 0
AND pp.rec_status = 0
</select>
<select id="getTeamByProjectId" resultMap="getTeamByProjectId">
SELECT
t.id as teamId,
t.creator as creatorId,
(SELECT `name` FROM t_compete_player WHERE id = t.creator) as creatorName,
t.certificate as certificate,
(SELECT count(id) FROM t_compete_team_member WHERE compete_team_id = t.id) as memberNums,
m.id as memberId,
p.`name` as memberName,
if(t.creator = p.id , true,false) as captain
FROM
t_compete_team t left join t_compete_team_member m on t.id = m.compete_team_id
LEFT JOIN t_compete_player p on m.player_id = p.id
WHERE
t.project_id = #{competeProjectId}
and t.compete_time_id = #{competeTimeId}
and t.rec_status = 0
and m.rec_status = 0
and p.rec_status = 0
</select>
<select id="getPlayerByProjectId" resultType="com.ccsens.mt.bean.vo.CompeteVo$PlayerInfoByProject">
SELECT
p.id as playerId,
p.`name`,
p.gender,
p.phone,
p.compete_group_id as groupId,
(SELECT `group_name` FROM t_compete_group WHERE id = p.compete_group_id) as groupName,
(SELECT `name` FROM t_compete_company WHERE id = p.company_id) as companyName,
pp.certificate
FROM
t_compete_project_player pp left join t_compete_player p on pp.player_id = p.id
WHERE
pp.project_id = 9
and pp.compete_time_id = 1
and pp.rec_status = 0
and p.rec_status = 0
</select>
</mapper>

323
mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml

@ -0,0 +1,323 @@
<?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.mapper.CompeteVideoMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.CompeteVideo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="compete_time_id" jdbcType="BIGINT" property="competeTimeId" />
<result column="compete_code" jdbcType="VARCHAR" property="competeCode" />
<result column="team" jdbcType="TINYINT" property="team" />
<result column="player_id" jdbcType="BIGINT" property="playerId" />
<result column="file_id" jdbcType="BIGINT" property="fileId" />
<result column="video_url" jdbcType="VARCHAR" property="videoUrl" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="upload_user_id" jdbcType="BIGINT" property="uploadUserId" />
<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, compete_time_id, compete_code, team, player_id, file_id, video_url, time, upload_user_id,
created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.CompeteVideoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_compete_video
<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_compete_video
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_compete_video
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.CompeteVideoExample">
delete from t_compete_video
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.CompeteVideo">
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>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.CompeteVideo">
insert into t_compete_video
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="competeTimeId != null">
compete_time_id,
</if>
<if test="competeCode != null">
compete_code,
</if>
<if test="team != null">
team,
</if>
<if test="playerId != null">
player_id,
</if>
<if test="fileId != null">
file_id,
</if>
<if test="videoUrl != null">
video_url,
</if>
<if test="time != null">
time,
</if>
<if test="uploadUserId != null">
upload_user_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="competeTimeId != null">
#{competeTimeId,jdbcType=BIGINT},
</if>
<if test="competeCode != null">
#{competeCode,jdbcType=VARCHAR},
</if>
<if test="team != null">
#{team,jdbcType=TINYINT},
</if>
<if test="playerId != null">
#{playerId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
#{fileId,jdbcType=BIGINT},
</if>
<if test="videoUrl != null">
#{videoUrl,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=BIGINT},
</if>
<if test="uploadUserId != null">
#{uploadUserId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.CompeteVideoExample" resultType="java.lang.Long">
select count(*) from t_compete_video
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_compete_video
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.competeTimeId != null">
compete_time_id = #{record.competeTimeId,jdbcType=BIGINT},
</if>
<if test="record.competeCode != null">
compete_code = #{record.competeCode,jdbcType=VARCHAR},
</if>
<if test="record.team != null">
team = #{record.team,jdbcType=TINYINT},
</if>
<if test="record.playerId != null">
player_id = #{record.playerId,jdbcType=BIGINT},
</if>
<if test="record.fileId != null">
file_id = #{record.fileId,jdbcType=BIGINT},
</if>
<if test="record.videoUrl != null">
video_url = #{record.videoUrl,jdbcType=VARCHAR},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=BIGINT},
</if>
<if test="record.uploadUserId != null">
upload_user_id = #{record.uploadUserId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.CompeteVideo">
update t_compete_video
<set>
<if test="competeTimeId != null">
compete_time_id = #{competeTimeId,jdbcType=BIGINT},
</if>
<if test="competeCode != null">
compete_code = #{competeCode,jdbcType=VARCHAR},
</if>
<if test="team != null">
team = #{team,jdbcType=TINYINT},
</if>
<if test="playerId != null">
player_id = #{playerId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
file_id = #{fileId,jdbcType=BIGINT},
</if>
<if test="videoUrl != null">
video_url = #{videoUrl,jdbcType=VARCHAR},
</if>
<if test="time != null">
time = #{time,jdbcType=BIGINT},
</if>
<if test="uploadUserId != null">
upload_user_id = #{uploadUserId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.CompeteVideo">
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}
</update>
</mapper>

3
pom.xml

@ -12,9 +12,10 @@
<module>ht</module>
<module>game</module>
<module>mt</module>
<module>pims</module>
<!-- <module>health</module>-->
<!-- <module>ct</module>-->
<!-- <module>pims</module>-->
</modules>
<groupId>com.ccsens</groupId>

5
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<Long> plugins;
@ApiModelProperty("任务提醒信息")
private List<UpdateTaskRemind> taskRemindList;
private List<TaskRemind> 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自定义时间")

2
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("该角色是否显示")

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

16
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<ProRemind> 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();
}
});
}
//返回的任务详细信息

147
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<SysAuth> authList = null;
SysAuth theAuth = null;
List<SysAuth> 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<String, Object> 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<SysAuth> 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<SysAuth> 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<SysAuth> 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<SysAuth> 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<SysAuth> 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<SysAuth> 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);
}

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

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

Loading…
Cancel
Save