From a17c51ce68cf45a9bbe91afd12368a0e41dfab27 Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Mon, 23 Nov 2020 18:59:17 +0800 Subject: [PATCH 1/4] 11-23-4 --- .../main/java/com/ccsens/mt/api/CompeteScoreController.java | 2 +- .../main/java/com/ccsens/mt/service/CompeteScoreService.java | 1 - mt/src/main/resources/application.yml | 4 ++-- tall/src/main/resources/application.yml | 4 ++-- 4 files changed, 5 insertions(+), 6 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 e2671074..455ac85c 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java @@ -129,7 +129,7 @@ public class CompeteScoreController { @RequestMapping(value = "/submitScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse submitScore(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查询比赛项目上的参赛选手列表:{}",params); -// competeService.submitScore(params.getParam()); + competeService.submitScore(params.getParam()); competeScoreService.submitScore(params.getParam()); return JsonResponse.newInstance().ok(); } diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java index 302b3a7a..16ea5923 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java @@ -55,7 +55,6 @@ public class CompeteScoreService implements ICompeteScoreService{ countScore.setDeductTimes(param.getDeductTime()); countScore.setDeductCause(param.getDeductReason()); countScore.setFinalScore(param.getFinalScore()); - competeCountScoreMapper.insertSelective(countScore); } } 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/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 From c06d911211641ed6e41062a3fb615f1e8e3bafb3 Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Tue, 24 Nov 2020 09:53:20 +0800 Subject: [PATCH 2/4] 11-24-1 --- mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java | 1 + mt/src/main/resources/mapper_dao/CompeteScoreDao.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java index 16ea5923..302b3a7a 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java @@ -55,6 +55,7 @@ public class CompeteScoreService implements ICompeteScoreService{ countScore.setDeductTimes(param.getDeductTime()); countScore.setDeductCause(param.getDeductReason()); countScore.setFinalScore(param.getFinalScore()); + competeCountScoreMapper.insertSelective(countScore); } } diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index f1eb223f..4bec2fe9 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -100,6 +100,7 @@ LEFT JOIN t_compete_company c on p.company_id = c.id WHERE so.id = #{siteId} + and cs.rec_status = 0 and so.rec_status = 0 and cp.rec_status = 0 and pp.rec_status = 0 From 823dcb129a68943641ce7ea007b4c35f447fbb9d Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Tue, 24 Nov 2020 11:22:44 +0800 Subject: [PATCH 3/4] 11-23-4 --- .../com/ccsens/mt/api/ExcelController.java | 1 - .../ccsens/mt/bean/po/CompeteCountScore.java | 24 +++- .../mt/bean/po/CompeteCountScoreExample.java | 120 +++++++++--------- .../mapper/CompeteCountScoreMapper.java | 5 +- .../mt/service/CompeteScoreService.java | 1 - mt/src/main/resources/logback-spring.xml | 2 +- .../mapper_raw/CompeteCountScoreMapper.xml | 50 ++++---- 7 files changed, 111 insertions(+), 92 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/api/ExcelController.java b/mt/src/main/java/com/ccsens/mt/api/ExcelController.java index 8fff9c05..918c56c5 100644 --- a/mt/src/main/java/com/ccsens/mt/api/ExcelController.java +++ b/mt/src/main/java/com/ccsens/mt/api/ExcelController.java @@ -75,7 +75,6 @@ public class ExcelController { return JsonResponse.newInstance().ok(path); } - @MustLogin @ApiOperation(value = "大赛参赛队伍信息表", notes = "") @RequestMapping(value = "/competitionTeamInformationTable", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScore.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScore.java index d89e1feb..bd87e822 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScore.java +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScore.java @@ -4,7 +4,9 @@ import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; -public class CompeteCountScore extends CompeteCountScoreKey implements Serializable { +public class CompeteCountScore implements Serializable { + private Long id; + private Long competeTimeId; private Long projectId; @@ -17,6 +19,8 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa private BigDecimal judgmentBScore2; + private Integer shouldTimes; + private Integer deductTimes; private String deductCause; @@ -31,6 +35,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa private static final long serialVersionUID = 1L; + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public Long getCompeteTimeId() { return competeTimeId; } @@ -79,6 +91,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa this.judgmentBScore2 = judgmentBScore2; } + public Integer getShouldTimes() { + return shouldTimes; + } + + public void setShouldTimes(Integer shouldTimes) { + this.shouldTimes = shouldTimes; + } + public Integer getDeductTimes() { return deductTimes; } @@ -133,12 +153,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); sb.append(", competeTimeId=").append(competeTimeId); sb.append(", projectId=").append(projectId); sb.append(", siteOrderId=").append(siteOrderId); sb.append(", chiefJudgmentScore=").append(chiefJudgmentScore); sb.append(", judgmentAScore=").append(judgmentAScore); sb.append(", judgmentBScore2=").append(judgmentBScore2); + sb.append(", shouldTimes=").append(shouldTimes); sb.append(", deductTimes=").append(deductTimes); sb.append(", deductCause=").append(deductCause); sb.append(", finalScore=").append(finalScore); diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreExample.java index c72f3961..f7572afa 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreExample.java +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreExample.java @@ -166,66 +166,6 @@ public class CompeteCountScoreExample { return (Criteria) this; } - public Criteria andShouldTimesIsNull() { - addCriterion("should_times is null"); - return (Criteria) this; - } - - public Criteria andShouldTimesIsNotNull() { - addCriterion("should_times is not null"); - return (Criteria) this; - } - - public Criteria andShouldTimesEqualTo(Integer value) { - addCriterion("should_times =", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesNotEqualTo(Integer value) { - addCriterion("should_times <>", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesGreaterThan(Integer value) { - addCriterion("should_times >", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesGreaterThanOrEqualTo(Integer value) { - addCriterion("should_times >=", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesLessThan(Integer value) { - addCriterion("should_times <", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesLessThanOrEqualTo(Integer value) { - addCriterion("should_times <=", value, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesIn(List values) { - addCriterion("should_times in", values, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesNotIn(List values) { - addCriterion("should_times not in", values, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesBetween(Integer value1, Integer value2) { - addCriterion("should_times between", value1, value2, "shouldTimes"); - return (Criteria) this; - } - - public Criteria andShouldTimesNotBetween(Integer value1, Integer value2) { - addCriterion("should_times not between", value1, value2, "shouldTimes"); - return (Criteria) this; - } - public Criteria andCompeteTimeIdIsNull() { addCriterion("compete_time_id is null"); return (Criteria) this; @@ -586,6 +526,66 @@ public class CompeteCountScoreExample { return (Criteria) this; } + public Criteria andShouldTimesIsNull() { + addCriterion("should_times is null"); + return (Criteria) this; + } + + public Criteria andShouldTimesIsNotNull() { + addCriterion("should_times is not null"); + return (Criteria) this; + } + + public Criteria andShouldTimesEqualTo(Integer value) { + addCriterion("should_times =", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesNotEqualTo(Integer value) { + addCriterion("should_times <>", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesGreaterThan(Integer value) { + addCriterion("should_times >", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesGreaterThanOrEqualTo(Integer value) { + addCriterion("should_times >=", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesLessThan(Integer value) { + addCriterion("should_times <", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesLessThanOrEqualTo(Integer value) { + addCriterion("should_times <=", value, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesIn(List values) { + addCriterion("should_times in", values, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesNotIn(List values) { + addCriterion("should_times not in", values, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesBetween(Integer value1, Integer value2) { + addCriterion("should_times between", value1, value2, "shouldTimes"); + return (Criteria) this; + } + + public Criteria andShouldTimesNotBetween(Integer value1, Integer value2) { + addCriterion("should_times not between", value1, value2, "shouldTimes"); + return (Criteria) this; + } + public Criteria andDeductTimesIsNull() { addCriterion("deduct_times is null"); return (Criteria) this; diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteCountScoreMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteCountScoreMapper.java index 5592b7ec..faf0e354 100644 --- a/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteCountScoreMapper.java +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteCountScoreMapper.java @@ -2,7 +2,6 @@ package com.ccsens.mt.persist.mapper; import com.ccsens.mt.bean.po.CompeteCountScore; import com.ccsens.mt.bean.po.CompeteCountScoreExample; -import com.ccsens.mt.bean.po.CompeteCountScoreKey; import java.util.List; import org.apache.ibatis.annotations.Param; @@ -11,7 +10,7 @@ public interface CompeteCountScoreMapper { int deleteByExample(CompeteCountScoreExample example); - int deleteByPrimaryKey(CompeteCountScoreKey key); + int deleteByPrimaryKey(Long id); int insert(CompeteCountScore record); @@ -19,7 +18,7 @@ public interface CompeteCountScoreMapper { List selectByExample(CompeteCountScoreExample example); - CompeteCountScore selectByPrimaryKey(CompeteCountScoreKey key); + CompeteCountScore selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") CompeteCountScore record, @Param("example") CompeteCountScoreExample example); diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java index 302b3a7a..4f880607 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java @@ -25,7 +25,6 @@ public class CompeteScoreService implements ICompeteScoreService{ private CompeteCountScoreMapper competeCountScoreMapper; @Resource private Snowflake snowflake; - @Override public void submitScore(CompeteDto.SubmitScore param) { //查找该场次已经有的分数 diff --git a/mt/src/main/resources/logback-spring.xml b/mt/src/main/resources/logback-spring.xml index da37f156..bdd2a4ea 100644 --- a/mt/src/main/resources/logback-spring.xml +++ b/mt/src/main/resources/logback-spring.xml @@ -1,4 +1,4 @@ - + diff --git a/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml b/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml index 6f586d68..f562ef5f 100644 --- a/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml +++ b/mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml @@ -3,13 +3,13 @@ - + @@ -76,8 +76,8 @@ - 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, + 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, 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 @@ -113,14 +111,14 @@ - 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, + 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, deduct_cause, final_score, created_at, updated_at, rec_status) - 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}, + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, + #{siteOrderId,jdbcType=BIGINT}, #{chiefJudgmentScore,jdbcType=DECIMAL}, #{judgmentAScore,jdbcType=DECIMAL}, + #{judgmentBScore2,jdbcType=DECIMAL}, #{shouldTimes,jdbcType=INTEGER}, #{deductTimes,jdbcType=INTEGER}, #{deductCause,jdbcType=VARCHAR}, #{finalScore,jdbcType=DECIMAL}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) @@ -130,9 +128,6 @@ id, - - should_times, - compete_time_id, @@ -151,6 +146,9 @@ judgment_b_score2, + + should_times, + deduct_times, @@ -174,9 +172,6 @@ #{id,jdbcType=BIGINT}, - - #{shouldTimes,jdbcType=INTEGER}, - #{competeTimeId,jdbcType=BIGINT}, @@ -195,6 +190,9 @@ #{judgmentBScore2,jdbcType=DECIMAL}, + + #{shouldTimes,jdbcType=INTEGER}, + #{deductTimes,jdbcType=INTEGER}, @@ -227,9 +225,6 @@ id = #{record.id,jdbcType=BIGINT}, - - should_times = #{record.shouldTimes,jdbcType=INTEGER}, - compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, @@ -248,6 +243,9 @@ judgment_b_score2 = #{record.judgmentBScore2,jdbcType=DECIMAL}, + + should_times = #{record.shouldTimes,jdbcType=INTEGER}, + deduct_times = #{record.deductTimes,jdbcType=INTEGER}, @@ -274,13 +272,13 @@ 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=INTEGER}, deduct_times = #{record.deductTimes,jdbcType=INTEGER}, deduct_cause = #{record.deductCause,jdbcType=VARCHAR}, final_score = #{record.finalScore,jdbcType=DECIMAL}, @@ -312,6 +310,9 @@ judgment_b_score2 = #{judgmentBScore2,jdbcType=DECIMAL}, + + should_times = #{shouldTimes,jdbcType=INTEGER}, + deduct_times = #{deductTimes,jdbcType=INTEGER}, @@ -332,7 +333,6 @@ where id = #{id,jdbcType=BIGINT} - and should_times = #{shouldTimes,jdbcType=INTEGER} update t_compete_count_score @@ -342,6 +342,7 @@ chief_judgment_score = #{chiefJudgmentScore,jdbcType=DECIMAL}, judgment_a_score = #{judgmentAScore,jdbcType=DECIMAL}, judgment_b_score2 = #{judgmentBScore2,jdbcType=DECIMAL}, + should_times = #{shouldTimes,jdbcType=INTEGER}, deduct_times = #{deductTimes,jdbcType=INTEGER}, deduct_cause = #{deductCause,jdbcType=VARCHAR}, final_score = #{finalScore,jdbcType=DECIMAL}, @@ -349,6 +350,5 @@ 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 From c6ec4a34b6a7cfd703e217a031503f4aa6fc609a Mon Sep 17 00:00:00 2001 From: "Lihong@123456" <1090591095@qq.com> Date: Tue, 24 Nov 2020 15:42:39 +0800 Subject: [PATCH 4/4] 11-24-2 --- .../mt/persist/dao/CompeteCompanyDao.java | 10 +++ .../com/ccsens/mt/service/CompeteService.java | 1 - .../com/ccsens/mt/service/ExcelService.java | 84 ++++++++++++------- mt/src/main/resources/logback-spring.xml | 2 +- .../mapper_dao/CompeteCompanyDao.xml | 14 ++++ 5 files changed, 78 insertions(+), 33 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteCompanyDao.java b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteCompanyDao.java index 9c27abdd..45ca8e90 100644 --- a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteCompanyDao.java +++ b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteCompanyDao.java @@ -6,6 +6,7 @@ import com.ccsens.mt.bean.po.CompeteCompany; import com.ccsens.mt.bean.vo.CompeteExcelVo; import com.ccsens.mt.bean.vo.CompeteVo; import com.ccsens.mt.bean.vo.ProvinceCompeteVo; +import com.ccsens.mt.bean.vo.TableVo; import com.ccsens.mt.persist.mapper.CompeteCompanyMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -152,4 +153,13 @@ public interface CompeteCompanyDao extends CompeteCompanyMapper { * @return */ int selectJoinNumByPlayer(@Param("playerId")Long playerId, @Param("competeTimeId")Long competeTimeId); + + /** + * 参赛人数统计表 + * @param competeTimeId + * @return 参赛人数 + */ + List selectCompeteJoinCountList(@Param("competeTimeId")Long competeTimeId); + + } 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 205e2909..b1b0847f 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -1409,7 +1409,6 @@ public class CompeteService implements ICompeteService { @Override public List countScoreCurrentSite(CompeteDto.CompeteSite params) { - Long siteId = params.getSiteId(); List countScoreCurrentSites = competeScoreDao.selectCountScoreCurrentSite(siteId); countScoreCurrentSites.forEach(mes->{ diff --git a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java index 5358d6cc..4d64301a 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java @@ -25,6 +25,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Table; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.eclipse.jetty.util.StringUtil; @@ -41,6 +42,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.util.LinkedList; import java.util.List; @Slf4j @@ -634,38 +636,58 @@ public class ExcelService implements IExcelService { } private List competeJoinCountList(CompeteDto.CompeteTime params) { - CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample(); - competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId()); - //根据大赛id查公司集合 - List competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample); - List competeOverview2List = new ArrayList<>(); - for (CompeteCompany competeCompany : competeCompanyList) { - //每个公司的教练数量 - int leader = 1; - int coach = 0; - CompeteCoachExample competeCoachExample = new CompeteCoachExample(); - competeCoachExample.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) coach); - competeCoachMapper.selectByExample(competeCoachExample); - long count = competeCoachMapper.countByExample(competeCoachExample); - //每个公司的领队数量 - CompeteCoachExample competeCoachExample1 = new CompeteCoachExample(); - competeCoachExample1.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) leader); - long count1 = competeCoachMapper.countByExample(competeCoachExample1); - //每个公司运动员人数 - CompetePlayerExample competePlayerExample2 = new CompetePlayerExample(); - competePlayerExample2.createCriteria().andCompanyIdEqualTo(competeCompany.getId()); - long count2 = competePlayerDao.countByExample(competePlayerExample2); - //总人数 - long sum = count + count1 + count2; - TableVo.CompeteOverview CompeteOverview2 = new TableVo.CompeteOverview(); - CompeteOverview2.setCompanyName(competeCompany.getName()); - CompeteOverview2.setCoachNum((int) count); - CompeteOverview2.setGuideNum((int) count1); - CompeteOverview2.setPlayerNum((int) count2); - CompeteOverview2.setSum((int) sum); - competeOverview2List.add(CompeteOverview2); + List competeOverviewList = competeCompanyDao.selectCompeteJoinCountList(params.getCompeteTimeId()); + List list = new LinkedList<>(); + for (TableVo.CompeteOverview mes : competeOverviewList){ + if (mes.getCoachNum() != 0 && mes.getGuideNum() != 0 && mes.getPlayerNum() != 0){ + int num = mes.getCoachNum()+mes.getPlayerNum()+mes.getGuideNum(); + mes.setSum(num); + list.add(mes); + } + } - return competeOverview2List; + return list; + + + +// CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample(); +// competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId()); +// //根据大赛id查公司集合 +// List competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample); +// List competeOverview2List = new ArrayList<>(); +// for (CompeteCompany competeCompany : competeCompanyList) { +// //每个公司的教练数量 +// int leader = 1; +// int coach = 0; +// CompeteCoachExample competeCoachExample = new CompeteCoachExample(); +// competeCoachExample.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) coach); +// competeCoachMapper.selectByExample(competeCoachExample); +// long count = competeCoachMapper.countByExample(competeCoachExample); +// //每个公司的领队数量 +// CompeteCoachExample competeCoachExample1 = new CompeteCoachExample(); +// competeCoachExample1.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) leader); +// long count1 = competeCoachMapper.countByExample(competeCoachExample1); +// //每个公司运动员人数 +// CompetePlayerExample competePlayerExample2 = new CompetePlayerExample(); +// competePlayerExample2.createCriteria().andCompanyIdEqualTo(competeCompany.getId()); +// long count2 = competePlayerDao.countByExample(competePlayerExample2); +// List competePlayerList = competePlayerDao.selectByExample(competePlayerExample2); +// competePlayerList.forEach(mes->{ +// CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample(); +// competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample); +// +// }); +// //总人数 +// long sum = count + count1 + count2; +// TableVo.CompeteOverview CompeteOverview2 = new TableVo.CompeteOverview(); +// CompeteOverview2.setCompanyName(competeCompany.getName()); +// CompeteOverview2.setCoachNum((int) count); +// CompeteOverview2.setGuideNum((int) count1); +// CompeteOverview2.setPlayerNum((int) count2); +// CompeteOverview2.setSum((int) sum); +// competeOverview2List.add(CompeteOverview2); +// } +// return competeOverview2List; } diff --git a/mt/src/main/resources/logback-spring.xml b/mt/src/main/resources/logback-spring.xml index bdd2a4ea..da37f156 100644 --- a/mt/src/main/resources/logback-spring.xml +++ b/mt/src/main/resources/logback-spring.xml @@ -1,4 +1,4 @@ - + diff --git a/mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml b/mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml index 91ab5fab..bea9e374 100644 --- a/mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml @@ -398,4 +398,18 @@ and pp.rec_status = 0 and p.rec_status = 0 + + + \ No newline at end of file