wang0018 5 years ago
parent
commit
9872f0f5d6
  1. 2
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/MemberVo.java
  2. 2
      mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java
  3. 2
      mt/src/main/java/com/ccsens/mt/api/DebugController.java
  4. 1
      mt/src/main/java/com/ccsens/mt/api/ExcelController.java
  5. 4
      mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java
  6. 24
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScore.java
  7. 120
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreExample.java
  8. 38
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreKey.java
  9. 10
      mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java
  10. 10
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteCompanyDao.java
  11. 7
      mt/src/main/java/com/ccsens/mt/persist/dao/CompetePlayerDao.java
  12. 5
      mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteCountScoreMapper.java
  13. 1
      mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java
  14. 1
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  15. 147
      mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java
  16. 190
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  17. 2
      mt/src/main/java/com/ccsens/mt/service/IExcelService.java
  18. 4
      mt/src/main/resources/application.yml
  19. 14
      mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml
  20. 2
      mt/src/main/resources/mapper_dao/CompeteJudgmentDao.xml
  21. 88
      mt/src/main/resources/mapper_dao/CompetePlayerDao.xml
  22. 16
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml
  23. 50
      mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml
  24. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  25. 1
      tall/src/main/java/com/ccsens/tall/service/ProMemberService.java
  26. 7
      util/src/test/java/com/ccsens/util/OtherTest.java

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

@ -51,5 +51,7 @@ public class MemberVo {
private Long memberId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("userId")
private Long userId;
}
}

2
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<CompeteDto.SubmitScore> params) {
log.info("查询比赛项目上的参赛选手列表:{}",params);
// competeService.submitScore(params.getParam());
competeService.submitScore(params.getParam());
competeScoreService.submitScore(params.getParam());
return JsonResponse.newInstance().ok();
}

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

@ -44,7 +44,7 @@ public class DebugController {
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
List<TableVo.CompeteAllCount1> competeAllCount1s = excelService.competeAllCountList1(0);
List<TableVo.CompeteAllCount1> competeAllCount1s = excelService.competeAllCountList1(1L);
return JsonResponse.newInstance().ok(competeAllCount1s);
}

1
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"})

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

@ -105,12 +105,10 @@ public class ScoreDto {
@NotNull
@ApiModelProperty("裁判id")
private Long judgmentId;
@NotNull
@ApiModelProperty("备注")
private String remark;
@NotNull
@ApiModelProperty("裁判是否选择了弃权还是啥的")
private Byte waiver;
private Byte waiver = 0;
@NotNull
@ApiModelProperty("计分项目")
private List<Fraction> fractionsList;

24
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);

120
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<Integer> values) {
addCriterion("should_times in", values, "shouldTimes");
return (Criteria) this;
}
public Criteria andShouldTimesNotIn(List<Integer> 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<Integer> values) {
addCriterion("should_times in", values, "shouldTimes");
return (Criteria) this;
}
public Criteria andShouldTimesNotIn(List<Integer> 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;

38
mt/src/main/java/com/ccsens/mt/bean/po/CompeteCountScoreKey.java

@ -1,4 +1,3 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
@ -38,40 +37,3 @@ public class CompeteCountScoreKey implements Serializable {
return sb.toString();
}
}
//public class CompeteCountScoreKey implements Serializable {
// private Long id;
//
// private Integer shouldTimes;
//
// private static final long serialVersionUID = 1L;
//
// public Long getId() {
// return id;
// }
//
// public void setId(Long id) {
// this.id = id;
// }
//
// public Integer getShouldTimes() {
// return shouldTimes;
// }
//
// public void setShouldTimes(Integer shouldTimes) {
// this.shouldTimes = shouldTimes;
// }
//
// @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(", shouldTimes=").append(shouldTimes);
// sb.append("]");
// return sb.toString();
// }
//}

10
mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java

@ -118,13 +118,17 @@ public class TableVo {
@ApiModel("XXX比赛报名汇总表")
public static class CompeteAllCount1{
@ApiModelProperty("参赛id")
private String projectId;
private long projectId;
@ApiModelProperty()
private int id = (int) projectId;
@ApiModelProperty("参赛项目")
private String projectName;
@ApiModelProperty("通级 0限制 1不限制")
private int certificate;
@ApiModelProperty("是否限制组别 0否 1是")
private int joinRile;
private int joinRule;
@ApiModelProperty("是否是团队 0否 1是")
private int team;
@ApiModelProperty("参赛人数 顺序:小学(男女混)→中学(男女混)→高职院校(男女混)→本科院校(男女混)→俱乐部(男女混)")
private List<String> nums;
@ApiModelProperty("每个组别内的人数")
@ -205,7 +209,7 @@ public class TableVo {
public int getGames(){
if(joinNum != 0 && siteNum != 0) {
return (int) Math.ceil(joinNum / siteNum);
return (int) Math.ceil((float)joinNum / (float)siteNum);
}
return 0;
}

10
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<TableVo.CompeteOverview> selectCompeteJoinCountList(@Param("competeTimeId")Long competeTimeId);
}

7
mt/src/main/java/com/ccsens/mt/persist/dao/CompetePlayerDao.java

@ -99,4 +99,11 @@ public interface CompetePlayerDao extends CompetePlayerMapper {
* @return
*/
List<TableVo.CompeteAllCount1> getJoinTeamNumByType(@Param("type")byte type);
/**
* 查询团队限制组别的项目的数量汇总交互绳 一带一
* @param type
* @return
*/
List<TableVo.CompeteAllCount1> getJoinRuleTeamNumByType(@Param("type")byte type);
}

5
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<CompeteCountScore> selectByExample(CompeteCountScoreExample example);
CompeteCountScore selectByPrimaryKey(CompeteCountScoreKey key);
CompeteCountScore selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CompeteCountScore record, @Param("example") CompeteCountScoreExample example);

1
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) {
//查找该场次已经有的分数

1
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -1409,7 +1409,6 @@ public class CompeteService implements ICompeteService {
@Override
public List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSite(CompeteDto.CompeteSite params) {
Long siteId = params.getSiteId();
List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSites = competeScoreDao.selectCountScoreCurrentSite(siteId);
countScoreCurrentSites.forEach(mes->{

147
mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java

@ -25,9 +25,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
@ -137,12 +135,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("本项目参加的人数:{}", playerIdOrTeamIdList);
if (CollectionUtil.isNotEmpty(playerIdOrTeamIdList)) {
//计算场次
int order = (int) Math.ceil(playerIdOrTeamIdList.size() / projectConfig.getSiteNum());
int order = (int) Math.ceil((float)playerIdOrTeamIdList.size() / (float)projectConfig.getSiteNum());
//计算每个场次时间
long projectStartTime = projectConfig.getStartTime();
long orderTime = 0;
if (order != 0) {
orderTime = (long) Math.floor((projectConfig.getEndTime() - projectStartTime) / order);
orderTime = (long) Math.floor(((float)projectConfig.getEndTime() - (float)projectStartTime) / (float)order);
} else {
log.info("场次为0的比赛:{}------{}", project, projectConfig);
}
@ -172,7 +170,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.updataTask(updateTaskInfo);
log.info("修改tall的任务信息后返回:{}", normalTaskJsonResponse);
//失败return
if (ObjectUtil.isNull(normalTaskJsonResponse) || normalTaskJsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(normalTaskJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(normalTaskJsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", normalTaskJsonResponse.getMsg());
return;
}
}
@ -192,7 +195,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask);
//异常return
log.info("添加任务后返回:{}", normalTaskJsonResponse);
if (ObjectUtil.isNull(normalTaskJsonResponse) || normalTaskJsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(normalTaskJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(normalTaskJsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", normalTaskJsonResponse.getMsg());
return;
}
TaskVo.NormalTask normalTask = normalTaskJsonResponse.getData();
@ -423,39 +431,70 @@ public class CompeteTaskService implements ICompeteTaskService {
List<ProvinceCompeteVo.QueryJudgment> queryJudgmentList = competeJudgmentDao.queryJudgment(param.getCompeteTimeId(), param.getProjectId());
if (CollectionUtil.isNotEmpty(queryJudgmentList)) {
queryJudgmentList.forEach(projectJudgment -> {
// for(ProvinceCompeteVo.QueryJudgment projectJudgment : queryJudgmentList){
//裁判数量
int count = projectJudgment.getProjectType() == 0 ? 3 : 7;
for (int i = 0; i < projectJudgment.getSiteNums(); i++) {
if (i < projectJudgment.getSiteList().size()) {
ProvinceCompeteVo.ProjectSite siteJudgment = projectJudgment.getSiteList().get(i);
if (CollectionUtil.isEmpty(siteJudgment.getJudgmentList())) {
siteJudgment.setJudgmentList(new ArrayList<>());
}
int a = siteJudgment.getJudgmentList().size();
for (int j = 0; j < count - a; j++) {
Map<Integer,Integer> siteMap = new HashMap<>();
Map<Integer,Integer> judgmentMap = new HashMap<>();
projectJudgment.getSiteList().forEach(site-> {
siteMap.put(site.getSiteNum(),site.getSiteNum());
if (CollectionUtil.isEmpty(site.getJudgmentList())) {
site.setJudgmentList(new ArrayList<>());
}else {
site.getJudgmentList().forEach(judgment -> judgmentMap.put(judgment.getJudgmentNum(),judgment.getJudgmentNum()));
}
for (int j = 0; j < count; j++) {
if(judgmentMap.get(j) == null) {
ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
siteJudgment1.setJudgmentNum(a + j);
siteJudgment.getJudgmentList().add(siteJudgment1);
siteJudgment1.setJudgmentNum(j);
site.getJudgmentList().add(siteJudgment1);
}
} else {
int a = projectJudgment.getSiteList().size();
System.out.println("==========="+ a);
System.out.println("==========="+ projectJudgment.getSiteNums());
System.out.println("==========="+ (projectJudgment.getSiteNums()-a));
for (int j = 0; j < projectJudgment.getSiteNums() - a; j++) {
}
CollectionUtil.sort(site.getJudgmentList(), Comparator.comparingInt(ProvinceCompeteVo.SiteJudgment::getJudgmentNum));
});
for (int j = 0; j < projectJudgment.getSiteNums(); j++) {
if(siteMap.get(j+1) == null) {
ProvinceCompeteVo.ProjectSite siteJudgment = new ProvinceCompeteVo.ProjectSite();
siteJudgment.setSiteNum(a + j + 1);
siteJudgment.setSiteNum(j + 1);
projectJudgment.getSiteList().add(siteJudgment);
int b = siteJudgment.getJudgmentList().size();
for (int x = 0; x < count - b; x++) {
for (int x = 0; x < count; x++) {
ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
siteJudgment1.setJudgmentNum(b + x);
siteJudgment1.setJudgmentNum(x);
siteJudgment.getJudgmentList().add(siteJudgment1);
}
}
}
}
//
// projectJudgment.getSiteList().forEach(site-> judgmentMap.put(site.getSiteNum(),site.getSiteNum()));
// for (int i = 0; i < projectJudgment.getSiteNums(); i++) {
// if (i < projectJudgment.getSiteList().size()) {
// ProvinceCompeteVo.ProjectSite siteJudgment = projectJudgment.getSiteList().get(i);
// if (CollectionUtil.isEmpty(siteJudgment.getJudgmentList())) {
// siteJudgment.setJudgmentList(new ArrayList<>());
// }else {
// siteJudgment.getJudgmentList().forEach(judgment -> siteMap.put(judgment.getJudgmentNum(),judgment.getJudgmentNum()));
// }
// for (int j = 0; j < count; j++) {
// if(siteMap.get(j) == null) {
// ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
// siteJudgment1.setJudgmentNum(j);
// siteJudgment.getJudgmentList().add(siteJudgment1);
// }
// }
// CollectionUtil.sort(siteJudgment.getJudgmentList(), Comparator.comparingInt(ProvinceCompeteVo.SiteJudgment::getJudgmentNum));
// } else {
// int a = projectJudgment.getSiteList().size();
// for (int j = 0; j < projectJudgment.getSiteNums(); j++) {
// ProvinceCompeteVo.ProjectSite siteJudgment = new ProvinceCompeteVo.ProjectSite();
// siteJudgment.setSiteNum(a + j + 1);
// projectJudgment.getSiteList().add(siteJudgment);
// int b = siteJudgment.getJudgmentList().size();
// for (int x = 0; x < count - b; x++) {
// ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
// siteJudgment1.setJudgmentNum(b + x);
// siteJudgment.getJudgmentList().add(siteJudgment1);
// }
// }
// }
// }
});
}
@ -532,7 +571,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<MemberVo.RoleInfo> roleJsonResponse = tallFeignClient.saveRole(saveRole);
log.info("添加角色后返回:{}", roleJsonResponse);
//失败return
if (ObjectUtil.isNull(roleJsonResponse) || roleJsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(roleJsonResponse)) {
log.info("调用tall返回null");
return;
}
if( roleJsonResponse.getCode() != 200) {
log.info("调用tall异常后返回:{}", roleJsonResponse.getMsg());
return;
}
MemberVo.RoleInfo roleInfo = roleJsonResponse.getData();
@ -554,37 +598,60 @@ public class CompeteTaskService implements ICompeteTaskService {
Long userId = null;
//失败return
if (ObjectUtil.isNull(memberJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(memberJsonResponse.getCode() != 200 && memberJsonResponse.getCode() != 21){
log.info("调用tall异常后返回:{}", memberJsonResponse.getMsg());
return;
}
if(roleJsonResponse.getCode() == 200){
MemberVo.Member member = memberJsonResponse.getData();
if(ObjectUtil.isNotNull(member)){
userId = member.getUserId();
}
}
//code等于21代表成员已存在
if (memberJsonResponse.getCode() == 21) {
log.info("该成员已存在:{}", memberJsonResponse.getMsg());
//查询该手机号在项目内的成员的id
MemberRoleDto.GetMemberByPhone getMemberByPhone = new MemberRoleDto.GetMemberByPhone();
getMemberByPhone.setProjectId(tallProjectId);
getMemberByPhone.setPhone(judgmentInfo.getJudgmentPhone());
getMemberByPhone.setToken(token);
log.info("查找该手机号以前的成员信息:{}", judgmentInfo.getJudgmentPhone());
JsonResponse<MemberVo.MemberList> memberListJsonResponse = tallFeignClient.queryMemberByPhone(getMemberByPhone);
if (ObjectUtil.isNotNull(memberListJsonResponse)) {
log.info("查找该手机号以前的成员信息返回:{}", memberListJsonResponse);
//失败return
if (ObjectUtil.isNull(memberListJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(memberListJsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", memberJsonResponse.getMsg());
return;
}
MemberVo.MemberList memberList = memberListJsonResponse.getData();
if (ObjectUtil.isNotNull(memberList)) {
memberId = memberList.getMemberId();
userId = memberList.getUserId();
}
}
//将该成员添加至角色下
if (ObjectUtil.isNotNull(roleId) && ObjectUtil.isNotNull(memberId)) {
MemberRoleDto.SaveMemberInRole saveMemberInRole = new MemberRoleDto.SaveMemberInRole();
saveMemberInRole.setRoleId(roleId);
saveMemberInRole.setMemberId(memberId);
saveMemberInRole.setToken(token);
log.info("将该成员添加至角色内");
JsonResponse jsonResponse = tallFeignClient.saveMemberInRole(saveMemberInRole);
if (ObjectUtil.isNull(jsonResponse) || jsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(jsonResponse)) {
log.info("调用tall返回null");
return;
}
if(jsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", jsonResponse.getMsg());
return;
}
}
@ -610,7 +677,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("在tall内添加任务:{}", addTask);
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask);
log.info("添加任务后返回:{}", normalTaskJsonResponse);
if (ObjectUtil.isNull(normalTaskJsonResponse) || normalTaskJsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(normalTaskJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(normalTaskJsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", normalTaskJsonResponse.getMsg());
return;
}
if (ObjectUtil.isNotNull(normalTaskJsonResponse)) {
@ -624,7 +696,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("修改tall内任务插件配置:{}", updatePluginConfig);
JsonResponse<TaskVo.PluginVo> pluginVoJsonResponse = tallFeignClient.updatePluginConfig(updatePluginConfig);
log.info("修改任务插件配置后返回:{}", pluginVoJsonResponse);
if (ObjectUtil.isNull(pluginVoJsonResponse) || pluginVoJsonResponse.getCode() != 200) {
if (ObjectUtil.isNull(pluginVoJsonResponse)) {
log.info("调用tall返回null");
return;
}
if(pluginVoJsonResponse.getCode() != 200){
log.info("调用tall异常后返回:{}", pluginVoJsonResponse.getMsg());
return;
}
}

190
mt/src/main/java/com/ccsens/mt/service/ExcelService.java

@ -7,10 +7,7 @@ import com.ccsens.mt.bean.dto.CompeteDto;
import com.ccsens.mt.bean.dto.ProvinceCompeteDto;
import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.po.*;
import com.ccsens.mt.bean.vo.CompeteExcelVo;
import com.ccsens.mt.bean.vo.CompeteVo;
import com.ccsens.mt.bean.vo.ScoreVo;
import com.ccsens.mt.bean.vo.TableVo;
import com.ccsens.mt.bean.vo.*;
import com.ccsens.mt.persist.dao.*;
import com.ccsens.mt.persist.mapper.*;
import com.ccsens.mt.util.Constant;
@ -25,6 +22,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;
@ -40,7 +38,9 @@ import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
@Slf4j
@ -718,38 +718,58 @@ public class ExcelService implements IExcelService {
}
private List<TableVo.CompeteOverview> competeJoinCountList(CompeteDto.CompeteTime params) {
CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample();
competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId());
//根据大赛id查公司集合
List<CompeteCompany> competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample);
List<TableVo.CompeteOverview> 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);
}
return competeOverview2List;
List<TableVo.CompeteOverview> competeOverviewList = competeCompanyDao.selectCompeteJoinCountList(params.getCompeteTimeId());
List<TableVo.CompeteOverview> 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 list;
// CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample();
// competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId());
// //根据大赛id查公司集合
// List<CompeteCompany> competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample);
// List<TableVo.CompeteOverview> 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<CompetePlayer> 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;
}
@ -809,7 +829,8 @@ public class ExcelService implements IExcelService {
@Override
public String competeAllCount(CompeteDto.CompeteTime params) throws IOException {
List<TableVo.CompeteAllCount> competeAllCountList = competeAllCountList(params);
// List<TableVo.CompeteAllCount> competeAllCountList = competeAllCountList(params);
List<TableVo.CompeteAllCount1> competeAllCountList = competeAllCountList1(params.getCompeteTimeId());
String path = getExcelFilePathForCompeteAllCount(competeAllCountList);
return path;
}
@ -1036,24 +1057,26 @@ public class ExcelService implements IExcelService {
}
@Override
public List<TableVo.CompeteAllCount1> competeAllCountList1(int type){
// CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(params.getCompeteTimeId());
public List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeId){
CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(competeTimeId);
List<TableVo.CompeteAllCount1> competeAllCountList = new ArrayList<>();
// if(ObjectUtil.isNotNull(competeTime)) {
if(ObjectUtil.isNotNull(competeTime)){
//查询个人赛的数量统计
competeAllCountList = competePlayerDao.getJoinNumByType((byte) type);
//查询团体赛的数量统计
// List<TableVo.CompeteAllCount1> groupNum = competePlayerDao.getJoinTeamNumByType((byte) type);
List<TableVo.CompeteAllCount1> nums = competePlayerDao.getJoinNumByType(competeTime.getType());
competeAllCountList.addAll(nums);
//查询限制组别的团体赛的统计
//查询不限组别团体赛的统计
// }
List<TableVo.CompeteAllCount1> groupRuleNum = competePlayerDao.getJoinRuleTeamNumByType(competeTime.getType());
competeAllCountList.addAll(groupRuleNum);
//查询团体赛的数量统计
List<TableVo.CompeteAllCount1> groupNum = competePlayerDao.getJoinTeamNumByType(competeTime.getType());
competeAllCountList.addAll(groupNum);
}
CollectionUtil.sort(competeAllCountList,(t1,t2)-> (int)(t1.getProjectId() - t2.getProjectId()));
return competeAllCountList;
}
private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount> arrayList) throws IOException {
private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount1> arrayList) throws IOException {
//创建excle表格对象
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
//创建行对象
@ -1081,43 +1104,52 @@ public class ExcelService implements IExcelService {
//创建整个excel表格对象
Workbook workbook = new XSSFWorkbook();
int i = 1;
for (TableVo.CompeteAllCount competeAllCount : arrayList) {
for (TableVo.CompeteAllCount1 competeAllCount : arrayList) {
//行对象
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>();
cells.add(new PoiUtil.PoiUtilCell(i + "", 1, 1, 300, 18));
//单元格对象
PoiUtil.PoiUtilCell poiUtilCel15 = new PoiUtil.PoiUtilCell(competeAllCount.getProjectName());
cells.add(poiUtilCel15);
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0)));
for (int j = 0; j < competeAllCount.getNums().size(); j++) {
if((competeAllCount.getTeam() == 1 && competeAllCount.getJoinRule() == 1) || (competeAllCount.getCertificate() == 1)){
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j),15,1);
cells.add(poiUtilCel);
PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1)));
cells.add(poiUtilCell);
PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2)));
cells.add(poiUtilCel2);
PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3)));
cells.add(poiUtilCel3);
PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4)));
cells.add(poiUtilCel4);
PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5)));
cells.add(poiUtilCel5);
PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6)));
cells.add(poiUtilCel6);
PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7)));
cells.add(poiUtilCel7);
PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8)));
cells.add(poiUtilCel8);
PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9)));
cells.add(poiUtilCel9);
PoiUtil.PoiUtilCell poiUtilCel10 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(10)));
cells.add(poiUtilCel10);
PoiUtil.PoiUtilCell poiUtilCel11 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(11)));
cells.add(poiUtilCel11);
PoiUtil.PoiUtilCell poiUtilCel12 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(12)));
cells.add(poiUtilCel12);
PoiUtil.PoiUtilCell poiUtilCel13 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(13)));
cells.add(poiUtilCel13);
PoiUtil.PoiUtilCell poiUtilCel14 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(14)));
cells.add(poiUtilCel14);
}else {
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j));
cells.add(poiUtilCel);
}
}
// PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0)));
// cells.add(poiUtilCel);
// PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1)));
// cells.add(poiUtilCell);
// PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2)));
// cells.add(poiUtilCel2);
// PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3)));
// cells.add(poiUtilCel3);
// PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4)));
// cells.add(poiUtilCel4);
// PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5)));
// cells.add(poiUtilCel5);
// PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6)));
// cells.add(poiUtilCel6);
// PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7)));
// cells.add(poiUtilCel7);
// PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8)));
// cells.add(poiUtilCel8);
// PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9)));
// cells.add(poiUtilCel9);
// PoiUtil.PoiUtilCell poiUtilCel10 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(10)));
// cells.add(poiUtilCel10);
// PoiUtil.PoiUtilCell poiUtilCel11 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(11)));
// cells.add(poiUtilCel11);
// PoiUtil.PoiUtilCell poiUtilCel12 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(12)));
// cells.add(poiUtilCel12);
// PoiUtil.PoiUtilCell poiUtilCel13 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(13)));
// cells.add(poiUtilCel13);
// PoiUtil.PoiUtilCell poiUtilCel14 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(14)));
// cells.add(poiUtilCel14);
list.add(cells);
i++;
}
@ -1802,7 +1834,7 @@ public class ExcelService implements IExcelService {
} else {
for (int i = 0; i < eights.size(); i++) {
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>();
cells.add(new PoiUtil.PoiUtilCell("第" + i + "名"));
cells.add(new PoiUtil.PoiUtilCell("第" + (i + 1) + "名"));
cells.add(new PoiUtil.PoiUtilCell(eights.get(i).getEightNames(), 8, 1));
raws.add(cells);
}

2
mt/src/main/java/com/ccsens/mt/service/IExcelService.java

@ -94,7 +94,7 @@ public interface IExcelService {
// String patternExpTable(ScoreDto.ShowResult param);
List<TableVo.CompeteAllCount1> competeAllCountList1(int type);
List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeid);
/**
* 生成比赛前八名的表格
* @param params 第几届比赛

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

@ -1,5 +1,5 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

14
mt/src/main/resources/mapper_dao/CompeteCompanyDao.xml

@ -398,4 +398,18 @@
and pp.rec_status = 0
and p.rec_status = 0
</select>
<select id="selectCompeteJoinCountList" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteOverview">
SELECT
tcc.`name` as companyName,
(SELECT count(tcca.id) FROM t_compete_coach tcca WHERE tcc.id = tcca.company_id and identity = 1 and rec_status = 0) as coachNum,
(SELECT count(tcca.id) FROM t_compete_coach tcca WHERE tcc.id = tcca.company_id and identity = 0 and rec_status = 0) as guideNum,
(SELECT COUNT(tcpp.id) FROM t_compete_project_player tcpp LEFT JOIN t_compete_player tcp on tcp.id = tcpp.player_id WHERE tcp.company_id = tcc.id and tcp.rec_status = 0 and tcpp.rec_status = 0) as playerNum
FROM
t_compete_company tcc
WHERE
tcc.rec_status =0
and tcc.compete_time_id = #{competeTimeId}
</select>
</mapper>

2
mt/src/main/resources/mapper_dao/CompeteJudgmentDao.xml

@ -36,7 +36,9 @@
FROM
t_compete_project p LEFT JOIN t_compete_time ct on p.type = ct.type
LEFT JOIN t_compete_project_config pc on p.id = pc.project_id
LEFT JOIN t_compete_judgment j on j.project_id = p.id and (j.rec_status = 0 or j.rec_status IS NULL)
WHERE
ct.id = #{competeTimeId}
<if test="projectId != null">

88
mt/src/main/resources/mapper_dao/CompetePlayerDao.xml

@ -44,6 +44,8 @@
<id column="projectId" property="projectId"/>
<result column="projectName" property="projectName"/>
<result column="certificate" property="certificate"/>
<result column="team" property="team"/>
<result column="joinRule" property="joinRule"/>
<collection property="joinNum" ofType="com.ccsens.mt.bean.vo.TableVo$JoinGroupNum">
<id column="groupId" property="groupId"/>
<result column="aNum" property="num"/>
@ -332,7 +334,9 @@
p.`name` as projectName,
p.certificate as certificate,
a.groupId as groupId,
a.aNum as aNum
a.aNum as aNum,
p.team as team,
p.join_rule as joinRule
FROM
t_compete_project p
LEFT JOIN(
@ -379,6 +383,86 @@
ORDER BY p.id,a.sequence
</select>
<select id="getJoinTeamNumByType" resultMap="teamNum1">
SELECT
p.id as projectId,
p.`name` as projectName,
count(t.id) as aNum,
p.team as team,
p.join_rule as joinRule
FROM
t_compete_project p
LEFT JOIN t_compete_team t on p.id = t.project_id
LEFT JOIN t_compete_company c on t.company_id = c.id
WHERE
p.type = #{type}
and p.`level` = 2
and p.team = 1
and p.join_rule = 1
and p.rec_status = 0
and t.rec_status = 0
and c.rec_status = 0
GROUP BY p.id
</select>
<select id="getJoinRuleTeamNumByType" resultMap="teamNum1">
SELECT
p.id as projectId,
p.`name` as projectName,
p.certificate as certificate,
a.groupId as groupId,
a.aNum as aNum,
p.team as team,
p.join_rule as joinRule
FROM
t_compete_project p
LEFT JOIN(
SELECT
g.id as groupId,
g.group_name as groupName,
g.sequence as sequence,
t.projectId,
if(t.num is null,'/',t.num) as aNum
FROM
t_compete_group g
LEFT JOIN
(
SELECT
g.id as gid,
g.group_name,
count(t.teamId) as num,
t.projectId as projectId
FROM
t_compete_group g
LEFT JOIN
(
SELECT
t.id as teamId,
t.project_id as projectId,
t.gender_group,
t.group_remark
FROM
t_compete_team t
LEFT JOIN t_compete_company c on t.company_id = c.id
WHERE
(t.rec_status = 0 or t.rec_status is null)
and (c.rec_status = 0 or c.rec_status is null)
)t on ((t.gender_group = g.sex and t.group_remark = g.group_remark) or t.teamId is null)
WHERE
g.type = 0
and g.rec_status = 0
GROUP BY g.id,t.projectId
ORDER BY g.sequence
)t
on (t.gid = g.id or t.gid is null)
WHERE
g.type = 0
and g.rec_status = 0
)a on (p.id = a.projectId or a.projectId is null)
WHERE
p.type = #{type}
and p.team = 1
and p.`level` = 2
and p.join_rule = 0
and p.rec_status = 0
ORDER BY p.id,a.sequence
</select>
</mapper>

16
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
@ -596,8 +597,8 @@
AND startOrder.rec_status = 0
AND team.rec_status = 0
AND tm.rec_status = 0
group by score.id) t1,
group by score.id) t1
left join
(SELECT
CONCAT(
CASE team.group_remark WHEN 1 THEN '小学' WHEN 2 THEN '中学' WHEN 3 THEN '高职院校' WHEN 4 THEN '本科院校' ELSE '俱乐部'END,
@ -631,14 +632,14 @@
AND team.rec_status = 0
AND tm.rec_status = 0
group by score.id) t2
WHERE
on
t1.groupName = t2.groupName
AND t1.finalScore &lt;= t2.finalScore
AND t1.finalScore &lt; t2.finalScore
GROUP BY t1.groupName, t1.name
order by rangee desc
</select>
<select id="queryCountScorePerson" resultType="com.ccsens.mt.bean.vo.ScoreVo$CountScorePublicity">
select t1.*, count(t2.id) as rangee from
select t1.*, count(t2.id) + 1 as rangee from
(SELECT
competeGroup.group_name as groupName,
player.NAME as name,
@ -666,7 +667,8 @@
AND score.rec_status = 0
AND player.rec_status = 0
AND startOrder.rec_status = 0
AND competeGroup.rec_status = 0)t1,
AND competeGroup.rec_status = 0)t1
left join
(SELECT
competeGroup.group_name as groupName,
player.NAME as name,
@ -695,7 +697,7 @@
AND player.rec_status = 0
AND startOrder.rec_status = 0
AND competeGroup.rec_status = 0)t2
where t1.groupName = t2.groupName and t1.finalScore &lt;= t2.finalScore
on t1.groupName = t2.groupName and t1.finalScore &lt; t2.finalScore
group by t1.id
order by t1.groupName, rangee
</select>

50
mt/src/main/resources/mapper_raw/CompeteCountScoreMapper.xml

@ -3,13 +3,13 @@
<mapper namespace="com.ccsens.mt.persist.mapper.CompeteCountScoreMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.CompeteCountScore">
<id column="id" jdbcType="BIGINT" property="id" />
<id column="should_times" jdbcType="INTEGER" property="shouldTimes" />
<result column="compete_time_id" jdbcType="BIGINT" property="competeTimeId" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="site_order_id" jdbcType="BIGINT" property="siteOrderId" />
<result column="chief_judgment_score" jdbcType="DECIMAL" property="chiefJudgmentScore" />
<result column="judgment_a_score" jdbcType="DECIMAL" property="judgmentAScore" />
<result column="judgment_b_score2" jdbcType="DECIMAL" property="judgmentBScore2" />
<result column="should_times" jdbcType="INTEGER" property="shouldTimes" />
<result column="deduct_times" jdbcType="INTEGER" property="deductTimes" />
<result column="deduct_cause" jdbcType="VARCHAR" property="deductCause" />
<result column="final_score" jdbcType="DECIMAL" property="finalScore" />
@ -76,8 +76,8 @@
</where>
</sql>
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.CompeteCountScoreExample" resultMap="BaseResultMap">
@ -94,17 +94,15 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="com.ccsens.mt.bean.po.CompeteCountScoreKey" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_compete_count_score
where id = #{id,jdbcType=BIGINT}
and should_times = #{shouldTimes,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="com.ccsens.mt.bean.po.CompeteCountScoreKey">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_compete_count_score
where id = #{id,jdbcType=BIGINT}
and should_times = #{shouldTimes,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.CompeteCountScoreExample">
delete from t_compete_count_score
@ -113,14 +111,14 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.CompeteCountScore">
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})
</insert>
@ -130,9 +128,6 @@
<if test="id != null">
id,
</if>
<if test="shouldTimes != null">
should_times,
</if>
<if test="competeTimeId != null">
compete_time_id,
</if>
@ -151,6 +146,9 @@
<if test="judgmentBScore2 != null">
judgment_b_score2,
</if>
<if test="shouldTimes != null">
should_times,
</if>
<if test="deductTimes != null">
deduct_times,
</if>
@ -174,9 +172,6 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="shouldTimes != null">
#{shouldTimes,jdbcType=INTEGER},
</if>
<if test="competeTimeId != null">
#{competeTimeId,jdbcType=BIGINT},
</if>
@ -195,6 +190,9 @@
<if test="judgmentBScore2 != null">
#{judgmentBScore2,jdbcType=DECIMAL},
</if>
<if test="shouldTimes != null">
#{shouldTimes,jdbcType=INTEGER},
</if>
<if test="deductTimes != null">
#{deductTimes,jdbcType=INTEGER},
</if>
@ -227,9 +225,6 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.shouldTimes != null">
should_times = #{record.shouldTimes,jdbcType=INTEGER},
</if>
<if test="record.competeTimeId != null">
compete_time_id = #{record.competeTimeId,jdbcType=BIGINT},
</if>
@ -248,6 +243,9 @@
<if test="record.judgmentBScore2 != null">
judgment_b_score2 = #{record.judgmentBScore2,jdbcType=DECIMAL},
</if>
<if test="record.shouldTimes != null">
should_times = #{record.shouldTimes,jdbcType=INTEGER},
</if>
<if test="record.deductTimes != null">
deduct_times = #{record.deductTimes,jdbcType=INTEGER},
</if>
@ -274,13 +272,13 @@
<update id="updateByExample" parameterType="map">
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 @@
<if test="judgmentBScore2 != null">
judgment_b_score2 = #{judgmentBScore2,jdbcType=DECIMAL},
</if>
<if test="shouldTimes != null">
should_times = #{shouldTimes,jdbcType=INTEGER},
</if>
<if test="deductTimes != null">
deduct_times = #{deductTimes,jdbcType=INTEGER},
</if>
@ -332,7 +333,6 @@
</if>
</set>
where id = #{id,jdbcType=BIGINT}
and should_times = #{shouldTimes,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.CompeteCountScore">
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}
</update>
</mapper>

2
tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java

@ -367,6 +367,8 @@ public class ProjectVo {
private Long memberId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("userId")
private Long userId;
}

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

@ -457,6 +457,7 @@ public class ProMemberService implements IProMemberService {
member = new ProjectVo.MemberList();
member.setMemberId(memberList.get(0).getId());
member.setMemberName(memberList.get(0).getNickname());
member.setUserId(memberList.get(0).getUserId());
}
return member;
}

7
util/src/test/java/com/ccsens/util/OtherTest.java

@ -45,4 +45,11 @@ public class OtherTest {
System.out.println(sd2);
}
@Test
public void test4() {
int a = 119;
int b = 6;
System.out.println(Math.ceil((float)a/(float)b));
}
}

Loading…
Cancel
Save