Browse Source

评分

master
zhangye 6 years ago
parent
commit
cfa9abb3cb
  1. 21
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/MemberVo.java
  2. 14
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/TaskVo.java
  3. 28
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
  4. 16
      game/src/main/java/com/ccsens/game/api/ScreenController.java
  5. 4
      game/src/main/java/com/ccsens/game/bean/dto/ScreenDto.java
  6. 30
      game/src/main/java/com/ccsens/game/bean/po/GameType.java
  7. 166
      game/src/main/java/com/ccsens/game/bean/po/GameTypeExample.java
  8. 81
      game/src/main/java/com/ccsens/game/bean/vo/ScreenVo.java
  9. 2
      game/src/main/java/com/ccsens/game/config/SwaggerConfigure.java
  10. 8
      game/src/main/java/com/ccsens/game/persist/dao/GameActivityRuleDao.java
  11. 8
      game/src/main/java/com/ccsens/game/persist/dao/GameMemberDao.java
  12. 8
      game/src/main/java/com/ccsens/game/persist/dao/GameRecordDao.java
  13. 8
      game/src/main/java/com/ccsens/game/persist/dao/GameTypeDao.java
  14. 9
      game/src/main/java/com/ccsens/game/persist/dao/GameTypeMemberDao.java
  15. 8
      game/src/main/java/com/ccsens/game/service/IScreenService.java
  16. 110
      game/src/main/java/com/ccsens/game/service/ScreenService.java
  17. 55
      game/src/main/resources/mapper_raw/GameTypeMapper.xml
  18. 16
      game/src/main/resources/mbg.xml
  19. 15
      game/src/test/java/com/ccsens/game/GameApplicationTests.java
  20. 117
      mt/.mvn/wrapper/MavenWrapperDownloader.java
  21. 2
      mt/.mvn/wrapper/maven-wrapper.properties
  22. 75
      mt/pom.xml
  23. 24
      mt/src/main/java/com/ccsens/mt/MtApplication.java
  24. 28
      mt/src/main/java/com/ccsens/mt/api/DebugController.java
  25. 124
      mt/src/main/java/com/ccsens/mt/api/ScoreController.java
  26. 56
      mt/src/main/java/com/ccsens/mt/api/SigninController.java
  27. 83
      mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java
  28. 19
      mt/src/main/java/com/ccsens/mt/bean/dto/SigninDto.java
  29. 35
      mt/src/main/java/com/ccsens/mt/bean/dto/message/BaseMessageDto.java
  30. 39
      mt/src/main/java/com/ccsens/mt/bean/dto/message/SyncMessageWithShowDto.java
  31. 117
      mt/src/main/java/com/ccsens/mt/bean/po/MtJudge.java
  32. 771
      mt/src/main/java/com/ccsens/mt/bean/po/MtJudgeExample.java
  33. 129
      mt/src/main/java/com/ccsens/mt/bean/po/MtScore.java
  34. 812
      mt/src/main/java/com/ccsens/mt/bean/po/MtScoreExample.java
  35. 118
      mt/src/main/java/com/ccsens/mt/bean/po/MtScoreLog.java
  36. 752
      mt/src/main/java/com/ccsens/mt/bean/po/MtScoreLogExample.java
  37. 139
      mt/src/main/java/com/ccsens/mt/bean/po/MtSignin.java
  38. 891
      mt/src/main/java/com/ccsens/mt/bean/po/MtSigninExample.java
  39. 172
      mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java
  40. 21
      mt/src/main/java/com/ccsens/mt/bean/vo/SigninVo.java
  41. 31
      mt/src/main/java/com/ccsens/mt/config/BeanConfig.java
  42. 164
      mt/src/main/java/com/ccsens/mt/config/SpringConfig.java
  43. 56
      mt/src/main/java/com/ccsens/mt/config/SwaggerConfigure.java
  44. 154
      mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java
  45. 8
      mt/src/main/java/com/ccsens/mt/persist/dao/MtJudgeDao.java
  46. 12
      mt/src/main/java/com/ccsens/mt/persist/dao/MtScoreDao.java
  47. 8
      mt/src/main/java/com/ccsens/mt/persist/dao/MtScoreLogDao.java
  48. 8
      mt/src/main/java/com/ccsens/mt/persist/dao/MtSigninDao.java
  49. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/MtJudgeMapper.java
  50. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/MtScoreLogMapper.java
  51. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/MtScoreMapper.java
  52. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/MtSigninMapper.java
  53. 9
      mt/src/main/java/com/ccsens/mt/service/IMessageService.java
  54. 18
      mt/src/main/java/com/ccsens/mt/service/IScoreService.java
  55. 10
      mt/src/main/java/com/ccsens/mt/service/ISigninService.java
  56. 8
      mt/src/main/java/com/ccsens/mt/service/IUserService.java
  57. 22
      mt/src/main/java/com/ccsens/mt/service/MessageServicer.java
  58. 324
      mt/src/main/java/com/ccsens/mt/service/ScoreService.java
  59. 75
      mt/src/main/java/com/ccsens/mt/service/SigninService.java
  60. 41
      mt/src/main/java/com/ccsens/mt/service/UserService.java
  61. 30
      mt/src/main/resources/application-common.yml
  62. 29
      mt/src/main/resources/application-dev.yml
  63. 28
      mt/src/main/resources/application-test.yml
  64. 4
      mt/src/main/resources/application.yml
  65. 33
      mt/src/main/resources/druid-dev.yml
  66. 33
      mt/src/main/resources/druid-prod.yml
  67. 33
      mt/src/main/resources/druid-test.yml
  68. 196
      mt/src/main/resources/logback-spring.xml
  69. 50
      mt/src/main/resources/mapper_dao/ScoreDao.xml
  70. 275
      mt/src/main/resources/mapper_raw/MtJudgeMapper.xml
  71. 275
      mt/src/main/resources/mapper_raw/MtScoreLogMapper.xml
  72. 291
      mt/src/main/resources/mapper_raw/MtScoreMapper.xml
  73. 306
      mt/src/main/resources/mapper_raw/MtSigninMapper.xml
  74. 61
      mt/src/main/resources/mybatis/mybatis-config.xml
  75. 1
      pom.xml
  76. 4
      tall/src/main/java/com/ccsens/tall/bean/vo/MemberVo.java
  77. 9
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  78. 2
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  79. 3
      tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java
  80. 1106
      tall/src/main/java/com/ccsens/tall/service/ExcelMtService.java
  81. 326
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  82. 8
      tall/src/main/java/com/ccsens/tall/service/IExcelMtService.java
  83. 1
      tall/src/main/java/com/ccsens/tall/service/IProMemberService.java
  84. 2
      tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java
  85. 14
      tall/src/main/java/com/ccsens/tall/service/ProMemberService.java
  86. 59
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  87. 3
      tall/src/main/java/com/ccsens/tall/web/MemberRoleController.java
  88. 14
      tall/src/main/java/com/ccsens/tall/web/TaskController.java
  89. 17
      tall/src/main/java/com/ccsens/tall/web/UserController.java
  90. 38
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  91. 5
      util/src/main/java/com/ccsens/util/CodeEnum.java
  92. 11
      util/src/main/java/com/ccsens/util/WebConstant.java
  93. 7
      util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java

21
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/MemberVo.java

@ -0,0 +1,21 @@
package com.ccsens.cloudutil.bean.tall.vo;
import lombok.Data;
@Data
public class MemberVo {
@Data
public static class MemberInfo{
private Long id;
private Long userId;
private Long projectId;
private String nickname;
private String avatarUrl;
private Integer no;
private String phone;
private String description;
private Long joinTime;
private Long stakeholderId;
}
}

14
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/TaskVo.java

@ -0,0 +1,14 @@
package com.ccsens.cloudutil.bean.tall.vo;
import lombok.Data;
@Data
public class TaskVo {
@Data
public static class TaskInfoWithFeign{
private Long id;
private String name;
private Long projectId;
private String projectName;
}
}

28
cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java

@ -4,8 +4,11 @@ import com.ccsens.cloudutil.bean.QueryParam;
import com.ccsens.cloudutil.bean.tall.dto.LogDto;
import com.ccsens.cloudutil.bean.tall.dto.MemberRoleDto;
import com.ccsens.cloudutil.bean.tall.dto.UserDto;
import com.ccsens.cloudutil.bean.tall.vo.MemberVo;
import com.ccsens.cloudutil.bean.tall.vo.TaskVo;
import com.ccsens.cloudutil.bean.tall.vo.UserVo;
import com.ccsens.util.JsonResponse;
import feign.Param;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.configurationprocessor.json.JSONObject;
@ -72,6 +75,21 @@ public interface TallFeignClient {
*/
@RequestMapping("/log/operation")
JsonResponse log(LogDto logDto);
/**
* 通过任务id获得项目id
* @param taskId
* @return
*/
@GetMapping("/tasks/projectId")
TaskVo.TaskInfoWithFeign getProjectId(@RequestParam( name = "taskId")Long taskId);
/**
* 查询该用户在项目中的member信息
* @return
*/
@GetMapping("/users/member")
JsonResponse<MemberVo.MemberInfo> getMemberByUserId(@RequestParam( name = "userId") Long userId,@RequestParam( name = "projectId") Long projectId);
}
@Slf4j
@ -114,6 +132,16 @@ class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> {
public JsonResponse log(LogDto logDto) {
return JsonResponse.newInstance().fail();
}
@Override
public TaskVo.TaskInfoWithFeign getProjectId(Long taskId) {
return null;
}
@Override
public JsonResponse<MemberVo.MemberInfo> getMemberByUserId(Long userId,Long projectId) {
return JsonResponse.newInstance().fail();
}
};
}

16
game/src/main/java/com/ccsens/game/api/ScreenController.java

@ -1,12 +1,12 @@
package com.ccsens.game.api;
import com.ccsens.game.bean.dto.ScreenDto;
import com.ccsens.game.bean.vo.ScreenVo;
import com.ccsens.game.service.IScreenService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -14,23 +14,23 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
@Slf4j
@Api(tags = "大屏相关api" , description = "ScreenController")
@RestController
@RequestMapping("/screen")
public class ScreenController {
@Autowired
private IScreenService screenService;
@ApiOperation(value = "获取大屏路径", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "url", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse getScreenUrl(HttpServletRequest request,
public JsonResponse<ScreenVo.UrlVo> getScreenUrl(HttpServletRequest request,
@ApiParam @Validated @RequestBody ScreenDto.MemberGame memberGame) throws Exception {
log.info("获取大屏路径:{}",memberGame);
ScreenVo.UrlVo urlVo = screenService.getScreenUrl(memberGame);
return JsonResponse.newInstance().ok();
}
@ -38,7 +38,7 @@ public class ScreenController {
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse getGameInfo(HttpServletRequest request,
public JsonResponse<ScreenVo.GameInfoVo> getGameInfo(HttpServletRequest request,
@ApiParam @Validated @RequestBody ScreenDto.MemberRecord memberRecord) throws Exception {
log.info("获取游戏基本信息:{}",memberRecord);

4
game/src/main/java/com/ccsens/game/bean/dto/ScreenDto.java

@ -9,7 +9,9 @@ public class ScreenDto {
@Data
@ApiModel
public static class MemberGame{
@ApiModelProperty("是否关注")
@ApiModelProperty("要创建的小游戏的类型 例如:SQ 代表数钱小游戏")
private String gameType;
@ApiModelProperty("是否关注了公众号")
private Byte subscribe;
@ApiModelProperty("用户的标识,对当前公众号唯一")
private String openid;

30
game/src/main/java/com/ccsens/game/bean/po/GameType.java

@ -12,7 +12,11 @@ public class GameType implements Serializable {
private String description;
private String payType;
private Byte payType;
private String screenUrl;
private String clientUrl;
private Date createdAt;
@ -54,12 +58,28 @@ public class GameType implements Serializable {
this.description = description == null ? null : description.trim();
}
public String getPayType() {
public Byte getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType == null ? null : payType.trim();
public void setPayType(Byte payType) {
this.payType = payType;
}
public String getScreenUrl() {
return screenUrl;
}
public void setScreenUrl(String screenUrl) {
this.screenUrl = screenUrl == null ? null : screenUrl.trim();
}
public String getClientUrl() {
return clientUrl;
}
public void setClientUrl(String clientUrl) {
this.clientUrl = clientUrl == null ? null : clientUrl.trim();
}
public Date getCreatedAt() {
@ -97,6 +117,8 @@ public class GameType implements Serializable {
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", payType=").append(payType);
sb.append(", screenUrl=").append(screenUrl);
sb.append(", clientUrl=").append(clientUrl);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);

166
game/src/main/java/com/ccsens/game/bean/po/GameTypeExample.java

@ -385,63 +385,193 @@ public class GameTypeExample {
return (Criteria) this;
}
public Criteria andPayTypeEqualTo(String value) {
public Criteria andPayTypeEqualTo(Byte value) {
addCriterion("pay_type =", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeNotEqualTo(String value) {
public Criteria andPayTypeNotEqualTo(Byte value) {
addCriterion("pay_type <>", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeGreaterThan(String value) {
public Criteria andPayTypeGreaterThan(Byte value) {
addCriterion("pay_type >", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeGreaterThanOrEqualTo(String value) {
public Criteria andPayTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("pay_type >=", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeLessThan(String value) {
public Criteria andPayTypeLessThan(Byte value) {
addCriterion("pay_type <", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeLessThanOrEqualTo(String value) {
public Criteria andPayTypeLessThanOrEqualTo(Byte value) {
addCriterion("pay_type <=", value, "payType");
return (Criteria) this;
}
public Criteria andPayTypeLike(String value) {
addCriterion("pay_type like", value, "payType");
public Criteria andPayTypeIn(List<Byte> values) {
addCriterion("pay_type in", values, "payType");
return (Criteria) this;
}
public Criteria andPayTypeNotLike(String value) {
addCriterion("pay_type not like", value, "payType");
public Criteria andPayTypeNotIn(List<Byte> values) {
addCriterion("pay_type not in", values, "payType");
return (Criteria) this;
}
public Criteria andPayTypeIn(List<String> values) {
addCriterion("pay_type in", values, "payType");
public Criteria andPayTypeBetween(Byte value1, Byte value2) {
addCriterion("pay_type between", value1, value2, "payType");
return (Criteria) this;
}
public Criteria andPayTypeNotIn(List<String> values) {
addCriterion("pay_type not in", values, "payType");
public Criteria andPayTypeNotBetween(Byte value1, Byte value2) {
addCriterion("pay_type not between", value1, value2, "payType");
return (Criteria) this;
}
public Criteria andPayTypeBetween(String value1, String value2) {
addCriterion("pay_type between", value1, value2, "payType");
public Criteria andScreenUrlIsNull() {
addCriterion("screen_url is null");
return (Criteria) this;
}
public Criteria andPayTypeNotBetween(String value1, String value2) {
addCriterion("pay_type not between", value1, value2, "payType");
public Criteria andScreenUrlIsNotNull() {
addCriterion("screen_url is not null");
return (Criteria) this;
}
public Criteria andScreenUrlEqualTo(String value) {
addCriterion("screen_url =", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlNotEqualTo(String value) {
addCriterion("screen_url <>", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlGreaterThan(String value) {
addCriterion("screen_url >", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlGreaterThanOrEqualTo(String value) {
addCriterion("screen_url >=", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlLessThan(String value) {
addCriterion("screen_url <", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlLessThanOrEqualTo(String value) {
addCriterion("screen_url <=", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlLike(String value) {
addCriterion("screen_url like", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlNotLike(String value) {
addCriterion("screen_url not like", value, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlIn(List<String> values) {
addCriterion("screen_url in", values, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlNotIn(List<String> values) {
addCriterion("screen_url not in", values, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlBetween(String value1, String value2) {
addCriterion("screen_url between", value1, value2, "screenUrl");
return (Criteria) this;
}
public Criteria andScreenUrlNotBetween(String value1, String value2) {
addCriterion("screen_url not between", value1, value2, "screenUrl");
return (Criteria) this;
}
public Criteria andClientUrlIsNull() {
addCriterion("client_url is null");
return (Criteria) this;
}
public Criteria andClientUrlIsNotNull() {
addCriterion("client_url is not null");
return (Criteria) this;
}
public Criteria andClientUrlEqualTo(String value) {
addCriterion("client_url =", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlNotEqualTo(String value) {
addCriterion("client_url <>", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlGreaterThan(String value) {
addCriterion("client_url >", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlGreaterThanOrEqualTo(String value) {
addCriterion("client_url >=", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlLessThan(String value) {
addCriterion("client_url <", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlLessThanOrEqualTo(String value) {
addCriterion("client_url <=", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlLike(String value) {
addCriterion("client_url like", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlNotLike(String value) {
addCriterion("client_url not like", value, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlIn(List<String> values) {
addCriterion("client_url in", values, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlNotIn(List<String> values) {
addCriterion("client_url not in", values, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlBetween(String value1, String value2) {
addCriterion("client_url between", value1, value2, "clientUrl");
return (Criteria) this;
}
public Criteria andClientUrlNotBetween(String value1, String value2) {
addCriterion("client_url not between", value1, value2, "clientUrl");
return (Criteria) this;
}

81
game/src/main/java/com/ccsens/game/bean/vo/ScreenVo.java

@ -0,0 +1,81 @@
package com.ccsens.game.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ScreenVo {
@Data
@ApiModel
public static class UrlVo{
@ApiModelProperty("大屏的路径")
private String url;
@ApiModelProperty("游戏路径")
private List<String> ruleList;
}
@Data
@ApiModel
public static class GameInfoVo{
@ApiModelProperty("二维码路径")
private String QRCodeUrl;
@ApiModelProperty("游戏状态")
private Byte gameStatus;
@ApiModelProperty("可玩总次数")
private int totalCount;
@ApiModelProperty("已用次数")
private int usedCount ;
@ApiModelProperty("总人数")
private int totalMembers ;
@ApiModelProperty("未开始")
private PendingData pendingData;
@ApiModelProperty("未开始")
private PreparingData preparingData;
@ApiModelProperty("未开始")
private ProcessingData processingData;
@ApiModelProperty("未开始")
private CompletedData completedData;
}
@Data
@ApiModel("未开始")
public static class PendingData{
@ApiModelProperty("活动规则")
private List<String> activityRule;
@ApiModelProperty("活动奖品")
private List<String> activityPrize;
@ApiModelProperty("奖券使用说明")
private List<String> instructions;
}
@Data
@ApiModel("准备中")
public static class PreparingData{
@ApiModelProperty("本地开始时间")
private Long startLocalTime ;
}
@Data
@ApiModel("进行中")
public static class ProcessingData{
}
@Data
@ApiModel("已结束")
public static class CompletedData{
@ApiModelProperty("总次数")
private int totalTimes;
@ApiModelProperty("总分数")
private int totalScore;
@ApiModelProperty("平均每人多少分")
private int averageTimes;
@ApiModelProperty("平均次数超过百分之多少人")
private int over;
}
}

2
game/src/main/java/com/ccsens/game/config/SwaggerConfigure.java

@ -28,7 +28,7 @@ public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.game.web"))
.basePackage("com.ccsens.game.api"))
.build()
.globalOperationParameters(setHeaderToken());
}

8
game/src/main/java/com/ccsens/game/persist/dao/GameActivityRuleDao.java

@ -0,0 +1,8 @@
package com.ccsens.game.persist.dao;
import com.ccsens.game.persist.mapper.GameActivityRuleMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface GameActivityRuleDao extends GameActivityRuleMapper{
}

8
game/src/main/java/com/ccsens/game/persist/dao/GameMemberDao.java

@ -0,0 +1,8 @@
package com.ccsens.game.persist.dao;
import com.ccsens.game.persist.mapper.GameMemberMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface GameMemberDao extends GameMemberMapper{
}

8
game/src/main/java/com/ccsens/game/persist/dao/GameRecordDao.java

@ -0,0 +1,8 @@
package com.ccsens.game.persist.dao;
import com.ccsens.game.persist.mapper.GameRecordMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface GameRecordDao extends GameRecordMapper{
}

8
game/src/main/java/com/ccsens/game/persist/dao/GameTypeDao.java

@ -0,0 +1,8 @@
package com.ccsens.game.persist.dao;
import com.ccsens.game.persist.mapper.GameTypeMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface GameTypeDao extends GameTypeMapper{
}

9
game/src/main/java/com/ccsens/game/persist/dao/GameTypeMemberDao.java

@ -0,0 +1,9 @@
package com.ccsens.game.persist.dao;
import com.ccsens.game.persist.mapper.GameTypeMemberMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface GameTypeMemberDao extends GameTypeMemberMapper{
}

8
game/src/main/java/com/ccsens/game/service/IScreenService.java

@ -0,0 +1,8 @@
package com.ccsens.game.service;
import com.ccsens.game.bean.dto.ScreenDto;
import com.ccsens.game.bean.vo.ScreenVo;
public interface IScreenService {
ScreenVo.UrlVo getScreenUrl(ScreenDto.MemberGame memberGame);
}

110
game/src/main/java/com/ccsens/game/service/ScreenService.java

@ -0,0 +1,110 @@
package com.ccsens.game.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.game.bean.dto.ScreenDto;
import com.ccsens.game.bean.po.*;
import com.ccsens.game.bean.vo.ScreenVo;
import com.ccsens.game.persist.dao.*;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ScreenService implements IScreenService{
@Autowired
private GameMemberDao memberDao;
@Autowired
private GameTypeMemberDao typeMemberDao;
@Autowired
private GameTypeDao gameTypeDao;
@Autowired
private GameRecordDao gameRecordDao;
@Autowired
private GameActivityRuleDao activityRuleDao;
@Autowired
private Snowflake snowflake;
@Override
public ScreenVo.UrlVo getScreenUrl(ScreenDto.MemberGame memberGame) {
//1、查询此用户,若没有则保存用户信息
GameMember member = null;
GameMemberExample memberExample = new GameMemberExample();
memberExample.createCriteria().andOpenidEqualTo(memberGame.getOpenid());
List<GameMember> memberList = memberDao.selectByExample(memberExample);
if(CollectionUtil.isNotEmpty(memberList)){
member = memberList.get(0);
}else {
member = new GameMember();
BeanUtil.copyProperties(memberGame,member);
member.setId(snowflake.nextId());
memberDao.insertSelective(member);
}
//查找游戏
GameType gameType = null;
GameTypeExample gameTypeExample = new GameTypeExample();
gameTypeExample.createCriteria().andCodeEqualTo(memberGame.getGameType());
List<GameType> gameTypeList = gameTypeDao.selectByExample(gameTypeExample);
if(CollectionUtil.isNotEmpty(gameTypeList)){
gameType = gameTypeList.get(0);
}
if(ObjectUtil.isNull(gameType)){
throw new BaseException(CodeEnum.NOT_GAME_TYPE);
}
//2、查找此用户购买的此游戏的信息,若没有则添加一条记录,默认已付款,结束时间为添加后的一个月,默认次数为10次
GameTypeMember gameTypeMember = null;
GameTypeMemberExample typeMemberExample = new GameTypeMemberExample();
typeMemberExample.createCriteria().andMemberIdEqualTo(member.getId()).andGameTypeIdEqualTo(gameType.getId());
List<GameTypeMember> gameTypeMemberList = typeMemberDao.selectByExample(typeMemberExample);
if(CollectionUtil.isNotEmpty(gameTypeMemberList)){
gameTypeMember = gameTypeMemberList.get(0);
}else {
gameTypeMember = new GameTypeMember();
gameTypeMember.setId(snowflake.nextId());
gameTypeMember.setMemberId(member.getId());
gameTypeMember.setGameTypeId(gameType.getId());
gameTypeMember.setTotalCount(10);
gameTypeMember.setUsedCount(0);
gameTypeMember.setCreatedTime(System.currentTimeMillis());
gameTypeMember.setDueTime(gameTypeMember.getCreatedTime() + (3600*24*30));
typeMemberDao.insertSelective(gameTypeMember);
}
//3、根据用户购买的记录,添加一场新的游戏记录
GameRecord gameRecord = new GameRecord();
gameRecord.setId(snowflake.nextId());
gameRecord.setTypeMemberId(gameTypeMember.getId());
gameRecord.setUrl(WebConstant.TEST_URL_GAME + gameRecord.getId() + File.separator + gameType.getScreenUrl());
gameRecord.setQrCodeUrl(WebConstant.TEST_URL_GAME + gameRecord.getId() + File.separator + gameType.getClientUrl());
gameRecordDao.insertSelective(gameRecord);
//5、查询该游戏的规则
List<String> ruleList = null;
GameActivityRuleExample activityRuleExample = new GameActivityRuleExample();
activityRuleExample.createCriteria().andGameIdEqualTo(gameType.getId());
List<GameActivityRule> gameActivityRuleList = activityRuleDao.selectByExample(activityRuleExample);
if(CollectionUtil.isNotEmpty(gameActivityRuleList)){
ruleList = new ArrayList<>();
for(GameActivityRule activityRule : gameActivityRuleList){
ruleList.add(activityRule.getDescription());
}
}
//6、返回
ScreenVo.UrlVo urlVo = new ScreenVo.UrlVo();
urlVo.setUrl(gameRecord.getUrl());
urlVo.setRuleList(ruleList);
return urlVo;
}
}

55
game/src/main/resources/mapper_raw/GameTypeMapper.xml

@ -6,7 +6,9 @@
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="pay_type" jdbcType="VARCHAR" property="payType" />
<result column="pay_type" jdbcType="TINYINT" property="payType" />
<result column="screen_url" jdbcType="VARCHAR" property="screenUrl" />
<result column="client_url" jdbcType="VARCHAR" property="clientUrl" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -70,7 +72,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, code, name, description, pay_type, created_at, updated_at, rec_status
id, code, name, description, pay_type, screen_url, client_url, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.game.bean.po.GameTypeExample" resultMap="BaseResultMap">
select
@ -104,11 +107,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.game.bean.po.GameType">
insert into t_game_type (id, code, name,
description, pay_type, created_at,
updated_at, rec_status)
description, pay_type, screen_url,
client_url, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{description,jdbcType=VARCHAR}, #{payType,jdbcType=TINYINT}, #{screenUrl,jdbcType=VARCHAR},
#{clientUrl,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.game.bean.po.GameType">
insert into t_game_type
@ -128,6 +133,12 @@
<if test="payType != null">
pay_type,
</if>
<if test="screenUrl != null">
screen_url,
</if>
<if test="clientUrl != null">
client_url,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -152,7 +163,13 @@
#{description,jdbcType=VARCHAR},
</if>
<if test="payType != null">
#{payType,jdbcType=VARCHAR},
#{payType,jdbcType=TINYINT},
</if>
<if test="screenUrl != null">
#{screenUrl,jdbcType=VARCHAR},
</if>
<if test="clientUrl != null">
#{clientUrl,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
@ -187,7 +204,13 @@
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.payType != null">
pay_type = #{record.payType,jdbcType=VARCHAR},
pay_type = #{record.payType,jdbcType=TINYINT},
</if>
<if test="record.screenUrl != null">
screen_url = #{record.screenUrl,jdbcType=VARCHAR},
</if>
<if test="record.clientUrl != null">
client_url = #{record.clientUrl,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -209,7 +232,9 @@
code = #{record.code,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
pay_type = #{record.payType,jdbcType=VARCHAR},
pay_type = #{record.payType,jdbcType=TINYINT},
screen_url = #{record.screenUrl,jdbcType=VARCHAR},
client_url = #{record.clientUrl,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -230,7 +255,13 @@
description = #{description,jdbcType=VARCHAR},
</if>
<if test="payType != null">
pay_type = #{payType,jdbcType=VARCHAR},
pay_type = #{payType,jdbcType=TINYINT},
</if>
<if test="screenUrl != null">
screen_url = #{screenUrl,jdbcType=VARCHAR},
</if>
<if test="clientUrl != null">
client_url = #{clientUrl,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
@ -249,7 +280,9 @@
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
pay_type = #{payType,jdbcType=VARCHAR},
pay_type = #{payType,jdbcType=TINYINT},
screen_url = #{screenUrl,jdbcType=VARCHAR},
client_url = #{clientUrl,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

16
game/src/main/resources/mbg.xml

@ -23,7 +23,7 @@
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://49.233.89.188:3306/game?useUnicode=true&amp;characterEncoding=UTF-8&amp;tinyInt1isBit=false"
userId="root"
password="">
password="po3OynBO[M3579p6L7)o">
</jdbcConnection>
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
@ -57,13 +57,13 @@
</javaClientGenerator>
<table tableName="t_game_member" domainObjectName="GameMember"></table>
<table tableName="t_game_type" domainObjectName="GameType"></table>
<table tableName="t_game_type_member" domainObjectName="GameTypeMember"></table>
<table tableName="t_game_record" domainObjectName="GameRecord"></table>
<table tableName="t_game_member_join" domainObjectName="GameMemberJoin"></table>
<table tableName="t_game_score_log" domainObjectName="GameScoreLog"></table>
<table tableName="t_game_activity_rule" domainObjectName="GameActivityRule"></table>
<table tableName="t_game_activity_prize" domainObjectName="GameActivityPrize"></table>
<table tableName="t_game_prize_instructions" domainObjectName="GamePrizeInstructions"></table>
<!--<table tableName="t_game_type_member" domainObjectName="GameTypeMember"></table>-->
<!--<table tableName="t_game_record" domainObjectName="GameRecord"></table>-->
<!--<table tableName="t_game_member_join" domainObjectName="GameMemberJoin"></table>-->
<!--<table tableName="t_game_score_log" domainObjectName="GameScoreLog"></table>-->
<!--<table tableName="t_game_activity_rule" domainObjectName="GameActivityRule"></table>-->
<!--<table tableName="t_game_activity_prize" domainObjectName="GameActivityPrize"></table>-->
<!--<table tableName="t_game_prize_instructions" domainObjectName="GamePrizeInstructions"></table>-->
<!-- 有些表的字段需要指定java类型
<table schema="" tableName="">

15
game/src/test/java/com/ccsens/game/GameApplicationTests.java

@ -1,15 +0,0 @@
package com.ccsens.game;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class GameApplicationTests {
@Test
void contextLoads() {
}
}

117
mt/.mvn/wrapper/MavenWrapperDownloader.java

@ -0,0 +1,117 @@
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.5";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

2
mt/.mvn/wrapper/maven-wrapper.properties

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar

75
mt/pom.xml

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ccsenscloud</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mt</artifactId>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--cloud 工具类-->
<dependency>
<artifactId>cloudutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util 工具类-->
<dependency>
<artifactId>util</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.62</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.ccsens.mt.MtApplication</mainClass>
<!--<skip>true</skip>-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

24
mt/src/main/java/com/ccsens/mt/MtApplication.java

@ -0,0 +1,24 @@
package com.ccsens.mt;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
@MapperScan(basePackages = {"com.ccsens.mt.persist.*"})
@ServletComponentScan
@EnableAsync
//开启断路器功能
@EnableCircuitBreaker
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
@SpringBootApplication(scanBasePackages = "com.ccsens")
public class MtApplication {
public static void main(String[] args) {
SpringApplication.run(MtApplication.class, args);
}
}

28
mt/src/main/java/com/ccsens/mt/api/DebugController.java

@ -0,0 +1,28 @@
package com.ccsens.mt.api;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
public class DebugController {
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse getSmsCode(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
}
}

124
mt/src/main/java/com/ccsens/mt/api/ScoreController.java

@ -0,0 +1,124 @@
package com.ccsens.mt.api;
import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.vo.ScoreVo;
import com.ccsens.mt.service.IScoreService;
import com.ccsens.mt.service.IUserService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(tags = "评分插件相关" , description = "")
@RestController
@RequestMapping("/plugins")
@Slf4j
public class ScoreController {
@Autowired
private IUserService userService;
@Autowired
private IScoreService scoreService;
@ApiOperation(value = "评委获取评分项",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "roleId", value = "评委id", required = true, paramType = "path"),
@ApiImplicitParam(name = "playerId", value = "参赛项目id", required = true, paramType = "path"),
})
@RequestMapping(value = "/score", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ScoreVo.ScoreInfo>> getScoreLog(HttpServletRequest request,
@RequestParam Long roleId,
@RequestParam(required = true) Long playerId) throws Exception {
//获取userId
Long userId = userService.getUserIdByToken(request);
List<ScoreVo.ScoreInfo> scoreInfoList = scoreService.getScoreLog(userId,playerId);
return JsonResponse.newInstance().ok(scoreInfoList);
}
@ApiOperation(value = "提交评分",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/score", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse submitScore(HttpServletRequest request,
@ApiParam @RequestBody ScoreDto.SubmitScore submitScore) throws Exception {
//获取userId
Long userId = userService.getUserIdByToken(request);
scoreService.submitScore(userId,submitScore);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "获取评分",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "roleId", value = "评委id", required = true, paramType = "path"),
@ApiImplicitParam(name = "playerId", value = "任务id", required = true, paramType = "path"),
})
@RequestMapping(value = "/scores", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ScoreVo.AdminScore>> adminScore(HttpServletRequest request,
@RequestParam(required = true) Long roleId,
@RequestParam(required = true) Long playerId) throws Exception {
//获取userId
Long userId = userService.getUserIdByToken(request);
List<ScoreVo.AdminScore> adminScoreList = scoreService.adminScore(userId,roleId,playerId);
return JsonResponse.newInstance().ok(adminScoreList);
}
//
// @ApiOperation(value = "退回单个评委的评分",notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "roleId", value = "评委id", required = true, paramType = "path"),
// @ApiImplicitParam(name = "playerId", value = "参赛项目id", required = true, paramType = "path"),
// })
// @RequestMapping(value = "/back", method = RequestMethod.DELETE, produces = {"application/json;charset=UTF-8"})
// public JsonResponse backScore(HttpServletRequest request,
// @RequestParam(required = true) Long roleId,
// @RequestParam(required = true) Long playerId) throws Exception {
// scoreService.backScore(roleId,playerId);
// return JsonResponse.newInstance().ok();
// }
//
// @ApiOperation(value = "退回所有评委的评分",notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "playerId", value = "参赛项目id", required = true, paramType = "path"),
// })
// @RequestMapping(value = "/backAll", method = RequestMethod.DELETE, produces = {"application/json;charset=UTF-8"})
// public JsonResponse backScoreAll(HttpServletRequest request,
// @RequestParam(required = true) Long playerId) throws Exception {
// scoreService.backScoreAll(playerId);
// return JsonResponse.newInstance().ok();
// }
@ApiOperation(value = "查看项目排名及详细分数",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectId", value = "项目组id", required = true, paramType = "path"),
})
@RequestMapping(value = "/rankingScore", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ScoreVo.RankingScore>> getRankingScore(HttpServletRequest request,
@RequestParam(required = true) Long projectId) throws Exception {
List<ScoreVo.RankingScore> bankingList = scoreService.getRanking(projectId);
return JsonResponse.newInstance().ok(bankingList);
}
@ApiOperation(value = "亮分环节",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectId", value = "项目id", required = true, paramType = "path"),
@ApiImplicitParam(name = "playerId", value = "参赛公司id", required = true, paramType = "path")
})
@RequestMapping(value = "/show", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse showScore(HttpServletRequest request,
@RequestParam(required = true)Long projectId,Long playerId) throws Exception {
scoreService.showScore(projectId,playerId);
return JsonResponse.newInstance().ok();
}
}

56
mt/src/main/java/com/ccsens/mt/api/SigninController.java

@ -0,0 +1,56 @@
package com.ccsens.mt.api;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.mt.bean.dto.SigninDto;
import com.ccsens.mt.bean.vo.SigninVo;
import com.ccsens.mt.service.ISigninService;
import com.ccsens.mt.service.IUserService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "签到" , description = "")
@RestController
@RequestMapping("/signin")
@Slf4j
public class SigninController {
@Autowired
private IUserService userService;
@Autowired
private ISigninService signinService;
@ApiOperation(value = "签到", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SigninVo.SigninVoInfo> signin(HttpServletRequest request,
@ApiParam @Validated @RequestBody SigninDto.SigninInfo signinInfo) throws Exception {
log.info("{}:签到");
//获取userId
Long userId = userService.getUserIdByToken(request);
SigninVo.SigninVoInfo signinVoInfo = signinService.signin(signinInfo,userId);
return JsonResponse.newInstance().ok(signinVoInfo);
}
@ApiOperation(value = "查看自己的签到信息", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "签到任务的id", required = true, paramType = ""),
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SigninVo.SigninVoInfo> getSignByTaskId(HttpServletRequest request,
@RequestParam(required = true) Long taskId) throws Exception {
log.info("查看自己的签到信息");
//获取userId
Long userId = userService.getUserIdByToken(request);
SigninVo.SigninVoInfo signinVoInfo = signinService.getSignByTaskId(taskId,userId);
return JsonResponse.newInstance().ok(signinVoInfo);
}
}

83
mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java

@ -0,0 +1,83 @@
package com.ccsens.mt.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ScoreDto {
@Getter
@Setter
@ApiModel
public static class Judge{
@ApiModelProperty("评委id")
private Long roleId;
@ApiModelProperty("公司项目Id")
private Long playerId;
}
@Getter
@Setter
@ApiModel
public static class SubmitScore{
@ApiModelProperty("评委id")
private Long roleId;
@ApiModelProperty("公司项目Id")
private Long playerId;
@ApiModelProperty("评分信息")
private List<ScoreInfo1> data;
}
@Getter
@Setter
@ApiModel
public static class SubmitScoreTable{
@ApiModelProperty("评委id")
private Long roleId;
@ApiModelProperty("公司项目Id")
private Long playerId;
@ApiModelProperty("行业")
private String industry;
@ApiModelProperty("是否推荐 1、是 0、否")
private Integer isRecommend;
@ApiModelProperty("意见")
private String opinion;
@ApiModelProperty("评委姓名")
private String judge;
@ApiModelProperty("分数信息")
private List<BigDecimal> scores;
}
@Getter
@Setter
@ApiModel
public static class ScoreInfo1{
@ApiModelProperty("评分项Id")
private Long id;
@ApiModelProperty("评分")
private BigDecimal score;
}
@Getter
@Setter
@ApiModel
public class ScoreLogs{
@ApiModelProperty("评分项")
private List<ScoreLogVo> scoreLogList;
}
@Getter
@Setter
@ApiModel
public class ScoreLogVo {
@ApiModelProperty("名字")
private String name;
@ApiModelProperty("最大值")
private BigDecimal maxScore;
@ApiModelProperty("最小值")
private BigDecimal minScore;
}
}

19
mt/src/main/java/com/ccsens/mt/bean/dto/SigninDto.java

@ -0,0 +1,19 @@
package com.ccsens.mt.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SigninDto {
@Data
@ApiModel
public static class SigninInfo{
@ApiModelProperty("任务id")
private Long taskId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("手机号")
private String phone;
}
}

35
mt/src/main/java/com/ccsens/mt/bean/dto/message/BaseMessageDto.java

@ -0,0 +1,35 @@
package com.ccsens.mt.bean.dto.message;
import lombok.Data;
import java.util.List;
@Data
public class BaseMessageDto {
@Data
public static class MessageUser {
private Long id;
private Long userId; //本质上是authId //20190507 本质上是userId
private String nickname;
private String avatarUrl;
private boolean hasRead;
public MessageUser(){
hasRead = false;
}
public MessageUser(Long id,Long userId,String nickname,String avatarUrl){
this();
this.id = id;
this.userId = userId;
this.nickname = nickname;
this.avatarUrl = avatarUrl;
}
}
private Long time;
private String type;
private String event;
private Long projectId;
private MessageUser sender;
private List<MessageUser> receivers;
// private Object data;
}

39
mt/src/main/java/com/ccsens/mt/bean/dto/message/SyncMessageWithShowDto.java

@ -0,0 +1,39 @@
package com.ccsens.mt.bean.dto.message;
import com.ccsens.util.WebConstant;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.List;
@Data
public class SyncMessageWithShowDto extends BaseMessageDto{
@Setter
@Getter
public static class Data{
private Long projectId;
private String projectName;
private Long playerId;
private String playerName;
private BigDecimal averageScore;
private List<Judge> scoreList;
@Setter
@Getter
public static class Judge{
private Integer isMaxOrMin;//0正常的分数 1最高分 2最低分
private String avatarUrl;//头像
private String judgeName;
private BigDecimal score;
}
}
private Data data;
public SyncMessageWithShowDto(){
setType(WebConstant.Message_Type.Sync.phase);
setEvent(WebConstant.Message_Sync_Event.Show.phase);
setTime(System.currentTimeMillis());
}
}

117
mt/src/main/java/com/ccsens/mt/bean/po/MtJudge.java

@ -0,0 +1,117 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.util.Date;
public class MtJudge implements Serializable {
private Long id;
private Long projectId;
private Long userId;
private String nickname;
private String avatarUrl;
private String phone;
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 getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", projectId=").append(projectId);
sb.append(", userId=").append(userId);
sb.append(", nickname=").append(nickname);
sb.append(", avatarUrl=").append(avatarUrl);
sb.append(", phone=").append(phone);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

771
mt/src/main/java/com/ccsens/mt/bean/po/MtJudgeExample.java

@ -0,0 +1,771 @@
package com.ccsens.mt.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MtJudgeExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MtJudgeExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(Long value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(Long value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(Long value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(Long value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(Long value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(Long value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<Long> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<Long> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(Long value1, Long value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(Long value1, Long value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andNicknameIsNull() {
addCriterion("nickname is null");
return (Criteria) this;
}
public Criteria andNicknameIsNotNull() {
addCriterion("nickname is not null");
return (Criteria) this;
}
public Criteria andNicknameEqualTo(String value) {
addCriterion("nickname =", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotEqualTo(String value) {
addCriterion("nickname <>", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThan(String value) {
addCriterion("nickname >", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThanOrEqualTo(String value) {
addCriterion("nickname >=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThan(String value) {
addCriterion("nickname <", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThanOrEqualTo(String value) {
addCriterion("nickname <=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLike(String value) {
addCriterion("nickname like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotLike(String value) {
addCriterion("nickname not like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameIn(List<String> values) {
addCriterion("nickname in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotIn(List<String> values) {
addCriterion("nickname not in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameBetween(String value1, String value2) {
addCriterion("nickname between", value1, value2, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotBetween(String value1, String value2) {
addCriterion("nickname not between", value1, value2, "nickname");
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<String> values) {
addCriterion("avatar_url in", values, "avatarUrl");
return (Criteria) this;
}
public Criteria andAvatarUrlNotIn(List<String> 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 andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

129
mt/src/main/java/com/ccsens/mt/bean/po/MtScore.java

@ -0,0 +1,129 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class MtScore implements Serializable {
private Long id;
private Long judgeUserId;
private Long scoreLogId;
private Long taskId;
private String taskName;
private BigDecimal score;
private Integer isScore;
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 getJudgeUserId() {
return judgeUserId;
}
public void setJudgeUserId(Long judgeUserId) {
this.judgeUserId = judgeUserId;
}
public Long getScoreLogId() {
return scoreLogId;
}
public void setScoreLogId(Long scoreLogId) {
this.scoreLogId = scoreLogId;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName == null ? null : taskName.trim();
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
public Integer getIsScore() {
return isScore;
}
public void setIsScore(Integer isScore) {
this.isScore = isScore;
}
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(", judgeUserId=").append(judgeUserId);
sb.append(", scoreLogId=").append(scoreLogId);
sb.append(", taskId=").append(taskId);
sb.append(", taskName=").append(taskName);
sb.append(", score=").append(score);
sb.append(", isScore=").append(isScore);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

812
mt/src/main/java/com/ccsens/mt/bean/po/MtScoreExample.java

@ -0,0 +1,812 @@
package com.ccsens.mt.bean.po;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MtScoreExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MtScoreExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andJudgeUserIdIsNull() {
addCriterion("judge_user_id is null");
return (Criteria) this;
}
public Criteria andJudgeUserIdIsNotNull() {
addCriterion("judge_user_id is not null");
return (Criteria) this;
}
public Criteria andJudgeUserIdEqualTo(Long value) {
addCriterion("judge_user_id =", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdNotEqualTo(Long value) {
addCriterion("judge_user_id <>", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdGreaterThan(Long value) {
addCriterion("judge_user_id >", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("judge_user_id >=", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdLessThan(Long value) {
addCriterion("judge_user_id <", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdLessThanOrEqualTo(Long value) {
addCriterion("judge_user_id <=", value, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdIn(List<Long> values) {
addCriterion("judge_user_id in", values, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdNotIn(List<Long> values) {
addCriterion("judge_user_id not in", values, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdBetween(Long value1, Long value2) {
addCriterion("judge_user_id between", value1, value2, "judgeUserId");
return (Criteria) this;
}
public Criteria andJudgeUserIdNotBetween(Long value1, Long value2) {
addCriterion("judge_user_id not between", value1, value2, "judgeUserId");
return (Criteria) this;
}
public Criteria andScoreLogIdIsNull() {
addCriterion("score_log_id is null");
return (Criteria) this;
}
public Criteria andScoreLogIdIsNotNull() {
addCriterion("score_log_id is not null");
return (Criteria) this;
}
public Criteria andScoreLogIdEqualTo(Long value) {
addCriterion("score_log_id =", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdNotEqualTo(Long value) {
addCriterion("score_log_id <>", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdGreaterThan(Long value) {
addCriterion("score_log_id >", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdGreaterThanOrEqualTo(Long value) {
addCriterion("score_log_id >=", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdLessThan(Long value) {
addCriterion("score_log_id <", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdLessThanOrEqualTo(Long value) {
addCriterion("score_log_id <=", value, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdIn(List<Long> values) {
addCriterion("score_log_id in", values, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdNotIn(List<Long> values) {
addCriterion("score_log_id not in", values, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdBetween(Long value1, Long value2) {
addCriterion("score_log_id between", value1, value2, "scoreLogId");
return (Criteria) this;
}
public Criteria andScoreLogIdNotBetween(Long value1, Long value2) {
addCriterion("score_log_id not between", value1, value2, "scoreLogId");
return (Criteria) this;
}
public Criteria andTaskIdIsNull() {
addCriterion("task_id is null");
return (Criteria) this;
}
public Criteria andTaskIdIsNotNull() {
addCriterion("task_id is not null");
return (Criteria) this;
}
public Criteria andTaskIdEqualTo(Long value) {
addCriterion("task_id =", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotEqualTo(Long value) {
addCriterion("task_id <>", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThan(Long value) {
addCriterion("task_id >", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_id >=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThan(Long value) {
addCriterion("task_id <", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThanOrEqualTo(Long value) {
addCriterion("task_id <=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdIn(List<Long> values) {
addCriterion("task_id in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotIn(List<Long> values) {
addCriterion("task_id not in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdBetween(Long value1, Long value2) {
addCriterion("task_id between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotBetween(Long value1, Long value2) {
addCriterion("task_id not between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskNameIsNull() {
addCriterion("task_name is null");
return (Criteria) this;
}
public Criteria andTaskNameIsNotNull() {
addCriterion("task_name is not null");
return (Criteria) this;
}
public Criteria andTaskNameEqualTo(String value) {
addCriterion("task_name =", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameNotEqualTo(String value) {
addCriterion("task_name <>", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameGreaterThan(String value) {
addCriterion("task_name >", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameGreaterThanOrEqualTo(String value) {
addCriterion("task_name >=", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameLessThan(String value) {
addCriterion("task_name <", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameLessThanOrEqualTo(String value) {
addCriterion("task_name <=", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameLike(String value) {
addCriterion("task_name like", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameNotLike(String value) {
addCriterion("task_name not like", value, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameIn(List<String> values) {
addCriterion("task_name in", values, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameNotIn(List<String> values) {
addCriterion("task_name not in", values, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameBetween(String value1, String value2) {
addCriterion("task_name between", value1, value2, "taskName");
return (Criteria) this;
}
public Criteria andTaskNameNotBetween(String value1, String value2) {
addCriterion("task_name not between", value1, value2, "taskName");
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(BigDecimal value) {
addCriterion("score =", value, "score");
return (Criteria) this;
}
public Criteria andScoreNotEqualTo(BigDecimal value) {
addCriterion("score <>", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThan(BigDecimal value) {
addCriterion("score >", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("score >=", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThan(BigDecimal value) {
addCriterion("score <", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThanOrEqualTo(BigDecimal value) {
addCriterion("score <=", value, "score");
return (Criteria) this;
}
public Criteria andScoreIn(List<BigDecimal> values) {
addCriterion("score in", values, "score");
return (Criteria) this;
}
public Criteria andScoreNotIn(List<BigDecimal> values) {
addCriterion("score not in", values, "score");
return (Criteria) this;
}
public Criteria andScoreBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("score between", value1, value2, "score");
return (Criteria) this;
}
public Criteria andScoreNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("score not between", value1, value2, "score");
return (Criteria) this;
}
public Criteria andIsScoreIsNull() {
addCriterion("is_score is null");
return (Criteria) this;
}
public Criteria andIsScoreIsNotNull() {
addCriterion("is_score is not null");
return (Criteria) this;
}
public Criteria andIsScoreEqualTo(Integer value) {
addCriterion("is_score =", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreNotEqualTo(Integer value) {
addCriterion("is_score <>", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreGreaterThan(Integer value) {
addCriterion("is_score >", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreGreaterThanOrEqualTo(Integer value) {
addCriterion("is_score >=", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreLessThan(Integer value) {
addCriterion("is_score <", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreLessThanOrEqualTo(Integer value) {
addCriterion("is_score <=", value, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreIn(List<Integer> values) {
addCriterion("is_score in", values, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreNotIn(List<Integer> values) {
addCriterion("is_score not in", values, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreBetween(Integer value1, Integer value2) {
addCriterion("is_score between", value1, value2, "isScore");
return (Criteria) this;
}
public Criteria andIsScoreNotBetween(Integer value1, Integer value2) {
addCriterion("is_score not between", value1, value2, "isScore");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

118
mt/src/main/java/com/ccsens/mt/bean/po/MtScoreLog.java

@ -0,0 +1,118 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class MtScoreLog implements Serializable {
private Long id;
private String name;
private BigDecimal maxScore;
private BigDecimal minScore;
private Long projectId;
private Integer sequence;
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 String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public BigDecimal getMaxScore() {
return maxScore;
}
public void setMaxScore(BigDecimal maxScore) {
this.maxScore = maxScore;
}
public BigDecimal getMinScore() {
return minScore;
}
public void setMinScore(BigDecimal minScore) {
this.minScore = minScore;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Integer getSequence() {
return sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
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(", name=").append(name);
sb.append(", maxScore=").append(maxScore);
sb.append(", minScore=").append(minScore);
sb.append(", projectId=").append(projectId);
sb.append(", sequence=").append(sequence);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

752
mt/src/main/java/com/ccsens/mt/bean/po/MtScoreLogExample.java

@ -0,0 +1,752 @@
package com.ccsens.mt.bean.po;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MtScoreLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MtScoreLogExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria 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<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> 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 andMaxScoreIsNull() {
addCriterion("max_score is null");
return (Criteria) this;
}
public Criteria andMaxScoreIsNotNull() {
addCriterion("max_score is not null");
return (Criteria) this;
}
public Criteria andMaxScoreEqualTo(BigDecimal value) {
addCriterion("max_score =", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreNotEqualTo(BigDecimal value) {
addCriterion("max_score <>", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreGreaterThan(BigDecimal value) {
addCriterion("max_score >", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("max_score >=", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreLessThan(BigDecimal value) {
addCriterion("max_score <", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreLessThanOrEqualTo(BigDecimal value) {
addCriterion("max_score <=", value, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreIn(List<BigDecimal> values) {
addCriterion("max_score in", values, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreNotIn(List<BigDecimal> values) {
addCriterion("max_score not in", values, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("max_score between", value1, value2, "maxScore");
return (Criteria) this;
}
public Criteria andMaxScoreNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("max_score not between", value1, value2, "maxScore");
return (Criteria) this;
}
public Criteria andMinScoreIsNull() {
addCriterion("min_score is null");
return (Criteria) this;
}
public Criteria andMinScoreIsNotNull() {
addCriterion("min_score is not null");
return (Criteria) this;
}
public Criteria andMinScoreEqualTo(BigDecimal value) {
addCriterion("min_score =", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreNotEqualTo(BigDecimal value) {
addCriterion("min_score <>", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreGreaterThan(BigDecimal value) {
addCriterion("min_score >", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("min_score >=", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreLessThan(BigDecimal value) {
addCriterion("min_score <", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreLessThanOrEqualTo(BigDecimal value) {
addCriterion("min_score <=", value, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreIn(List<BigDecimal> values) {
addCriterion("min_score in", values, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreNotIn(List<BigDecimal> values) {
addCriterion("min_score not in", values, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("min_score between", value1, value2, "minScore");
return (Criteria) this;
}
public Criteria andMinScoreNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("min_score not between", value1, value2, "minScore");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(Long value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(Long value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(Long value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(Long value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(Long value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(Long value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<Long> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<Long> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(Long value1, Long value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(Long value1, Long value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andSequenceIsNull() {
addCriterion("sequence is null");
return (Criteria) this;
}
public Criteria andSequenceIsNotNull() {
addCriterion("sequence is not null");
return (Criteria) this;
}
public Criteria andSequenceEqualTo(Integer value) {
addCriterion("sequence =", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotEqualTo(Integer value) {
addCriterion("sequence <>", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceGreaterThan(Integer value) {
addCriterion("sequence >", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceGreaterThanOrEqualTo(Integer value) {
addCriterion("sequence >=", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceLessThan(Integer value) {
addCriterion("sequence <", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceLessThanOrEqualTo(Integer value) {
addCriterion("sequence <=", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceIn(List<Integer> values) {
addCriterion("sequence in", values, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotIn(List<Integer> values) {
addCriterion("sequence not in", values, "sequence");
return (Criteria) this;
}
public Criteria andSequenceBetween(Integer value1, Integer value2) {
addCriterion("sequence between", value1, value2, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotBetween(Integer value1, Integer value2) {
addCriterion("sequence not between", value1, value2, "sequence");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

139
mt/src/main/java/com/ccsens/mt/bean/po/MtSignin.java

@ -0,0 +1,139 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.util.Date;
public class MtSignin implements Serializable {
private Long id;
private Long userId;
private Long taskId;
private String name;
private String phone;
private String company;
private Long signinTime;
private Integer sequence;
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 getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company == null ? null : company.trim();
}
public Long getSigninTime() {
return signinTime;
}
public void setSigninTime(Long signinTime) {
this.signinTime = signinTime;
}
public Integer getSequence() {
return sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
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(", userId=").append(userId);
sb.append(", taskId=").append(taskId);
sb.append(", name=").append(name);
sb.append(", phone=").append(phone);
sb.append(", company=").append(company);
sb.append(", signinTime=").append(signinTime);
sb.append(", sequence=").append(sequence);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

891
mt/src/main/java/com/ccsens/mt/bean/po/MtSigninExample.java

@ -0,0 +1,891 @@
package com.ccsens.mt.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MtSigninExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public MtSigninExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andTaskIdIsNull() {
addCriterion("task_id is null");
return (Criteria) this;
}
public Criteria andTaskIdIsNotNull() {
addCriterion("task_id is not null");
return (Criteria) this;
}
public Criteria andTaskIdEqualTo(Long value) {
addCriterion("task_id =", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotEqualTo(Long value) {
addCriterion("task_id <>", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThan(Long value) {
addCriterion("task_id >", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_id >=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThan(Long value) {
addCriterion("task_id <", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThanOrEqualTo(Long value) {
addCriterion("task_id <=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdIn(List<Long> values) {
addCriterion("task_id in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotIn(List<Long> values) {
addCriterion("task_id not in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdBetween(Long value1, Long value2) {
addCriterion("task_id between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotBetween(Long value1, Long value2) {
addCriterion("task_id not between", value1, value2, "taskId");
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<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> 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 andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andCompanyIsNull() {
addCriterion("company is null");
return (Criteria) this;
}
public Criteria andCompanyIsNotNull() {
addCriterion("company is not null");
return (Criteria) this;
}
public Criteria andCompanyEqualTo(String value) {
addCriterion("company =", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotEqualTo(String value) {
addCriterion("company <>", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThan(String value) {
addCriterion("company >", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThanOrEqualTo(String value) {
addCriterion("company >=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThan(String value) {
addCriterion("company <", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThanOrEqualTo(String value) {
addCriterion("company <=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLike(String value) {
addCriterion("company like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotLike(String value) {
addCriterion("company not like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyIn(List<String> values) {
addCriterion("company in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyNotIn(List<String> values) {
addCriterion("company not in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyBetween(String value1, String value2) {
addCriterion("company between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andCompanyNotBetween(String value1, String value2) {
addCriterion("company not between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andSigninTimeIsNull() {
addCriterion("signin_time is null");
return (Criteria) this;
}
public Criteria andSigninTimeIsNotNull() {
addCriterion("signin_time is not null");
return (Criteria) this;
}
public Criteria andSigninTimeEqualTo(Long value) {
addCriterion("signin_time =", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeNotEqualTo(Long value) {
addCriterion("signin_time <>", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeGreaterThan(Long value) {
addCriterion("signin_time >", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeGreaterThanOrEqualTo(Long value) {
addCriterion("signin_time >=", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeLessThan(Long value) {
addCriterion("signin_time <", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeLessThanOrEqualTo(Long value) {
addCriterion("signin_time <=", value, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeIn(List<Long> values) {
addCriterion("signin_time in", values, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeNotIn(List<Long> values) {
addCriterion("signin_time not in", values, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeBetween(Long value1, Long value2) {
addCriterion("signin_time between", value1, value2, "signinTime");
return (Criteria) this;
}
public Criteria andSigninTimeNotBetween(Long value1, Long value2) {
addCriterion("signin_time not between", value1, value2, "signinTime");
return (Criteria) this;
}
public Criteria andSequenceIsNull() {
addCriterion("sequence is null");
return (Criteria) this;
}
public Criteria andSequenceIsNotNull() {
addCriterion("sequence is not null");
return (Criteria) this;
}
public Criteria andSequenceEqualTo(Integer value) {
addCriterion("sequence =", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotEqualTo(Integer value) {
addCriterion("sequence <>", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceGreaterThan(Integer value) {
addCriterion("sequence >", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceGreaterThanOrEqualTo(Integer value) {
addCriterion("sequence >=", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceLessThan(Integer value) {
addCriterion("sequence <", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceLessThanOrEqualTo(Integer value) {
addCriterion("sequence <=", value, "sequence");
return (Criteria) this;
}
public Criteria andSequenceIn(List<Integer> values) {
addCriterion("sequence in", values, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotIn(List<Integer> values) {
addCriterion("sequence not in", values, "sequence");
return (Criteria) this;
}
public Criteria andSequenceBetween(Integer value1, Integer value2) {
addCriterion("sequence between", value1, value2, "sequence");
return (Criteria) this;
}
public Criteria andSequenceNotBetween(Integer value1, Integer value2) {
addCriterion("sequence not between", value1, value2, "sequence");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

172
mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java

@ -0,0 +1,172 @@
package com.ccsens.mt.bean.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ScoreVo {
//评委获取评分
@Getter
@Setter
@ApiModel
public static class ScoreInfo{
@ApiModelProperty("评分项id")
private Long id;
@ApiModelProperty("评分项名")
private String name;
@ApiModelProperty("满分")
private BigDecimal max;
@ApiModelProperty("最低分")
private BigDecimal min;
@ApiModelProperty("分数")
private BigDecimal score;
@ApiModelProperty("是否可以打分 1可以 0不可以")
private int valid;
}
@Getter
@Setter
@ApiModel
public static class ScoreTableVo{
@ApiModelProperty("行业")
private String industry;
@ApiModelProperty("是否推荐 1、是 0、否")
private Integer isRecommend;
@ApiModelProperty("意见")
private String opinion;
@ApiModelProperty("评委名称")
private String judge;
@JsonIgnore
private Long time;
@ApiModelProperty("评分信息")
private List<BigDecimal> scores;
}
//管理员获取参赛项目评分
@Getter
@Setter
@ApiModel
public static class AdminScore{
@ApiModelProperty("评委id")
private Long judge;
@ApiModelProperty("是否是最高最低分 0普通 1最高 2最低")
private Integer isMaxOrMin;
@ApiModelProperty("评委名字")
private String judgeName;
@ApiModelProperty("分数")
private BigDecimal score;
}
//管理员查看排名(详细信息。有每个评委的打分)
@Getter
@Setter
@ApiModel
public static class RankingScore{
@ApiModelProperty("参赛任务id")
private Long playerId;
@ApiModelProperty("任务名")
private String company;
@ApiModelProperty("分组")
private String group;
@ApiModelProperty("平均分得分")
private BigDecimal aveScore;
@ApiModelProperty("每个评委的分数")
private List<JudgeScore> judgeScoreList;
}
@Getter
@Setter
@ApiModel
public static class JudgeScore{
@ApiModelProperty("评委Id")
private Long judgeId;
@ApiModelProperty("评委姓名")
private String judgeName;
@ApiModelProperty("分数")
private BigDecimal score;
}
//管理员查看排名
@Getter
@Setter
@ApiModel
public static class ranking{
@JsonIgnore//任务id
private Long id;
@JsonIgnore//评委id
private Long roleId;
@ApiModelProperty("分组")
private String group;
@ApiModelProperty("行业")
private String industry;
@ApiModelProperty("行业内公司")
private List<player> playerList;
}
@Getter
@Setter
@ApiModel
public static class player{
@ApiModelProperty("公司参赛项目Id")
private Long playerId;
@ApiModelProperty("行业")
private String industry;
@ApiModelProperty("参赛项目名称")
private String playerName;
@ApiModelProperty("参赛公司名称")
private String company;
@ApiModelProperty("参赛项目得分")
private BigDecimal score;
}
//签字表的数据
@Getter
@Setter
public static class ExportExcel{
private Long id;//参赛项目Id
private String playerName;//参赛项目名
private String company;//参赛公司名
private List<ScoreExcel> scoreList;
@Getter
@Setter
public static class ScoreExcel {
private Long scoreLogId;//评分项的id
private BigDecimal score;
}
}
//总分表
@Getter
@Setter
public static class ExportExcelAll{
private String company;//参赛公司名
private String playerName;//项目名
private String industry;//行业
private String group;//分组
private List<Judge> judgeList;
@Getter
@Setter
public static class Judge{
private BigDecimal score1;
private BigDecimal score2;
private BigDecimal score3;
private BigDecimal score4;
private BigDecimal score5;
}
}
// @Getter
// @Setter
// @ApiModel
// public static class MaxAndMinScore{
// @ApiModelProperty("最高分")
// private Score scoreMax;
// @ApiModelProperty("最低分")
// private Score scoreMin;
// @ApiModelProperty("平均分")
// private BigDecimal aveScore;
// }
}

21
mt/src/main/java/com/ccsens/mt/bean/vo/SigninVo.java

@ -0,0 +1,21 @@
package com.ccsens.mt.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SigninVo {
@Data
@ApiModel
public static class SigninVoInfo{
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("序号")
private int sequence;
@ApiModelProperty("签到时间")
private Long signTime;
}
}

31
mt/src/main/java/com/ccsens/mt/config/BeanConfig.java

@ -0,0 +1,31 @@
package com.ccsens.mt.config;
import com.ccsens.mt.intercept.MybatisInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/03 18:01
*/
@Configuration
public class BeanConfig {
// @Bean
// public static PropertySourcesPlaceholderConfigurer properties(){
// PropertySourcesPlaceholderConfigurer conf = new PropertySourcesPlaceholderConfigurer();
// YamlPropertiesFactoryBean yml = new YamlPropertiesFactoryBean();
// yml.setResources(new ClassPathResource("business.yml"));
// conf.setProperties(yml.getObject());
// return conf;
// }
/**
* 注册拦截器
*/
@Bean
public MybatisInterceptor mybatisInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
}

164
mt/src/main/java/com/ccsens/mt/config/SpringConfig.java

@ -0,0 +1,164 @@
package com.ccsens.mt.config;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.ccsens.util.config.DruidProps;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;
import javax.sql.DataSource;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@Configuration
//public class SpringConfig extends WebMvcConfigurationSupport {
public class SpringConfig implements WebMvcConfigurer {
@Autowired
private DruidProps druidPropsUtil;
@Value("${spring.snowflake.workerId}")
private String workerId;
@Value("${spring.snowflake.datacenterId}")
private String datacenterId;
/**
* 配置Converter
* @return
*/
@Bean
public HttpMessageConverter<String> responseStringConverter() {
StringHttpMessageConverter converter = new StringHttpMessageConverter(
Charset.forName("UTF-8"));
return converter;
}
@Bean
public HttpMessageConverter<Object> responseJsonConverter(){
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
List<MediaType> mediaTypeList = new ArrayList<>();
mediaTypeList.add(MediaType.TEXT_HTML);
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
converter.setSupportedMediaTypes(mediaTypeList);
//converter.setObjectMapper();
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
converter.setObjectMapper(objectMapper);
return converter;
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//super.configureMessageConverters(converters);
converters.add(responseStringConverter());
converters.add(responseJsonConverter());
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS");
}
/**
* 配置视图解析器 SpringBoot建议使用Thymeleaf代替jsp动态页面默认路径resources/template静态页面默认路径: resources/static
* @return
*/
// @Bean
// public ViewResolver getViewResolver() {
// InternalResourceViewResolver resolver = new InternalResourceViewResolver();
// resolver.setPrefix("/WEB-INF/views/");
// resolver.setSuffix(".jsp");
// return resolver;
// }
// @Override
// public void configureDefaultServletHandling(
// DefaultServletHandlerConfigurer configurer) {
// configurer.enable();
// }
/**
* 配置静态资源
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/uploads/**")
.addResourceLocations("file:///home/cloud/tall/uploads/");
//super.addResourceHandlers(registry);
}
/**
* 配置拦截器
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
//addPathPatterns 用于添加拦截规则
//excludePathPatterns 用于排除拦截
// registry.addInterceptor(tokenInterceptor())
// .addPathPatterns("/projects/**")
// .addPathPatterns("/messages/**")
// .addPathPatterns("/users/**")
// .excludePathPatterns("/users/signin")
// .excludePathPatterns("/users/smscode")
// .excludePathPatterns("/users/signup")
// .excludePathPatterns("/users/password")
// .excludePathPatterns("/users/account")
// .excludePathPatterns("/users/token")
// .excludePathPatterns("/users/claims")
// .addPathPatterns("/plugins/**")
// .addPathPatterns("/delivers/**")
// .addPathPatterns("/tasks/**")
// .addPathPatterns("/members/**")
// .addPathPatterns("/templates/**")
// .addPathPatterns("/hardware/**");
//super.addInterceptors(registry);
}
//
// @Bean
// public TokenInterceptor tokenInterceptor(){
// return new TokenInterceptor();
// }
/**
* 配置数据源单数据源
*/
@Bean
public DataSource dataSource(){
return druidPropsUtil.createDruidDataSource();
}
@Bean
public Snowflake snowflake(){
// return new Snowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
return IdUtil.createSnowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
}
}

56
mt/src/main/java/com/ccsens/mt/config/SwaggerConfigure.java

@ -0,0 +1,56 @@
package com.ccsens.mt.config;
import com.ccsens.util.WebConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableSwagger2
@ConditionalOnExpression("${swagger.enable}")
//public class SwaggerConfigure extends WebMvcConfigurationSupport {
public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
@Bean
public Docket customDocket() {
//
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.mt.api"))
.build()
.globalOperationParameters(setHeaderToken());
}
private ApiInfo apiInfo() {
return new ApiInfo("Swagger Tall-game",//大标题 title
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
"1.0.0",//版本
"http://swagger.io/terms/",//termsOfServiceUrl
"zhangsan",//作者
"Apache 2.0",//链接显示文字
"http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
);
}
private List<Parameter> setHeaderToken() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token")
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX)
.modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
return pars;
}
}

154
mt/src/main/java/com/ccsens/mt/intercept/MybatisInterceptor.java

@ -0,0 +1,154 @@
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.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Properties;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/11 10:58
*/
@Intercepts({
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)
})
public class MybatisInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
String selectByExample = "selectByExample";
String selectByPrimaryKey = "selectByPrimaryKey";
Object[] args = invocation.getArgs();
MappedStatement statement = (MappedStatement) args[0];
if (statement.getId().endsWith(selectByExample)) {
//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);
}
}
} else if (statement.getId().endsWith(selectByPrimaryKey)) {
BoundSql boundSql = statement.getBoundSql(args[1]);
String sql = boundSql.getSql() + " and rec_status = 0";
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql));
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
msObject.setValue("sqlSource.boundSql.sql", sql);
args[0] = newStatement;
}
return invocation.proceed();
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder =
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource());
builder.fetchSize(ms.getFetchSize());
builder.statementType(ms.getStatementType());
builder.keyGenerator(ms.getKeyGenerator());
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) {
StringBuilder keyProperties = new StringBuilder();
for (String keyProperty : ms.getKeyProperties()) {
keyProperties.append(keyProperty).append(",");
}
keyProperties.delete(keyProperties.length() - 1, keyProperties.length());
builder.keyProperty(keyProperties.toString());
}
builder.timeout(ms.getTimeout());
builder.parameterMap(ms.getParameterMap());
builder.resultMaps(ms.getResultMaps());
builder.resultSetType(ms.getResultSetType());
builder.cache(ms.getCache());
builder.flushCacheRequired(ms.isFlushCacheRequired());
builder.useCache(ms.isUseCache());
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;
public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
return boundSql;
}
}
}

8
mt/src/main/java/com/ccsens/mt/persist/dao/MtJudgeDao.java

@ -0,0 +1,8 @@
package com.ccsens.mt.persist.dao;
import com.ccsens.mt.persist.mapper.MtJudgeMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface MtJudgeDao extends MtJudgeMapper{
}

12
mt/src/main/java/com/ccsens/mt/persist/dao/MtScoreDao.java

@ -0,0 +1,12 @@
package com.ccsens.mt.persist.dao;
import com.ccsens.mt.persist.mapper.MtScoreMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
@Repository
public interface MtScoreDao extends MtScoreMapper{
BigDecimal sumScoreByJudgeId(@Param("judgeId")Long judgeId, @Param("playerId")Long playerId);
}

8
mt/src/main/java/com/ccsens/mt/persist/dao/MtScoreLogDao.java

@ -0,0 +1,8 @@
package com.ccsens.mt.persist.dao;
import com.ccsens.mt.persist.mapper.MtScoreLogMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface MtScoreLogDao extends MtScoreLogMapper{
}

8
mt/src/main/java/com/ccsens/mt/persist/dao/MtSigninDao.java

@ -0,0 +1,8 @@
package com.ccsens.mt.persist.dao;
import com.ccsens.mt.persist.mapper.MtSigninMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface MtSigninDao extends MtSigninMapper{
}

30
mt/src/main/java/com/ccsens/mt/persist/mapper/MtJudgeMapper.java

@ -0,0 +1,30 @@
package com.ccsens.mt.persist.mapper;
import com.ccsens.mt.bean.po.MtJudge;
import com.ccsens.mt.bean.po.MtJudgeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MtJudgeMapper {
long countByExample(MtJudgeExample example);
int deleteByExample(MtJudgeExample example);
int deleteByPrimaryKey(Long id);
int insert(MtJudge record);
int insertSelective(MtJudge record);
List<MtJudge> selectByExample(MtJudgeExample example);
MtJudge selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") MtJudge record, @Param("example") MtJudgeExample example);
int updateByExample(@Param("record") MtJudge record, @Param("example") MtJudgeExample example);
int updateByPrimaryKeySelective(MtJudge record);
int updateByPrimaryKey(MtJudge record);
}

30
mt/src/main/java/com/ccsens/mt/persist/mapper/MtScoreLogMapper.java

@ -0,0 +1,30 @@
package com.ccsens.mt.persist.mapper;
import com.ccsens.mt.bean.po.MtScoreLog;
import com.ccsens.mt.bean.po.MtScoreLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MtScoreLogMapper {
long countByExample(MtScoreLogExample example);
int deleteByExample(MtScoreLogExample example);
int deleteByPrimaryKey(Long id);
int insert(MtScoreLog record);
int insertSelective(MtScoreLog record);
List<MtScoreLog> selectByExample(MtScoreLogExample example);
MtScoreLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") MtScoreLog record, @Param("example") MtScoreLogExample example);
int updateByExample(@Param("record") MtScoreLog record, @Param("example") MtScoreLogExample example);
int updateByPrimaryKeySelective(MtScoreLog record);
int updateByPrimaryKey(MtScoreLog record);
}

30
mt/src/main/java/com/ccsens/mt/persist/mapper/MtScoreMapper.java

@ -0,0 +1,30 @@
package com.ccsens.mt.persist.mapper;
import com.ccsens.mt.bean.po.MtScore;
import com.ccsens.mt.bean.po.MtScoreExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MtScoreMapper {
long countByExample(MtScoreExample example);
int deleteByExample(MtScoreExample example);
int deleteByPrimaryKey(Long id);
int insert(MtScore record);
int insertSelective(MtScore record);
List<MtScore> selectByExample(MtScoreExample example);
MtScore selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") MtScore record, @Param("example") MtScoreExample example);
int updateByExample(@Param("record") MtScore record, @Param("example") MtScoreExample example);
int updateByPrimaryKeySelective(MtScore record);
int updateByPrimaryKey(MtScore record);
}

30
mt/src/main/java/com/ccsens/mt/persist/mapper/MtSigninMapper.java

@ -0,0 +1,30 @@
package com.ccsens.mt.persist.mapper;
import com.ccsens.mt.bean.po.MtSignin;
import com.ccsens.mt.bean.po.MtSigninExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MtSigninMapper {
long countByExample(MtSigninExample example);
int deleteByExample(MtSigninExample example);
int deleteByPrimaryKey(Long id);
int insert(MtSignin record);
int insertSelective(MtSignin record);
List<MtSignin> selectByExample(MtSigninExample example);
MtSignin selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") MtSignin record, @Param("example") MtSigninExample example);
int updateByExample(@Param("record") MtSignin record, @Param("example") MtSigninExample example);
int updateByPrimaryKeySelective(MtSignin record);
int updateByPrimaryKey(MtSignin record);
}

9
mt/src/main/java/com/ccsens/mt/service/IMessageService.java

@ -0,0 +1,9 @@
package com.ccsens.mt.service;
import com.ccsens.mt.bean.dto.message.SyncMessageWithShowDto;
import com.fasterxml.jackson.core.JsonProcessingException;
public interface IMessageService {
//发送亮分消息至树莓派
void sendSyncMessageWithShow(SyncMessageWithShowDto scoreShow) throws Exception;
}

18
mt/src/main/java/com/ccsens/mt/service/IScoreService.java

@ -0,0 +1,18 @@
package com.ccsens.mt.service;
import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.vo.ScoreVo;
import java.util.List;
public interface IScoreService {
List<ScoreVo.ScoreInfo> getScoreLog(Long userId, Long playerId);
void submitScore(Long userId, ScoreDto.SubmitScore submitScore);
List<ScoreVo.AdminScore> adminScore(Long userId, Long roleId, Long playerId);
List<ScoreVo.RankingScore> getRanking(Long projectId);
void showScore(Long projectId, Long playerId) throws Exception;
}

10
mt/src/main/java/com/ccsens/mt/service/ISigninService.java

@ -0,0 +1,10 @@
package com.ccsens.mt.service;
import com.ccsens.mt.bean.dto.SigninDto;
import com.ccsens.mt.bean.vo.SigninVo;
public interface ISigninService {
SigninVo.SigninVoInfo signin(SigninDto.SigninInfo signinInfo, Long userId);
SigninVo.SigninVoInfo getSignByTaskId(Long taskId, Long userId);
}

8
mt/src/main/java/com/ccsens/mt/service/IUserService.java

@ -0,0 +1,8 @@
package com.ccsens.mt.service;
import javax.servlet.http.HttpServletRequest;
public interface IUserService {
Long getUserIdByToken(HttpServletRequest request);
}

22
mt/src/main/java/com/ccsens/mt/service/MessageServicer.java

@ -0,0 +1,22 @@
package com.ccsens.mt.service;
import com.ccsens.mt.bean.dto.message.SyncMessageWithShowDto;
import com.ccsens.util.JacksonUtil;
import com.ccsens.util.config.RabbitMQConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MessageServicer implements IMessageService{
@Autowired
private AmqpTemplate rabbitTemplate;
@Override
public void sendSyncMessageWithShow(SyncMessageWithShowDto message) throws Exception {
System.out.println(JacksonUtil.beanToJson(message));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(message));
}
}

324
mt/src/main/java/com/ccsens/mt/service/ScoreService.java

@ -0,0 +1,324 @@
package com.ccsens.mt.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.cloudutil.bean.tall.vo.MemberVo;
import com.ccsens.cloudutil.bean.tall.vo.TaskVo;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.dto.message.BaseMessageDto;
import com.ccsens.mt.bean.dto.message.SyncMessageWithShowDto;
import com.ccsens.mt.bean.po.*;
import com.ccsens.mt.bean.vo.ScoreVo;
import com.ccsens.mt.persist.dao.MtJudgeDao;
import com.ccsens.mt.persist.dao.MtScoreDao;
import com.ccsens.mt.persist.dao.MtScoreLogDao;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static java.math.BigDecimal.ROUND_HALF_UP;
@Service
public class ScoreService implements IScoreService{
@Autowired
private TallFeignClient tallFeignClient;
@Autowired
private MtScoreDao scoreDao;
@Autowired
private MtScoreLogDao scoreLogDao;
@Autowired
private MtJudgeDao judgeDao;
@Autowired
private IMessageService messageService;
@Autowired
private Snowflake snowflake;
/**
* 获取评分项
* @param userId
* @param playerId
* @return
*/
@Override
public List<ScoreVo.ScoreInfo> getScoreLog(Long userId, Long playerId) {
List<ScoreVo.ScoreInfo> scoreInfoList = new ArrayList<>();
if(ObjectUtil.isNull(userId)){
throw new BaseException(CodeEnum.NOT_LOGIN);
}
TaskVo.TaskInfoWithFeign taskInfo = tallFeignClient.getProjectId(playerId);
if(ObjectUtil.isNull(taskInfo)){
throw new BaseException(CodeEnum.NOT_TASK);
}
JsonResponse<MemberVo.MemberInfo> jMemberInfo = tallFeignClient.getMemberByUserId(userId,taskInfo.getProjectId());
if(ObjectUtil.isNull(jMemberInfo)){
throw new BaseException(CodeEnum.NOT_MEMBER);
}
MemberVo.MemberInfo memberInfo = jMemberInfo.getData();
if(ObjectUtil.isNull(memberInfo)){
throw new BaseException(CodeEnum.NOT_MEMBER);
}
MtScoreLogExample scoreLogExample = new MtScoreLogExample();
scoreLogExample.createCriteria().andProjectIdEqualTo(taskInfo.getProjectId());
List<MtScoreLog> scoreLogList = scoreLogDao.selectByExample(scoreLogExample);
if(CollectionUtil.isNotEmpty(scoreLogList)){
ScoreVo.ScoreInfo scoreInfo = null;
for(MtScoreLog mtScoreLog : scoreLogList){
scoreInfo = new ScoreVo.ScoreInfo();
scoreInfo.setId(mtScoreLog.getId());
scoreInfo.setMax(mtScoreLog.getMaxScore());
scoreInfo.setMin(mtScoreLog.getMinScore());
scoreInfo.setName(mtScoreLog.getName());
scoreInfo.setValid(1);
scoreInfo.setScore(new BigDecimal(0));
//查找评分
MtScoreExample scoreExample = new MtScoreExample();
scoreExample.createCriteria().andScoreLogIdEqualTo(mtScoreLog.getId())
.andJudgeUserIdEqualTo(memberInfo.getId()).andTaskIdEqualTo(playerId);
List<MtScore> scoreList = scoreDao.selectByExample(scoreExample);
if (CollectionUtil.isNotEmpty(scoreList)) {
scoreInfo.setScore(scoreList.get(0).getScore());
scoreInfo.setValid(0);
}
scoreInfoList.add(scoreInfo);
}
}
return scoreInfoList;
}
/**
* 提交评分
* @param userId
* @param submitScore
*/
@Override
public void submitScore(Long userId, ScoreDto.SubmitScore submitScore) {
if(ObjectUtil.isNull(userId)){
throw new BaseException(CodeEnum.NOT_LOGIN);
}
TaskVo.TaskInfoWithFeign taskInfo = tallFeignClient.getProjectId(submitScore.getPlayerId());
if(ObjectUtil.isNull(taskInfo)){
throw new BaseException(CodeEnum.NOT_TASK);
}
JsonResponse<MemberVo.MemberInfo> jMemberInfo = tallFeignClient.getMemberByUserId(userId,taskInfo.getProjectId());
if(ObjectUtil.isNull(jMemberInfo)){
throw new BaseException(CodeEnum.NOT_MEMBER);
}
MemberVo.MemberInfo memberInfo = jMemberInfo.getData();
if(ObjectUtil.isNull(memberInfo)){
throw new BaseException(CodeEnum.NOT_MEMBER);
}
//添加评委
addJudge(memberInfo);
MtScoreExample scoreExample = new MtScoreExample();
scoreExample.createCriteria().andTaskIdEqualTo(submitScore.getPlayerId()).andJudgeUserIdEqualTo(memberInfo.getId());
List<MtScore> scoreList = scoreDao.selectByExample(scoreExample);
if (CollectionUtil.isEmpty(scoreList)) {
if (CollectionUtil.isNotEmpty(submitScore.getData())) {
for (ScoreDto.ScoreInfo1 data : submitScore.getData()) {
MtScore score = new MtScore();
score.setId(snowflake.nextId());
score.setJudgeUserId(memberInfo.getId());
score.setTaskId(submitScore.getPlayerId());
score.setTaskName(null);
score.setScoreLogId(data.getId());
score.setScore(data.getScore());
//0已评分,1被退回
score.setIsScore(0);
scoreDao.insert(score);
}
}
} else {
throw new BaseException(CodeEnum.SCORE_REPEAT);
}
}
private void addJudge(MemberVo.MemberInfo memberInfo){
MtJudge judge = judgeDao.selectByPrimaryKey(memberInfo.getId());
if(ObjectUtil.isNull(judge)){
judge = new MtJudge();
BeanUtil.copyProperties(memberInfo,judge);
judgeDao.insertSelective(judge);
}
}
/**
* 查看评分
* @param userId
* @param roleId
* @param playerId
* @return
*/
@Override
public List<ScoreVo.AdminScore> adminScore(Long userId, Long roleId, Long playerId) {
List<ScoreVo.AdminScore> adminScoreList = new ArrayList<>();
ScoreVo.AdminScore adminScore = null;
//
// Score scoreMax = scoreDao.maxScore(playerId);//最高分
// Score scoreMin = scoreDao.minScore(playerId);//最低分
TaskVo.TaskInfoWithFeign taskInfo = tallFeignClient.getProjectId(playerId);
if(ObjectUtil.isNull(taskInfo)){
throw new BaseException(CodeEnum.NOT_TASK);
}
MtJudgeExample judgeExample = new MtJudgeExample();
judgeExample.createCriteria().andProjectIdEqualTo(taskInfo.getProjectId());
List<MtJudge> judgeList = judgeDao.selectByExample(judgeExample);
if(CollectionUtil.isNotEmpty(judgeList)){
for(MtJudge mtJudge:judgeList){
BigDecimal score = scoreDao.sumScoreByJudgeId(mtJudge.getId(),playerId);
adminScore = new ScoreVo.AdminScore();
adminScore.setJudge(mtJudge.getId());
adminScore.setScore(score);
adminScore.setJudgeName(mtJudge.getNickname());
adminScoreList.add(adminScore);
}
}
return adminScoreList;
}
/**
* 查看排名
*/
@Override
public List<ScoreVo.RankingScore> getRanking(Long projectId) {
//获取所有参赛任务
Set<Long> taskIdList = new HashSet<>();
MtScoreLogExample scoreLogExample = new MtScoreLogExample();
scoreLogExample.createCriteria().andProjectIdEqualTo(projectId);
List<MtScoreLog> scoreLogList = scoreLogDao.selectByExample(scoreLogExample);
if(CollectionUtil.isNotEmpty(scoreLogList)){
for(MtScoreLog scoreLog : scoreLogList){
MtScoreExample scoreExample = new MtScoreExample();
scoreExample.createCriteria().andScoreLogIdEqualTo(scoreLog.getId());
List<MtScore> scoreList = scoreDao.selectByExample(scoreExample);
if(CollectionUtil.isNotEmpty(scoreList)){
for(MtScore score : scoreList){
taskIdList.add(score.getTaskId());
}
}
}
}
//查找每个任务的分数
List<ScoreVo.RankingScore> rankingScoreList = new ArrayList<>();
ScoreVo.RankingScore rankingScore = null;
if(CollectionUtil.isNotEmpty(taskIdList)){
for(Long taskId : taskIdList){
rankingScore = new ScoreVo.RankingScore();
TaskVo.TaskInfoWithFeign taskInfo = tallFeignClient.getProjectId(taskId);
if(ObjectUtil.isNull(taskInfo)){
throw new BaseException(CodeEnum.NOT_TASK);
}
rankingScore.setPlayerId(taskInfo.getId());
rankingScore.setCompany(taskInfo.getName());
//获取每个评委对此任务的评分
List<ScoreVo.JudgeScore> judgeScoreList = findJudgeScore(projectId,taskId);
rankingScore.setJudgeScoreList(judgeScoreList);
//获取此任务的平均分
BigDecimal aveScore = BigDecimal.valueOf(0);
if(CollectionUtil.isNotEmpty(judgeScoreList)){
for(ScoreVo.JudgeScore judgeScore : judgeScoreList){
aveScore = aveScore.subtract(judgeScore.getScore());
}
aveScore = aveScore.divide(BigDecimal.valueOf(judgeScoreList.size()), 2, ROUND_HALF_UP);
}
rankingScore.setAveScore(aveScore);
rankingScoreList.add(rankingScore);
}
}
return null;
}
/**
* 获取每个评委对此任务的评分
*/
private List<ScoreVo.JudgeScore> findJudgeScore(Long projectId, Long taskId) {
List<ScoreVo.JudgeScore> judgeScoreList = new ArrayList<>();
ScoreVo.JudgeScore judgeScore = null;
//查找项目下所有评委
MtJudgeExample judgeExample = new MtJudgeExample();
judgeExample.createCriteria().andProjectIdEqualTo(projectId);
List<MtJudge> judgeList = judgeDao.selectByExample(judgeExample);
if (CollectionUtil.isNotEmpty(judgeList)) {
for (MtJudge judge : judgeList) {
BigDecimal scoreSUM = scoreDao.sumScoreByJudgeId(judge.getId(), taskId);
judgeScore = new ScoreVo.JudgeScore();
judgeScore.setJudgeId(judge.getId());
judgeScore.setJudgeName(judge.getNickname());
judgeScore.setScore(scoreSUM);
judgeScoreList.add(judgeScore);
}
}
return judgeScoreList;
}
/**
* 亮分
*/
@Override
public void showScore(Long projectId, Long taskId) throws Exception {
SyncMessageWithShowDto scoreShow = new SyncMessageWithShowDto();
SyncMessageWithShowDto.Data data = new SyncMessageWithShowDto.Data();
SyncMessageWithShowDto.Data.Judge judge = null;
List<SyncMessageWithShowDto.Data.Judge> judgeList = new ArrayList<>();
//项目
TaskVo.TaskInfoWithFeign taskInfo = tallFeignClient.getProjectId(taskId);
if(ObjectUtil.isNull(taskInfo)){
throw new BaseException(CodeEnum.NOT_TASK);
}
data.setProjectId(taskInfo.getProjectId());
data.setPlayerName(taskInfo.getProjectName());
data.setPlayerId(taskInfo.getId());
data.setPlayerName(taskInfo.getName());
//获取每个评委对此任务的评分
List<ScoreVo.JudgeScore> judgeScoreList = findJudgeScore(projectId,taskId);
BigDecimal aveScore = BigDecimal.valueOf(0);
if(CollectionUtil.isNotEmpty(judgeScoreList)){
for(ScoreVo.JudgeScore judgeScore : judgeScoreList){
MtJudge mtJudge = judgeDao.selectByPrimaryKey(judgeScore.getJudgeId());
judge = new SyncMessageWithShowDto.Data.Judge();
judge.setJudgeName(mtJudge.getNickname());
// judge.setAvatarUrl(WebConstant.URL_BASE + mtJudge.getAvatarUrl());
judge.setScore(judgeScore.getScore());
judgeList.add(judge);
//获取此任务的总分
aveScore = aveScore.subtract(judgeScore.getScore());
}
//平均分
aveScore = aveScore.divide(BigDecimal.valueOf(judgeScoreList.size()), 2, ROUND_HALF_UP);
}
data.setAverageScore(aveScore);
data.setScoreList(judgeList);
//接收者id
List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
BaseMessageDto.MessageUser messageUser1 = new BaseMessageDto.MessageUser();
BaseMessageDto.MessageUser messageUser2 = new BaseMessageDto.MessageUser();
messageUser1.setUserId(1990L);
messageUser2.setUserId(1991L);
messageUserList.add(messageUser1);
messageUserList.add(messageUser2);
scoreShow.setData(data);
scoreShow.setReceivers(messageUserList);
//发送消息
messageService.sendSyncMessageWithShow(scoreShow);
}
}

75
mt/src/main/java/com/ccsens/mt/service/SigninService.java

@ -0,0 +1,75 @@
package com.ccsens.mt.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.mt.bean.dto.SigninDto;
import com.ccsens.mt.bean.po.MtSignin;
import com.ccsens.mt.bean.po.MtSigninExample;
import com.ccsens.mt.bean.vo.SigninVo;
import com.ccsens.mt.persist.dao.MtSigninDao;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SigninService implements ISigninService{
@Autowired
private MtSigninDao mtSigninDao;
@Autowired
private Snowflake snowflake;
@Override
public SigninVo.SigninVoInfo signin(SigninDto.SigninInfo signinInfo, Long userId) {
MtSigninExample signinExample = new MtSigninExample();
signinExample.createCriteria().andTaskIdEqualTo(signinInfo.getTaskId()).andUserIdEqualTo(userId);
List<MtSignin> signinList = mtSigninDao.selectByExample(signinExample);
if(CollectionUtil.isNotEmpty(signinList)){
throw new BaseException(CodeEnum.SIGNIN_REPEAT);
}
MtSignin mtSignin = new MtSignin();
mtSignin.setId(snowflake.nextId());
mtSignin.setUserId(userId);
mtSignin.setTaskId(signinInfo.getTaskId());
mtSignin.setName(signinInfo.getName());
mtSignin.setPhone(signinInfo.getPhone());
mtSignin.setSigninTime(System.currentTimeMillis());
MtSigninExample mtSigninExample = new MtSigninExample();
mtSigninExample.createCriteria().andTaskIdEqualTo(signinInfo.getTaskId());
List<MtSignin> mtSigninList = mtSigninDao.selectByExample(mtSigninExample);
if(CollectionUtil.isNotEmpty(mtSigninList)){
mtSignin.setSequence(mtSigninList.size() + 1);
}else {
mtSignin.setSequence(1);
}
mtSigninDao.insertSelective(mtSignin);
SigninVo.SigninVoInfo signinVoInfo = new SigninVo.SigninVoInfo();
signinVoInfo.setName(mtSignin.getName());
signinVoInfo.setPhone(mtSignin.getPhone());
signinVoInfo.setSequence(mtSignin.getSequence());
signinVoInfo.setSignTime(mtSignin.getSigninTime());
return signinVoInfo;
}
@Override
public SigninVo.SigninVoInfo getSignByTaskId(Long taskId, Long userId) {
SigninVo.SigninVoInfo signinVoInfo = new SigninVo.SigninVoInfo();
MtSigninExample signinExample = new MtSigninExample();
signinExample.createCriteria().andTaskIdEqualTo(taskId).andUserIdEqualTo(userId);
List<MtSignin> signinList = mtSigninDao.selectByExample(signinExample);
if(CollectionUtil.isNotEmpty(signinList)){
MtSignin mtSignin = signinList.get(0);
signinVoInfo.setName(mtSignin.getName());
signinVoInfo.setPhone(mtSignin.getPhone());
signinVoInfo.setSequence(mtSignin.getSequence());
signinVoInfo.setSignTime(mtSignin.getSigninTime());
}
return signinVoInfo;
}
}

41
mt/src/main/java/com/ccsens/mt/service/UserService.java

@ -0,0 +1,41 @@
package com.ccsens.mt.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
@Slf4j
@Service
public class UserService implements IUserService{
@Autowired
private TallFeignClient tallFeignClient;
@Override
public Long getUserIdByToken(HttpServletRequest request){
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
JsonResponse response = tallFeignClient.getUserIdByToken(authHeader);
log.info("{}获取userId:{}", authHeader, response);
if (response.getCode().intValue() != CodeEnum.SUCCESS.getCode().intValue()) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
if (response.getData() == null) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
Long userId = json.getLong("id");
if (userId == null || userId == 0) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
return userId;
}
}

30
mt/src/main/resources/application-common.yml

@ -0,0 +1,30 @@
logging:
level:
com:
favorites: DEBUG
org:
hibernate: ERROR
springframework:
web: DEBUG
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath*:mapper_*/*.xml
type-aliases-package: com.ccsens.mtpro.bean
#server:
# tomcat:
# uri-encoding: UTF-8
spring:
http:
encoding:
charset: UTF-8
enabled: true
force: true
log-request-details: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 100MB
snowflake:
datacenterId: 1
workerId: 1

29
mt/src/main/resources/application-dev.yml

@ -0,0 +1,29 @@
server:
port: 7060
servlet:
context-path:
spring:
application:
name: mt
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: api.ccsens.com
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true

28
mt/src/main/resources/application-test.yml

@ -0,0 +1,28 @@
server:
port: 7060
servlet:
context-path:
spring:
application:
name: mt
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: api.ccsens.com
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true

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

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

33
mt/src/main/resources/druid-dev.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/mt?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

33
mt/src/main/resources/druid-prod.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

33
mt/src/main/resources/druid-test.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

196
mt/src/main/resources/logback-spring.xml

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="/home/cloud/mt/log/" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender><logger>仅有一个name属性,
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!--<logger name="org.springframework.web" level="info"/>-->
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="com.ccsens.ptpro.persist.*" level="debug"/>
</springProfile>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
<!--生产环境:输出到文件-->
<!--<springProfile name="pro">-->
<!--<root level="info">-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--</root>-->
<!--</springProfile>-->
</configuration>

50
mt/src/main/resources/mapper_dao/ScoreDao.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.dao.MtScoreDao">
<select id="sumScoreByJudgeId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
SELECT
SUM(score)
FROM
`t_score`
WHERE
player_id=#{playerId}
AND
role_id = #{judgeId}
</select>
<select id="sumScore" parameterType="java.util.Map" resultType="java.math.BigDecimal">
SELECT
SUM(score)
FROM
`t_score`
WHERE
player_id=#{playerId}
</select>
<select id="maxScore" parameterType="java.util.Map" resultType="com.ccsens.mt.bean.po.MtScore">
SELECT
*
FROM
`t_score`
WHERE
score = (SELECT MAX(score) FROM `t_score` WHERE player_id=#{playerId})
AND
player_id=#{playerId}
LIMIT 0,1
</select>
<select id="minScore" parameterType="java.util.Map" resultType="com.ccsens.mt.bean.po.MtScore">
SELECT
*
FROM
`t_score`
WHERE
score = (SELECT MIN(score) FROM `t_score` WHERE player_id=#{playerId})
AND
player_id=#{playerId}
LIMIT 0,1
</select>
</mapper>

275
mt/src/main/resources/mapper_raw/MtJudgeMapper.xml

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.mapper.MtJudgeMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.MtJudge">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, user_id, nickname, avatar_url, phone, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.MtJudgeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_mt_judge
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_mt_judge
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_mt_judge
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.MtJudgeExample">
delete from t_mt_judge
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.MtJudge">
insert into t_mt_judge (id, project_id, user_id,
nickname, avatar_url, phone,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{nickname,jdbcType=VARCHAR}, #{avatarUrl,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.MtJudge">
insert into t_mt_judge
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="avatarUrl != null">
avatar_url,
</if>
<if test="phone != null">
phone,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="avatarUrl != null">
#{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.MtJudgeExample" resultType="java.lang.Long">
select count(*) from t_mt_judge
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_mt_judge
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.nickname != null">
nickname = #{record.nickname,jdbcType=VARCHAR},
</if>
<if test="record.avatarUrl != null">
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_mt_judge
set id = #{record.id,jdbcType=BIGINT},
project_id = #{record.projectId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
nickname = #{record.nickname,jdbcType=VARCHAR},
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.MtJudge">
update t_mt_judge
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="avatarUrl != null">
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.MtJudge">
update t_mt_judge
set project_id = #{projectId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
nickname = #{nickname,jdbcType=VARCHAR},
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

275
mt/src/main/resources/mapper_raw/MtScoreLogMapper.xml

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.mapper.MtScoreLogMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.MtScoreLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="max_score" jdbcType="DECIMAL" property="maxScore" />
<result column="min_score" jdbcType="DECIMAL" property="minScore" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, max_score, min_score, project_id, sequence, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.MtScoreLogExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_mt_score_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_mt_score_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_mt_score_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.MtScoreLogExample">
delete from t_mt_score_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.MtScoreLog">
insert into t_mt_score_log (id, name, max_score,
min_score, project_id, sequence,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{maxScore,jdbcType=DECIMAL},
#{minScore,jdbcType=DECIMAL}, #{projectId,jdbcType=BIGINT}, #{sequence,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.MtScoreLog">
insert into t_mt_score_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="maxScore != null">
max_score,
</if>
<if test="minScore != null">
min_score,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="sequence != null">
sequence,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="maxScore != null">
#{maxScore,jdbcType=DECIMAL},
</if>
<if test="minScore != null">
#{minScore,jdbcType=DECIMAL},
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
</if>
<if test="sequence != null">
#{sequence,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.MtScoreLogExample" resultType="java.lang.Long">
select count(*) from t_mt_score_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_mt_score_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.maxScore != null">
max_score = #{record.maxScore,jdbcType=DECIMAL},
</if>
<if test="record.minScore != null">
min_score = #{record.minScore,jdbcType=DECIMAL},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=BIGINT},
</if>
<if test="record.sequence != null">
sequence = #{record.sequence,jdbcType=INTEGER},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_mt_score_log
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
max_score = #{record.maxScore,jdbcType=DECIMAL},
min_score = #{record.minScore,jdbcType=DECIMAL},
project_id = #{record.projectId,jdbcType=BIGINT},
sequence = #{record.sequence,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.MtScoreLog">
update t_mt_score_log
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="maxScore != null">
max_score = #{maxScore,jdbcType=DECIMAL},
</if>
<if test="minScore != null">
min_score = #{minScore,jdbcType=DECIMAL},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
<if test="sequence != null">
sequence = #{sequence,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.MtScoreLog">
update t_mt_score_log
set name = #{name,jdbcType=VARCHAR},
max_score = #{maxScore,jdbcType=DECIMAL},
min_score = #{minScore,jdbcType=DECIMAL},
project_id = #{projectId,jdbcType=BIGINT},
sequence = #{sequence,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

291
mt/src/main/resources/mapper_raw/MtScoreMapper.xml

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.mapper.MtScoreMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.MtScore">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="judge_user_id" jdbcType="BIGINT" property="judgeUserId" />
<result column="score_log_id" jdbcType="BIGINT" property="scoreLogId" />
<result column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="is_score" jdbcType="INTEGER" property="isScore" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, judge_user_id, score_log_id, task_id, task_name, score, is_score, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.MtScoreExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_mt_score
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_mt_score
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_mt_score
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.MtScoreExample">
delete from t_mt_score
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.MtScore">
insert into t_mt_score (id, judge_user_id, score_log_id,
task_id, task_name, score,
is_score, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{judgeUserId,jdbcType=BIGINT}, #{scoreLogId,jdbcType=BIGINT},
#{taskId,jdbcType=BIGINT}, #{taskName,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL},
#{isScore,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.MtScore">
insert into t_mt_score
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="judgeUserId != null">
judge_user_id,
</if>
<if test="scoreLogId != null">
score_log_id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="taskName != null">
task_name,
</if>
<if test="score != null">
score,
</if>
<if test="isScore != null">
is_score,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="judgeUserId != null">
#{judgeUserId,jdbcType=BIGINT},
</if>
<if test="scoreLogId != null">
#{scoreLogId,jdbcType=BIGINT},
</if>
<if test="taskId != null">
#{taskId,jdbcType=BIGINT},
</if>
<if test="taskName != null">
#{taskName,jdbcType=VARCHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="isScore != null">
#{isScore,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.MtScoreExample" resultType="java.lang.Long">
select count(*) from t_mt_score
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_mt_score
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.judgeUserId != null">
judge_user_id = #{record.judgeUserId,jdbcType=BIGINT},
</if>
<if test="record.scoreLogId != null">
score_log_id = #{record.scoreLogId,jdbcType=BIGINT},
</if>
<if test="record.taskId != null">
task_id = #{record.taskId,jdbcType=BIGINT},
</if>
<if test="record.taskName != null">
task_name = #{record.taskName,jdbcType=VARCHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.isScore != null">
is_score = #{record.isScore,jdbcType=INTEGER},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_mt_score
set id = #{record.id,jdbcType=BIGINT},
judge_user_id = #{record.judgeUserId,jdbcType=BIGINT},
score_log_id = #{record.scoreLogId,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
task_name = #{record.taskName,jdbcType=VARCHAR},
score = #{record.score,jdbcType=DECIMAL},
is_score = #{record.isScore,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.MtScore">
update t_mt_score
<set>
<if test="judgeUserId != null">
judge_user_id = #{judgeUserId,jdbcType=BIGINT},
</if>
<if test="scoreLogId != null">
score_log_id = #{scoreLogId,jdbcType=BIGINT},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=BIGINT},
</if>
<if test="taskName != null">
task_name = #{taskName,jdbcType=VARCHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="isScore != null">
is_score = #{isScore,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.MtScore">
update t_mt_score
set judge_user_id = #{judgeUserId,jdbcType=BIGINT},
score_log_id = #{scoreLogId,jdbcType=BIGINT},
task_id = #{taskId,jdbcType=BIGINT},
task_name = #{taskName,jdbcType=VARCHAR},
score = #{score,jdbcType=DECIMAL},
is_score = #{isScore,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

306
mt/src/main/resources/mapper_raw/MtSigninMapper.xml

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.mapper.MtSigninMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.MtSignin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="company" jdbcType="VARCHAR" property="company" />
<result column="signin_time" jdbcType="BIGINT" property="signinTime" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, task_id, name, phone, company, signin_time, sequence, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.MtSigninExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_mt_signin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_mt_signin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_mt_signin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.MtSigninExample">
delete from t_mt_signin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.MtSignin">
insert into t_mt_signin (id, user_id, task_id,
name, phone, company,
signin_time, sequence, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR},
#{signinTime,jdbcType=BIGINT}, #{sequence,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.MtSignin">
insert into t_mt_signin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="name != null">
name,
</if>
<if test="phone != null">
phone,
</if>
<if test="company != null">
company,
</if>
<if test="signinTime != null">
signin_time,
</if>
<if test="sequence != null">
sequence,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="taskId != null">
#{taskId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="company != null">
#{company,jdbcType=VARCHAR},
</if>
<if test="signinTime != null">
#{signinTime,jdbcType=BIGINT},
</if>
<if test="sequence != null">
#{sequence,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.MtSigninExample" resultType="java.lang.Long">
select count(*) from t_mt_signin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_mt_signin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.taskId != null">
task_id = #{record.taskId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.company != null">
company = #{record.company,jdbcType=VARCHAR},
</if>
<if test="record.signinTime != null">
signin_time = #{record.signinTime,jdbcType=BIGINT},
</if>
<if test="record.sequence != null">
sequence = #{record.sequence,jdbcType=INTEGER},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_mt_signin
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
company = #{record.company,jdbcType=VARCHAR},
signin_time = #{record.signinTime,jdbcType=BIGINT},
sequence = #{record.sequence,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.MtSignin">
update t_mt_signin
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="company != null">
company = #{company,jdbcType=VARCHAR},
</if>
<if test="signinTime != null">
signin_time = #{signinTime,jdbcType=BIGINT},
</if>
<if test="sequence != null">
sequence = #{sequence,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.MtSignin">
update t_mt_signin
set user_id = #{userId,jdbcType=BIGINT},
task_id = #{taskId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
company = #{company,jdbcType=VARCHAR},
signin_time = #{signinTime,jdbcType=BIGINT},
sequence = #{sequence,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

61
mt/src/main/resources/mybatis/mybatis-config.xml

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 打印SQL语句 -->
<setting name="logImpl" value="STDOUT_LOGGING" />
<!-- 使全局的映射器启用或禁用缓存。 -->
<setting name="cacheEnabled" value="true"/>
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 -->
<setting name="lazyLoadingEnabled" value="true"/>
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 -->
<setting name="aggressiveLazyLoading" value="true"/>
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true -->
<setting name="multipleResultSetsEnabled" value="true"/>
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true -->
<setting name="useColumnLabel" value="true"/>
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。 default:false -->
<setting name="useGeneratedKeys" value="true"/>
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分 FULL:全部 -->
<setting name="autoMappingBehavior" value="PARTIAL"/>
<!-- 这是默认的执行类型 (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新) -->
<setting name="defaultExecutorType" value="SIMPLE"/>
<!-- 使用驼峰命名法转换字段。 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session -->
<setting name="localCacheScope" value="SESSION"/>
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
<setting name="jdbcTypeForNull" value="NULL"/>
</settings>
<typeAliases>
<typeAlias alias="Integer" type="java.lang.Integer" />
<typeAlias alias="Long" type="java.lang.Long" />
<typeAlias alias="HashMap" type="java.util.HashMap" />
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" />
<typeAlias alias="ArrayList" type="java.util.ArrayList" />
<typeAlias alias="LinkedList" type="java.util.LinkedList" />
</typeAliases>
<plugins>
<!-- com.github.pagehelper为PageHelper类所在包名 -->
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql"/>
<!-- 该参数默认为false -->
<!-- 设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用 -->
<!-- 和startPage中的pageNum效果一样-->
<property name="offsetAsPageNum" value="false"/>
<!-- 该参数默认为false -->
<!-- 设置为true时,使用RowBounds分页会进行count查询 -->
<property name="rowBoundsWithCount" value="false"/>
<property name="pageSizeZero" value="true"/>
<property name="reasonable" value="false"/>
<property name="supportMethodsArguments" value="false"/>
<property name="returnPageInfo" value="none"/>
</plugin>
</plugins>
</configuration>

1
pom.xml

@ -11,6 +11,7 @@
<module>tall</module>
<module>util</module>
<module>game</module>
<module>mt</module>
</modules>
<groupId>com.ccsens</groupId>

4
tall/src/main/java/com/ccsens/tall/bean/vo/MemberVo.java

@ -5,16 +5,18 @@ import lombok.Getter;
import lombok.Setter;
@Data
public class MemberVo {
@Data
public static class MemberInfo{
private Long id;
private Long userId;
// private Long memberRoleId;
private Long projectId;
private String nickname;
private String avatarUrl;
private Integer no;
private String phone;
private String description;
private Long joinTime;
private Long stakeholderId;
}
}

9
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -140,7 +140,7 @@ public class TaskVo {
@Data
public static class PluginVo{
@ApiModelProperty("插件id")
private Long id;
private String id;
@ApiModelProperty("插件名")
private String name;
@JsonIgnore
@ -240,4 +240,11 @@ public class TaskVo {
private Long subTimeId;
}
@Data
public static class TaskInfoWithFeign{
private Long id;
private String name;
private Long projectId;
private String projectName;
}
}

2
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -134,9 +134,11 @@ public class SpringConfig implements WebMvcConfigurer {
.excludePathPatterns("/users/account")
.excludePathPatterns("/users/token")
.excludePathPatterns("/users/claims")
.excludePathPatterns("/users/member")
.addPathPatterns("/plugins/**")
.addPathPatterns("/delivers/**")
.addPathPatterns("/tasks/**")
.excludePathPatterns("/tasks/projectId")
.addPathPatterns("/members/**")
.addPathPatterns("/templates/**")
.addPathPatterns("/hardware/**");

3
tall/src/main/java/com/ccsens/tall/persist/dao/TaskDetailDao.java

@ -11,7 +11,8 @@ import java.util.List;
@Repository
public interface TaskDetailDao extends ProTaskDetailMapper {
List<TaskVo.NormalTask> selectNormalTaskListByPM(@Param("projectId") Long projectId, @Param("parentId") Long parentId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
List<TaskVo.NormalTask> selectNormalTaskListByPM(@Param("projectId") Long projectId, @Param("parentId") Long parentId,
@Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("roleId") Long roleId);
List<TaskVo.NormalTask> selectTaskByRoleAndAllMembers(@Param("projectId") Long projectId, @Param("roleId") Long roleId,
@Param("startTime") Long startTime, @Param("endTime") Long endTime);

1106
tall/src/main/java/com/ccsens/tall/service/ExcelMtService.java

File diff suppressed because it is too large

326
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -28,7 +28,7 @@ import java.util.*;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ExcelService implements IExcelService {
@Autowired
private SysPluginDao sysPluginDao;
@ -68,7 +68,7 @@ public class ExcelService implements IExcelService {
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
//读取WBS表
SysProject sysProject = readWbs(xssfWorkbook, currentUserId);
ProjectVo.ProjectInfo projectInfo = selectByProjectId(currentUserId,sysProject);
ProjectVo.ProjectInfo projectInfo = selectByProjectId(currentUserId, sysProject);
return projectInfo;
}
@ -76,6 +76,7 @@ public class ExcelService implements IExcelService {
* 读取Wbs
*/
public SysProject readWbs(XSSFWorkbook xssfWorkbook, Long currentUserId) throws Exception {
Map<String, List<ProTaskDetail>> hasGroupMap = new HashMap<>();
//项目
SysProject sysProject = new SysProject();
//角色
@ -120,39 +121,40 @@ public class ExcelService implements IExcelService {
taskStart = i + 1;
}
}
if(projectInfoStart==0){
if (projectInfoStart == 0) {
throw new BaseException(CodeEnum.WSB_NOT_PROJECT_HEADER);
}
if(projectInfoStart==0){
if (projectInfoStart == 0) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER_HEADER);
}
if(projectInfoStart==0){
if (projectInfoStart == 0) {
throw new BaseException(CodeEnum.WSB_NOT_TASK_HEADER);
}
readProject(wbsSheet, projectInfoStart, projectInfoEnd, currentUserId,sysProject);
readMember(wbsSheet, memberSheet,memberStart, memberEnd,sysProject, proRoles,proMembers);
readTask(xssfWorkbook, wbsSheet, taskStart, taskEnd, currentUserId,sysProject,taskDetails,proRoles,proMembers);
readProject(wbsSheet, projectInfoStart, projectInfoEnd, currentUserId, sysProject);
readMember(wbsSheet, memberSheet, memberStart, memberEnd, sysProject, proRoles, proMembers);
readTask(xssfWorkbook, wbsSheet, taskStart, taskEnd, currentUserId, sysProject, taskDetails, proRoles, proMembers, hasGroupMap);
saveProTaskSubTime(taskDetails);
//读取插件表
readPlugin(xssfWorkbook,taskDetails,proRoles);
readPlugin(xssfWorkbook, taskDetails, proRoles, hasGroupMap);
return sysProject;
}
/**
* 添加项目
*/
private void readProject(XSSFSheet wbsSheet, int projectInfoStart, int projectInfoEnd, Long currentUserId,SysProject sysProject) {
private void readProject(XSSFSheet wbsSheet, int projectInfoStart, int projectInfoEnd, Long currentUserId, SysProject sysProject) {
XSSFRow row = wbsSheet.getRow(projectInfoStart + 1);
String projectName = ExcelUtil.getCellValue(row.getCell(0));
if(StrUtil.isNotEmpty(projectName)){
if (StrUtil.isNotEmpty(projectName)) {
String begin = ExcelUtil.getCellValue(row.getCell(3));
String end = ExcelUtil.getCellValue(row.getCell(4));
if(StrUtil.isNotEmpty(begin)&&StrUtil.isNotEmpty(end)){
if (StrUtil.isNotEmpty(begin) && StrUtil.isNotEmpty(end)) {
Long beginTime = null;
Long endTime = null;
try {
beginTime = Long.parseLong(begin);
endTime = Long.parseLong(end);
}catch (Exception e){
} catch (Exception e) {
//日期格式错误
throw new BaseException(CodeEnum.WBS_PROJECT_TIME_ERROR);
}
@ -174,11 +176,11 @@ public class ExcelService implements IExcelService {
proShow.setId(snowflake.nextId());
proShow.setProjectId(sysProject.getId());
proShowService.saveProShow(proShow);
}else {
} else {
//没有开始结束时间
throw new BaseException(CodeEnum.WBS_NOT_PROJECT_TIME);
}
}else {
} else {
//没有项目名
throw new BaseException(CodeEnum.WBS_NOT_PROJECT_NAME);
}
@ -245,7 +247,7 @@ public class ExcelService implements IExcelService {
proRoles.add(attentionRole);
//添加成员和奖惩干系人
memberWhitStakeholder(memberSheet, stakeholderProRole.getId(),sysProject,proMembers);
memberWhitStakeholder(memberSheet, stakeholderProRole.getId(), sysProject, proMembers);
Long firstRoleId = null;
Long secondRoleId = null;
@ -267,28 +269,23 @@ public class ExcelService implements IExcelService {
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.God.phase)) {
role.setName(WebConstant.ROLE_NAME.God.value);
role.setDescription(WebConstant.ROLE_NAME.God.phase);
}else
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ManageRepresent.phase)) {
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ManageRepresent.phase)) {
role.setName(WebConstant.ROLE_NAME.ManageRepresent.value);
role.setDescription(WebConstant.ROLE_NAME.ManageRepresent.phase);
}else
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Stakeholder.phase)) {
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Stakeholder.phase)) {
role.setName(WebConstant.ROLE_NAME.Stakeholder.value);
role.setDescription(WebConstant.ROLE_NAME.Stakeholder.phase);
}else
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.PM.phase)) {
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.PM.phase)) {
role.setName(WebConstant.ROLE_NAME.PM.value);
role.setDescription(WebConstant.ROLE_NAME.PM.phase);
}else
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Member.phase)) {
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Member.phase)) {
role.setName(WebConstant.ROLE_NAME.Member.value);
role.setDescription(WebConstant.ROLE_NAME.Member.phase);
}else
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Attention.phase)) {
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Attention.phase)) {
role.setName(WebConstant.ROLE_NAME.Attention.value);
role.setDescription(WebConstant.ROLE_NAME.Attention.phase);
}else{
throw new BaseException(CodeEnum.WBS_NOT_FIRST_ROLE.addMsg(wbsSheet.getSheetName()+i));
} else {
throw new BaseException(CodeEnum.WBS_NOT_FIRST_ROLE.addMsg(wbsSheet.getSheetName() + i));
}
proRoleService.saveProRole(role);
proRoles.add(role);
@ -309,7 +306,7 @@ public class ExcelService implements IExcelService {
}
//二级角色
if (StrUtil.isNotEmpty(secondRoleCell)) {
if (!proMemberRoleExist(secondRoleCell,proRoles)) {
if (!proMemberRoleExist(secondRoleCell, proRoles)) {
ProRole proRole = new ProRole();
proRole.setName(secondRoleCell);
proRole.setParentId(firstRoleId);
@ -318,8 +315,8 @@ public class ExcelService implements IExcelService {
proRoleService.saveProRole(proRole);
proRoles.add(proRole);
secondRoleId = proRole.getId();
}else {
throw new BaseException(CodeEnum.WBS_REPEAT_ROLE_NAME.addMsg(wbsSheet.getSheetName()+i));
} else {
throw new BaseException(CodeEnum.WBS_REPEAT_ROLE_NAME.addMsg(wbsSheet.getSheetName() + i));
}
}
if (ObjectUtil.isNull(secondRoleId)) {
@ -337,8 +334,8 @@ public class ExcelService implements IExcelService {
proMemberRoleService.saveMemberRole(memberRole);
}
}
if(ObjectUtil.isNull(memberRole)){
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(wbsSheet.getSheetName()+i));
if (ObjectUtil.isNull(memberRole)) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(wbsSheet.getSheetName() + i));
}
}
}
@ -376,8 +373,8 @@ public class ExcelService implements IExcelService {
break;
}
}
if(ObjectUtil.isNull(roleId)){
throw new BaseException(CodeEnum.WBS_NOT_FIND_ROLE.addMsg(wbsSheet.getSheetName()+i));
if (ObjectUtil.isNull(roleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_ROLE.addMsg(wbsSheet.getSheetName() + i));
}
}
excludeRoleService.saveExcludeRole(excludeRole);
@ -399,7 +396,7 @@ public class ExcelService implements IExcelService {
/**
* 判断集合是否为空有没有相同内容
*/
private boolean proMemberRoleExist(String memberRoleName,List<ProRole> proRoles) {
private boolean proMemberRoleExist(String memberRoleName, List<ProRole> proRoles) {
if (CollectionUtil.isNotEmpty(proRoles)) {
for (ProRole proMemberRole : proRoles) {
if (proMemberRole.getName().equals(memberRoleName)) {
@ -426,17 +423,17 @@ public class ExcelService implements IExcelService {
ProMember stakeholder = null;
ProMember member = null;
//手机号不能为空
if((StrUtil.isNotEmpty(memberCell)&&StrUtil.isEmpty(phoneCell)) ||
(StrUtil.isNotEmpty(stakeholderCell)&&StrUtil.isEmpty(stakeholderPhoneCell))){
throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName()+i));
if ((StrUtil.isNotEmpty(memberCell) && StrUtil.isEmpty(phoneCell)) ||
(StrUtil.isNotEmpty(stakeholderCell) && StrUtil.isEmpty(stakeholderPhoneCell))) {
throw new BaseException(CodeEnum.WBS_NOT_PHONE.addMsg(memberSheet.getSheetName() + i));
}
//TODO 判断手机号格式
//添加奖惩干系人
if (StrUtil.isNotEmpty(stakeholderCell)) {
if(!stakeholderWithPhone(stakeholderList,stakeholderCell,stakeholderPhoneCell)) {
if (!stakeholderWithPhone(stakeholderList, stakeholderCell, stakeholderPhoneCell)) {
Long userId = userService.selectUserIdByPhone(stakeholderPhoneCell);
if(ObjectUtil.isNotNull(userId)){
if (ObjectUtil.isNotNull(userId)) {
userIdSet.add(userId);
}
stakeholder = new ProMember();
@ -453,15 +450,15 @@ public class ExcelService implements IExcelService {
proMemberRole.setMemberId(stakeholder.getId());
proMemberRole.setRoleId(stakeholderId);
proMemberRoleService.saveMemberRole(proMemberRole);
}else {
throw new BaseException(CodeEnum.WBS_STAKEHOLDER_PHONE.addMsg(memberSheet.getSheetName()+i));
} else {
throw new BaseException(CodeEnum.WBS_STAKEHOLDER_PHONE.addMsg(memberSheet.getSheetName() + i));
}
}
//成员
if (StrUtil.isNotEmpty(memberCell)) {
if (!memberAndPhoneRepeat(proMembers, memberCell, phoneCell)) {
Long userId = userService.selectUserIdByPhone(phoneCell);
if(ObjectUtil.isNotNull(userId)){
if (ObjectUtil.isNotNull(userId)) {
userIdSet.add(userId);
}
member = new ProMember();
@ -476,23 +473,24 @@ public class ExcelService implements IExcelService {
proMemberService.saveMember(member);
proMembers.add(member);
// //创建者依据project的creatorId判断,不需要添加成员
}else {
throw new BaseException(CodeEnum.WBS_REPEAT_MEMBER_PHONE.addMsg(memberSheet.getSheetName()+i));
} else {
throw new BaseException(CodeEnum.WBS_REPEAT_MEMBER_PHONE.addMsg(memberSheet.getSheetName() + i));
}
}
}
//TODO 每个成员都关注此项目(暂时)
addUserAttention(userIdSet,sysProject);
addUserAttention(userIdSet, sysProject);
} else {
throw new BaseException(CodeEnum.WBS_NOT_MEMBER_SHEET);
}
}
/**
* 项目成员表内的每个人都关注此项目暂时当前版本
*/
private void addUserAttention(Set<Long> userIdList,SysProject sysProject){
if(CollectionUtil.isNotEmpty(userIdList)){
for(Long userId:userIdList){
private void addUserAttention(Set<Long> userIdList, SysProject sysProject) {
if (CollectionUtil.isNotEmpty(userIdList)) {
for (Long userId : userIdList) {
UserAttention userAttention = new UserAttention();
userAttention.setId(snowflake.nextId());
userAttention.setUserId(userId);
@ -501,19 +499,20 @@ public class ExcelService implements IExcelService {
}
}
}
/**
* 判断奖惩干系人与手机号对应是否正确
* 奖惩干系人可以重复一个人只能对应一个手机号
*/
private boolean stakeholderWithPhone(List<ProMember> stakeholderList, String stakeholderName, String phone){
if(CollectionUtil.isNotEmpty(stakeholderList)){
for(ProMember proMember:stakeholderList){
if(stakeholderName.equalsIgnoreCase(proMember.getNickname())){
if(!proMember.getPhone().equalsIgnoreCase(phone)){
private boolean stakeholderWithPhone(List<ProMember> stakeholderList, String stakeholderName, String phone) {
if (CollectionUtil.isNotEmpty(stakeholderList)) {
for (ProMember proMember : stakeholderList) {
if (stakeholderName.equalsIgnoreCase(proMember.getNickname())) {
if (!proMember.getPhone().equalsIgnoreCase(phone)) {
return true;
}
}else {
if(proMember.getPhone().equalsIgnoreCase(phone)){
} else {
if (proMember.getPhone().equalsIgnoreCase(phone)) {
return true;
}
}
@ -521,16 +520,17 @@ public class ExcelService implements IExcelService {
}
return false;
}
/**
*判断成员和手机号是否重复
* 判断成员和手机号是否重复
*/
private boolean memberAndPhoneRepeat(List<ProMember> proMembers, String memberName, String phone){
if(CollectionUtil.isNotEmpty(proMembers)){
for(ProMember proMember:proMembers){
if(proMember.getNickname().equalsIgnoreCase(memberName)){
private boolean memberAndPhoneRepeat(List<ProMember> proMembers, String memberName, String phone) {
if (CollectionUtil.isNotEmpty(proMembers)) {
for (ProMember proMember : proMembers) {
if (proMember.getNickname().equalsIgnoreCase(memberName)) {
return true;
}
if(proMember.getPhone().equalsIgnoreCase(phone)){
if (proMember.getPhone().equalsIgnoreCase(phone)) {
return true;
}
}
@ -543,7 +543,7 @@ public class ExcelService implements IExcelService {
*/
private void readTask(XSSFWorkbook xssfWorkbook, XSSFSheet wbsSheet, int taskStart, int taskEnd,
Long currentUserId, SysProject sysProject, List<ProTaskDetail> taskDetails,
List<ProRole> proRoles, List<ProMember> proMembers) throws Exception {
List<ProRole> proRoles, List<ProMember> proMembers, Map<String, List<ProTaskDetail>> hasGroupMap) throws Exception {
Long pmRoleId = null;
//获取项目经理的id(一级角色)
for (ProRole role : proRoles) {
@ -659,8 +659,8 @@ public class ExcelService implements IExcelService {
break;
}
}
if(ObjectUtil.isNull(executorRoleId)){
throw new BaseException(CodeEnum.WBS_NOT_FIND_EXECUTOR_ROLE.addMsg(wbsSheet.getSheetName()+i));
if (ObjectUtil.isNull(executorRoleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_EXECUTOR_ROLE.addMsg(wbsSheet.getSheetName() + i));
}
}
//检查人
@ -673,8 +673,8 @@ public class ExcelService implements IExcelService {
break;
}
}
if(ObjectUtil.isNull(checkerRoleId)){
throw new BaseException(CodeEnum.WBS_NOT_FIND_CHECKER_ROLE.addMsg(wbsSheet.getSheetName()+i));
if (ObjectUtil.isNull(checkerRoleId)) {
throw new BaseException(CodeEnum.WBS_NOT_FIND_CHECKER_ROLE.addMsg(wbsSheet.getSheetName() + i));
}
}
//奖惩金额
@ -688,8 +688,8 @@ public class ExcelService implements IExcelService {
taskDetail.setDelay((byte) WebConstant.TASK_DELAY.DelayManual.value);
} else if (delay.equals(WebConstant.TASK_DELAY.Manual.phase)) {
taskDetail.setDelay((byte) WebConstant.TASK_DELAY.Manual.value);
}else {
throw new BaseException(CodeEnum.WBS_DELAY_ERROR.addMsg(wbsSheet.getSheetName()+i));
} else {
throw new BaseException(CodeEnum.WBS_DELAY_ERROR.addMsg(wbsSheet.getSheetName() + i));
}
//延迟时间
if (StrUtil.isNotEmpty(delayTime)) {
@ -730,34 +730,37 @@ public class ExcelService implements IExcelService {
//子任务
if (StrUtil.isNotEmpty(subTaskCell)) {
taskDetail.setHasGroup((byte) 1);
switch (subTaskCell){
switch (subTaskCell) {
case "值日表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "运动计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "前端学习计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "后台学习计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "硬件学习计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "方圆学习计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "全体学习计划表":
getSubTask(xssfWorkbook, subTaskCell, taskDetail,taskDetails,proMembers,deliver);
getSubTask(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
case "年终总结":
getSubTaskMt(xssfWorkbook, subTaskCell, taskDetail, taskDetails, proMembers, deliver, hasGroupMap);
break;
default:
throw new BaseException(CodeEnum.WBS_SUB_TASK_ANALYSIS.addMsg(wbsSheet.getSheetName()+i));
throw new BaseException(CodeEnum.WBS_SUB_TASK_ANALYSIS.addMsg(wbsSheet.getSheetName() + i));
}
}else{
} else {
//不是分组任务,直接添加交付物
readDeliverSheet(deliver,xssfWorkbook,taskDetail.getId());
readDeliverSheet(deliver, xssfWorkbook, taskDetail.getId());
}
//添加任务
proTaskDetailService.saveTaskDetail(taskDetail);
@ -776,11 +779,84 @@ public class ExcelService implements IExcelService {
taskDetails.add(endTask);
}
/**
* 读取年终总结子表
*/
public void getSubTaskMt(XSSFWorkbook xssfWorkbook, String sheetName, ProTaskDetail parentTaskDetail,
List<ProTaskDetail> taskDetails, List<ProMember> proMembers, String deliverCell, Map<String, List<ProTaskDetail>> hasGroupMap) {
List<ProTaskDetail> taskNameList = new ArrayList<>();
XSSFSheet subTaskSheet = xssfWorkbook.getSheet(sheetName);
if (ObjectUtil.isNotNull(subTaskSheet)) {
for (int a = 2; a < subTaskSheet.getLastRowNum(); a++) {
String nameCell = ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(1));
String beginCell = ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(2));
String endCell = ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(3));
//重复时间、相对时间
String repeatCell = ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(4));
String memberCell = StringUtil.replaceComma(ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(6)));
//备注
String descriptionCell = ExcelUtil.getCellValue(subTaskSheet.getRow(a).getCell(8));
if (StrUtil.isNotEmpty(nameCell)) {
ProTaskDetail subTask = new ProTaskDetail();
BeanUtil.copyProperties(parentTaskDetail, subTask);
subTask.setId(snowflake.nextId());
subTask.setName(nameCell);
subTask.setDescription(descriptionCell);
if (StrUtil.isNotEmpty(beginCell)) {
subTask.setBeginTime(Long.valueOf(beginCell));
}
if (StrUtil.isNotEmpty(endCell)) {
subTask.setEndTime(Long.valueOf(endCell));
}
subTask.setLevel((byte) 2);
subTask.setHasGroup((byte) 0);
if (StrUtil.isNotEmpty(memberCell)) {
if (memberCell.equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)) {
subTask.setAllMember((byte) 1);
} else {
subTask.setAllMember((byte) 0);
if (CollectionUtil.isNotEmpty(proMembers)) {
Long proMemberId = null;
for (ProMember proMember : proMembers) {
if (memberCell.equalsIgnoreCase(proMember.getNickname())) {
proMemberId = proMember.getId();
ProTaskMember proTaskMember = new ProTaskMember();
proTaskMember.setId(snowflake.nextId());
proTaskMember.setMemberId(proMemberId);
proTaskMember.setTaskDetailId(subTask.getId());
taskMemberService.saveTaskMember(proTaskMember);
break;
}
}
if (ObjectUtil.isNull(proMemberId)) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName() + a));
}
}
}
} else {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName() + a));
}
//给每个子任务添加交付物
readDeliverSheet(deliverCell, xssfWorkbook, subTask.getId());
proTaskDetailService.saveTaskDetail(subTask);
taskDetails.add(subTask);
taskNameList.add(subTask);
}
}
hasGroupMap.put(parentTaskDetail.getName(), taskNameList);
} else {
throw new BaseException(CodeEnum.WBS_NOT_SUB_TASK);
}
}
/**
* 读取子任务表
*/
public void getSubTask(XSSFWorkbook xssfWorkbook, String sheetName, ProTaskDetail parentTaskDetail,
List<ProTaskDetail> taskDetails, List<ProMember> proMembers,String deliverCell) {
List<ProTaskDetail> taskDetails, List<ProMember> proMembers, String deliverCell, Map<String, List<ProTaskDetail>> hasGroupMap) {
XSSFSheet subTaskSheet = xssfWorkbook.getSheet(sheetName);
Long startTime = parentTaskDetail.getBeginTime();
if (ObjectUtil.isNotNull(subTaskSheet)) {
@ -826,13 +902,13 @@ public class ExcelService implements IExcelService {
break;
}
}
if(ObjectUtil.isNull(proMemberId)){
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName()+a));
if (ObjectUtil.isNull(proMemberId)) {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName() + a));
}
}
}
}else {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName()+a));
} else {
throw new BaseException(CodeEnum.WSB_NOT_MEMBER.addMsg(subTaskSheet.getSheetName() + a));
}
}
}
@ -859,7 +935,7 @@ public class ExcelService implements IExcelService {
}
startTime = subTask.getEndTime();
//给每个子任务添加交付物
readDeliverSheet(deliverCell,xssfWorkbook,subTask.getId());
readDeliverSheet(deliverCell, xssfWorkbook, subTask.getId());
proTaskDetailService.saveTaskDetail(subTask);
taskDetails.add(subTask);
@ -868,11 +944,12 @@ public class ExcelService implements IExcelService {
} else {
throw new BaseException(CodeEnum.WBS_NOT_SUB_TASK);
}
parentTaskDetail.setEndTime(startTime);
parentTaskDetail.setRecStatus((byte) 2);
}
/**
* 分解任务时间
*
* @param taskDetails
* @throws Exception
*/
@ -915,7 +992,7 @@ public class ExcelService implements IExcelService {
/**
* 读取交付物表
*/
private void readDeliverSheet(String deliverCell,XSSFWorkbook xssfWorkbook, Long taskId) {
private void readDeliverSheet(String deliverCell, XSSFWorkbook xssfWorkbook, Long taskId) {
if (StrUtil.isNotEmpty(deliverCell)) {
String str = "";
if (deliverCell.length() > 4) {
@ -953,15 +1030,16 @@ public class ExcelService implements IExcelService {
/**
* 读取插件
*
* @param xssfWorkbook
* @param taskDetails
* @param proRoles
*/
private void readPlugin(XSSFWorkbook xssfWorkbook, List<ProTaskDetail> taskDetails, List<ProRole> proRoles) {
private void readPlugin(XSSFWorkbook xssfWorkbook, List<ProTaskDetail> taskDetails, List<ProRole> proRoles, Map<String, List<ProTaskDetail>> hasGroupMap) {
SysPluginExample pluginExample = new SysPluginExample();
pluginExample.clear();
List<SysPlugin> sysPluginList = sysPluginDao.selectByExample(pluginExample);
if(CollectionUtil.isNotEmpty(sysPluginList)) {
if (CollectionUtil.isNotEmpty(sysPluginList)) {
XSSFSheet sheet = xssfWorkbook.getSheet("插件");
if (ObjectUtil.isNotNull(sheet)) {
Long taskId = null;
@ -969,50 +1047,69 @@ public class ExcelService implements IExcelService {
XSSFRow roleRow = sheet.getRow(2);
for (int i = 3; i < sheet.getLastRowNum(); i++) {
List<ProTaskDetail> taskNameList = null;
XSSFRow pluginRow = sheet.getRow(i);
String task = ExcelUtil.getCellValue(pluginRow.getCell(1));
//获取任务Id
if (StrUtil.isNotEmpty(task)) {
for (ProTaskDetail proTask : taskDetails) {
if (task.equals(proTask.getName())) {
taskId = proTask.getId();
break;
if (proTask.getHasGroup() == 1) {
taskNameList = hasGroupMap.get(proTask.getName());
break;
} else {
taskId = proTask.getId();
break;
}
}
}
}
for (int a = 2; a < roleRow.getLastCellNum(); a++) {
//获取memberRoleId
String roleCell = ExcelUtil.getCellValue(roleRow.getCell(a));
if (StrUtil.isNotEmpty(roleCell) && CollectionUtil.isNotEmpty(proRoles)) {
for (ProRole role : proRoles) {
if (roleCell.equals(role.getName())) {
memberRoleId = role.getId();
break;
}
}
}
String plugin = ExcelUtil.getCellValue(pluginRow.getCell(a));
if (StrUtil.isNotEmpty(plugin)) {
//获取memberRoleId
String roleCell = ExcelUtil.getCellValue(roleRow.getCell(a));
if (StrUtil.isNotEmpty(roleCell) && CollectionUtil.isNotEmpty(proRoles)) {
for (ProRole role : proRoles) {
if (roleCell.equals(role.getName())) {
memberRoleId = role.getId();
break;
}
}
}
Long sysPluginId = null;
for(SysPlugin sysPlugin:sysPluginList){
if(plugin.equalsIgnoreCase(sysPlugin.getName())){
for (SysPlugin sysPlugin : sysPluginList) {
if (plugin.equalsIgnoreCase(sysPlugin.getName())) {
sysPluginId = sysPlugin.getId();
break;
}
}
if(ObjectUtil.isNull(sysPluginId)){
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN.addMsg(sheet.getSheetName()+i));
if (ObjectUtil.isNull(sysPluginId)) {
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN.addMsg(sheet.getSheetName() + i));
}
if (CollectionUtil.isNotEmpty(taskNameList)) {
for (ProTaskDetail taskName : taskNameList) {
ProTaskPlugin taskPlugin = new ProTaskPlugin();
taskPlugin.setId(snowflake.nextId());
taskPlugin.setTaskDetailId(taskName.getId());
taskPlugin.setPluginId(sysPluginId);
taskPlugin.setMemberRoleId(memberRoleId);
taskPluginService.savePlugin(taskPlugin);
}
} else {
ProTaskPlugin taskPlugin = new ProTaskPlugin();
taskPlugin.setId(snowflake.nextId());
taskPlugin.setTaskDetailId(taskId);
taskPlugin.setPluginId(sysPluginId);
taskPlugin.setMemberRoleId(memberRoleId);
taskPluginService.savePlugin(taskPlugin);
}
ProTaskPlugin taskPlugin = new ProTaskPlugin();
taskPlugin.setId(snowflake.nextId());
taskPlugin.setTaskDetailId(taskId);
taskPlugin.setPluginId(sysPluginId);
taskPlugin.setMemberRoleId(memberRoleId);
taskPluginService.savePlugin(taskPlugin);
}
}
}
}else{
} else {
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN_SHEET);
}
}
@ -1020,6 +1117,7 @@ public class ExcelService implements IExcelService {
/**
* 返回信息
*
* @param currentUserId
* @param sysProject
* @return

8
tall/src/main/java/com/ccsens/tall/service/IExcelMtService.java

@ -1,8 +0,0 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.vo.ProjectVo;
public interface IExcelMtService {
ProjectVo.ProjectInfo readXls(String path, Long currentUserId) throws Exception;
}

1
tall/src/main/java/com/ccsens/tall/service/IProMemberService.java

@ -24,4 +24,5 @@ public interface IProMemberService {
List<ProMember> selectByRole(Long roleId)throws Exception;
MemberVo.MemberInfo getMemberByUserIdAndProjectId(Long userId, Long projectId);
}

2
tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java

@ -29,4 +29,6 @@ public interface IProTaskDetailService {
void deleteTaskByRoleId(Long taskId) throws Exception;
TaskVo.NormalTask updateTaskInfo(Long currentUserId, TaskDto.UpdateTaskInfo updateTaskInfo) throws Exception;
TaskVo.TaskInfoWithFeign getProjectIdByTaskId(Long taskId);
}

14
tall/src/main/java/com/ccsens/tall/service/ProMemberService.java

@ -1,5 +1,6 @@
package com.ccsens.tall.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.po.*;
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Member;
import java.util.ArrayList;
import java.util.List;
@ -194,4 +196,16 @@ public class ProMemberService implements IProMemberService {
return memberList;
}
@Override
public MemberVo.MemberInfo getMemberByUserIdAndProjectId(Long userId, Long projectId) {
MemberVo.MemberInfo memberInfo = null;
ProMemberExample memberExample = new ProMemberExample();
memberExample.createCriteria().andProjectIdEqualTo(projectId).andUserIdEqualTo(userId);
List<ProMember> proMemberList = proMemberDao.selectByExample(memberExample);
if(CollectionUtil.isNotEmpty(proMemberList)){
memberInfo = new MemberVo.MemberInfo();
BeanUtil.copyProperties(proMemberList.get(0),memberInfo);
}
return memberInfo;
}
}

59
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -93,7 +93,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
if (role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.MVP.value)) {
obj = getTaskInfoByMvp(projectId, page, pageSize);
} else if (parentRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.PM.value)) {
obj = getTaskInfoByProjectIdAndPM(currentUserId, projectId, startTime, endTime, process, page, pageSize);
obj = getTaskInfoByProjectIdAndPM(currentUserId, projectId, roleId, startTime, endTime, process, page, pageSize);
} else if (parentRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.Member.value)) {
obj = getTaskInfoByProjectIdAndRoleId(currentUserId, projectId, roleId, startTime, endTime, process, page, pageSize);
}
@ -106,7 +106,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
/**
* 查看任务 项目经理
*/
private TaskVo.ProTaskInfo getTaskInfoByProjectIdAndPM(Long currentUserId, Long projectId, Long startTime, Long endTime, Integer process, Integer page, Integer pageSize) throws Exception {
private TaskVo.ProTaskInfo getTaskInfoByProjectIdAndPM(Long currentUserId, Long projectId,Long roleId, Long startTime, Long endTime, Integer process, Integer page, Integer pageSize) throws Exception {
ProShow proShow = proShowService.selectByProjectId(projectId);
TaskVo.ProTaskInfo proTaskInfo = new TaskVo.ProTaskInfo();
@ -131,9 +131,12 @@ public class ProTaskDetailService implements IProTaskDetailService {
normalTask.setId(null);
normalTask.setSequence(sequence);
//查找一级任务下的二级任务
List<TaskVo.NormalTask> secondNormalTaskList = taskDetailDao.selectNormalTaskListByPM(projectId, firstTaskDetail.getId(), startTime, endTime);
List<TaskVo.NormalTask> secondNormalTaskList = taskDetailDao.selectNormalTaskListByPM(projectId, firstTaskDetail.getId(), startTime, endTime,roleId);
if (CollectionUtil.isNotEmpty(secondNormalTaskList)) {
for (TaskVo.NormalTask task : secondNormalTaskList) {
//处理插件
managePlugin(currentUserId,roleId,task);
ProSubTimeMember subTimeMember = getProcessByUserIdAndTask(currentUserId, task.getId());
if (ObjectUtil.isNotNull(subTimeMember)) {
task.setRealEndTime(subTimeMember.getRealFinishTime());
@ -197,8 +200,11 @@ public class ProTaskDetailService implements IProTaskDetailService {
List<TaskVo.NormalTask> secondTaskVoList = taskDetailDao.selectTaskByRoleAndAllMembers(projectId, roleId, startTime, endTime);
List<TaskVo.NormalTask> secondTaskVoList2 = taskDetailDao.selectTaskByRoleAndAllMembers(projectId, allMemberId, startTime, endTime);
secondTaskVoList.addAll(secondTaskVoList2);
if (CollectionUtil.isNotEmpty(secondTaskVoList)) {
for (TaskVo.NormalTask normalTask : secondTaskVoList) {
//处理插件
managePlugin(currentUserId,roleId,normalTask);
ProSubTimeMember subTimeMember = getProcessByUserIdAndTask(currentUserId, normalTask.getId());
if (ObjectUtil.isNotNull(subTimeMember)) {
normalTask.setProcess(subTimeMember.getComplatedStatus());
@ -351,6 +357,34 @@ public class ProTaskDetailService implements IProTaskDetailService {
return normalTaskList;
}
/**
* 处理任务的插件
*/
private void managePlugin(Long userId,Long roleId,TaskVo.NormalTask normalTask) throws Exception {
Boolean isMain = proMemberService.userIsBelongRole(userId,roleId);
if(!isMain){
normalTask.setPlugins(null);
}else {
if(CollectionUtil.isNotEmpty(normalTask.getPlugins())){
List<TaskVo.PluginVo> pluginVoList = new ArrayList<>();
for(TaskVo.PluginVo pluginVo : normalTask.getPlugins()){
String[] pluginIds = pluginVo.getId().split(",");
String[] pluginNames = pluginVo.getName().split(",");
TaskVo.PluginVo plugin = null;
for(int i = 0;i<pluginIds.length;i++){
plugin = new TaskVo.PluginVo();
plugin.setId(pluginIds[i]);
plugin.setName(pluginNames[i]);
pluginVoList.add(plugin);
}
}
normalTask.setPlugins(pluginVoList);
}
}
}
/**
* 点击MVP查看交付物
*/
@ -1146,4 +1180,23 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
}
}
@Override
public TaskVo.TaskInfoWithFeign getProjectIdByTaskId(Long taskId) {
TaskVo.TaskInfoWithFeign taskInfo = null;
ProTaskDetail detail = taskDetailDao.selectByPrimaryKey(taskId);
if(ObjectUtil.isNotNull(detail)){
taskInfo = new TaskVo.TaskInfoWithFeign();
taskInfo.setId(detail.getId());
taskInfo.setName(detail.getName());
taskInfo.setProjectId(detail.getProjectId());
SysProject project = sysProjectDao.selectByPrimaryKey(detail.getProjectId());
if(ObjectUtil.isNull(project)){
taskInfo.setProjectName(project.getName());
}
}
return taskInfo;
}
}

3
tall/src/main/java/com/ccsens/tall/web/MemberRoleController.java

@ -85,4 +85,7 @@ public class MemberRoleController {
proRoleService.deleteRole(currentUserId,roleId);
return JsonResponse.newInstance().ok();
}
}

14
tall/src/main/java/com/ccsens/tall/web/TaskController.java

@ -146,4 +146,18 @@ public class TaskController {
return JsonResponse.newInstance().ok(taskInfo);
}
/**
* 通过任务id查询项目id
* @param request
* @param taskId
* @return
* @throws Exception
*/
@RequestMapping(value = "projectId", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public TaskVo.TaskInfoWithFeign getProjectIdByTaskId(HttpServletRequest request, @RequestParam(required = false)Long taskId) throws Exception {
TaskVo.TaskInfoWithFeign taskInfo= taskDetailService.getProjectIdByTaskId(taskId);
return taskInfo;
}
}

17
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -6,11 +6,14 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.tall.bean.po.SysUser;
import com.ccsens.tall.bean.vo.MemberVo;
import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.tall.exception.UserLoginException;
import com.ccsens.tall.service.IProMemberService;
import com.ccsens.tall.service.IUserService;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import feign.Param;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.SignatureException;
@ -31,6 +34,9 @@ public class UserController {
@Autowired
private IUserService userService;
@Autowired
private IProMemberService proMemberService;
@ApiOperation(value = "/用户登录", notes = "")
@ApiImplicitParams({
@ -255,6 +261,17 @@ public class UserController {
return JsonResponse.newInstance().ok(tokenToUserId);
}
/**
* 查询user在项目中的member信息
*/
@RequestMapping(value = "member", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<MemberVo.MemberInfo> getMemberByUserIdAndProjectId( Long userId,Long projectId) throws Exception {
MemberVo.MemberInfo memberInfo = proMemberService.getMemberByUserIdAndProjectId(userId,projectId);
return JsonResponse.newInstance().ok(memberInfo);
}
}

38
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -61,11 +61,17 @@
d.virtual as tVirtual,
d.delay as tDelay,
d.has_group as tHasGroup,
p.id as pId,
sp.name as pName
GROUP_CONCAT(p.id) as pId,
GROUP_CONCAT(sp.name) as pName
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
AND
(
p.member_role_id = #{roleId}
OR
p.id IS NULL
)
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
@ -81,8 +87,11 @@
AND
s.end_time &gt;= #{startTime}
</if>
AND
Level = 2
d.Level in (2,3)
AND
d.has_group = 0
group by s.task_detail_id
</select>
@ -105,11 +114,17 @@
d.virtual as tVirtual,
d.delay as tDelay,
d.has_group as tHasGroup,
p.id as pId,
sp.name as pName
GROUP_CONCAT(p.id) as pId,
GROUP_CONCAT(sp.name) as pName
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
AND
(
p.member_role_id = #{roleId}
OR
p.id IS NULL
)
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
@ -121,8 +136,11 @@
s.begin_time &lt; #{endTime}
AND
s.end_time &gt;= #{startTime}
AND
d.Level in (2,3)
AND
level = 2
d.has_group = 0
group by s.task_detail_id
</select>
@ -173,8 +191,8 @@
d.virtual as tVirtual,
d.delay as tDelay,
d.has_group as tHasGroup,
p.id as pId,
sp.name as pName
GROUP_CONCAT(p.id) as pId,
GROUP_CONCAT(sp.name) as pName
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -239,8 +257,8 @@
d.virtual as tVirtual,
d.delay as tDelay,
d.has_group as tHasGroup,
p.id as pId,
sp.name as pName
GROUP_CONCAT(p.id) as pId,
GROUP_CONCAT(sp.name) as pName
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id

5
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -70,6 +70,11 @@ public enum CodeEnum {
DOCTOR_NOT_SUBMIT(55,"尚未进行资格认证",true),
REPORT_NOT_FOUND(56,"对不起,没有找到您查询的报告单,请确认报告单是否存在。",true),
PATIENT_NOT_CHOICE(57,"没有选择病人,不进行保存答案。", true),
NOT_GAME_TYPE(58,"对不起,未找到对应的游戏",true),
SIGNIN_REPEAT(59,"请勿重复签到",true),
SCORE_REPEAT(60,"您已经评分,请勿重复提交",true),
NOT_MEMBER(61,"对不起,找不到对应的成员信息",true)
;
public CodeEnum addMsg(String msg){

11
util/src/main/java/com/ccsens/util/WebConstant.java

@ -69,10 +69,11 @@ public class WebConstant {
public static final String UPLOAD_PATH_BASE = "/home/cloud/tall/uploads";
public static final String UPLOAD_PATH_DELIVER = UPLOAD_PATH_BASE + File.separator + "delivers";
public static final String UPLOAD_PATH_DELIVER1 ="delivers";
public static final String UPLOAD_PATH_PREVIEW ="preview";
public static final String UPLOAD_PROJECT_WBS = UPLOAD_PATH_BASE + File.separator + "project";
public static final String URL_BASE = "https://api.ccsens.com/ptpro/uploads/";
public static final String TEST_URL_BASE = "https://test.tall.wiki/gateway/tall/v1.0/uploads/";
public static final String TEST_URL = "https://test.tall.wiki/";
public static final String TEST_URL_GAME = TEST_URL + "game/";
public static final String TEST_URL_BASE = TEST_URL + "gateway/tall/v1.0/uploads/";
public static final Integer Expired_Verify_Code_In_Seconds = 120;
public static final Integer Exist_Verify_Code_In_Seconds = 60;
@ -452,7 +453,7 @@ public class WebConstant {
public enum Message_Sync_Event{
ChangeDuration(0,"ChangeDuration"),Move(1,"Move"),
Remove(2,"Remove"),Add(3,"Add"),Start(4,"Start"),ChangeBeginTime(5,"ChangeBeginTime");
Remove(2,"Remove"),Add(3,"Add"),Start(4,"Start"),ChangeBeginTime(5,"ChangeBeginTime"),Show(6,"Show");
public int value;
public String phase;
Message_Sync_Event(int value,String thePhase){
@ -467,6 +468,7 @@ public class WebConstant {
case 3: return Add;
case 4: return Start;
case 5: return ChangeBeginTime;
case 6: return Show;
default: return null;
}
}
@ -488,6 +490,9 @@ public class WebConstant {
}
if(phase.equalsIgnoreCase("ChangeBeginTime")) {
return ChangeBeginTime;
}
if(phase.equalsIgnoreCase("Show")) {
return Show;
} else {
return null;
}

7
util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java

@ -8,6 +8,8 @@ import org.springframework.context.annotation.Configuration;
public class RabbitMQConfig {
public static final String TALL_MESSAGE_1 = "tall_message_1";
public static final String TALL_MESSAGE_2 = "tall_message_2";
public static final String RabbitMQ_QUEUE_NAME = "Queue_Anyring";
@Bean
public Queue queue(){
return new Queue(TALL_MESSAGE_1);
@ -16,6 +18,9 @@ public class RabbitMQConfig {
public Queue queue1(){
return new Queue(TALL_MESSAGE_2);
}
@Bean
public Queue queue2(){
return new Queue(RabbitMQ_QUEUE_NAME);
}
}

Loading…
Cancel
Save