From 9aed6351770186d5f9f685bd135ab29d19c58467 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 4 Dec 2020 09:18:30 +0800 Subject: [PATCH] 20201204 --- .../cloudutil/aspect/MustLoginAspect.java | 4 +- game/src/main/resources/application-dev.yml | 2 +- game/src/main/resources/application-test.yml | 11 +- game/src/main/resources/application.yml | 4 +- game/src/main/resources/druid-test.yml | 5 +- .../ccsens/mt/api/CompeteVideoController.java | 10 +- .../com/ccsens/mt/api/DebugController.java | 21 + .../java/com/ccsens/mt/bean/dto/VideoDto.java | 14 + .../ccsens/mt/bean/po/CompeteSpeedVideo.java | 128 +++ .../mt/bean/po/CompeteSpeedVideoExample.java | 841 ++++++++++++++++++ .../com/ccsens/mt/bean/vo/VideoProjectVo.java | 4 +- .../mapper/CompeteSpeedVideoMapper.java | 30 + .../mt/service/CompeteVedioService.java | 45 +- .../mt/service/ICompeteVedioService.java | 2 + mt/src/main/resources/druid-prod.yml | 2 +- .../resources/mapper_dao/CompeteScoreDao.xml | 726 +++++++++++---- .../resources/mapper_dao/CompeteVideoDao.xml | 4 +- .../mapper_raw/CompeteSpeedVideoMapper.xml | 291 ++++++ .../main/resources/mapper_dao/SysUserDao.xml | 4 +- .../java/com/ccsens/util/wx/WxXcxUtil.java | 4 +- .../test/java/com/ccsens/util/VideoTest.java | 8 +- 21 files changed, 1970 insertions(+), 190 deletions(-) create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java create mode 100644 mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java create mode 100644 mt/src/main/resources/mapper_raw/CompeteSpeedVideoMapper.xml diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java index 1b155c8a..b3e63db6 100644 --- a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java +++ b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java @@ -48,7 +48,9 @@ public class MustLoginAspect { RequestContextHolder.getRequestAttributes()).getRequest(); final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN); - + if(StrUtil.isEmpty(authHeader)){ + return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); + } Object[] args = pjp.getArgs(); QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0]; diff --git a/game/src/main/resources/application-dev.yml b/game/src/main/resources/application-dev.yml index acc4b645..b7584d95 100644 --- a/game/src/main/resources/application-dev.yml +++ b/game/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource rabbitmq: - host: 81.70.54.64 + host: 192.168.0.99 password: 111111 port: 5672 username: admin diff --git a/game/src/main/resources/application-test.yml b/game/src/main/resources/application-test.yml index 93232b12..1b3de44e 100644 --- a/game/src/main/resources/application-test.yml +++ b/game/src/main/resources/application-test.yml @@ -8,17 +8,13 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource rabbitmq: -<<<<<<< HEAD - host: 81.70.54.64 -======= host: 127.0.0.1 ->>>>>>> pt password: 111111 port: 5672 username: admin redis: database: 0 - host: 192.168.0.99 + host: 127.0.0.1 jedis: pool: max-active: 200 @@ -32,9 +28,6 @@ swagger: enable: true eureka: instance: -<<<<<<< HEAD - ip-address: 192.168.0.99 -======= ip-address: 192.168.0.99 gatewayUrl: https://test.tall.wiki/gateway/ @@ -42,4 +35,4 @@ notGatewayUrl: https://test.tall.wiki/ file: qrCode: https://test.tall.wiki/gateway/tall/v1.0/uploads/ openWX: 0 ->>>>>>> pt + diff --git a/game/src/main/resources/application.yml b/game/src/main/resources/application.yml index d082c0ea..5889ff7f 100644 --- a/game/src/main/resources/application.yml +++ b/game/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: prod - include: common, util-prod \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/game/src/main/resources/druid-test.yml b/game/src/main/resources/druid-test.yml index 1d5e981e..f5a38592 100644 --- a/game/src/main/resources/druid-test.yml +++ b/game/src/main/resources/druid-test.yml @@ -27,10 +27,9 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 -<<<<<<< HEAD + # url: jdbc:mysql://test.tall.wiki/game?useUnicode=true&characterEncoding=UTF-8 -======= ->>>>>>> pt + url: jdbc:mysql://49.233.89.188:3306/game?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java index 5a625f40..319d68ac 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java @@ -71,6 +71,7 @@ public class CompeteVideoController { public JsonResponse> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查看裁判签到状态(签到用):{}",params); PageInfo coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params); + log.info("查看裁判签到状态:{}",coachSignStatus); return JsonResponse.newInstance().ok(coachSignStatus); } @@ -92,6 +93,13 @@ public class CompeteVideoController { return JsonResponse.newInstance().ok(list); } - + @MustLogin + @ApiOperation(value = "上传速度通级赛视频", notes = "zy--保存速度通级赛的视频,只存单位信息,选手名和视频地址") + @RequestMapping(value = "/save/speedVideo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse saveSpeedVideo(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("上传速度通级赛视频:{}",params); + iCompeteVedioService.saveSpeedVideo(params.getParam(),params.getUserId()); + return JsonResponse.newInstance().ok(true); + } } diff --git a/mt/src/main/java/com/ccsens/mt/api/DebugController.java b/mt/src/main/java/com/ccsens/mt/api/DebugController.java index 6bd68d6e..8f30dd77 100644 --- a/mt/src/main/java/com/ccsens/mt/api/DebugController.java +++ b/mt/src/main/java/com/ccsens/mt/api/DebugController.java @@ -1,11 +1,15 @@ package com.ccsens.mt.api; import com.ccsens.mt.bean.dto.LevelDto; +import com.ccsens.mt.bean.dto.VideoDto; import com.ccsens.mt.bean.po.CompetePlayer; +import com.ccsens.mt.bean.po.CompeteVideo; import com.ccsens.mt.bean.po.LevelUser; import com.ccsens.mt.bean.vo.ProvinceCompeteVo; import com.ccsens.mt.bean.vo.TableVo; +import com.ccsens.mt.bean.vo.VideoProjectVo; import com.ccsens.mt.persist.dao.CompetePlayerDao; +import com.ccsens.mt.persist.dao.CompeteVideoDao; import com.ccsens.mt.service.IExcelService; import com.ccsens.mt.service.ILevelUpService; import com.ccsens.util.JsonResponse; @@ -13,6 +17,7 @@ import com.ccsens.util.RedisUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.ZSetOperations; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -29,6 +34,7 @@ import java.util.Set; @Api(tags = "DEBUG" , description = "DebugController | ") @RestController @RequestMapping("/debug") +@Slf4j public class DebugController { @Resource private RedisUtil redisUtil; @@ -37,6 +43,8 @@ public class DebugController { @Resource private CompetePlayerDao competePlayerDao; @Resource + private CompeteVideoDao competeVideoDao; + @Resource private IExcelService excelService; @ApiOperation(value = "/测试",notes = "") @@ -82,4 +90,17 @@ public class DebugController { return JsonResponse.newInstance().ok(competeAllCount); } + + @ApiOperation(value = "/测试",notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value="/time",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse debugTime() throws Exception { + VideoDto.GetSignStatus getSignStatus = new VideoDto.GetSignStatus(); + getSignStatus.setId((long) 1); + List coachSignStatus = competeVideoDao.selectCoachSignStatus(getSignStatus); + log.info("查看裁判签到状态:{}",coachSignStatus); + return JsonResponse.newInstance().ok(coachSignStatus); + } + } 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 index 627cacb3..0b4424bf 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java @@ -8,7 +8,9 @@ import lombok.NonNull; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; import java.util.Date; +import java.util.List; /** @@ -115,4 +117,16 @@ public class VideoDto { private int pageSize = 10; } + @Data + @ApiModel("上传通级赛视频") + public static class SpeedVideoInfo{ + @NotNull(message = "单位信息不正确") + @ApiModelProperty("单位id") + private Long companyId; + @ApiModelProperty("选手名称") + private String playerName; + @ApiModelProperty("签到时间") + private List videoUrlList; + } + } diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java new file mode 100644 index 00000000..455167da --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java @@ -0,0 +1,128 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class CompeteSpeedVideo implements Serializable { + private Long id; + + private Long companyId; + + private String companyName; + + private String playerName; + + private Long userId; + + private String videoUrlOne; + + private String videoUrlTwo; + + 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 getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName == null ? null : companyName.trim(); + } + + public String getPlayerName() { + return playerName; + } + + public void setPlayerName(String playerName) { + this.playerName = playerName == null ? null : playerName.trim(); + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getVideoUrlOne() { + return videoUrlOne; + } + + public void setVideoUrlOne(String videoUrlOne) { + this.videoUrlOne = videoUrlOne == null ? null : videoUrlOne.trim(); + } + + public String getVideoUrlTwo() { + return videoUrlTwo; + } + + public void setVideoUrlTwo(String videoUrlTwo) { + this.videoUrlTwo = videoUrlTwo == null ? null : videoUrlTwo.trim(); + } + + 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(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", playerName=").append(playerName); + sb.append(", userId=").append(userId); + sb.append(", videoUrlOne=").append(videoUrlOne); + sb.append(", videoUrlTwo=").append(videoUrlTwo); + 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/CompeteSpeedVideoExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java new file mode 100644 index 00000000..eccec298 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java @@ -0,0 +1,841 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CompeteSpeedVideoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public CompeteSpeedVideoExample() { + 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 andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andPlayerNameIsNull() { + addCriterion("player_name is null"); + return (Criteria) this; + } + + public Criteria andPlayerNameIsNotNull() { + addCriterion("player_name is not null"); + return (Criteria) this; + } + + public Criteria andPlayerNameEqualTo(String value) { + addCriterion("player_name =", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotEqualTo(String value) { + addCriterion("player_name <>", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameGreaterThan(String value) { + addCriterion("player_name >", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameGreaterThanOrEqualTo(String value) { + addCriterion("player_name >=", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLessThan(String value) { + addCriterion("player_name <", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLessThanOrEqualTo(String value) { + addCriterion("player_name <=", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLike(String value) { + addCriterion("player_name like", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotLike(String value) { + addCriterion("player_name not like", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameIn(List values) { + addCriterion("player_name in", values, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotIn(List values) { + addCriterion("player_name not in", values, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameBetween(String value1, String value2) { + addCriterion("player_name between", value1, value2, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotBetween(String value1, String value2) { + addCriterion("player_name not between", value1, value2, "playerName"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIsNull() { + addCriterion("video_url_one is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIsNotNull() { + addCriterion("video_url_one is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneEqualTo(String value) { + addCriterion("video_url_one =", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotEqualTo(String value) { + addCriterion("video_url_one <>", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneGreaterThan(String value) { + addCriterion("video_url_one >", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneGreaterThanOrEqualTo(String value) { + addCriterion("video_url_one >=", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLessThan(String value) { + addCriterion("video_url_one <", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLessThanOrEqualTo(String value) { + addCriterion("video_url_one <=", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLike(String value) { + addCriterion("video_url_one like", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotLike(String value) { + addCriterion("video_url_one not like", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIn(List values) { + addCriterion("video_url_one in", values, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotIn(List values) { + addCriterion("video_url_one not in", values, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneBetween(String value1, String value2) { + addCriterion("video_url_one between", value1, value2, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotBetween(String value1, String value2) { + addCriterion("video_url_one not between", value1, value2, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIsNull() { + addCriterion("video_url_two is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIsNotNull() { + addCriterion("video_url_two is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoEqualTo(String value) { + addCriterion("video_url_two =", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotEqualTo(String value) { + addCriterion("video_url_two <>", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoGreaterThan(String value) { + addCriterion("video_url_two >", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoGreaterThanOrEqualTo(String value) { + addCriterion("video_url_two >=", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLessThan(String value) { + addCriterion("video_url_two <", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLessThanOrEqualTo(String value) { + addCriterion("video_url_two <=", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLike(String value) { + addCriterion("video_url_two like", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotLike(String value) { + addCriterion("video_url_two not like", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIn(List values) { + addCriterion("video_url_two in", values, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotIn(List values) { + addCriterion("video_url_two not in", values, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoBetween(String value1, String value2) { + addCriterion("video_url_two between", value1, value2, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotBetween(String value1, String value2) { + addCriterion("video_url_two not between", value1, value2, "videoUrlTwo"); + 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/VideoProjectVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java index 51ca828b..e79c75fc 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java @@ -49,8 +49,8 @@ public class VideoProjectVo { private String phone; @ApiModelProperty("裁判类型") private byte chiefJudgment; -// @ApiModelProperty("最近签到时间") -// private Date time; + @ApiModelProperty("最近签到时间") + private Date dateTime; @ApiModelProperty("最近签到时间戳") private Long time; } diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java new file mode 100644 index 00000000..aeb4c669 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.CompeteSpeedVideo; +import com.ccsens.mt.bean.po.CompeteSpeedVideoExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface CompeteSpeedVideoMapper { + long countByExample(CompeteSpeedVideoExample example); + + int deleteByExample(CompeteSpeedVideoExample example); + + int deleteByPrimaryKey(Long id); + + int insert(CompeteSpeedVideo record); + + int insertSelective(CompeteSpeedVideo record); + + List selectByExample(CompeteSpeedVideoExample example); + + CompeteSpeedVideo selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example); + + int updateByExample(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example); + + int updateByPrimaryKeySelective(CompeteSpeedVideo record); + + int updateByPrimaryKey(CompeteSpeedVideo record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java index 743113c8..46783fca 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java @@ -1,17 +1,18 @@ package com.ccsens.mt.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.ObjectUtil; import com.ccsens.mt.bean.dto.VideoDto; import com.ccsens.mt.bean.po.*; import com.ccsens.mt.bean.vo.VideoProjectVo; import com.ccsens.mt.persist.dao.CompeteTeamDao; import com.ccsens.mt.persist.dao.CompeteTimeDao; import com.ccsens.mt.persist.dao.CompeteVideoDao; -import com.ccsens.mt.persist.mapper.CompeteCompanyMapper; -import com.ccsens.mt.persist.mapper.CompetePlayerLookMapper; -import com.ccsens.mt.persist.mapper.CompeteProjectMapper; -import com.ccsens.mt.persist.mapper.CompeteVideoMapper; +import com.ccsens.mt.persist.mapper.*; +import com.ccsens.util.CodeEnum; import com.ccsens.util.bean.dto.QueryDto; +import com.ccsens.util.exception.BaseException; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Base64; import java.util.List; /** @@ -37,9 +39,8 @@ public class CompeteVedioService implements ICompeteVedioService{ private CompetePlayerLookMapper competePlayerLookMapper; @Resource private CompeteVideoMapper competeVideoMapper; - @Resource - private CompeteProjectMapper competeProjectMapper; + private CompeteSpeedVideoMapper speedVideoMapper; @Resource private CompeteCompanyMapper competeCompanyMapper; @Resource @@ -142,6 +143,34 @@ public class CompeteVedioService implements ICompeteVedioService{ return new PageInfo<>(competeVideoDao.selectCoachSignStatus(params.getParam())); } - - + /** + * 上传速度通级赛视频 + * @param param 视频地址和选手名 + * @param userId 上传者的userId + */ + @Override + public void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId) { + //查找单位信息 + CompeteCompany company = competeCompanyMapper.selectByPrimaryKey(param.getCompanyId()); + if(ObjectUtil.isNull(company)){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } + //保存视频信息 + CompeteSpeedVideo speedVideo = new CompeteSpeedVideo(); + speedVideo.setId(snowflake.nextId()); + speedVideo.setCompanyId(param.getCompanyId()); + speedVideo.setCompanyName(company.getName()); + speedVideo.setPlayerName(param.getPlayerName()); + if(CollectionUtil.isNotEmpty(param.getVideoUrlList())){ + for (int i = 0; i < param.getVideoUrlList().size(); i++) { + String url = param.getVideoUrlList().get(i); + if(i == 0){ + speedVideo.setVideoUrlOne(url); + }else { + speedVideo.setVideoUrlTwo(url); + } + } + } + speedVideoMapper.insertSelective(speedVideo); + } } diff --git a/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java b/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java index d999120e..ff4d69f8 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java @@ -32,4 +32,6 @@ public interface ICompeteVedioService { PageInfo selectCompanySignStatus(QueryDto params); PageInfo selectCoachSignStatus(QueryDto params); + + void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId); } diff --git a/mt/src/main/resources/druid-prod.yml b/mt/src/main/resources/druid-prod.yml index 56cd9c56..b92b92fe 100644 --- a/mt/src/main/resources/druid-prod.yml +++ b/mt/src/main/resources/druid-prod.yml @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index 06254cf1..19923ae3 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -778,19 +778,217 @@ group by startOrder.id + select + + distinct + + + from t_compete_speed_video + + + + + order by ${orderByClause} + + + + + delete from t_compete_speed_video + where id = #{id,jdbcType=BIGINT} + + + delete from t_compete_speed_video + + + + + + insert into t_compete_speed_video (id, company_id, company_name, + player_name, user_id, video_url_one, + video_url_two, created_at, updated_at, + rec_status) + values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, + #{playerName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{videoUrlOne,jdbcType=VARCHAR}, + #{videoUrlTwo,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) + + + insert into t_compete_speed_video + + + id, + + + company_id, + + + company_name, + + + player_name, + + + user_id, + + + video_url_one, + + + video_url_two, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{companyId,jdbcType=BIGINT}, + + + #{companyName,jdbcType=VARCHAR}, + + + #{playerName,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{videoUrlOne,jdbcType=VARCHAR}, + + + #{videoUrlTwo,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_compete_speed_video + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + company_name = #{record.companyName,jdbcType=VARCHAR}, + + + player_name = #{record.playerName,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR}, + + + video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_compete_speed_video + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + player_name = #{record.playerName,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=BIGINT}, + video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR}, + video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_compete_speed_video + + + company_id = #{companyId,jdbcType=BIGINT}, + + + company_name = #{companyName,jdbcType=VARCHAR}, + + + player_name = #{playerName,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + video_url_one = #{videoUrlOne,jdbcType=VARCHAR}, + + + video_url_two = #{videoUrlTwo,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_compete_speed_video + set company_id = #{companyId,jdbcType=BIGINT}, + company_name = #{companyName,jdbcType=VARCHAR}, + player_name = #{playerName,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=BIGINT}, + video_url_one = #{videoUrlOne,jdbcType=VARCHAR}, + video_url_two = #{videoUrlTwo,jdbcType=VARCHAR}, + 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/tall/src/main/resources/mapper_dao/SysUserDao.xml b/tall/src/main/resources/mapper_dao/SysUserDao.xml index 75854f37..d917ade3 100644 --- a/tall/src/main/resources/mapper_dao/SysUserDao.xml +++ b/tall/src/main/resources/mapper_dao/SysUserDao.xml @@ -145,8 +145,8 @@