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. 116
      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. 163
      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; private Long memberId;
@ApiModelProperty("成员名") @ApiModelProperty("成员名")
private String memberName; 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"}) @RequestMapping(value = "/submitScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse submitScore(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.SubmitScore> params) { public JsonResponse submitScore(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.SubmitScore> params) {
log.info("查询比赛项目上的参赛选手列表:{}",params); log.info("查询比赛项目上的参赛选手列表:{}",params);
// competeService.submitScore(params.getParam()); competeService.submitScore(params.getParam());
competeScoreService.submitScore(params.getParam()); competeScoreService.submitScore(params.getParam());
return JsonResponse.newInstance().ok(); 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"}) @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception { 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); 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); return JsonResponse.newInstance().ok(path);
} }
@MustLogin @MustLogin
@ApiOperation(value = "大赛参赛队伍信息表", notes = "") @ApiOperation(value = "大赛参赛队伍信息表", notes = "")
@RequestMapping(value = "/competitionTeamInformationTable", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @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 @NotNull
@ApiModelProperty("裁判id") @ApiModelProperty("裁判id")
private Long judgmentId; private Long judgmentId;
@NotNull
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@NotNull
@ApiModelProperty("裁判是否选择了弃权还是啥的") @ApiModelProperty("裁判是否选择了弃权还是啥的")
private Byte waiver; private Byte waiver = 0;
@NotNull @NotNull
@ApiModelProperty("计分项目") @ApiModelProperty("计分项目")
private List<Fraction> fractionsList; 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.math.BigDecimal;
import java.util.Date; import java.util.Date;
public class CompeteCountScore extends CompeteCountScoreKey implements Serializable { public class CompeteCountScore implements Serializable {
private Long id;
private Long competeTimeId; private Long competeTimeId;
private Long projectId; private Long projectId;
@ -17,6 +19,8 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa
private BigDecimal judgmentBScore2; private BigDecimal judgmentBScore2;
private Integer shouldTimes;
private Integer deductTimes; private Integer deductTimes;
private String deductCause; private String deductCause;
@ -31,6 +35,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCompeteTimeId() { public Long getCompeteTimeId() {
return competeTimeId; return competeTimeId;
} }
@ -79,6 +91,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa
this.judgmentBScore2 = judgmentBScore2; this.judgmentBScore2 = judgmentBScore2;
} }
public Integer getShouldTimes() {
return shouldTimes;
}
public void setShouldTimes(Integer shouldTimes) {
this.shouldTimes = shouldTimes;
}
public Integer getDeductTimes() { public Integer getDeductTimes() {
return deductTimes; return deductTimes;
} }
@ -133,12 +153,14 @@ public class CompeteCountScore extends CompeteCountScoreKey implements Serializa
sb.append(getClass().getSimpleName()); sb.append(getClass().getSimpleName());
sb.append(" ["); sb.append(" [");
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", competeTimeId=").append(competeTimeId); sb.append(", competeTimeId=").append(competeTimeId);
sb.append(", projectId=").append(projectId); sb.append(", projectId=").append(projectId);
sb.append(", siteOrderId=").append(siteOrderId); sb.append(", siteOrderId=").append(siteOrderId);
sb.append(", chiefJudgmentScore=").append(chiefJudgmentScore); sb.append(", chiefJudgmentScore=").append(chiefJudgmentScore);
sb.append(", judgmentAScore=").append(judgmentAScore); sb.append(", judgmentAScore=").append(judgmentAScore);
sb.append(", judgmentBScore2=").append(judgmentBScore2); sb.append(", judgmentBScore2=").append(judgmentBScore2);
sb.append(", shouldTimes=").append(shouldTimes);
sb.append(", deductTimes=").append(deductTimes); sb.append(", deductTimes=").append(deductTimes);
sb.append(", deductCause=").append(deductCause); sb.append(", deductCause=").append(deductCause);
sb.append(", finalScore=").append(finalScore); 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; 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() { public Criteria andCompeteTimeIdIsNull() {
addCriterion("compete_time_id is null"); addCriterion("compete_time_id is null");
return (Criteria) this; return (Criteria) this;
@ -586,6 +526,66 @@ public class CompeteCountScoreExample {
return (Criteria) this; 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() { public Criteria andDeductTimesIsNull() {
addCriterion("deduct_times is null"); addCriterion("deduct_times is null");
return (Criteria) this; return (Criteria) this;

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

@ -1,77 +1,39 @@
package com.ccsens.mt.bean.po;
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.io.Serializable;
public class CompeteCountScoreKey implements Serializable {
public class CompeteCountScoreKey implements Serializable { private Long id;
private Long id;
private Integer shouldTimes;
private Integer shouldTimes;
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
public Long getId() {
public Long getId() { return id;
return id; }
}
public void setId(Long id) {
public void setId(Long id) { this.id = id;
this.id = id; }
}
public Integer getShouldTimes() {
public Integer getShouldTimes() { return shouldTimes;
return shouldTimes; }
}
public void setShouldTimes(Integer shouldTimes) {
public void setShouldTimes(Integer shouldTimes) { this.shouldTimes = shouldTimes;
this.shouldTimes = shouldTimes; }
}
@Override
@Override public String toString() {
public String toString() { StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName());
sb.append(getClass().getSimpleName()); sb.append(" [");
sb.append(" ["); sb.append("Hash = ").append(hashCode());
sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id);
sb.append(", id=").append(id); sb.append(", shouldTimes=").append(shouldTimes);
sb.append(", shouldTimes=").append(shouldTimes); sb.append("]");
sb.append("]"); return sb.toString();
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比赛报名汇总表") @ApiModel("XXX比赛报名汇总表")
public static class CompeteAllCount1{ public static class CompeteAllCount1{
@ApiModelProperty("参赛id") @ApiModelProperty("参赛id")
private String projectId; private long projectId;
@ApiModelProperty()
private int id = (int) projectId;
@ApiModelProperty("参赛项目") @ApiModelProperty("参赛项目")
private String projectName; private String projectName;
@ApiModelProperty("通级 0限制 1不限制") @ApiModelProperty("通级 0限制 1不限制")
private int certificate; private int certificate;
@ApiModelProperty("是否限制组别 0否 1是") @ApiModelProperty("是否限制组别 0否 1是")
private int joinRile; private int joinRule;
@ApiModelProperty("是否是团队 0否 1是")
private int team;
@ApiModelProperty("参赛人数 顺序:小学(男女混)→中学(男女混)→高职院校(男女混)→本科院校(男女混)→俱乐部(男女混)") @ApiModelProperty("参赛人数 顺序:小学(男女混)→中学(男女混)→高职院校(男女混)→本科院校(男女混)→俱乐部(男女混)")
private List<String> nums; private List<String> nums;
@ApiModelProperty("每个组别内的人数") @ApiModelProperty("每个组别内的人数")
@ -205,7 +209,7 @@ public class TableVo {
public int getGames(){ public int getGames(){
if(joinNum != 0 && siteNum != 0) { if(joinNum != 0 && siteNum != 0) {
return (int) Math.ceil(joinNum / siteNum); return (int) Math.ceil((float)joinNum / (float)siteNum);
} }
return 0; 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.CompeteExcelVo;
import com.ccsens.mt.bean.vo.CompeteVo; import com.ccsens.mt.bean.vo.CompeteVo;
import com.ccsens.mt.bean.vo.ProvinceCompeteVo; import com.ccsens.mt.bean.vo.ProvinceCompeteVo;
import com.ccsens.mt.bean.vo.TableVo;
import com.ccsens.mt.persist.mapper.CompeteCompanyMapper; import com.ccsens.mt.persist.mapper.CompeteCompanyMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -152,4 +153,13 @@ public interface CompeteCompanyDao extends CompeteCompanyMapper {
* @return * @return
*/ */
int selectJoinNumByPlayer(@Param("playerId")Long playerId, @Param("competeTimeId")Long competeTimeId); 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 * @return
*/ */
List<TableVo.CompeteAllCount1> getJoinTeamNumByType(@Param("type")byte type); 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.CompeteCountScore;
import com.ccsens.mt.bean.po.CompeteCountScoreExample; import com.ccsens.mt.bean.po.CompeteCountScoreExample;
import com.ccsens.mt.bean.po.CompeteCountScoreKey;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -11,7 +10,7 @@ public interface CompeteCountScoreMapper {
int deleteByExample(CompeteCountScoreExample example); int deleteByExample(CompeteCountScoreExample example);
int deleteByPrimaryKey(CompeteCountScoreKey key); int deleteByPrimaryKey(Long id);
int insert(CompeteCountScore record); int insert(CompeteCountScore record);
@ -19,7 +18,7 @@ public interface CompeteCountScoreMapper {
List<CompeteCountScore> selectByExample(CompeteCountScoreExample example); List<CompeteCountScore> selectByExample(CompeteCountScoreExample example);
CompeteCountScore selectByPrimaryKey(CompeteCountScoreKey key); CompeteCountScore selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CompeteCountScore record, @Param("example") CompeteCountScoreExample example); 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; private CompeteCountScoreMapper competeCountScoreMapper;
@Resource @Resource
private Snowflake snowflake; private Snowflake snowflake;
@Override @Override
public void submitScore(CompeteDto.SubmitScore param) { 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 @Override
public List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSite(CompeteDto.CompeteSite params) { public List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSite(CompeteDto.CompeteSite params) {
Long siteId = params.getSiteId(); Long siteId = params.getSiteId();
List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSites = competeScoreDao.selectCountScoreCurrentSite(siteId); List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSites = competeScoreDao.selectCountScoreCurrentSite(siteId);
countScoreCurrentSites.forEach(mes->{ countScoreCurrentSites.forEach(mes->{

163
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 org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
@ -137,12 +135,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("本项目参加的人数:{}", playerIdOrTeamIdList); log.info("本项目参加的人数:{}", playerIdOrTeamIdList);
if (CollectionUtil.isNotEmpty(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 projectStartTime = projectConfig.getStartTime();
long orderTime = 0; long orderTime = 0;
if (order != 0) { if (order != 0) {
orderTime = (long) Math.floor((projectConfig.getEndTime() - projectStartTime) / order); orderTime = (long) Math.floor(((float)projectConfig.getEndTime() - (float)projectStartTime) / (float)order);
} else { } else {
log.info("场次为0的比赛:{}------{}", project, projectConfig); log.info("场次为0的比赛:{}------{}", project, projectConfig);
} }
@ -172,7 +170,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.updataTask(updateTaskInfo); JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.updataTask(updateTaskInfo);
log.info("修改tall的任务信息后返回:{}", normalTaskJsonResponse); log.info("修改tall的任务信息后返回:{}", normalTaskJsonResponse);
//失败return //失败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; return;
} }
} }
@ -192,7 +195,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask); JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask);
//异常return //异常return
log.info("添加任务后返回:{}", normalTaskJsonResponse); 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; return;
} }
TaskVo.NormalTask normalTask = normalTaskJsonResponse.getData(); TaskVo.NormalTask normalTask = normalTaskJsonResponse.getData();
@ -423,40 +431,71 @@ public class CompeteTaskService implements ICompeteTaskService {
List<ProvinceCompeteVo.QueryJudgment> queryJudgmentList = competeJudgmentDao.queryJudgment(param.getCompeteTimeId(), param.getProjectId()); List<ProvinceCompeteVo.QueryJudgment> queryJudgmentList = competeJudgmentDao.queryJudgment(param.getCompeteTimeId(), param.getProjectId());
if (CollectionUtil.isNotEmpty(queryJudgmentList)) { if (CollectionUtil.isNotEmpty(queryJudgmentList)) {
queryJudgmentList.forEach(projectJudgment -> { queryJudgmentList.forEach(projectJudgment -> {
// for(ProvinceCompeteVo.QueryJudgment projectJudgment : queryJudgmentList){
//裁判数量 //裁判数量
int count = projectJudgment.getProjectType() == 0 ? 3 : 7; int count = projectJudgment.getProjectType() == 0 ? 3 : 7;
for (int i = 0; i < projectJudgment.getSiteNums(); i++) { Map<Integer,Integer> siteMap = new HashMap<>();
if (i < projectJudgment.getSiteList().size()) { Map<Integer,Integer> judgmentMap = new HashMap<>();
ProvinceCompeteVo.ProjectSite siteJudgment = projectJudgment.getSiteList().get(i); projectJudgment.getSiteList().forEach(site-> {
if (CollectionUtil.isEmpty(siteJudgment.getJudgmentList())) { siteMap.put(site.getSiteNum(),site.getSiteNum());
siteJudgment.setJudgmentList(new ArrayList<>()); 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(j);
site.getJudgmentList().add(siteJudgment1);
} }
int a = siteJudgment.getJudgmentList().size(); }
for (int j = 0; j < count - 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(j + 1);
projectJudgment.getSiteList().add(siteJudgment);
for (int x = 0; x < count; x++) {
ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment(); ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
siteJudgment1.setJudgmentNum(a + j); siteJudgment1.setJudgmentNum(x);
siteJudgment.getJudgmentList().add(siteJudgment1); siteJudgment.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++) {
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);
}
}
} }
} }
// } //
// 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);
// }
// }
// }
// }
}); });
} }
return queryJudgmentList; return queryJudgmentList;
@ -532,7 +571,12 @@ public class CompeteTaskService implements ICompeteTaskService {
JsonResponse<MemberVo.RoleInfo> roleJsonResponse = tallFeignClient.saveRole(saveRole); JsonResponse<MemberVo.RoleInfo> roleJsonResponse = tallFeignClient.saveRole(saveRole);
log.info("添加角色后返回:{}", roleJsonResponse); log.info("添加角色后返回:{}", roleJsonResponse);
//失败return //失败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; return;
} }
MemberVo.RoleInfo roleInfo = roleJsonResponse.getData(); MemberVo.RoleInfo roleInfo = roleJsonResponse.getData();
@ -554,37 +598,60 @@ public class CompeteTaskService implements ICompeteTaskService {
Long userId = null; Long userId = null;
//失败return //失败return
if (ObjectUtil.isNull(memberJsonResponse)) { if (ObjectUtil.isNull(memberJsonResponse)) {
log.info("调用tall返回null");
return; return;
} }
if(memberJsonResponse.getCode() != 200 && memberJsonResponse.getCode() != 21){ if(memberJsonResponse.getCode() != 200 && memberJsonResponse.getCode() != 21){
log.info("调用tall异常后返回:{}", memberJsonResponse.getMsg());
return; return;
} }
if(roleJsonResponse.getCode() == 200){ if(roleJsonResponse.getCode() == 200){
MemberVo.Member member = memberJsonResponse.getData(); MemberVo.Member member = memberJsonResponse.getData();
userId = member.getUserId(); if(ObjectUtil.isNotNull(member)){
userId = member.getUserId();
}
} }
//code等于21代表成员已存在 //code等于21代表成员已存在
if (memberJsonResponse.getCode() == 21) { if (memberJsonResponse.getCode() == 21) {
log.info("该成员已存在:{}", memberJsonResponse.getMsg());
//查询该手机号在项目内的成员的id //查询该手机号在项目内的成员的id
MemberRoleDto.GetMemberByPhone getMemberByPhone = new MemberRoleDto.GetMemberByPhone(); MemberRoleDto.GetMemberByPhone getMemberByPhone = new MemberRoleDto.GetMemberByPhone();
getMemberByPhone.setProjectId(tallProjectId); getMemberByPhone.setProjectId(tallProjectId);
getMemberByPhone.setPhone(judgmentInfo.getJudgmentPhone()); getMemberByPhone.setPhone(judgmentInfo.getJudgmentPhone());
getMemberByPhone.setToken(token); getMemberByPhone.setToken(token);
log.info("查找该手机号以前的成员信息:{}", judgmentInfo.getJudgmentPhone());
JsonResponse<MemberVo.MemberList> memberListJsonResponse = tallFeignClient.queryMemberByPhone(getMemberByPhone); JsonResponse<MemberVo.MemberList> memberListJsonResponse = tallFeignClient.queryMemberByPhone(getMemberByPhone);
if (ObjectUtil.isNotNull(memberListJsonResponse)) { log.info("查找该手机号以前的成员信息返回:{}", memberListJsonResponse);
MemberVo.MemberList memberList = memberListJsonResponse.getData(); //失败return
if (ObjectUtil.isNotNull(memberList)) { if (ObjectUtil.isNull(memberListJsonResponse)) {
memberId = memberList.getMemberId(); 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)) { if (ObjectUtil.isNotNull(roleId) && ObjectUtil.isNotNull(memberId)) {
MemberRoleDto.SaveMemberInRole saveMemberInRole = new MemberRoleDto.SaveMemberInRole(); MemberRoleDto.SaveMemberInRole saveMemberInRole = new MemberRoleDto.SaveMemberInRole();
saveMemberInRole.setRoleId(roleId); saveMemberInRole.setRoleId(roleId);
saveMemberInRole.setMemberId(memberId); saveMemberInRole.setMemberId(memberId);
saveMemberInRole.setToken(token); saveMemberInRole.setToken(token);
log.info("将该成员添加至角色内");
JsonResponse jsonResponse = tallFeignClient.saveMemberInRole(saveMemberInRole); 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; return;
} }
} }
@ -610,7 +677,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("在tall内添加任务:{}", addTask); log.info("在tall内添加任务:{}", addTask);
JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask); JsonResponse<TaskVo.NormalTask> normalTaskJsonResponse = tallFeignClient.saveTask(addTask);
log.info("添加任务后返回:{}", normalTaskJsonResponse); 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; return;
} }
if (ObjectUtil.isNotNull(normalTaskJsonResponse)) { if (ObjectUtil.isNotNull(normalTaskJsonResponse)) {
@ -624,7 +696,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("修改tall内任务插件配置:{}", updatePluginConfig); log.info("修改tall内任务插件配置:{}", updatePluginConfig);
JsonResponse<TaskVo.PluginVo> pluginVoJsonResponse = tallFeignClient.updatePluginConfig(updatePluginConfig); JsonResponse<TaskVo.PluginVo> pluginVoJsonResponse = tallFeignClient.updatePluginConfig(updatePluginConfig);
log.info("修改任务插件配置后返回:{}", pluginVoJsonResponse); 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; 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.ProvinceCompeteDto;
import com.ccsens.mt.bean.dto.ScoreDto; import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.po.*; import com.ccsens.mt.bean.po.*;
import com.ccsens.mt.bean.vo.CompeteExcelVo; import com.ccsens.mt.bean.vo.*;
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.persist.dao.*; import com.ccsens.mt.persist.dao.*;
import com.ccsens.mt.persist.mapper.*; import com.ccsens.mt.persist.mapper.*;
import com.ccsens.mt.util.Constant; import com.ccsens.mt.util.Constant;
@ -25,6 +22,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Table;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
@ -40,7 +38,9 @@ import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.LinkedList;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
@ -718,38 +718,58 @@ public class ExcelService implements IExcelService {
} }
private List<TableVo.CompeteOverview> competeJoinCountList(CompeteDto.CompeteTime params) { private List<TableVo.CompeteOverview> competeJoinCountList(CompeteDto.CompeteTime params) {
CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample(); List<TableVo.CompeteOverview> competeOverviewList = competeCompanyDao.selectCompeteJoinCountList(params.getCompeteTimeId());
competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId()); List<TableVo.CompeteOverview> list = new LinkedList<>();
//根据大赛id查公司集合 for (TableVo.CompeteOverview mes : competeOverviewList){
List<CompeteCompany> competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample); if (mes.getCoachNum() != 0 && mes.getGuideNum() != 0 && mes.getPlayerNum() != 0){
List<TableVo.CompeteOverview> competeOverview2List = new ArrayList<>(); int num = mes.getCoachNum()+mes.getPlayerNum()+mes.getGuideNum();
for (CompeteCompany competeCompany : competeCompanyList) { mes.setSum(num);
//每个公司的教练数量 list.add(mes);
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; 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 @Override
public String competeAllCount(CompeteDto.CompeteTime params) throws IOException { 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); String path = getExcelFilePathForCompeteAllCount(competeAllCountList);
return path; return path;
} }
@ -1036,24 +1057,26 @@ public class ExcelService implements IExcelService {
} }
@Override @Override
public List<TableVo.CompeteAllCount1> competeAllCountList1(int type){ public List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeId){
// CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(params.getCompeteTimeId()); CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(competeTimeId);
List<TableVo.CompeteAllCount1> competeAllCountList = new ArrayList<>(); List<TableVo.CompeteAllCount1> competeAllCountList = new ArrayList<>();
// if(ObjectUtil.isNotNull(competeTime)) { if(ObjectUtil.isNotNull(competeTime)){
//查询个人赛的数量统计 //查询个人赛的数量统计
competeAllCountList = competePlayerDao.getJoinNumByType((byte) type); List<TableVo.CompeteAllCount1> nums = competePlayerDao.getJoinNumByType(competeTime.getType());
//查询团体赛的数量统计 competeAllCountList.addAll(nums);
// List<TableVo.CompeteAllCount1> groupNum = competePlayerDao.getJoinTeamNumByType((byte) type);
//查询限制组别的团体赛的统计 //查询限制组别的团体赛的统计
//查询不限组别团体赛的统计 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; return competeAllCountList;
} }
private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount> arrayList) throws IOException { private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount1> arrayList) throws IOException {
//创建excle表格对象 //创建excle表格对象
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
//创建行对象 //创建行对象
@ -1081,43 +1104,52 @@ public class ExcelService implements IExcelService {
//创建整个excel表格对象 //创建整个excel表格对象
Workbook workbook = new XSSFWorkbook(); Workbook workbook = new XSSFWorkbook();
int i = 1; int i = 1;
for (TableVo.CompeteAllCount competeAllCount : arrayList) { for (TableVo.CompeteAllCount1 competeAllCount : arrayList) {
//行对象 //行对象
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>(); List<PoiUtil.PoiUtilCell> cells = new ArrayList<>();
cells.add(new PoiUtil.PoiUtilCell(i + "", 1, 1, 300, 18)); cells.add(new PoiUtil.PoiUtilCell(i + "", 1, 1, 300, 18));
//单元格对象 //单元格对象
PoiUtil.PoiUtilCell poiUtilCel15 = new PoiUtil.PoiUtilCell(competeAllCount.getProjectName()); PoiUtil.PoiUtilCell poiUtilCel15 = new PoiUtil.PoiUtilCell(competeAllCount.getProjectName());
cells.add(poiUtilCel15); cells.add(poiUtilCel15);
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0))); for (int j = 0; j < competeAllCount.getNums().size(); j++) {
cells.add(poiUtilCel); if((competeAllCount.getTeam() == 1 && competeAllCount.getJoinRule() == 1) || (competeAllCount.getCertificate() == 1)){
PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1))); PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j),15,1);
cells.add(poiUtilCell); cells.add(poiUtilCel);
PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2))); }else {
cells.add(poiUtilCel2); PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j));
PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3))); cells.add(poiUtilCel);
cells.add(poiUtilCel3); }
PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4))); }
cells.add(poiUtilCel4); // PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0)));
PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5))); // cells.add(poiUtilCel);
cells.add(poiUtilCel5); // PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1)));
PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6))); // cells.add(poiUtilCell);
cells.add(poiUtilCel6); // PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2)));
PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7))); // cells.add(poiUtilCel2);
cells.add(poiUtilCel7); // PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3)));
PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8))); // cells.add(poiUtilCel3);
cells.add(poiUtilCel8); // PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4)));
PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9))); // cells.add(poiUtilCel4);
cells.add(poiUtilCel9); // PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5)));
PoiUtil.PoiUtilCell poiUtilCel10 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(10))); // cells.add(poiUtilCel5);
cells.add(poiUtilCel10); // PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6)));
PoiUtil.PoiUtilCell poiUtilCel11 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(11))); // cells.add(poiUtilCel6);
cells.add(poiUtilCel11); // PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7)));
PoiUtil.PoiUtilCell poiUtilCel12 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(12))); // cells.add(poiUtilCel7);
cells.add(poiUtilCel12); // PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8)));
PoiUtil.PoiUtilCell poiUtilCel13 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(13))); // cells.add(poiUtilCel8);
cells.add(poiUtilCel13); // PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9)));
PoiUtil.PoiUtilCell poiUtilCel14 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(14))); // cells.add(poiUtilCel9);
cells.add(poiUtilCel14); // 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); list.add(cells);
i++; i++;
} }
@ -1802,7 +1834,7 @@ public class ExcelService implements IExcelService {
} else { } else {
for (int i = 0; i < eights.size(); i++) { for (int i = 0; i < eights.size(); i++) {
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>(); 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)); cells.add(new PoiUtil.PoiUtilCell(eights.get(i).getEightNames(), 8, 1));
raws.add(cells); 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); // String patternExpTable(ScoreDto.ShowResult param);
List<TableVo.CompeteAllCount1> competeAllCountList1(int type); List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeid);
/** /**
* 生成比赛前八名的表格 * 生成比赛前八名的表格
* @param params 第几届比赛 * @param params 第几届比赛

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

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

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

@ -398,4 +398,18 @@
and pp.rec_status = 0 and pp.rec_status = 0
and p.rec_status = 0 and p.rec_status = 0
</select> </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> </mapper>

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

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

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

@ -44,6 +44,8 @@
<id column="projectId" property="projectId"/> <id column="projectId" property="projectId"/>
<result column="projectName" property="projectName"/> <result column="projectName" property="projectName"/>
<result column="certificate" property="certificate"/> <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"> <collection property="joinNum" ofType="com.ccsens.mt.bean.vo.TableVo$JoinGroupNum">
<id column="groupId" property="groupId"/> <id column="groupId" property="groupId"/>
<result column="aNum" property="num"/> <result column="aNum" property="num"/>
@ -332,7 +334,9 @@
p.`name` as projectName, p.`name` as projectName,
p.certificate as certificate, p.certificate as certificate,
a.groupId as groupId, a.groupId as groupId,
a.aNum as aNum a.aNum as aNum,
p.team as team,
p.join_rule as joinRule
FROM FROM
t_compete_project p t_compete_project p
LEFT JOIN( LEFT JOIN(
@ -379,6 +383,86 @@
ORDER BY p.id,a.sequence ORDER BY p.id,a.sequence
</select> </select>
<select id="getJoinTeamNumByType" resultMap="teamNum1"> <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> </select>
</mapper> </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 LEFT JOIN t_compete_company c on p.company_id = c.id
WHERE WHERE
so.id = #{siteId} so.id = #{siteId}
and cs.rec_status = 0
and so.rec_status = 0 and so.rec_status = 0
and cp.rec_status = 0 and cp.rec_status = 0
and pp.rec_status = 0 and pp.rec_status = 0
@ -596,8 +597,8 @@
AND startOrder.rec_status = 0 AND startOrder.rec_status = 0
AND team.rec_status = 0 AND team.rec_status = 0
AND tm.rec_status = 0 AND tm.rec_status = 0
group by score.id) t1, group by score.id) t1
left join
(SELECT (SELECT
CONCAT( CONCAT(
CASE team.group_remark WHEN 1 THEN '小学' WHEN 2 THEN '中学' WHEN 3 THEN '高职院校' WHEN 4 THEN '本科院校' ELSE '俱乐部'END, 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 team.rec_status = 0
AND tm.rec_status = 0 AND tm.rec_status = 0
group by score.id) t2 group by score.id) t2
WHERE on
t1.groupName = t2.groupName t1.groupName = t2.groupName
AND t1.finalScore &lt;= t2.finalScore AND t1.finalScore &lt; t2.finalScore
GROUP BY t1.groupName, t1.name GROUP BY t1.groupName, t1.name
order by rangee desc order by rangee desc
</select> </select>
<select id="queryCountScorePerson" resultType="com.ccsens.mt.bean.vo.ScoreVo$CountScorePublicity"> <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 (SELECT
competeGroup.group_name as groupName, competeGroup.group_name as groupName,
player.NAME as name, player.NAME as name,
@ -666,7 +667,8 @@
AND score.rec_status = 0 AND score.rec_status = 0
AND player.rec_status = 0 AND player.rec_status = 0
AND startOrder.rec_status = 0 AND startOrder.rec_status = 0
AND competeGroup.rec_status = 0)t1, AND competeGroup.rec_status = 0)t1
left join
(SELECT (SELECT
competeGroup.group_name as groupName, competeGroup.group_name as groupName,
player.NAME as name, player.NAME as name,
@ -695,7 +697,7 @@
AND player.rec_status = 0 AND player.rec_status = 0
AND startOrder.rec_status = 0 AND startOrder.rec_status = 0
AND competeGroup.rec_status = 0)t2 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 group by t1.id
order by t1.groupName, rangee order by t1.groupName, rangee
</select> </select>

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

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

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

@ -367,6 +367,8 @@ public class ProjectVo {
private Long memberId; private Long memberId;
@ApiModelProperty("成员名") @ApiModelProperty("成员名")
private String memberName; 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 = new ProjectVo.MemberList();
member.setMemberId(memberList.get(0).getId()); member.setMemberId(memberList.get(0).getId());
member.setMemberName(memberList.get(0).getNickname()); member.setMemberName(memberList.get(0).getNickname());
member.setUserId(memberList.get(0).getUserId());
} }
return member; return member;
} }

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

@ -45,4 +45,11 @@ public class OtherTest {
System.out.println(sd2); 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