From b5503616787c75864261d0f8c1c21d6ca12493ec Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Mon, 16 Nov 2020 10:01:37 +0800 Subject: [PATCH 1/3] 11-16-1 --- .../java/com/ccsens/mt/api/CompeteScoreController.java | 8 ++++---- mt/src/main/resources/application.yml | 4 ++-- mt/src/main/resources/mapper_dao/CompeteScoreDao.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java index f5715c4b..983dd98f 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java @@ -41,7 +41,7 @@ public class CompeteScoreController { } @MustLogin - @ApiOperation(value = "项目状态", notes = "") + @ApiOperation(value = "项目状态", notes = "lihong,查询项目集合,再根据时间判断项目得状态") @RequestMapping(value = "/countScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse countScore(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询比赛项目上的参赛选手列表:{}",params); @@ -50,7 +50,7 @@ public class CompeteScoreController { } @MustLogin - @ApiOperation(value = "选手排名", notes = "") + @ApiOperation(value = "选手排名", notes = "多个信息表关联之后,利用分数排序") @RequestMapping(value = "/countScoreDetail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse countScoreDetail(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询比赛项目上的参赛选手列表:{}",params); @@ -60,7 +60,7 @@ public class CompeteScoreController { @MustLogin - @ApiOperation(value = "计数赛查看当前场次的分数信息", notes = "") + @ApiOperation(value = "计数赛查看当前场次的分数信息", notes = "多表关联之后,查询当前你场次得分数信息") @RequestMapping(value = "/countScoreCurrentSite", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse countScoreCurrentSite(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询比赛项目上的参赛选手列表:{}",params); @@ -69,7 +69,7 @@ public class CompeteScoreController { } @MustLogin - @ApiOperation(value = "技术赛提交分数", notes = "") + @ApiOperation(value = "技术赛提交分数", notes = "接受前端得请求参数,插入相关得表中") @RequestMapping(value = "/submitScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse submitScore(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询比赛项目上的参赛选手列表:{}",params); diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml index f59084b0..4ecd13fd 100644 --- a/mt/src/main/resources/application.yml +++ b/mt/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: common, util-test + active: dev + include: common, util-dev diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index a03505c0..1a789b7b 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -42,7 +42,6 @@ tcp.`name` as name, tcc.`name` as companyName, tcvs.score as score - from t_compete_project_player tcpp LEFT JOIN t_compete_player tcp ON tcpp.player_id = tcp.id LEFT JOIN t_compete_start_order tcso on tcso.player_id = tcpp.player_id @@ -57,6 +56,7 @@ and tcpp.compete_group_id = #{competeGroupId} GROUP BY tcvs.score + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml b/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml index bf9b3dc5..6f586d68 100644 --- a/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml +++ b/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml @@ -3,14 +3,14 @@ + - - + @@ -76,8 +76,8 @@ - id, compete_time_id, project_id, site_order_id, chief_judgment_score, judgment_a_score, - judgment_b_score2, should_times, deduct_times, deduct_cause, final_score, created_at, + id, should_times, compete_time_id, project_id, site_order_id, chief_judgment_score, + judgment_a_score, judgment_b_score2, deduct_times, deduct_cause, final_score, created_at, updated_at, rec_status - select from t_compete_count_score where id = #{id,jdbcType=BIGINT} + and should_times = #{shouldTimes,jdbcType=INTEGER} - + delete from t_compete_count_score where id = #{id,jdbcType=BIGINT} + and should_times = #{shouldTimes,jdbcType=INTEGER} delete from t_compete_count_score @@ -111,14 +113,14 @@ - insert into t_compete_count_score (id, compete_time_id, project_id, - site_order_id, chief_judgment_score, judgment_a_score, - judgment_b_score2, should_times, deduct_times, + insert into t_compete_count_score (id, should_times, compete_time_id, + project_id, site_order_id, chief_judgment_score, + judgment_a_score, judgment_b_score2, deduct_times, deduct_cause, final_score, created_at, updated_at, rec_status) - values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, - #{siteOrderId,jdbcType=BIGINT}, #{chiefJudgmentScore,jdbcType=DECIMAL}, #{judgmentAScore,jdbcType=DECIMAL}, - #{judgmentBScore2,jdbcType=DECIMAL}, #{shouldTimes,jdbcType=DECIMAL}, #{deductTimes,jdbcType=DECIMAL}, + values (#{id,jdbcType=BIGINT}, #{shouldTimes,jdbcType=INTEGER}, #{competeTimeId,jdbcType=BIGINT}, + #{projectId,jdbcType=BIGINT}, #{siteOrderId,jdbcType=BIGINT}, #{chiefJudgmentScore,jdbcType=DECIMAL}, + #{judgmentAScore,jdbcType=DECIMAL}, #{judgmentBScore2,jdbcType=DECIMAL}, #{deductTimes,jdbcType=INTEGER}, #{deductCause,jdbcType=VARCHAR}, #{finalScore,jdbcType=DECIMAL}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) @@ -128,6 +130,9 @@ id, + + should_times, + compete_time_id, @@ -146,9 +151,6 @@ judgment_b_score2, - - should_times, - deduct_times, @@ -172,6 +174,9 @@ #{id,jdbcType=BIGINT}, + + #{shouldTimes,jdbcType=INTEGER}, + #{competeTimeId,jdbcType=BIGINT}, @@ -190,11 +195,8 @@ #{judgmentBScore2,jdbcType=DECIMAL}, - - #{shouldTimes,jdbcType=DECIMAL}, - - #{deductTimes,jdbcType=DECIMAL}, + #{deductTimes,jdbcType=INTEGER}, #{deductCause,jdbcType=VARCHAR}, @@ -225,6 +227,9 @@ id = #{record.id,jdbcType=BIGINT}, + + should_times = #{record.shouldTimes,jdbcType=INTEGER}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, @@ -243,11 +248,8 @@ judgment_b_score2 = #{record.judgmentBScore2,jdbcType=DECIMAL}, - - should_times = #{record.shouldTimes,jdbcType=DECIMAL}, - - deduct_times = #{record.deductTimes,jdbcType=DECIMAL}, + deduct_times = #{record.deductTimes,jdbcType=INTEGER}, deduct_cause = #{record.deductCause,jdbcType=VARCHAR}, @@ -272,14 +274,14 @@ update t_compete_count_score set id = #{record.id,jdbcType=BIGINT}, + should_times = #{record.shouldTimes,jdbcType=INTEGER}, compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, project_id = #{record.projectId,jdbcType=BIGINT}, site_order_id = #{record.siteOrderId,jdbcType=BIGINT}, chief_judgment_score = #{record.chiefJudgmentScore,jdbcType=DECIMAL}, judgment_a_score = #{record.judgmentAScore,jdbcType=DECIMAL}, judgment_b_score2 = #{record.judgmentBScore2,jdbcType=DECIMAL}, - should_times = #{record.shouldTimes,jdbcType=DECIMAL}, - deduct_times = #{record.deductTimes,jdbcType=DECIMAL}, + deduct_times = #{record.deductTimes,jdbcType=INTEGER}, deduct_cause = #{record.deductCause,jdbcType=VARCHAR}, final_score = #{record.finalScore,jdbcType=DECIMAL}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, @@ -310,11 +312,8 @@ judgment_b_score2 = #{judgmentBScore2,jdbcType=DECIMAL}, - - should_times = #{shouldTimes,jdbcType=DECIMAL}, - - deduct_times = #{deductTimes,jdbcType=DECIMAL}, + deduct_times = #{deductTimes,jdbcType=INTEGER}, deduct_cause = #{deductCause,jdbcType=VARCHAR}, @@ -333,6 +332,7 @@ where id = #{id,jdbcType=BIGINT} + and should_times = #{shouldTimes,jdbcType=INTEGER} update t_compete_count_score @@ -342,13 +342,13 @@ chief_judgment_score = #{chiefJudgmentScore,jdbcType=DECIMAL}, judgment_a_score = #{judgmentAScore,jdbcType=DECIMAL}, judgment_b_score2 = #{judgmentBScore2,jdbcType=DECIMAL}, - should_times = #{shouldTimes,jdbcType=DECIMAL}, - deduct_times = #{deductTimes,jdbcType=DECIMAL}, + deduct_times = #{deductTimes,jdbcType=INTEGER}, deduct_cause = #{deductCause,jdbcType=VARCHAR}, final_score = #{finalScore,jdbcType=DECIMAL}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, rec_status = #{recStatus,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} + and should_times = #{shouldTimes,jdbcType=INTEGER} \ No newline at end of file diff --git a/util/src/test/java/com/ccsens/util/ListSort.java b/util/src/test/java/com/ccsens/util/ListSort.java new file mode 100644 index 00000000..fc18c4fc --- /dev/null +++ b/util/src/test/java/com/ccsens/util/ListSort.java @@ -0,0 +1,33 @@ +package com.ccsens.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class ListSort { + public static void main(String[] args) { + List list = new ArrayList<>(); + list.add(new StuVO("AAA",90)); + list.add(new StuVO("BBB",150)); + list.add(new StuVO("CCC",12)); + list.add(new StuVO("DDD",64)); + list.add(new StuVO("EEE",5)); + for(int i = 0;i < list.size();i++){ + System.out.println(list.get(i).getName()+" "+list.get(i).getScore()); + } + System.out.println("--------"); + + Collections.sort(list, new Comparator() { + @Override + public int compare(StuVO o1, StuVO o2) { + int i = o1.getScore() - o2.getScore(); + return i; + } + }); + + for(int i = 0;i < list.size();i++){ + System.out.println(list.get(i).getName()+" "+list.get(i).getScore()); + } + } +} diff --git a/util/src/test/java/com/ccsens/util/StuVO.java b/util/src/test/java/com/ccsens/util/StuVO.java new file mode 100644 index 00000000..e59e7f36 --- /dev/null +++ b/util/src/test/java/com/ccsens/util/StuVO.java @@ -0,0 +1,27 @@ +package com.ccsens.util; + +public class StuVO { + private String name; + private int score; + + public StuVO(String name, int srore) { + this.name = name; + this.score = srore; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getScore() { + return score; + } + + public void setScore(int srore) { + this.score = srore; + } +} From 934ae56fe1ca8bf619f11920c4d03a22b319bf46 Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Mon, 16 Nov 2020 14:13:55 +0800 Subject: [PATCH 3/3] 11-16-2 --- .../com/ccsens/mt/api/CompeteScoreController.java | 2 +- .../main/java/com/ccsens/mt/bean/dto/VideoDto.java | 2 -- .../java/com/ccsens/mt/service/CompeteService.java | 3 ++- .../resources/mapper_dao/CompeteProjectConfigDao.xml | 2 +- mt/src/main/resources/mapper_dao/CompeteScoreDao.xml | 12 ++++++------ tall/src/main/resources/application-dev.yml | 2 +- tall/src/main/resources/application.yml | 4 ++-- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java index 983dd98f..c1bc93e4 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java @@ -40,7 +40,7 @@ public class CompeteScoreController { return JsonResponse.newInstance().ok(playerList); } - @MustLogin +// @MustLogin @ApiOperation(value = "项目状态", notes = "lihong,查询项目集合,再根据时间判断项目得状态") @RequestMapping(value = "/countScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse countScore(@ApiParam @Validated @RequestBody QueryDto params) { diff --git a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java index 21bb3fd9..2105d806 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java @@ -81,10 +81,8 @@ public class VideoDto { private Long id; @ApiModelProperty("姓名/参赛队伍") private String name; - @ApiModelProperty("账号") private String phone; - @ApiModelProperty("签到时间") private Long signEndTime; diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java index 5f14e370..0ed4dbaa 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -1123,7 +1123,8 @@ public class CompeteService implements ICompeteService { competeCountScore.setDeductCause(params.getDeductReason()); competeCountScore.setFinalScore(params.getFinalScore()); competeCountScore.setId(snowflake.nextId()); - competeCountScoreMapper.insert(competeCountScore); + competeCountScore.setRecStatus((byte) 0); + competeCountScoreMapper.insert(competeCountScore); } diff --git a/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml b/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml index 5edd2613..64c4c54a 100644 --- a/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml @@ -65,7 +65,7 @@ and tcc.id = #{companyId} - and tcp.name = #{name} + and tcp.name like #{name} and tcp.id_card = #{idCard} diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index 1a789b7b..43ea9e8f 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -18,7 +18,7 @@ and tcc.rec_status = 0 and tcpp.project_id= #{projectId} and tcpp.compete_group_id =#{competeGroupId} - GROUP BY tccs.final_score + GROUP BY tccs.final_score DESC diff --git a/tall/src/main/resources/application-dev.yml b/tall/src/main/resources/application-dev.yml index ee29058b..ee0a41b5 100644 --- a/tall/src/main/resources/application-dev.yml +++ b/tall/src/main/resources/application-dev.yml @@ -1,5 +1,5 @@ server: - port: 7070 + port: 7030 servlet: context-path: /v1.0 spring: diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index ebc544af..b5408a3a 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: util-test,common + active: dev + include: util-dev,common