diff --git a/ct/src/main/java/com/ccsens/ct/config/SpringConfig.java b/ct/src/main/java/com/ccsens/ct/config/SpringConfig.java index bd24e547..b701c3e8 100644 --- a/ct/src/main/java/com/ccsens/ct/config/SpringConfig.java +++ b/ct/src/main/java/com/ccsens/ct/config/SpringConfig.java @@ -111,7 +111,7 @@ public class SpringConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/uploads/**") - .addResourceLocations("file:///home/cloud/tall/uploads/"); + .addResourceLocations("file:///home/cloud/ct/uploads/"); //super.addResourceHandlers(registry); } diff --git a/game/src/main/java/com/ccsens/game/config/SpringConfig.java b/game/src/main/java/com/ccsens/game/config/SpringConfig.java index 8bd9c3a1..77036f1c 100644 --- a/game/src/main/java/com/ccsens/game/config/SpringConfig.java +++ b/game/src/main/java/com/ccsens/game/config/SpringConfig.java @@ -116,7 +116,7 @@ public class SpringConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/uploads/**") - .addResourceLocations("file:///home/cloud/tall/uploads/"); + .addResourceLocations("file:///home/cloud/game/uploads/"); //super.addResourceHandlers(registry); } diff --git a/game/src/main/java/com/ccsens/game/service/ScreenService.java b/game/src/main/java/com/ccsens/game/service/ScreenService.java index 97a711dc..46140ccf 100644 --- a/game/src/main/java/com/ccsens/game/service/ScreenService.java +++ b/game/src/main/java/com/ccsens/game/service/ScreenService.java @@ -102,6 +102,17 @@ public class ScreenService implements IScreenService { if (ObjectUtil.isNotNull(memberGame.getTaskId())) { selectOldRecord(memberGame.getTaskId()); } + //验证购买时间是否到期 + if (gameUserPay.getDueTime() < System.currentTimeMillis()) { + throw new BaseException(CodeEnum.GAME_TIME_DUE); + } + //验证游戏次数 + if (gameUserPay.getUsedCount() >= gameUserPay.getTotalCount()) { + throw new BaseException(CodeEnum.GAME_NOT_TIMES); + } + //修改购买的游戏的使用次数 + gameUserPay.setUsedCount(gameUserPay.getUsedCount() + 1); + gameUserPayDao.updateByPrimaryKeySelective(gameUserPay); //3、根据用户购买的记录,添加一场新的游戏记录 GameRecord gameRecord = new GameRecord(); @@ -321,7 +332,8 @@ public class ScreenService implements IScreenService { gameUserPay.setTotalCount(10); gameUserPay.setUsedCount(0); gameUserPay.setCreatedTime(System.currentTimeMillis()); - gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30)); +// gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30)); + gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 7)); gameUserPayDao.insertSelective(gameUserPay); } return gameUserPay; @@ -952,10 +964,14 @@ public class ScreenService implements IScreenService { if (ObjectUtil.isNull(gameType)) { throw new BaseException(CodeEnum.NOT_GAME_TYPE); } - -// if (gameUserPay.getUsedCount() >= gameUserPay.getTotalCount()) { -// throw new BaseException(CodeEnum.GAME_NOT_TIMES); -// } + //验证购买时间是否到期 + if (gameUserPay.getDueTime() < System.currentTimeMillis()) { + throw new BaseException(CodeEnum.GAME_TIME_DUE); + } + //验证游戏可玩次数 + if (gameUserPay.getUsedCount() >= gameUserPay.getTotalCount()) { + throw new BaseException(CodeEnum.GAME_NOT_TIMES); + } //之前的游戏若是准备中或进行中,则返回提示 if(gameRecord.getGameStatus() == GameConstant.GAME_PREPARATION || gameRecord.getGameStatus() == GameConstant.GAME_PROCESSING){ diff --git a/health/src/main/java/com/ccsens/health/config/SpringConfig.java b/health/src/main/java/com/ccsens/health/config/SpringConfig.java index 59f4b660..a7a7a70f 100644 --- a/health/src/main/java/com/ccsens/health/config/SpringConfig.java +++ b/health/src/main/java/com/ccsens/health/config/SpringConfig.java @@ -111,7 +111,7 @@ public class SpringConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/uploads/**") - .addResourceLocations("file:///home/cloud/tall/uploads/"); + .addResourceLocations("file:///home/cloud/health/uploads/"); //super.addResourceHandlers(registry); } diff --git a/mt/src/main/java/com/ccsens/mt/api/FileController.java b/mt/src/main/java/com/ccsens/mt/api/FileController.java index dfb13075..6f711826 100644 --- a/mt/src/main/java/com/ccsens/mt/api/FileController.java +++ b/mt/src/main/java/com/ccsens/mt/api/FileController.java @@ -38,7 +38,7 @@ public class FileController { private TallFeignClient tallFeignClient; - @ApiOperation(value = "上传交付物文件") + @ApiOperation(value = "上传文件") @ApiImplicitParams({ }) @RequestMapping(value = "upload", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) diff --git a/mt/src/main/java/com/ccsens/mt/api/LevelController.java b/mt/src/main/java/com/ccsens/mt/api/LevelController.java new file mode 100644 index 00000000..204d2f79 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/api/LevelController.java @@ -0,0 +1,51 @@ +package com.ccsens.mt.api; + +import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.mt.bean.dto.LevelDto; +import com.ccsens.mt.bean.vo.LevelVo; +import com.ccsens.mt.service.ILevelUpService; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.bean.dto.QueryDto; +import io.swagger.annotations.Api; +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 = "线上体育竞技比赛", description = "") +@RestController +@RequestMapping("/level") +public class LevelController { + @Resource + private ILevelUpService levelUpService; + + + @MustLogin + @ApiOperation(value = "手动晋级", notes = "") + @RequestMapping(value = "/manual", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse manualLevelUpPlayer(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("手动晋级:{}",params); + levelUpService.manualLevelUpPlayer(params); + return JsonResponse.newInstance().ok(); + } + + @MustLogin + @ApiOperation(value = "查找晋级选手信息", notes = "") + @RequestMapping(value = "/userInfo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse> queryLevelUserInfo(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("手动晋级:{}",params); + List levelUserInfoList = levelUpService.queryLevelUserInfo(params); + return JsonResponse.newInstance().ok(levelUserInfoList); + } +} diff --git a/mt/src/main/java/com/ccsens/mt/bean/dto/LevelDto.java b/mt/src/main/java/com/ccsens/mt/bean/dto/LevelDto.java new file mode 100644 index 00000000..d06f2ceb --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/LevelDto.java @@ -0,0 +1,90 @@ +package com.ccsens.mt.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author 逗 + */ +@Data +public class LevelDto { + + @Data + @ApiModel("添加选手信息") + public static class LevelUserDto{ + @ApiModelProperty("报名比赛的选手的id") + private Long playerId; + @ApiModelProperty("头像") + private String avatarUrl; + @ApiModelProperty("名称") + private String name; + @ApiModelProperty("团队id") + private Long teamId; + } + + + @Data + @ApiModel("添加晋级表信息") + public static class LevelUpDto{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + @ApiModelProperty("选手id") + private Long playerId; + @ApiModelProperty("分数") + private int score; + @ApiModelProperty("附加分数") + private int additionScore; + @ApiModelProperty("名次") + private int ranking; + } + + @Data + @ApiModel("自动晋级") + public static class AutoLevelUpDto{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + } + + + @Data + @ApiModel("手动晋级") + public static class ManualLevelUpDto{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + @ApiModelProperty("手动晋级的选手信息") + private List manualLevelUpPlayers; + } + @Data + @ApiModel("手动晋级的选手信息") + public static class ManualLevelUpPlayer{ + @ApiModelProperty("选手id") + private Long playerId; +// @ApiModelProperty("分数") +// private int score; +// @ApiModelProperty("附加分数") +// private int additionScore; +// @ApiModelProperty("名次") +// private int ranking; + } + @Data + @ApiModel("查询晋级信息") + public static class QueryLevelUserInfo{ + @ApiModelProperty("大赛id") + private Long competeTimeId; + @ApiModelProperty("比赛code") + private String competeCode; + @ApiModelProperty("页码 -1表示不分页 默认-1") + private int page = -1; + @ApiModelProperty("每页数量 默认10") + private int pageSize = 10; + } +} diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/LevelRule.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelRule.java new file mode 100644 index 00000000..4e90e935 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelRule.java @@ -0,0 +1,139 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class LevelRule implements Serializable { + private Long id; + + private Long competeTimeId; + + private String competeCodeNow; + + private String competeCodeLevelUp; + + private Byte rule; + + private Integer levelCondition; + + private Byte autoLevel; + + private Byte competeOrder; + + 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 getCompeteCodeNow() { + return competeCodeNow; + } + + public void setCompeteCodeNow(String competeCodeNow) { + this.competeCodeNow = competeCodeNow == null ? null : competeCodeNow.trim(); + } + + public String getCompeteCodeLevelUp() { + return competeCodeLevelUp; + } + + public void setCompeteCodeLevelUp(String competeCodeLevelUp) { + this.competeCodeLevelUp = competeCodeLevelUp == null ? null : competeCodeLevelUp.trim(); + } + + public Byte getRule() { + return rule; + } + + public void setRule(Byte rule) { + this.rule = rule; + } + + public Integer getLevelCondition() { + return levelCondition; + } + + public void setLevelCondition(Integer levelCondition) { + this.levelCondition = levelCondition; + } + + public Byte getAutoLevel() { + return autoLevel; + } + + public void setAutoLevel(Byte autoLevel) { + this.autoLevel = autoLevel; + } + + public Byte getCompeteOrder() { + return competeOrder; + } + + public void setCompeteOrder(Byte competeOrder) { + this.competeOrder = competeOrder; + } + + 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(", competeCodeNow=").append(competeCodeNow); + sb.append(", competeCodeLevelUp=").append(competeCodeLevelUp); + sb.append(", rule=").append(rule); + sb.append(", levelCondition=").append(levelCondition); + sb.append(", autoLevel=").append(autoLevel); + sb.append(", competeOrder=").append(competeOrder); + 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/LevelRuleExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelRuleExample.java new file mode 100644 index 00000000..4f629c41 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelRuleExample.java @@ -0,0 +1,881 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LevelRuleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public LevelRuleExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNull() { + addCriterion("compete_time_id is null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNotNull() { + addCriterion("compete_time_id is not null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdEqualTo(Long value) { + addCriterion("compete_time_id =", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotEqualTo(Long value) { + addCriterion("compete_time_id <>", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThan(Long value) { + addCriterion("compete_time_id >", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThanOrEqualTo(Long value) { + addCriterion("compete_time_id >=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThan(Long value) { + addCriterion("compete_time_id <", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThanOrEqualTo(Long value) { + addCriterion("compete_time_id <=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIn(List values) { + addCriterion("compete_time_id in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotIn(List values) { + addCriterion("compete_time_id not in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdBetween(Long value1, Long value2) { + addCriterion("compete_time_id between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotBetween(Long value1, Long value2) { + addCriterion("compete_time_id not between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowIsNull() { + addCriterion("compete_code_now is null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowIsNotNull() { + addCriterion("compete_code_now is not null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowEqualTo(String value) { + addCriterion("compete_code_now =", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowNotEqualTo(String value) { + addCriterion("compete_code_now <>", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowGreaterThan(String value) { + addCriterion("compete_code_now >", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowGreaterThanOrEqualTo(String value) { + addCriterion("compete_code_now >=", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowLessThan(String value) { + addCriterion("compete_code_now <", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowLessThanOrEqualTo(String value) { + addCriterion("compete_code_now <=", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowLike(String value) { + addCriterion("compete_code_now like", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowNotLike(String value) { + addCriterion("compete_code_now not like", value, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowIn(List values) { + addCriterion("compete_code_now in", values, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowNotIn(List values) { + addCriterion("compete_code_now not in", values, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowBetween(String value1, String value2) { + addCriterion("compete_code_now between", value1, value2, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNowNotBetween(String value1, String value2) { + addCriterion("compete_code_now not between", value1, value2, "competeCodeNow"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpIsNull() { + addCriterion("compete_code_level_up is null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpIsNotNull() { + addCriterion("compete_code_level_up is not null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpEqualTo(String value) { + addCriterion("compete_code_level_up =", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpNotEqualTo(String value) { + addCriterion("compete_code_level_up <>", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpGreaterThan(String value) { + addCriterion("compete_code_level_up >", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpGreaterThanOrEqualTo(String value) { + addCriterion("compete_code_level_up >=", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpLessThan(String value) { + addCriterion("compete_code_level_up <", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpLessThanOrEqualTo(String value) { + addCriterion("compete_code_level_up <=", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpLike(String value) { + addCriterion("compete_code_level_up like", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpNotLike(String value) { + addCriterion("compete_code_level_up not like", value, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpIn(List values) { + addCriterion("compete_code_level_up in", values, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpNotIn(List values) { + addCriterion("compete_code_level_up not in", values, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpBetween(String value1, String value2) { + addCriterion("compete_code_level_up between", value1, value2, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLevelUpNotBetween(String value1, String value2) { + addCriterion("compete_code_level_up not between", value1, value2, "competeCodeLevelUp"); + return (Criteria) this; + } + + public Criteria andRuleIsNull() { + addCriterion("rule is null"); + return (Criteria) this; + } + + public Criteria andRuleIsNotNull() { + addCriterion("rule is not null"); + return (Criteria) this; + } + + public Criteria andRuleEqualTo(Byte value) { + addCriterion("rule =", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleNotEqualTo(Byte value) { + addCriterion("rule <>", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleGreaterThan(Byte value) { + addCriterion("rule >", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleGreaterThanOrEqualTo(Byte value) { + addCriterion("rule >=", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleLessThan(Byte value) { + addCriterion("rule <", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleLessThanOrEqualTo(Byte value) { + addCriterion("rule <=", value, "rule"); + return (Criteria) this; + } + + public Criteria andRuleIn(List values) { + addCriterion("rule in", values, "rule"); + return (Criteria) this; + } + + public Criteria andRuleNotIn(List values) { + addCriterion("rule not in", values, "rule"); + return (Criteria) this; + } + + public Criteria andRuleBetween(Byte value1, Byte value2) { + addCriterion("rule between", value1, value2, "rule"); + return (Criteria) this; + } + + public Criteria andRuleNotBetween(Byte value1, Byte value2) { + addCriterion("rule not between", value1, value2, "rule"); + return (Criteria) this; + } + + public Criteria andLevelConditionIsNull() { + addCriterion("level_condition is null"); + return (Criteria) this; + } + + public Criteria andLevelConditionIsNotNull() { + addCriterion("level_condition is not null"); + return (Criteria) this; + } + + public Criteria andLevelConditionEqualTo(Integer value) { + addCriterion("level_condition =", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionNotEqualTo(Integer value) { + addCriterion("level_condition <>", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionGreaterThan(Integer value) { + addCriterion("level_condition >", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionGreaterThanOrEqualTo(Integer value) { + addCriterion("level_condition >=", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionLessThan(Integer value) { + addCriterion("level_condition <", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionLessThanOrEqualTo(Integer value) { + addCriterion("level_condition <=", value, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionIn(List values) { + addCriterion("level_condition in", values, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionNotIn(List values) { + addCriterion("level_condition not in", values, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionBetween(Integer value1, Integer value2) { + addCriterion("level_condition between", value1, value2, "levelCondition"); + return (Criteria) this; + } + + public Criteria andLevelConditionNotBetween(Integer value1, Integer value2) { + addCriterion("level_condition not between", value1, value2, "levelCondition"); + return (Criteria) this; + } + + public Criteria andAutoLevelIsNull() { + addCriterion("auto_level is null"); + return (Criteria) this; + } + + public Criteria andAutoLevelIsNotNull() { + addCriterion("auto_level is not null"); + return (Criteria) this; + } + + public Criteria andAutoLevelEqualTo(Byte value) { + addCriterion("auto_level =", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelNotEqualTo(Byte value) { + addCriterion("auto_level <>", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelGreaterThan(Byte value) { + addCriterion("auto_level >", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelGreaterThanOrEqualTo(Byte value) { + addCriterion("auto_level >=", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelLessThan(Byte value) { + addCriterion("auto_level <", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelLessThanOrEqualTo(Byte value) { + addCriterion("auto_level <=", value, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelIn(List values) { + addCriterion("auto_level in", values, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelNotIn(List values) { + addCriterion("auto_level not in", values, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelBetween(Byte value1, Byte value2) { + addCriterion("auto_level between", value1, value2, "autoLevel"); + return (Criteria) this; + } + + public Criteria andAutoLevelNotBetween(Byte value1, Byte value2) { + addCriterion("auto_level not between", value1, value2, "autoLevel"); + return (Criteria) this; + } + + public Criteria andCompeteOrderIsNull() { + addCriterion("compete_order is null"); + return (Criteria) this; + } + + public Criteria andCompeteOrderIsNotNull() { + addCriterion("compete_order is not null"); + return (Criteria) this; + } + + public Criteria andCompeteOrderEqualTo(Byte value) { + addCriterion("compete_order =", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderNotEqualTo(Byte value) { + addCriterion("compete_order <>", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderGreaterThan(Byte value) { + addCriterion("compete_order >", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderGreaterThanOrEqualTo(Byte value) { + addCriterion("compete_order >=", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderLessThan(Byte value) { + addCriterion("compete_order <", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderLessThanOrEqualTo(Byte value) { + addCriterion("compete_order <=", value, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderIn(List values) { + addCriterion("compete_order in", values, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderNotIn(List values) { + addCriterion("compete_order not in", values, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderBetween(Byte value1, Byte value2) { + addCriterion("compete_order between", value1, value2, "competeOrder"); + return (Criteria) this; + } + + public Criteria andCompeteOrderNotBetween(Byte value1, Byte value2) { + addCriterion("compete_order not between", value1, value2, "competeOrder"); + 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/po/LevelUp.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUp.java new file mode 100644 index 00000000..58cbc8c6 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUp.java @@ -0,0 +1,139 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class LevelUp implements Serializable { + private Long id; + + private Long competeTimeId; + + private String competeCode; + + private Long levelUserId; + + private Integer score; + + private Integer additionScore; + + private Integer ranking; + + private Byte levelUpType; + + 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 Long getLevelUserId() { + return levelUserId; + } + + public void setLevelUserId(Long levelUserId) { + this.levelUserId = levelUserId; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public Integer getAdditionScore() { + return additionScore; + } + + public void setAdditionScore(Integer additionScore) { + this.additionScore = additionScore; + } + + public Integer getRanking() { + return ranking; + } + + public void setRanking(Integer ranking) { + this.ranking = ranking; + } + + public Byte getLevelUpType() { + return levelUpType; + } + + public void setLevelUpType(Byte levelUpType) { + this.levelUpType = levelUpType; + } + + 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(", levelUserId=").append(levelUserId); + sb.append(", score=").append(score); + sb.append(", additionScore=").append(additionScore); + sb.append(", ranking=").append(ranking); + sb.append(", levelUpType=").append(levelUpType); + 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/LevelUpExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUpExample.java new file mode 100644 index 00000000..cc653bfe --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUpExample.java @@ -0,0 +1,871 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LevelUpExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public LevelUpExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNull() { + addCriterion("compete_time_id is null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIsNotNull() { + addCriterion("compete_time_id is not null"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdEqualTo(Long value) { + addCriterion("compete_time_id =", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotEqualTo(Long value) { + addCriterion("compete_time_id <>", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThan(Long value) { + addCriterion("compete_time_id >", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdGreaterThanOrEqualTo(Long value) { + addCriterion("compete_time_id >=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThan(Long value) { + addCriterion("compete_time_id <", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdLessThanOrEqualTo(Long value) { + addCriterion("compete_time_id <=", value, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdIn(List values) { + addCriterion("compete_time_id in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotIn(List values) { + addCriterion("compete_time_id not in", values, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdBetween(Long value1, Long value2) { + addCriterion("compete_time_id between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteTimeIdNotBetween(Long value1, Long value2) { + addCriterion("compete_time_id not between", value1, value2, "competeTimeId"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIsNull() { + addCriterion("compete_code is null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIsNotNull() { + addCriterion("compete_code is not null"); + return (Criteria) this; + } + + public Criteria andCompeteCodeEqualTo(String value) { + addCriterion("compete_code =", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotEqualTo(String value) { + addCriterion("compete_code <>", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeGreaterThan(String value) { + addCriterion("compete_code >", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeGreaterThanOrEqualTo(String value) { + addCriterion("compete_code >=", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLessThan(String value) { + addCriterion("compete_code <", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLessThanOrEqualTo(String value) { + addCriterion("compete_code <=", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeLike(String value) { + addCriterion("compete_code like", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotLike(String value) { + addCriterion("compete_code not like", value, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeIn(List values) { + addCriterion("compete_code in", values, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotIn(List values) { + addCriterion("compete_code not in", values, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeBetween(String value1, String value2) { + addCriterion("compete_code between", value1, value2, "competeCode"); + return (Criteria) this; + } + + public Criteria andCompeteCodeNotBetween(String value1, String value2) { + addCriterion("compete_code not between", value1, value2, "competeCode"); + return (Criteria) this; + } + + public Criteria andLevelUserIdIsNull() { + addCriterion("level_user_id is null"); + return (Criteria) this; + } + + public Criteria andLevelUserIdIsNotNull() { + addCriterion("level_user_id is not null"); + return (Criteria) this; + } + + public Criteria andLevelUserIdEqualTo(Long value) { + addCriterion("level_user_id =", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdNotEqualTo(Long value) { + addCriterion("level_user_id <>", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdGreaterThan(Long value) { + addCriterion("level_user_id >", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("level_user_id >=", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdLessThan(Long value) { + addCriterion("level_user_id <", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdLessThanOrEqualTo(Long value) { + addCriterion("level_user_id <=", value, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdIn(List values) { + addCriterion("level_user_id in", values, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdNotIn(List values) { + addCriterion("level_user_id not in", values, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdBetween(Long value1, Long value2) { + addCriterion("level_user_id between", value1, value2, "levelUserId"); + return (Criteria) this; + } + + public Criteria andLevelUserIdNotBetween(Long value1, Long value2) { + addCriterion("level_user_id not between", value1, value2, "levelUserId"); + return (Criteria) this; + } + + public Criteria andScoreIsNull() { + addCriterion("score is null"); + return (Criteria) this; + } + + public Criteria andScoreIsNotNull() { + addCriterion("score is not null"); + return (Criteria) this; + } + + public Criteria andScoreEqualTo(Integer value) { + addCriterion("score =", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotEqualTo(Integer value) { + addCriterion("score <>", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThan(Integer value) { + addCriterion("score >", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThanOrEqualTo(Integer value) { + addCriterion("score >=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThan(Integer value) { + addCriterion("score <", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThanOrEqualTo(Integer value) { + addCriterion("score <=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreIn(List values) { + addCriterion("score in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotIn(List values) { + addCriterion("score not in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreBetween(Integer value1, Integer value2) { + addCriterion("score between", value1, value2, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotBetween(Integer value1, Integer value2) { + addCriterion("score not between", value1, value2, "score"); + return (Criteria) this; + } + + public Criteria andAdditionScoreIsNull() { + addCriterion("addition_score is null"); + return (Criteria) this; + } + + public Criteria andAdditionScoreIsNotNull() { + addCriterion("addition_score is not null"); + return (Criteria) this; + } + + public Criteria andAdditionScoreEqualTo(Integer value) { + addCriterion("addition_score =", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreNotEqualTo(Integer value) { + addCriterion("addition_score <>", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreGreaterThan(Integer value) { + addCriterion("addition_score >", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreGreaterThanOrEqualTo(Integer value) { + addCriterion("addition_score >=", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreLessThan(Integer value) { + addCriterion("addition_score <", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreLessThanOrEqualTo(Integer value) { + addCriterion("addition_score <=", value, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreIn(List values) { + addCriterion("addition_score in", values, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreNotIn(List values) { + addCriterion("addition_score not in", values, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreBetween(Integer value1, Integer value2) { + addCriterion("addition_score between", value1, value2, "additionScore"); + return (Criteria) this; + } + + public Criteria andAdditionScoreNotBetween(Integer value1, Integer value2) { + addCriterion("addition_score not between", value1, value2, "additionScore"); + return (Criteria) this; + } + + public Criteria andRankingIsNull() { + addCriterion("ranking is null"); + return (Criteria) this; + } + + public Criteria andRankingIsNotNull() { + addCriterion("ranking is not null"); + return (Criteria) this; + } + + public Criteria andRankingEqualTo(Integer value) { + addCriterion("ranking =", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingNotEqualTo(Integer value) { + addCriterion("ranking <>", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingGreaterThan(Integer value) { + addCriterion("ranking >", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingGreaterThanOrEqualTo(Integer value) { + addCriterion("ranking >=", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingLessThan(Integer value) { + addCriterion("ranking <", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingLessThanOrEqualTo(Integer value) { + addCriterion("ranking <=", value, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingIn(List values) { + addCriterion("ranking in", values, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingNotIn(List values) { + addCriterion("ranking not in", values, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingBetween(Integer value1, Integer value2) { + addCriterion("ranking between", value1, value2, "ranking"); + return (Criteria) this; + } + + public Criteria andRankingNotBetween(Integer value1, Integer value2) { + addCriterion("ranking not between", value1, value2, "ranking"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeIsNull() { + addCriterion("level_up_type is null"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeIsNotNull() { + addCriterion("level_up_type is not null"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeEqualTo(Byte value) { + addCriterion("level_up_type =", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeNotEqualTo(Byte value) { + addCriterion("level_up_type <>", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeGreaterThan(Byte value) { + addCriterion("level_up_type >", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("level_up_type >=", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeLessThan(Byte value) { + addCriterion("level_up_type <", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeLessThanOrEqualTo(Byte value) { + addCriterion("level_up_type <=", value, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeIn(List values) { + addCriterion("level_up_type in", values, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeNotIn(List values) { + addCriterion("level_up_type not in", values, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeBetween(Byte value1, Byte value2) { + addCriterion("level_up_type between", value1, value2, "levelUpType"); + return (Criteria) this; + } + + public Criteria andLevelUpTypeNotBetween(Byte value1, Byte value2) { + addCriterion("level_up_type not between", value1, value2, "levelUpType"); + 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/po/LevelUser.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUser.java new file mode 100644 index 00000000..c09e467f --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUser.java @@ -0,0 +1,106 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class LevelUser implements Serializable { + private Long id; + + private Long playerId; + + private String avatarUrl; + + private String name; + + private Long teamId; + + 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 getPlayerId() { + return playerId; + } + + public void setPlayerId(Long playerId) { + this.playerId = playerId; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Long getTeamId() { + return teamId; + } + + public void setTeamId(Long teamId) { + this.teamId = teamId; + } + + 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(", playerId=").append(playerId); + sb.append(", avatarUrl=").append(avatarUrl); + sb.append(", name=").append(name); + sb.append(", teamId=").append(teamId); + 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/LevelUserExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUserExample.java new file mode 100644 index 00000000..8fa18271 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/LevelUserExample.java @@ -0,0 +1,701 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LevelUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public LevelUserExample() { + 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 andPlayerIdIsNull() { + addCriterion("player_id is null"); + return (Criteria) this; + } + + public Criteria andPlayerIdIsNotNull() { + addCriterion("player_id is not null"); + return (Criteria) this; + } + + public Criteria andPlayerIdEqualTo(Long value) { + addCriterion("player_id =", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotEqualTo(Long value) { + addCriterion("player_id <>", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdGreaterThan(Long value) { + addCriterion("player_id >", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdGreaterThanOrEqualTo(Long value) { + addCriterion("player_id >=", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdLessThan(Long value) { + addCriterion("player_id <", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdLessThanOrEqualTo(Long value) { + addCriterion("player_id <=", value, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdIn(List values) { + addCriterion("player_id in", values, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotIn(List values) { + addCriterion("player_id not in", values, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdBetween(Long value1, Long value2) { + addCriterion("player_id between", value1, value2, "playerId"); + return (Criteria) this; + } + + public Criteria andPlayerIdNotBetween(Long value1, Long value2) { + addCriterion("player_id not between", value1, value2, "playerId"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNull() { + addCriterion("avatar_url is null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNotNull() { + addCriterion("avatar_url is not null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlEqualTo(String value) { + addCriterion("avatar_url =", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotEqualTo(String value) { + addCriterion("avatar_url <>", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThan(String value) { + addCriterion("avatar_url >", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThanOrEqualTo(String value) { + addCriterion("avatar_url >=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThan(String value) { + addCriterion("avatar_url <", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThanOrEqualTo(String value) { + addCriterion("avatar_url <=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLike(String value) { + addCriterion("avatar_url like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotLike(String value) { + addCriterion("avatar_url not like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIn(List values) { + addCriterion("avatar_url in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotIn(List values) { + addCriterion("avatar_url not in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlBetween(String value1, String value2) { + addCriterion("avatar_url between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotBetween(String value1, String value2) { + addCriterion("avatar_url not between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNull() { + addCriterion("team_id is null"); + return (Criteria) this; + } + + public Criteria andTeamIdIsNotNull() { + addCriterion("team_id is not null"); + return (Criteria) this; + } + + public Criteria andTeamIdEqualTo(Long value) { + addCriterion("team_id =", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotEqualTo(Long value) { + addCriterion("team_id <>", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThan(Long value) { + addCriterion("team_id >", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdGreaterThanOrEqualTo(Long value) { + addCriterion("team_id >=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThan(Long value) { + addCriterion("team_id <", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdLessThanOrEqualTo(Long value) { + addCriterion("team_id <=", value, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdIn(List values) { + addCriterion("team_id in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotIn(List values) { + addCriterion("team_id not in", values, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdBetween(Long value1, Long value2) { + addCriterion("team_id between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andTeamIdNotBetween(Long value1, Long value2) { + addCriterion("team_id not between", value1, value2, "teamId"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java index e1ed69b5..ba978e1a 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java @@ -142,6 +142,21 @@ public class CompeteVo { private String qrCode; @ApiModelProperty("团队内的成员") private List members; +// +// public CompeteTeamProject(Long teamId, byte type, String parentProjectName, String secondProjectName, byte certificate, byte creator, int memberMin, int memberMax, String qrCode) { +// this.teamId = teamId; +// this.type = type; +// this.parentProjectName = parentProjectName; +// this.secondProjectName = secondProjectName; +// this.certificate = certificate; +// this.creator = creator; +// this.memberMin = memberMin; +// this.memberMax = memberMax; +// this.qrCode = qrCode; +// } + + public CompeteTeamProject() { + } public CompeteTeamProject(CompeteTeam team, byte isCreator, com.ccsens.mt.bean.po.CompeteProject project, String parentProjectName, List members) { this.teamId = team.getId(); @@ -212,7 +227,7 @@ public class CompeteVo { } @Data - @ApiModel("返回当前选手所有报名信息") + @ApiModel("当前选手的基本报名信息") public static class GetPlayerInfo { @ApiModelProperty("id") private Long playerId; diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/LevelVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/LevelVo.java new file mode 100644 index 00000000..d7ed27ff --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/LevelVo.java @@ -0,0 +1,23 @@ +package com.ccsens.mt.bean.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author 逗 + */ +public class LevelVo { + @Data + @ApiModel("返回查询到的晋级选手信息") + public static class QueryLevelUserInfo{ + @ApiModelProperty("选手id") + private Long levelUserId; + @ApiModelProperty("头像") + private String avatarUrl; + @ApiModelProperty("名称") + private String name; + @ApiModelProperty("团队id") + private Long teamId; + } +} diff --git a/mt/src/main/java/com/ccsens/mt/config/SpringConfig.java b/mt/src/main/java/com/ccsens/mt/config/SpringConfig.java index c477f308..a98c3a3f 100644 --- a/mt/src/main/java/com/ccsens/mt/config/SpringConfig.java +++ b/mt/src/main/java/com/ccsens/mt/config/SpringConfig.java @@ -111,7 +111,7 @@ public class SpringConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/uploads/**") - .addResourceLocations("file:///home/cloud/tall/uploads/"); + .addResourceLocations("file:///home/cloud/mt/uploads/"); //super.addResourceHandlers(registry); } diff --git a/mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java b/mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java index 09a10b09..de50f842 100644 --- a/mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java +++ b/mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java @@ -3,7 +3,10 @@ package com.ccsens.mt.intercept; import cn.hutool.core.collection.CollectionUtil; import com.ccsens.util.WebConstant; import org.apache.ibatis.executor.Executor; -import org.apache.ibatis.mapping.*; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.ResultMap; +import org.apache.ibatis.mapping.SqlSource; import org.apache.ibatis.plugin.*; import org.apache.ibatis.reflection.DefaultReflectorFactory; import org.apache.ibatis.reflection.MetaObject; @@ -12,8 +15,10 @@ import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.RowBounds; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.List; +import java.util.Map; import java.util.Properties; /** @@ -34,43 +39,21 @@ public class MybatisInterceptor implements Interceptor { String selectByExample = "selectByExample"; + String countByExample = "countByExample"; + String countByExample2 = "selectByExample_COUNT"; String selectByPrimaryKey = "selectByPrimaryKey"; Object[] args = invocation.getArgs(); MappedStatement statement = (MappedStatement) args[0]; - if (statement.getId().endsWith(selectByExample)) { + if (statement.getId().endsWith(selectByExample) + || statement.getId().endsWith(countByExample) + || statement.getId().endsWith(countByExample2)) { //XXXExample Object example = args[1]; - Method method = example.getClass().getMethod("getOredCriteria", null); - //获取到条件数组,第一个是Criteria - List list = (List)method.invoke(example); - if (CollectionUtil.isEmpty(list)) { - Class clazz = ((ResultMap)statement.getResultMaps().get(0)).getType(); - String exampleName = clazz.getName() + "Example"; - Object paramExample = Class.forName(exampleName).newInstance(); - Method createCriteria = paramExample.getClass().getMethod("createCriteria"); - Object criteria = createCriteria.invoke(paramExample); - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - list.add(criteria); - } else { - Object criteria = list.get(0); - Method getCriteria = criteria.getClass().getMethod("getCriteria"); - List params = (List)getCriteria.invoke(criteria); - boolean hasDel = false; - for(Object param: params) { - Method getCondition = param.getClass().getMethod("getCondition"); - Object condition = getCondition.invoke(param); - if ("iis_del =".equals(condition)) { - hasDel = true; - } - } - if (!hasDel) { - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - } - } + addCondition(statement, example); + + } else if (statement.getId().endsWith(selectByPrimaryKey)) { @@ -85,6 +68,45 @@ public class MybatisInterceptor implements Interceptor { return invocation.proceed(); } + private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { + if (example instanceof Map) { + example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); + } + + + Method method = example.getClass().getMethod("getOredCriteria", null); + //获取到条件数组,第一个是Criteria + List list = (List) method.invoke(example); + if (CollectionUtil.isEmpty(list)) { + Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); + String exampleName = clazz.getName() + "Example"; + Object paramExample = Class.forName(exampleName).newInstance(); + Method createCriteria = paramExample.getClass().getMethod("createCriteria"); + Object criteria = createCriteria.invoke(paramExample); + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + list.add(criteria); + } else { + Object criteria = list.get(0); + Method getCriteria = criteria.getClass().getMethod("getCriteria"); + List params = (List) getCriteria.invoke(criteria); + boolean hasDel = false; + for (Object param : params) { + Method getCondition = param.getClass().getMethod("getCondition"); + Object condition = getCondition.invoke(param); + if ("rec_status =".equals(condition)) { + hasDel = true; + } + } + if (!hasDel) { + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + } + + } + + } + @Override public Object plugin(Object target) { return Plugin.wrap(target, this); @@ -121,24 +143,7 @@ public class MybatisInterceptor implements Interceptor { return builder.build(); } - private String getOperateType(Invocation invocation) { - final Object[] args = invocation.getArgs(); - MappedStatement ms = (MappedStatement) args[0]; - SqlCommandType commondType = ms.getSqlCommandType(); - if (commondType.compareTo(SqlCommandType.SELECT) == 0) { - return "select"; - } - if (commondType.compareTo(SqlCommandType.INSERT) == 0) { - return "insert"; - } - if (commondType.compareTo(SqlCommandType.UPDATE) == 0) { - return "update"; - } - if (commondType.compareTo(SqlCommandType.DELETE) == 0) { - return "delete"; - } - return null; - } + // 定义一个内部辅助类,作用是包装sq class BoundSqlSqlSource implements SqlSource { private BoundSql boundSql; diff --git a/mt/src/main/java/com/ccsens/mt/persist/dao/LevelUpDao.java b/mt/src/main/java/com/ccsens/mt/persist/dao/LevelUpDao.java new file mode 100644 index 00000000..40357e43 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/dao/LevelUpDao.java @@ -0,0 +1,19 @@ +package com.ccsens.mt.persist.dao; + +import com.ccsens.mt.persist.mapper.LevelUpMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +/** + * @author 逗 + */ +@Repository +public interface LevelUpDao extends LevelUpMapper{ + /** + * 通过levelUserId和比赛code查看晋级信息 + * @param levelUserId levelUserId + * @param competeCode 比赛code + * @return 返回晋级信息id + */ + Long getByLevelUserIdAndCode(@Param("levelUserId") Long levelUserId, @Param("competeCode")String competeCode); +} diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelRuleMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelRuleMapper.java new file mode 100644 index 00000000..4fcc2580 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelRuleMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.LevelRule; +import com.ccsens.mt.bean.po.LevelRuleExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface LevelRuleMapper { + long countByExample(LevelRuleExample example); + + int deleteByExample(LevelRuleExample example); + + int deleteByPrimaryKey(Long id); + + int insert(LevelRule record); + + int insertSelective(LevelRule record); + + List selectByExample(LevelRuleExample example); + + LevelRule selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") LevelRule record, @Param("example") LevelRuleExample example); + + int updateByExample(@Param("record") LevelRule record, @Param("example") LevelRuleExample example); + + int updateByPrimaryKeySelective(LevelRule record); + + int updateByPrimaryKey(LevelRule record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUpMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUpMapper.java new file mode 100644 index 00000000..76ed0393 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUpMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.LevelUp; +import com.ccsens.mt.bean.po.LevelUpExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface LevelUpMapper { + long countByExample(LevelUpExample example); + + int deleteByExample(LevelUpExample example); + + int deleteByPrimaryKey(Long id); + + int insert(LevelUp record); + + int insertSelective(LevelUp record); + + List selectByExample(LevelUpExample example); + + LevelUp selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") LevelUp record, @Param("example") LevelUpExample example); + + int updateByExample(@Param("record") LevelUp record, @Param("example") LevelUpExample example); + + int updateByPrimaryKeySelective(LevelUp record); + + int updateByPrimaryKey(LevelUp record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUserMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUserMapper.java new file mode 100644 index 00000000..d80b85b3 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/LevelUserMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.LevelUser; +import com.ccsens.mt.bean.po.LevelUserExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface LevelUserMapper { + long countByExample(LevelUserExample example); + + int deleteByExample(LevelUserExample example); + + int deleteByPrimaryKey(Long id); + + int insert(LevelUser record); + + int insertSelective(LevelUser record); + + List selectByExample(LevelUserExample example); + + LevelUser selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") LevelUser record, @Param("example") LevelUserExample example); + + int updateByExample(@Param("record") LevelUser record, @Param("example") LevelUserExample example); + + int updateByPrimaryKeySelective(LevelUser record); + + int updateByPrimaryKey(LevelUser record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java index 873d5c78..c00e3c50 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -116,12 +116,12 @@ public class CompeteService implements ICompeteService{ Long userId = params.getUserId(); //检查验证码是否正确 -// if (!redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(competePlayerInfo.getPhone()))) { -// throw new BaseException(CodeEnum.SMS_CODE_CORRECT); -// } -// if (!competePlayerInfo.getSmsCode().equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(competePlayerInfo.getPhone())).toString())) { -// throw new BaseException(CodeEnum.SMS_CODE_CORRECT); -// } + if (!redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(competePlayerInfo.getPhone()))) { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + if (!competePlayerInfo.getSmsCode().equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(competePlayerInfo.getPhone())).toString())) { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } //检查此用户是否已经报名 CompetePlayerExample playerExample = new CompetePlayerExample(); playerExample.createCriteria().andUserIdEqualTo(userId); @@ -215,8 +215,8 @@ public class CompeteService implements ICompeteService{ team.setCompeteTimeId(params.getParam().getCompeteTimeId()); team.setCertificate(params.getParam().getCertificate()); team.setGenderGroup(player.getGender()); - String qrCode = PropUtil.signUpUrl + "home&teamId=" + team.getId(); - String qrCodeVisit = QrCodeUtil.urlToQRCode(qrCode, PropUtil.path + "qrCode"); + String qrCode = PropUtil.signUpUrl + "home?teamId=" + team.getId(); + String qrCodeVisit = QrCodeUtil.urlToQRCode(qrCode, PropUtil.path); team.setQrCode(qrCodeVisit); competeTeamDao.insertSelective(team); // 加入团队 @@ -263,6 +263,7 @@ public class CompeteService implements ICompeteService{ List competeTeamProjects = competeTeamDao.queryTeam(userId, competeTimeId); //封装队员信息和总队员数 competeTeamProjects.forEach(team -> { + team.setQrCode(PropUtil.imgDomain + team.getQrCode()); List members = competeTeamDao.queryMembers(team.getTeamId()); team.setMembers(members); team.setMemberNums(members.size()); diff --git a/mt/src/main/java/com/ccsens/mt/service/FileService.java b/mt/src/main/java/com/ccsens/mt/service/FileService.java index 5fee1229..aaa34977 100644 --- a/mt/src/main/java/com/ccsens/mt/service/FileService.java +++ b/mt/src/main/java/com/ccsens/mt/service/FileService.java @@ -3,6 +3,7 @@ package com.ccsens.mt.service; import cn.hutool.core.lang.Snowflake; import com.ccsens.mt.bean.po.CommonFile; import com.ccsens.mt.persist.mapper.CommonFileMapper; +import com.ccsens.mt.util.Constant; import com.ccsens.util.NotSupportedFileTypeException; import com.ccsens.util.PropUtil; import com.ccsens.util.UploadFileUtil_Servlet3; @@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.Part; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -48,7 +50,7 @@ public class FileService implements IFileService { fileDo.setLocation(dir + java.io.File.separator + path); fileDo.setUserId(userId); if (WebConstant.IMG_TYPE.contains(name.substring(name.lastIndexOf(".") + 1))) { - fileDo.setVisitLocation(PropUtil.imgDomain + path); + fileDo.setVisitLocation(PropUtil.imgDomain + Constant.File.UPLOAD_URL + File.separator + path); } else { fileDo.setVisitLocation(PropUtil.domain + "file/download/"+fileDo.getId()); } diff --git a/mt/src/main/java/com/ccsens/mt/service/ILevelUpService.java b/mt/src/main/java/com/ccsens/mt/service/ILevelUpService.java new file mode 100644 index 00000000..f2d78327 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/service/ILevelUpService.java @@ -0,0 +1,44 @@ +package com.ccsens.mt.service; + +import com.ccsens.mt.bean.dto.LevelDto; +import com.ccsens.mt.bean.vo.LevelVo; +import com.ccsens.util.bean.dto.QueryDto; + +import java.util.List; + +/** + * @author 逗 + */ +public interface ILevelUpService { + + /** + * 添加选手信息 + * @param levelUserDto 选手信息 + */ + void saveLevelUser(LevelDto.LevelUserDto levelUserDto); + + /** + * 参加比赛时添加晋级表信息 + * @param levelUpDto 选手和比赛信息 + */ + void joinCompete(LevelDto.LevelUpDto levelUpDto); + + /** + * 自动晋级 + * @param autoLevelUpDto 大赛id和比赛code + */ + void autoLevelUp(LevelDto.AutoLevelUpDto autoLevelUpDto); + + /** + * 手动晋级 + * @param params 比赛信息和晋级的选手信息 + */ + void manualLevelUpPlayer(QueryDto params); + + /** + * 查询比赛内晋级的选手信息 + * @param params 比赛id和分页信息 + * @return 返回查到的比赛下所有晋级的选手的信息 + */ + List queryLevelUserInfo(QueryDto params); +} diff --git a/mt/src/main/java/com/ccsens/mt/service/LevelUpService.java b/mt/src/main/java/com/ccsens/mt/service/LevelUpService.java new file mode 100644 index 00000000..43fd1631 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/service/LevelUpService.java @@ -0,0 +1,159 @@ +package com.ccsens.mt.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.lang.Snowflake; +import com.ccsens.mt.bean.dto.LevelDto; +import com.ccsens.mt.bean.po.*; +import com.ccsens.mt.bean.vo.LevelVo; +import com.ccsens.mt.persist.dao.LevelUpDao; +import com.ccsens.mt.persist.mapper.LevelRuleMapper; +import com.ccsens.mt.persist.mapper.LevelUserMapper; +import com.ccsens.mt.util.Constant; +import com.ccsens.util.RedisUtil; +import com.ccsens.util.bean.dto.QueryDto; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @author 逗 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) +public class LevelUpService implements ILevelUpService{ + @Resource + private Snowflake snowflake; + @Resource + private LevelUserMapper levelUserMapper; + @Resource + private LevelUpDao levelUpDao; + @Resource + private LevelRuleMapper levelRuleMapper; + @Resource + private RedisUtil redisUtil; + + /** + * 选手报名时将信息存入选手表 + * @param levelUserDto 选手信息 + */ + @Override + public void saveLevelUser(LevelDto.LevelUserDto levelUserDto) { + log.info("将参加比赛的选手信息存入数据库:{}",levelUserDto); + LevelUser levelUser = new LevelUser(); + BeanUtil.copyProperties(levelUserDto,levelUser); + levelUser.setId(snowflake.nextId()); + levelUserMapper.insertSelective(levelUser); + } + + /** + * 参加比赛时存入将选手和比赛的关联信息存入晋级表,同时存入redis + * @param levelUpDto 选手和比赛信息 + */ + @Override + public void joinCompete(LevelDto.LevelUpDto levelUpDto) { + log.info("参加比赛时储存晋级表:{}",levelUpDto); + //根据playerId查找的选手表id + LevelUser levelUser = null; + LevelUserExample levelUserExample = new LevelUserExample(); + levelUserExample.createCriteria().andPlayerIdEqualTo(levelUpDto.getPlayerId()); + List levelUserList = levelUserMapper.selectByExample(levelUserExample); + if (CollectionUtil.isNotEmpty(levelUserList)){ + log.info("查找到的用户的选手信息:{}",levelUserList); + levelUser = levelUserList.get(0); + } + //添加晋级表 + LevelUpExample levelUpExample = new LevelUpExample(); + levelUpExample.createCriteria().andLevelUserIdEqualTo(levelUser.getId()).andCompeteCodeEqualTo(levelUpDto.getCompeteCode()); + if(levelUpDao.countByExample(levelUpExample) == 0) { + LevelUp levelUp = new LevelUp(); + BeanUtil.copyProperties(levelUpDto, levelUp); + levelUp.setId(snowflake.nextId()); + levelUp.setLevelUserId(levelUser.getId()); + levelUpDao.insertSelective(levelUp); + //存入redis + String key = Constant.Redis.COMPETE_LEVEL + levelUpDto.getCompeteTimeId() + "_" + levelUpDto.getCompeteCode(); + redisUtil.zsSet(key, levelUser, 0); + } + + } + + /** + * 自动晋级 + * @param autoLevelUpDto 大赛id和比赛code + */ + @Override + public void autoLevelUp(LevelDto.AutoLevelUpDto autoLevelUpDto) { + //查找晋级规则, + LevelRule levelRule = new LevelRule(); + LevelRuleExample levelRuleExample = new LevelRuleExample(); + levelRuleExample.createCriteria().andCompeteCodeNowEqualTo(autoLevelUpDto.getCompeteCode()) + .andCompeteTimeIdEqualTo(autoLevelUpDto.getCompeteTimeId()); + List ruleList = levelRuleMapper.selectByExample(levelRuleExample); + if(CollectionUtil.isNotEmpty(ruleList)){ + levelRule = ruleList.get(0); + } + log.info("查找到的比赛晋级规则:{}",levelRule); + String key = Constant.Redis.COMPETE_LEVEL + autoLevelUpDto.getCompeteTimeId() + "_" + autoLevelUpDto.getCompeteCode(); + switch (levelRule.getRule()){ + case Constant.LevelUp.RULE_RANK_NO_REPEAT : + log.info("根据排名(不重复)晋级"); + Set> typedTuples = redisUtil.zsRevGetWithScore(key, 0, -1); + AtomicInteger index = new AtomicInteger(0); + typedTuples.forEach(type ->{ + index.set(index.get() + 1); + // 更新数据库分数 + LevelUser levelUser = (LevelUser) type.getValue(); + Long levelUpId = levelUpDao.getByLevelUserIdAndCode(levelUser.getId(),autoLevelUpDto.getCompeteCode()); + LevelUp levelUp = new LevelUp(); + levelUp.setId(levelUpId); + levelUp.setScore(Objects.requireNonNull(type.getScore()).intValue()); +// levelUp.setRanking(); + }); + break; + case Constant.LevelUp.RULE_RANK_REPEAT : + log.info("根据排名(可以重复)晋级"); + break; + case Constant.LevelUp.RULE_SCORE : + log.info("根据分数晋级"); + break; + case Constant.LevelUp.RULE_APPOINT : + case Constant.LevelUp.RULE_TEAM_RANK : + case Constant.LevelUp.RULE_NO : + default: + break; + } + //在redis中查找需要晋级的人 + + //将选手和晋级信息添加至数据库 + } + + /** + * 手动晋级 + * @param params 比赛信息和晋级的选手信息 + */ + @Override + public void manualLevelUpPlayer(QueryDto params) { + + } + + /** + * 查询比赛内晋级的选手信息 + * @param params 比赛id和分页信息 + * @return 返回查到的比赛下所有晋级的选手的信息 + */ + @Override + public List queryLevelUserInfo(QueryDto params) { + + return null; + } +} diff --git a/mt/src/main/java/com/ccsens/mt/util/Constant.java b/mt/src/main/java/com/ccsens/mt/util/Constant.java index 91af8882..394481f1 100644 --- a/mt/src/main/java/com/ccsens/mt/util/Constant.java +++ b/mt/src/main/java/com/ccsens/mt/util/Constant.java @@ -27,6 +27,8 @@ public class Constant { public final static String COMPETE_COMPANY = "_compete_company"; // 远程比赛参赛单位存在时间10天 public final static long COMPETE_COMPANY_TIME = 10 * 24 * 60 * 60; + // 远程比赛参赛单位 + public final static String COMPETE_LEVEL = "compete_"; } public static final int VOTE_TOTAL = 2; @@ -47,4 +49,18 @@ public class Constant { public static class File{ public static final String UPLOAD_URL = "upload"; } + public final static class LevelUp{ + //不晋级 + public final static byte RULE_NO = 0; + //根据名次晋级(不重复) + public final static byte RULE_RANK_NO_REPEAT = 1; + //根据名次晋级(可以重复) + public final static byte RULE_RANK_REPEAT = 2; + //根据分数晋级 + public final static byte RULE_SCORE = 3; + //指定晋级人员 + public final static byte RULE_APPOINT = 4; + //团体赛按名次 + public final static byte RULE_TEAM_RANK = 5; + } } diff --git a/mt/src/main/resources/application-dev.yml b/mt/src/main/resources/application-dev.yml index 0865be50..3121478b 100644 --- a/mt/src/main/resources/application-dev.yml +++ b/mt/src/main/resources/application-dev.yml @@ -28,4 +28,6 @@ swagger: enable: true file: path: /home/cloud/mt/uploads/ - signUpUrl: https://test.tall.wiki/signup/ + signUpUrl: https://test.tall.wiki/compete/ + domain: https://test.tall.wiki/gateway/mt/ + imgDomain: https://test.tall.wiki/gateway/mt/uploads/ diff --git a/mt/src/main/resources/application-prod.yml b/mt/src/main/resources/application-prod.yml index 2976c702..41a2460b 100644 --- a/mt/src/main/resources/application-prod.yml +++ b/mt/src/main/resources/application-prod.yml @@ -34,4 +34,6 @@ gatewayUrl: https://www.tall.wiki/gateway/ notGatewayUrl: https://www.tall.wiki/ file: path: /home/cloud/mt/uploads/ - signUpUrl: https://www.tall.wiki/signup/ \ No newline at end of file + signUpUrl: https://www.tall.wiki/compete/ + domain: https://test.tall.wiki/gateway/mt/ + imgDomain: https://test.tall.wiki/gateway/mt/uploads/ \ No newline at end of file diff --git a/mt/src/main/resources/application-test.yml b/mt/src/main/resources/application-test.yml index 7f8a933b..5130b7a9 100644 --- a/mt/src/main/resources/application-test.yml +++ b/mt/src/main/resources/application-test.yml @@ -31,4 +31,6 @@ eureka: ip-address: 192.168.0.99 file: path: /home/cloud/mt/uploads/ - signUpUrl: https://test.tall.wiki/signup/ + signUpUrl: https://test.tall.wiki/compete/ + domain: https://test.tall.wiki/gateway/mt/ + imgDomain: https://test.tall.wiki/gateway/mt/uploads/ diff --git a/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml b/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml index 1ba0c914..a943bcff 100644 --- a/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml +++ b/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml @@ -4,7 +4,7 @@ + SELECT id FROM `t_level_up` WHERE level_user_id = #{levelUserId} and compete_code = #{competeCode} + + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml b/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml new file mode 100644 index 00000000..9bdb92cd --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, compete_time_id, compete_code_now, compete_code_level_up, rule, level_condition, + auto_level, compete_order, created_at, updated_at, rec_status + + + + + delete from t_level_rule + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_rule + + + + + + insert into t_level_rule (id, compete_time_id, compete_code_now, + compete_code_level_up, rule, level_condition, + auto_level, compete_order, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{competeCodeNow,jdbcType=VARCHAR}, + #{competeCodeLevelUp,jdbcType=VARCHAR}, #{rule,jdbcType=TINYINT}, #{levelCondition,jdbcType=INTEGER}, + #{autoLevel,jdbcType=TINYINT}, #{competeOrder,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_rule + + + id, + + + compete_time_id, + + + compete_code_now, + + + compete_code_level_up, + + + rule, + + + level_condition, + + + auto_level, + + + compete_order, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{competeTimeId,jdbcType=BIGINT}, + + + #{competeCodeNow,jdbcType=VARCHAR}, + + + #{competeCodeLevelUp,jdbcType=VARCHAR}, + + + #{rule,jdbcType=TINYINT}, + + + #{levelCondition,jdbcType=INTEGER}, + + + #{autoLevel,jdbcType=TINYINT}, + + + #{competeOrder,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_rule + + + id = #{record.id,jdbcType=BIGINT}, + + + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + + + compete_code_now = #{record.competeCodeNow,jdbcType=VARCHAR}, + + + compete_code_level_up = #{record.competeCodeLevelUp,jdbcType=VARCHAR}, + + + rule = #{record.rule,jdbcType=TINYINT}, + + + level_condition = #{record.levelCondition,jdbcType=INTEGER}, + + + auto_level = #{record.autoLevel,jdbcType=TINYINT}, + + + compete_order = #{record.competeOrder,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_rule + set id = #{record.id,jdbcType=BIGINT}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + compete_code_now = #{record.competeCodeNow,jdbcType=VARCHAR}, + compete_code_level_up = #{record.competeCodeLevelUp,jdbcType=VARCHAR}, + rule = #{record.rule,jdbcType=TINYINT}, + level_condition = #{record.levelCondition,jdbcType=INTEGER}, + auto_level = #{record.autoLevel,jdbcType=TINYINT}, + compete_order = #{record.competeOrder,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_rule + + + compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + + + compete_code_now = #{competeCodeNow,jdbcType=VARCHAR}, + + + compete_code_level_up = #{competeCodeLevelUp,jdbcType=VARCHAR}, + + + rule = #{rule,jdbcType=TINYINT}, + + + level_condition = #{levelCondition,jdbcType=INTEGER}, + + + auto_level = #{autoLevel,jdbcType=TINYINT}, + + + compete_order = #{competeOrder,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_rule + set compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + compete_code_now = #{competeCodeNow,jdbcType=VARCHAR}, + compete_code_level_up = #{competeCodeLevelUp,jdbcType=VARCHAR}, + rule = #{rule,jdbcType=TINYINT}, + level_condition = #{levelCondition,jdbcType=INTEGER}, + auto_level = #{autoLevel,jdbcType=TINYINT}, + compete_order = #{competeOrder,jdbcType=TINYINT}, + 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/mt/src/main/resources/mapper_raw/LevelUpMapper.xml b/mt/src/main/resources/mapper_raw/LevelUpMapper.xml new file mode 100644 index 00000000..86c97dd8 --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelUpMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, compete_time_id, compete_code, level_user_id, score, addition_score, ranking, + level_up_type, created_at, updated_at, rec_status + + + + + delete from t_level_up + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_up + + + + + + insert into t_level_up (id, compete_time_id, compete_code, + level_user_id, score, addition_score, + ranking, level_up_type, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{competeCode,jdbcType=VARCHAR}, + #{levelUserId,jdbcType=BIGINT}, #{score,jdbcType=INTEGER}, #{additionScore,jdbcType=INTEGER}, + #{ranking,jdbcType=INTEGER}, #{levelUpType,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_up + + + id, + + + compete_time_id, + + + compete_code, + + + level_user_id, + + + score, + + + addition_score, + + + ranking, + + + level_up_type, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{competeTimeId,jdbcType=BIGINT}, + + + #{competeCode,jdbcType=VARCHAR}, + + + #{levelUserId,jdbcType=BIGINT}, + + + #{score,jdbcType=INTEGER}, + + + #{additionScore,jdbcType=INTEGER}, + + + #{ranking,jdbcType=INTEGER}, + + + #{levelUpType,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_up + + + id = #{record.id,jdbcType=BIGINT}, + + + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + + + level_user_id = #{record.levelUserId,jdbcType=BIGINT}, + + + score = #{record.score,jdbcType=INTEGER}, + + + addition_score = #{record.additionScore,jdbcType=INTEGER}, + + + ranking = #{record.ranking,jdbcType=INTEGER}, + + + level_up_type = #{record.levelUpType,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_up + set id = #{record.id,jdbcType=BIGINT}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + level_user_id = #{record.levelUserId,jdbcType=BIGINT}, + score = #{record.score,jdbcType=INTEGER}, + addition_score = #{record.additionScore,jdbcType=INTEGER}, + ranking = #{record.ranking,jdbcType=INTEGER}, + level_up_type = #{record.levelUpType,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_up + + + compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{competeCode,jdbcType=VARCHAR}, + + + level_user_id = #{levelUserId,jdbcType=BIGINT}, + + + score = #{score,jdbcType=INTEGER}, + + + addition_score = #{additionScore,jdbcType=INTEGER}, + + + ranking = #{ranking,jdbcType=INTEGER}, + + + level_up_type = #{levelUpType,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_up + set compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + compete_code = #{competeCode,jdbcType=VARCHAR}, + level_user_id = #{levelUserId,jdbcType=BIGINT}, + score = #{score,jdbcType=INTEGER}, + addition_score = #{additionScore,jdbcType=INTEGER}, + ranking = #{ranking,jdbcType=INTEGER}, + level_up_type = #{levelUpType,jdbcType=TINYINT}, + 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/mt/src/main/resources/mapper_raw/LevelUserMapper.xml b/mt/src/main/resources/mapper_raw/LevelUserMapper.xml new file mode 100644 index 00000000..ffb091a8 --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelUserMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, player_id, avatar_url, name, team_id, created_at, updated_at, rec_status + + + + + delete from t_level_user + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_user + + + + + + insert into t_level_user (id, player_id, avatar_url, + name, team_id, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{playerId,jdbcType=BIGINT}, #{avatarUrl,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{teamId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_user + + + id, + + + player_id, + + + avatar_url, + + + name, + + + team_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{playerId,jdbcType=BIGINT}, + + + #{avatarUrl,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_user + + + id = #{record.id,jdbcType=BIGINT}, + + + player_id = #{record.playerId,jdbcType=BIGINT}, + + + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_user + set id = #{record.id,jdbcType=BIGINT}, + player_id = #{record.playerId,jdbcType=BIGINT}, + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + team_id = #{record.teamId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_user + + + player_id = #{playerId,jdbcType=BIGINT}, + + + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_user + set player_id = #{playerId,jdbcType=BIGINT}, + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + team_id = #{teamId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/pims/src/main/java/com/ccsens/pims/config/SpringConfig.java b/pims/src/main/java/com/ccsens/pims/config/SpringConfig.java index c8d02d73..2b00edcf 100644 --- a/pims/src/main/java/com/ccsens/pims/config/SpringConfig.java +++ b/pims/src/main/java/com/ccsens/pims/config/SpringConfig.java @@ -111,7 +111,7 @@ public class SpringConfig implements WebMvcConfigurer { .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/uploads/**") - .addResourceLocations("file:///home/cloud/tall/uploads/"); + .addResourceLocations("file:///home/cloud/pims/uploads/"); //super.addResourceHandlers(registry); } diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java index 52bc2604..2b6f88ff 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java @@ -10,6 +10,8 @@ public class SysDomain implements Serializable { private String logo; + private String logoPath; + private String companyName; private String systemName; @@ -60,6 +62,14 @@ public class SysDomain implements Serializable { this.logo = logo == null ? null : logo.trim(); } + public String getLogoPath() { + return logoPath; + } + + public void setLogoPath(String logoPath) { + this.logoPath = logoPath == null ? null : logoPath.trim(); + } + public String getCompanyName() { return companyName; } @@ -165,6 +175,7 @@ public class SysDomain implements Serializable { sb.append(", id=").append(id); sb.append(", domainName=").append(domainName); sb.append(", logo=").append(logo); + sb.append(", logoPath=").append(logoPath); sb.append(", companyName=").append(companyName); sb.append(", systemName=").append(systemName); sb.append(", backdropUrl=").append(backdropUrl); diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java index 1b0fda64..e100bac0 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java @@ -305,6 +305,76 @@ public class SysDomainExample { return (Criteria) this; } + public Criteria andLogoPathIsNull() { + addCriterion("logo_path is null"); + return (Criteria) this; + } + + public Criteria andLogoPathIsNotNull() { + addCriterion("logo_path is not null"); + return (Criteria) this; + } + + public Criteria andLogoPathEqualTo(String value) { + addCriterion("logo_path =", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotEqualTo(String value) { + addCriterion("logo_path <>", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathGreaterThan(String value) { + addCriterion("logo_path >", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathGreaterThanOrEqualTo(String value) { + addCriterion("logo_path >=", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLessThan(String value) { + addCriterion("logo_path <", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLessThanOrEqualTo(String value) { + addCriterion("logo_path <=", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLike(String value) { + addCriterion("logo_path like", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotLike(String value) { + addCriterion("logo_path not like", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathIn(List values) { + addCriterion("logo_path in", values, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotIn(List values) { + addCriterion("logo_path not in", values, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathBetween(String value1, String value2) { + addCriterion("logo_path between", value1, value2, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotBetween(String value1, String value2) { + addCriterion("logo_path not between", value1, value2, "logoPath"); + return (Criteria) this; + } + public Criteria andCompanyNameIsNull() { addCriterion("company_name is null"); return (Criteria) this; diff --git a/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java b/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java index e35e1230..25367769 100644 --- a/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java +++ b/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java @@ -3,7 +3,10 @@ package com.ccsens.tall.intercept; import cn.hutool.core.collection.CollectionUtil; import com.ccsens.util.WebConstant; import org.apache.ibatis.executor.Executor; -import org.apache.ibatis.mapping.*; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.ResultMap; +import org.apache.ibatis.mapping.SqlSource; import org.apache.ibatis.plugin.*; import org.apache.ibatis.reflection.DefaultReflectorFactory; import org.apache.ibatis.reflection.MetaObject; @@ -12,8 +15,10 @@ import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.RowBounds; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.List; +import java.util.Map; import java.util.Properties; /** @@ -34,43 +39,21 @@ public class MybatisInterceptor implements Interceptor { String selectByExample = "selectByExample"; + String countByExample = "countByExample"; + String countByExample2 = "selectByExample_COUNT"; String selectByPrimaryKey = "selectByPrimaryKey"; Object[] args = invocation.getArgs(); MappedStatement statement = (MappedStatement) args[0]; - if (statement.getId().endsWith(selectByExample)) { + if (statement.getId().endsWith(selectByExample) + || statement.getId().endsWith(countByExample) + || statement.getId().endsWith(countByExample2)) { //XXXExample Object example = args[1]; - Method method = example.getClass().getMethod("getOredCriteria", null); - //获取到条件数组,第一个是Criteria - List list = (List)method.invoke(example); - if (CollectionUtil.isEmpty(list)) { - Class clazz = ((ResultMap)statement.getResultMaps().get(0)).getType(); - String exampleName = clazz.getName() + "Example"; - Object paramExample = Class.forName(exampleName).newInstance(); - Method createCriteria = paramExample.getClass().getMethod("createCriteria"); - Object criteria = createCriteria.invoke(paramExample); - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - list.add(criteria); - } else { - Object criteria = list.get(0); - Method getCriteria = criteria.getClass().getMethod("getCriteria"); - List params = (List)getCriteria.invoke(criteria); - boolean hasDel = false; - for(Object param: params) { - Method getCondition = param.getClass().getMethod("getCondition"); - Object condition = getCondition.invoke(param); - if ("iis_del =".equals(condition)) { - hasDel = true; - } - } - if (!hasDel) { - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - } - } + addCondition(statement, example); + + } else if (statement.getId().endsWith(selectByPrimaryKey)) { @@ -85,6 +68,45 @@ public class MybatisInterceptor implements Interceptor { return invocation.proceed(); } + private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { + if (example instanceof Map) { + example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); + } + + + Method method = example.getClass().getMethod("getOredCriteria", null); + //获取到条件数组,第一个是Criteria + List list = (List) method.invoke(example); + if (CollectionUtil.isEmpty(list)) { + Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); + String exampleName = clazz.getName() + "Example"; + Object paramExample = Class.forName(exampleName).newInstance(); + Method createCriteria = paramExample.getClass().getMethod("createCriteria"); + Object criteria = createCriteria.invoke(paramExample); + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + list.add(criteria); + } else { + Object criteria = list.get(0); + Method getCriteria = criteria.getClass().getMethod("getCriteria"); + List params = (List) getCriteria.invoke(criteria); + boolean hasDel = false; + for (Object param : params) { + Method getCondition = param.getClass().getMethod("getCondition"); + Object condition = getCondition.invoke(param); + if ("rec_status =".equals(condition)) { + hasDel = true; + } + } + if (!hasDel) { + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + } + + } + + } + @Override public Object plugin(Object target) { return Plugin.wrap(target, this); @@ -121,24 +143,7 @@ public class MybatisInterceptor implements Interceptor { return builder.build(); } - private String getOperateType(Invocation invocation) { - final Object[] args = invocation.getArgs(); - MappedStatement ms = (MappedStatement) args[0]; - SqlCommandType commondType = ms.getSqlCommandType(); - if (commondType.compareTo(SqlCommandType.SELECT) == 0) { - return "select"; - } - if (commondType.compareTo(SqlCommandType.INSERT) == 0) { - return "insert"; - } - if (commondType.compareTo(SqlCommandType.UPDATE) == 0) { - return "update"; - } - if (commondType.compareTo(SqlCommandType.DELETE) == 0) { - return "delete"; - } - return null; - } + // 定义一个内部辅助类,作用是包装sq class BoundSqlSqlSource implements SqlSource { private BoundSql boundSql; diff --git a/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java b/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java index bc497031..79e8967f 100644 --- a/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java +++ b/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java @@ -2,16 +2,12 @@ package com.ccsens.tall.scheduled; import cn.hutool.core.collection.CollectionUtil; import com.ccsens.tall.bean.po.ProRemind; -import com.ccsens.tall.bean.po.SysProjectRobot; -import com.ccsens.tall.bean.po.SysProjectRobotExample; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.ProRemindDao; import com.ccsens.tall.service.IProjectMessageService; import com.ccsens.tall.service.IRobotService; -import com.ccsens.tall.util.TallConstant; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -42,7 +38,7 @@ public class ScheduledService { public static final String AFTER_END = "您在项目's'中的任务's'已经在's'结束了"; public static final String USER_DEFINED = "来自项目's'中的任务's'的提醒"; - @Scheduled(cron = "*/60 * * * * ?") +// @Scheduled(cron = "*/60 * * * * ?") public void runfirst(){ long now = System.currentTimeMillis(); // long now = 1594611047000L; diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 9773413f..2628c5d5 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -765,11 +765,15 @@ public class ProTaskDetailService implements IProTaskDetailService { List normalTaskList = new ArrayList<>(); //获取用户的角色 if(CollectionUtil.isEmpty(roleList)){ + roleList = new HashSet<>(); //查询此用户在项目中的的所有角色的任务 List roles = proMemberService.selectRolesByUserIdAndProjectId(userId, project.getId()); - roles.forEach(role->{ + for (ProRole role : roles){ roleList.add(role.getId()); - }); + } +// roles.forEach(role->{ +// roleList.add(role.getId()); +// }); } //获取“全体成员”角色 diff --git a/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java b/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java index 3c48980e..3c0a3d8f 100644 --- a/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java +++ b/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java @@ -287,7 +287,7 @@ public class TaskPluginService implements ITaskPluginService{ domainExample.createCriteria().andDomainNameEqualTo(getMinutes.getDomainName()); List sysDomainList = sysDomainDao.selectByExample(domainExample); if (CollectionUtil.isNotEmpty(sysDomainList)) { - logo = sysDomainList.get(0).getLogo(); + logo = sysDomainList.get(0).getLogoPath(); } } //查找该任务的会议记录文件,有则直接返回 @@ -423,7 +423,7 @@ public class TaskPluginService implements ITaskPluginService{ domainExample.createCriteria().andDomainNameEqualTo(updateMinutes.getDomainName()); List sysDomainList = sysDomainDao.selectByExample(domainExample); if (CollectionUtil.isNotEmpty(sysDomainList)) { - logo = sysDomainList.get(0).getLogo(); + logo = sysDomainList.get(0).getLogoPath(); } } //查找到文件信息 @@ -487,9 +487,55 @@ public class TaskPluginService implements ITaskPluginService{ }); } } - OutputStream stream = new FileOutputStream(wpsFile.getSaveUrl()); +// OutputStream stream = new FileOutputStream(wpsFile.getSaveUrl()); +// wb.write(stream); +// stream.close(); + + String name = "会议记录"+DateUtil.today() + ".xlsx"; + String fileName = "minutes/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; + String path = WebConstant.UPLOAD_PATH_BASE + File.separator + fileName; + File tmpFile = new File(path); + if (!tmpFile.getParentFile().exists()) { + tmpFile.getParentFile().mkdirs(); + } + OutputStream stream = new FileOutputStream(tmpFile); wb.write(stream); stream.close(); + //删除projectFile + ProProjectFileExample projectFileExample = new ProProjectFileExample(); + projectFileExample.createCriteria().andWpsFileIdEqualTo(wpsFile.getId()); + List projectFileList = proProjectFileDao.selectByExample(projectFileExample); + if(CollectionUtil.isNotEmpty(projectFileList)) { + projectFileList.forEach(proProjectFile -> { + proProjectFile.setRecStatus((byte) 2); + proProjectFileDao.updateByPrimaryKeySelective(proProjectFile); + }); + } + //重新保存wps + WpsDto.Business business = new WpsDto.Business(); + business.setBusinessId(updateMinutes.getTaskId()); + business.setBusinessType((byte) 2); + business.setUserId(currentUserId); + business.setFileName(name); + business.setFilePath(fileName); + business.setFileSize(tmpFile.length()); + business.setOperation(WebConstant.Wps.USER_OPERATION_NEW); + business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_QUERY); + business.setPrivilegeQueryUrl(PropUtil.domain + "v1/3rd/wpsPower"); + wpsService.saveFile(business); + + List minutesInfoList1 = new ArrayList<>(); + List wpsPath1 = wpsService.queryVisitUrls(updateMinutes.getTaskId(),(byte) 2,token,null); + if(CollectionUtil.isNotEmpty(wpsPath1)){ + wpsPath1.forEach(wps->{ + PluginVo.MinutesInfo minutesInfo = new PluginVo.MinutesInfo(); + minutesInfo.setWpsPath(wps); + minutesInfo.setDownloadPath(wpsFile.getDownloadUrl()); + minutesInfo.setWpsFileId(wpsFile.getId()); + minutesInfoList1.add(minutesInfo); + }); + } + return minutesInfoList1; } return minutesInfoList; diff --git a/tall/src/main/java/com/ccsens/tall/service/WpsService.java b/tall/src/main/java/com/ccsens/tall/service/WpsService.java index 433c7d32..56ee8acc 100644 --- a/tall/src/main/java/com/ccsens/tall/service/WpsService.java +++ b/tall/src/main/java/com/ccsens/tall/service/WpsService.java @@ -227,18 +227,16 @@ public class WpsService implements IWpsService { } String fileType = WebConstant.Wps.getFileType(ext); Map paramMap= new HashMap<>(); - paramMap.put("_w_appid", WebConstant.Wps.APPID); + paramMap.put("_w_appid", (String) redisUtil.get(WebConstant.Wps.APPID)); paramMap.put("_w_token", token); if (CollectionUtil.isNotEmpty(params)) { paramMap.putAll(params); } - String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY); - StringBuilder fileUrl = new StringBuilder("https://wwo.wps.cn/office/{}/{}?_w_appid=" + WebConstant.Wps.APPID + "&_w_signature={}&_w_token={}"); + String newSignature = WpsSignature.getSignature(paramMap, (String) redisUtil.get(WebConstant.Wps.APPKEY)); + StringBuilder fileUrl = new StringBuilder("https://wwo.wps.cn/office/{}/{}?_w_appid=" + redisUtil.get(WebConstant.Wps.APPID) + "&_w_signature={}&_w_token={}"); if (CollectionUtil.isNotEmpty(params)) { params.forEach((k,v) -> fileUrl.append("&").append(k).append("=").append(v)); - - } return StrUtil.format(fileUrl, fileType, fileId, newSignature, token); } diff --git a/tall/src/main/java/com/ccsens/tall/web/DebugController.java b/tall/src/main/java/com/ccsens/tall/web/DebugController.java index 808631e0..8ce4801f 100644 --- a/tall/src/main/java/com/ccsens/tall/web/DebugController.java +++ b/tall/src/main/java/com/ccsens/tall/web/DebugController.java @@ -3,6 +3,7 @@ package com.ccsens.tall.web; import com.ccsens.tall.bean.dto.message.SyncMessageWithStartDto; import com.ccsens.util.JacksonUtil; import com.ccsens.util.JsonResponse; +import com.ccsens.util.RedisUtil; import com.ccsens.util.bean.message.common.InMessage; import com.ccsens.util.bean.message.common.MessageConstant; import com.ccsens.util.bean.message.common.MessageRule; @@ -30,6 +31,8 @@ import java.util.Set; public class DebugController { @Autowired private AmqpTemplate rabbitTemplate; + @Resource + private RedisUtil redisUtil; @Resource private PlatformTransactionManager transactionManager; @@ -40,7 +43,10 @@ public class DebugController { }) @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) public JsonResponse getSmsCode(HttpServletRequest request) throws Exception { - return JsonResponse.newInstance().ok("测试"); + redisUtil.set("wps_tall_appId","d12722a7d28e430c889309fa4754aaba"); + redisUtil.set("wps_tall_appKey","f273e717247947ba8942a2373b6896c7"); + + return JsonResponse.newInstance().ok(redisUtil.get("wps_tall_appId")); } diff --git a/tall/src/main/java/com/ccsens/tall/web/WpsController.java b/tall/src/main/java/com/ccsens/tall/web/WpsController.java index 475efe07..7eef3bb2 100644 --- a/tall/src/main/java/com/ccsens/tall/web/WpsController.java +++ b/tall/src/main/java/com/ccsens/tall/web/WpsController.java @@ -8,10 +8,7 @@ import com.ccsens.tall.bean.vo.UserVo; import com.ccsens.tall.bean.vo.WpsVo; import com.ccsens.tall.service.IUserService; import com.ccsens.tall.service.IWpsService; -import com.ccsens.util.CodeEnum; -import com.ccsens.util.JsonResponse; -import com.ccsens.util.WebConstant; -import com.ccsens.util.WpsSignature; +import com.ccsens.util.*; import com.ccsens.util.exception.BaseException; import io.swagger.annotations.*; import lombok.Data; @@ -44,6 +41,8 @@ public class WpsController { private IWpsService wpsService; @Resource private IUserService userService; + @Resource + private RedisUtil redisUtil; @InitBinder public void initBinder(WebDataBinder binder) { @@ -223,7 +222,7 @@ public class WpsController { */ private Map initMap(){ Map paramMap= new HashMap<>(); - paramMap.put("_w_appid", WebConstant.Wps.APPID); + paramMap.put("_w_appid", (String) redisUtil.get(WebConstant.Wps.APPID)); return paramMap; } @@ -253,7 +252,7 @@ public class WpsController { } } - String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY); + String newSignature = WpsSignature.getSignature(paramMap,(String) redisUtil.get(WebConstant.Wps.APPKEY)); log.info("newSignature:{}", newSignature); log.info("参数签名:{}---{}", signature, URLEncoder.encode(signature, CharsetUtil.UTF_8)); if (!newSignature.equals(URLEncoder.encode(signature, CharsetUtil.UTF_8))) { diff --git a/tall/src/main/resources/mapper_raw/SysDomainMapper.xml b/tall/src/main/resources/mapper_raw/SysDomainMapper.xml index ffc262a9..7324a050 100644 --- a/tall/src/main/resources/mapper_raw/SysDomainMapper.xml +++ b/tall/src/main/resources/mapper_raw/SysDomainMapper.xml @@ -5,6 +5,7 @@ + @@ -77,8 +78,9 @@ - id, domain_name, logo, company_name, system_name, backdrop_url, show_calendar, show_project_id, - caption, headline, created_at, updated_at, rec_status, forever_project_id, navigation_bar + id, domain_name, logo, logo_path, company_name, system_name, backdrop_url, show_calendar, + show_project_id, caption, headline, created_at, updated_at, rec_status, forever_project_id, + navigation_bar