Browse Source

修改

tiaosheng
wang0018 5 years ago
parent
commit
b351c0980c
  1. 5
      mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java
  2. 9
      mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java
  3. 11
      mt/src/main/java/com/ccsens/mt/api/ExcelController.java
  4. 9
      mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java
  5. 15
      mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java
  6. 2
      mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java
  7. 1
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteVideoDao.java
  8. 102
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  9. 12
      mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java
  10. 246
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  11. 2
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java
  12. 5
      mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java
  13. 2
      mt/src/main/java/com/ccsens/mt/service/IExcelService.java
  14. 4
      mt/src/main/resources/application.yml
  15. 18
      mt/src/main/resources/mapper_dao/CompeteVideoDao.xml

5
mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java

@ -8,6 +8,7 @@ import com.ccsens.mt.bean.vo.ScoreVo;
import com.ccsens.mt.service.ICompeteService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
@ -64,9 +65,9 @@ public class CompeteScoreController {
@ApiOperation(value = "花样赛成绩查看", notes = "Mr.王 -----从花样赛成绩表里面查看出这个人得成绩")
@RequestMapping(value = "/showResult", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<CompeteVo.TotalScoreDisplay>> showResult (@ApiParam @Validated @RequestBody QueryDto<ScoreDto.ShowResult> params){
public JsonResponse<PageInfo<CompeteVo.TotalScoreDisplay>> showResult (@ApiParam @Validated @RequestBody QueryDto<ScoreDto.ShowResult> params){
log.info("花样赛详细分数查看:{}",params);
List<CompeteVo.TotalScoreDisplay> totalScoreDisplaysList= competeService.showResult(params.getParam());
PageInfo<CompeteVo.TotalScoreDisplay> totalScoreDisplaysList= competeService.showResultPage(params.getParam());
return JsonResponse.newInstance().ok(totalScoreDisplaysList);
}

9
mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java

@ -7,6 +7,7 @@ import com.ccsens.mt.bean.vo.VideoProjectVo;
import com.ccsens.mt.service.ICompeteVedioService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
@ -60,17 +61,17 @@ public class CompeteVideoController {
@MustLogin
@ApiOperation(value = "查看单位签到状态(签到用)(有筛选)", notes = "Mr.王---------查看单位的人的最近一条的签到状态")
@RequestMapping(value = "/selectUserStatus", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<VideoProjectVo.PeoSignStatu>> selectCompanySignStatus(@ApiParam @Validated @RequestBody QueryDto<VideoDto.GetSignStatus> params) {
public JsonResponse<PageInfo<VideoProjectVo.PeoSignStatu>> selectCompanySignStatus(@ApiParam @Validated @RequestBody QueryDto<VideoDto.GetSignStatus> params) {
log.info("查看单位签到状态(签到用):{}",params);
List<VideoProjectVo.PeoSignStatu> peoSignStatus = iCompeteVedioService.selectCompanySignStatus(params);
PageInfo<VideoProjectVo.PeoSignStatu> peoSignStatus = iCompeteVedioService.selectCompanySignStatus(params);
return JsonResponse.newInstance().ok(peoSignStatus);
}
@MustLogin
@ApiOperation(value = "查看教练签到状态(签到用)", notes = "Mr.王---------查看教练的人的签到状态")
@RequestMapping(value = "/selectCoachStatus", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<VideoProjectVo.CoachSignStatu>> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto<VideoDto.GetSignStatus> params) {
public JsonResponse<PageInfo<VideoProjectVo.CoachSignStatu>> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto<VideoDto.GetSignStatus> params) {
log.info("查看教练签到状态(签到用):{}",params);
List<VideoProjectVo.CoachSignStatu> coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params);
PageInfo<VideoProjectVo.CoachSignStatu> coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params);
return JsonResponse.newInstance().ok(coachSignStatus);
}

11
mt/src/main/java/com/ccsens/mt/api/ExcelController.java

@ -124,12 +124,19 @@ public class ExcelController {
return JsonResponse.newInstance().ok(schedulePlanDetailList);
}
@MustLogin
@ApiOperation(value = "花样赛成绩导出(导出)", notes = "")
@ApiOperation(value = "花样赛成绩导出(导出)", notes = "100715")
@RequestMapping(value = "/patternExpTable", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse patternExpTable(@ApiParam @Validated @RequestBody QueryDto<ScoreDto.ShowResult> params) {
log.info("参赛人数统计表:{}",params);
String path = excelService.patternExpTable(params.getParam());
return JsonResponse.newInstance().ok(path);
}
@MustLogin
@ApiOperation(value = "花样赛成绩导出(导出)", notes = "100715")
@RequestMapping(value = "/countExpTable", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse countExpTable(@ApiParam @Validated @RequestBody QueryDto<ScoreDto.ShowResult> params) {
log.info("参赛人数统计表:{}",params);
String path = excelService.countExpTable(params.getParam());
return JsonResponse.newInstance().ok(path);
}
}

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

@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
@ -129,6 +131,13 @@ public class ScoreDto {
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ApiModelProperty("每页多少条")
@Min(value = 1)
@Max(value=100)
private int pageSize = 10;
}
@Data
@ApiModel

15
mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java

@ -1,10 +1,15 @@
package com.ccsens.mt.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.Date;
/**
* @author
@ -98,8 +103,16 @@ public class VideoDto {
private String name;
@ApiModelProperty("账号")
private String phone;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("签到时间")
private Long signEndTime;
private Date signEndTime;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ApiModelProperty("每页多少条")
@Min(value = 1)
@Max(value=100)
private int pageSize = 10;
}
}

2
mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java

@ -494,6 +494,8 @@ public class CompeteVo {
public BigDecimal result = new BigDecimal(0);
@ApiModelProperty("排名")
public int order;
@ApiModelProperty("备注")
public Byte remark;
}
@Data

1
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteVideoDao.java

@ -3,6 +3,7 @@ package com.ccsens.mt.persist.dao;
import com.ccsens.mt.bean.dto.VideoDto;
import com.ccsens.mt.bean.vo.VideoProjectVo;
import com.ccsens.mt.persist.mapper.CompeteCompanyMapper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;

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

@ -21,6 +21,8 @@ import com.ccsens.mt.util.Constant;
import com.ccsens.util.*;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@ -99,6 +101,105 @@ public class CompeteService implements ICompeteService {
private CompetePlayerMapper competePlayerMapper;
@Resource
private CompeteJudgmentMapper competeJudgmentMapper;
@Override
public PageInfo<CompeteVo.TotalScoreDisplay> showResultPage(ScoreDto.ShowResult param) {
PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<CompeteVo.TotalScoreDisplay> totalScoreDisplaysList=new ArrayList<>();
CompeteStartOrderExample competeStartOrderExample =new CompeteStartOrderExample();
competeStartOrderExample.createCriteria().andProjectIdEqualTo(param.getProjectId()).andRecStatusEqualTo((byte) 0);
List<CompeteStartOrder> competeStartOrdersList = competeStartOrderMapper.selectByExample(competeStartOrderExample);
competeStartOrdersList.forEach(competeStartOrder -> {
//一个人或者一个团队得数据
CompeteVo.TotalScoreDisplay totalScoreDisplay = new CompeteVo.TotalScoreDisplay();
totalScoreDisplay.setRemark(totalScoreDisplay.getRemark());
//名字
if(competeStartOrder.getTeam().equals((byte) 0)){
//个人人名
CompetePlayer player = competePlayerDao.selectByPrimaryKey(competeStartOrder.getPlayerId());
if(ObjectUtil.isNotNull(player)) {
totalScoreDisplay.setPeopleName(player.getName());
//个人所属团队名
CompeteCompany competeCompany = competeCompanyMapper.selectByPrimaryKey(player.getCompanyId());
if (ObjectUtil.isNotNull(competeCompany)){
totalScoreDisplay.setCompanyName(competeCompany.getName());
}
}
}else {
//团体名
CompeteTeam competeTeam = competeTeamDao.selectByPrimaryKey(competeStartOrder.getPlayerId());
CompeteCompany competeCompany =competeCompanyMapper.selectByPrimaryKey(competeTeam.getCompanyId());
totalScoreDisplay.setCompanyName(competeCompany.getName());
//团队人名
CompeteTeamMemberExample competeTeamMemberExample = new CompeteTeamMemberExample();
competeTeamMemberExample.createCriteria().andCompeteTeamIdEqualTo(competeTeam.getId());
List<CompeteTeamMember> competeTeamMemberList = competeTeamMemberMapper.selectByExample(competeTeamMemberExample);
StringBuilder stringBuilder=new StringBuilder("");
competeTeamMemberList.forEach(mes->{
CompetePlayer competePlayer = competePlayerDao.selectByPrimaryKey(mes.getPlayerId());
stringBuilder.append(competePlayer.getName());
});
totalScoreDisplay.setPeopleName(stringBuilder.toString());
totalScoreDisplay.setPeopleName(stringBuilder.toString().substring(0,stringBuilder.length()));
}
List<CompeteVo.Result> results = competeTimeDao.selectJudgmentS(competeStartOrder.getId());
//7个教练成绩也上去了
for (CompeteVo.Result r :results){
if(r.getChief()==0){
totalScoreDisplay.setReferee0(r.getScore());
}else if(r.getChief()==1){
totalScoreDisplay.setReferee1(r.getScore());
}else if(r.getChief()==2){
totalScoreDisplay.setReferee2(r.getScore());
}else if(r.getChief()==3){
totalScoreDisplay.setReferee3(r.getScore());
}else if(r.getChief()==4){
totalScoreDisplay.setReferee4(r.getScore());
}else if(r.getChief()==5){
totalScoreDisplay.setReferee5(r.getScore());
}else if(r.getChief()==6){
totalScoreDisplay.setReferee6(r.getScore());
}
}
BigDecimal bigDecimal1to3=new BigDecimal(0);
bigDecimal1to3.add(totalScoreDisplay.getReferee1()).add(totalScoreDisplay.getReferee2()).add(totalScoreDisplay.getReferee3());
BigDecimal bigDecimalavg1to3=new BigDecimal(0);
BigDecimal bignum=new BigDecimal(3);
totalScoreDisplay.setAvg1To3(bigDecimalavg1to3.divide(bignum,2,BigDecimal.ROUND_HALF_UP));
BigDecimal bigDecimal4to6=new BigDecimal(0);
bigDecimal4to6.add(totalScoreDisplay.getReferee4()).add(totalScoreDisplay.getReferee5()).add(totalScoreDisplay.getReferee6());
BigDecimal bigDecimalavg4to6=new BigDecimal(0);
BigDecimal bignum1=new BigDecimal(3);
totalScoreDisplay.setAvg4To6(bigDecimalavg4to6.divide(bignum1,2,BigDecimal.ROUND_HALF_UP));
//总成绩也出来了
BigDecimal re=new BigDecimal(0);
re.add(totalScoreDisplay.getAvg1To3()).add(totalScoreDisplay.getAvg4To6()).subtract(totalScoreDisplay.getReferee0());
totalScoreDisplay.setResult(re);
totalScoreDisplaysList.add(totalScoreDisplay);
});
for (int i = 0; i < totalScoreDisplaysList.size() - 1; i++) {
for (int j = 1; j < totalScoreDisplaysList.size() - i; j++) {
BigDecimal b1 = totalScoreDisplaysList.get(j - 1).getResult();
BigDecimal b2 = totalScoreDisplaysList.get(j).getResult();
CompeteVo.TotalScoreDisplay a;
if (b1.compareTo(b2) < 0) {
a = totalScoreDisplaysList.get(j - 1);
totalScoreDisplaysList.set((j - 1), totalScoreDisplaysList.get(j));
totalScoreDisplaysList.set(j, a);
}
}
}
for (int i=0; i<totalScoreDisplaysList.size();i++){
CompeteVo.TotalScoreDisplay totalScoreDisplay = totalScoreDisplaysList.get(i);
totalScoreDisplay.setOrder(i+1);
}
return new PageInfo<>(totalScoreDisplaysList);
}
/**
* 花样赛总成绩展示
* @param param
@ -112,6 +213,7 @@ public class CompeteService implements ICompeteService {
competeStartOrdersList.forEach(competeStartOrder -> {
//一个人或者一个团队得数据
CompeteVo.TotalScoreDisplay totalScoreDisplay = new CompeteVo.TotalScoreDisplay();
totalScoreDisplay.setRemark(totalScoreDisplay.getRemark());
//项目名
// CompeteProject project = competeProjectMapper.selectByPrimaryKey(competeStartOrder.getProjectId());
// if(ObjectUtil.isNotNull(project)) {

12
mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java

@ -12,6 +12,8 @@ import com.ccsens.mt.persist.mapper.CompetePlayerLookMapper;
import com.ccsens.mt.persist.mapper.CompeteProjectMapper;
import com.ccsens.mt.persist.mapper.CompeteVideoMapper;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -116,8 +118,9 @@ public class CompeteVedioService implements ICompeteVedioService{
* @return
*/
@Override
public List<VideoProjectVo.PeoSignStatu> selectCompanySignStatus(QueryDto<VideoDto.GetSignStatus> params) {
return competeVideoDao.selectCompanySignStatus(params.getParam());
public PageInfo<VideoProjectVo.PeoSignStatu> selectCompanySignStatus(QueryDto<VideoDto.GetSignStatus> params) {
PageHelper.startPage(params.getParam().getPageNum(),params.getParam().getPageSize());
return new PageInfo<>(competeVideoDao.selectCompanySignStatus(params.getParam()));
}
/**
* 查看教练的签到状态
@ -125,9 +128,10 @@ public class CompeteVedioService implements ICompeteVedioService{
* @return
*/
@Override
public List<VideoProjectVo.CoachSignStatu> selectCoachSignStatus(QueryDto<VideoDto.GetSignStatus> params) {
public PageInfo<VideoProjectVo.CoachSignStatu> selectCoachSignStatus(QueryDto<VideoDto.GetSignStatus> params) {
PageHelper.startPage(params.getParam().getPageNum(),params.getParam().getPageSize());
log.info(params.getParam().toString());
return competeVideoDao.selectCoachSignStatus(params.getParam());
return new PageInfo<>(competeVideoDao.selectCoachSignStatus(params.getParam()));
}

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

@ -9,6 +9,7 @@ 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.persist.dao.*;
import com.ccsens.mt.persist.mapper.*;
@ -24,9 +25,12 @@ import com.ctc.wstx.util.DataUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.poi.POIDocument;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.eclipse.jetty.util.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -82,10 +86,11 @@ public class ExcelService implements IExcelService {
private CompeteProjectConfigDao competeProjectConfigDao;
@Resource
private CompeteProjectDao competeProjectDao;
@Resource
private CompeteScoreDao competeScoreDao;
@Resource
private ICompeteService competeService;
@Override
public String dasaiduiwuxinxiWPS(QueryDto<CompeteDto.CompeteTime> params) {
//这个里面包含联系人得信息
@ -1378,17 +1383,21 @@ public class ExcelService implements IExcelService {
public String patternExpTable(ScoreDto.ShowResult param) {
List<CompeteVo.TotalScoreDisplay> totalScoreDisplays = competeService.showResult(param);
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
List<PoiUtil.PoiUtilCell> zero=new ArrayList<>();
PoiUtil.PoiUtilCell zeroOne=new PoiUtil.PoiUtilCell("比赛成绩公示(花样赛)", 14, 1);
zero.add(zeroOne);
list.add(zero);
List<PoiUtil.PoiUtilCell> one=new ArrayList<>();
PoiUtil.PoiUtilCell oneOne=new PoiUtil.PoiUtilCell("参赛单位", 1, 1);
PoiUtil.PoiUtilCell oneTwo=new PoiUtil.PoiUtilCell("参赛队员", 1, 1);
PoiUtil.PoiUtilCell oneThree=new PoiUtil.PoiUtilCell("创意编排分", 3, 1);
PoiUtil.PoiUtilCell oneFour=new PoiUtil.PoiUtilCell("创意最后得分", 1, 1);
PoiUtil.PoiUtilCell oneFive=new PoiUtil.PoiUtilCell("完成质量分", 3, 1);
PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("完成最后得分", 1, 1);
PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("主裁判扣分", 1, 1);
PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("最后得分", 1, 1);
PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("名次", 1, 1);
PoiUtil.PoiUtilCell oneTen=new PoiUtil.PoiUtilCell("备注", 1, 1);
PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("完成最后得分", 1, 2);
PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("主裁判扣分", 1, 2);
PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("最后得分", 1, 2);
PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("名次", 1, 2);
PoiUtil.PoiUtilCell oneTen=new PoiUtil.PoiUtilCell("备注", 1, 2);
one.add(oneOne);
one.add(oneTwo);
one.add(oneThree);
@ -1400,21 +1409,228 @@ public class ExcelService implements IExcelService {
one.add(oneNine);
one.add(oneTen);
list.add(one);
List<PoiUtil.PoiUtilCell> two = new ArrayList<>();
PoiUtil.PoiUtilCell twoOne = new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoTwo = new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoThree = new PoiUtil.PoiUtilCell("1", 1, 1);
PoiUtil.PoiUtilCell twoFour = new PoiUtil.PoiUtilCell("2", 1, 1);
PoiUtil.PoiUtilCell twoFive = new PoiUtil.PoiUtilCell("3", 1, 1);
PoiUtil.PoiUtilCell twoSix = new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoSeven = new PoiUtil.PoiUtilCell("1", 1, 1);
PoiUtil.PoiUtilCell twoEight = new PoiUtil.PoiUtilCell("2", 1, 1);
PoiUtil.PoiUtilCell twoNight = new PoiUtil.PoiUtilCell("3", 1, 1);
two.add(twoOne);
two.add(twoTwo);
two.add(twoThree);
two.add(twoFour);
two.add(twoFive);
two.add(twoSix);
two.add(twoSeven);
two.add(twoEight);
two.add(twoNight);
list.add(two);
totalScoreDisplays.forEach(mes->{
List<PoiUtil.PoiUtilCell> three = new ArrayList<>();
PoiUtil.PoiUtilCell threeOne = new PoiUtil.PoiUtilCell(mes.getCompanyName(), 1, 1);
PoiUtil.PoiUtilCell threeTwo = new PoiUtil.PoiUtilCell(mes.getPeopleName(), 1, 1);
three.add(threeOne);
three.add(threeTwo);
if(mes.getRemark()==(byte)0){
PoiUtil.PoiUtilCell threeThree=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee1()),1,1);
PoiUtil.PoiUtilCell threeFive=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee2()),1,1);
PoiUtil.PoiUtilCell threeSix=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee3()),1,1);
PoiUtil.PoiUtilCell threeSeven=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getAvg1To3()),1,1);
PoiUtil.PoiUtilCell threeEight=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee4()),1,1);
PoiUtil.PoiUtilCell threeNight=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee5()),1,1);
PoiUtil.PoiUtilCell threeTen=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee6()),1,1);
PoiUtil.PoiUtilCell threeEle=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getAvg4To6()),1,1);
PoiUtil.PoiUtilCell threeTwe=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getReferee0()),1,1);
PoiUtil.PoiUtilCell threeThir=new PoiUtil.PoiUtilCell((StringUtil.valueOf(mes.getResult())),1,1);
PoiUtil.PoiUtilCell threeFour=new PoiUtil.PoiUtilCell((StringUtil.valueOf(mes.getOrder())),1,1);
three.add(threeThree);
three.add(threeFive);
three.add(threeSix);
three.add(threeSeven);
three.add(threeEight);
three.add(threeNight);
three.add(threeTen);
three.add(threeEle);
three.add(threeTwe);
three.add(threeThir);
three.add(threeFour);
}else {
PoiUtil.PoiUtilCell threeThree=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeFive=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeSix=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeSeven=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getAvg1To3()),1,1);
PoiUtil.PoiUtilCell threeEight=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeNight=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeTen=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeEle=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getAvg4To6()),1,1);
PoiUtil.PoiUtilCell threeTwe=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeThir=new PoiUtil.PoiUtilCell((StringUtil.valueOf(mes.getResult())),1,1);
PoiUtil.PoiUtilCell threeFour=new PoiUtil.PoiUtilCell("",1,1);
PoiUtil.PoiUtilCell threeFif=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL,1,1);
if(mes.getRemark()==(byte)1){
threeFif.setValue("弃权");
}else {
threeFif.setValue("取消比赛资格");
}
three.add(threeThree);
three.add(threeFive);
three.add(threeSix);
three.add(threeSeven);
three.add(threeEight);
three.add(threeNight);
three.add(threeTen);
three.add(threeEle);
three.add(threeTwe);
three.add(threeThir);
three.add(threeFour);
three.add(threeFif);
}
list.add(three);
});
List<PoiUtil.PoiUtilCell> four = new ArrayList<>();
PoiUtil.PoiUtilCell fourOne = new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell fourTwo = new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell fourThree = new PoiUtil.PoiUtilCell("裁判1", 1, 1);
PoiUtil.PoiUtilCell fourFour = new PoiUtil.PoiUtilCell("裁判2", 1, 1);
PoiUtil.PoiUtilCell fourFive = new PoiUtil.PoiUtilCell("裁判3", 1, 1);
PoiUtil.PoiUtilCell fourSix = new PoiUtil.PoiUtilCell("创意分平均", 1, 1);
PoiUtil.PoiUtilCell fourSeven = new PoiUtil.PoiUtilCell("裁判1", 1, 1);
PoiUtil.PoiUtilCell fourEigth = new PoiUtil.PoiUtilCell("裁判2", 1, 1);
PoiUtil.PoiUtilCell fourNine = new PoiUtil.PoiUtilCell("裁判3", 1, 1);
PoiUtil.PoiUtilCell fourTen = new PoiUtil.PoiUtilCell("完成分平均", 1, 1);
PoiUtil.PoiUtilCell fourEle = new PoiUtil.PoiUtilCell("主裁", 1, 1);
PoiUtil.PoiUtilCell fourTwe = new PoiUtil.PoiUtilCell("=创意分平均+完成分平均-主裁判扣分", 1, 1);
four.add(fourOne);
four.add(fourTwo);
four.add(fourThree);
four.add(fourFour);
four.add(fourFive);
four.add(fourSix);
four.add(fourSeven);
four.add(fourEigth);
four.add(fourNine);
four.add(fourTen);
four.add(fourEle);
four.add(fourTwe);
list.add(four);
Workbook workbook = new XSSFWorkbook();
PoiUtil.exportWB("花样赛成绩表公示",list,workbook);
String filepath = "mt/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
String path = PropUtil.path + filepath;
File tmpFile = new File(path);
if (!tmpFile.getParentFile().exists()) {
tmpFile.getParentFile().mkdirs();
}
File file = new File(path);
try {
OutputStream outputStream = new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return PropUtil.domain + "file/download/know?path="+path;
}
@Override
public String countExpTable(ScoreDto.ShowResult param) {
List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSiteList = new ArrayList<>();
CompeteProject competeProject = competeProjectMapper.selectByPrimaryKey(param.getProjectId());
if(ObjectUtil.isNotNull(competeProject)) {
if(competeProject.getTeam() == 0) {
countScoreCurrentSiteList = competeScoreDao.queryCountScoreAll(param.getProjectId());
}else {
countScoreCurrentSiteList = competeScoreDao.queryCountScoreAllByTeam(param.getProjectId());
}
}
List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSites = countScoreCurrentSiteList;
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
List<PoiUtil.PoiUtilCell> zero=new ArrayList<>();
PoiUtil.PoiUtilCell zeroOne=new PoiUtil.PoiUtilCell("比赛成绩公示(计数赛)", 10, 1);
zero.add(zeroOne);
list.add(zero);
List<PoiUtil.PoiUtilCell> one=new ArrayList<>();
PoiUtil.PoiUtilCell oneOne=new PoiUtil.PoiUtilCell("组别", 1, 2);
PoiUtil.PoiUtilCell oneTwo=new PoiUtil.PoiUtilCell("参赛单位", 1, 2);
PoiUtil.PoiUtilCell oneThree=new PoiUtil.PoiUtilCell("姓名", 1, 2);
PoiUtil.PoiUtilCell oneFour=new PoiUtil.PoiUtilCell("成绩", 2, 1);
PoiUtil.PoiUtilCell oneFive=new PoiUtil.PoiUtilCell("总成绩", 1, 2);
PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("扣除次数", 1, 2);
PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("最终成绩", 1, 2);
PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名词", 1, 2);
PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("备注", 1, 2);
one.add(oneOne);
one.add(oneTwo);
one.add(oneThree);
one.add(oneFour);
one.add(oneFive);
one.add(oneSix);
one.add(oneSeven);
one.add(oneEight);
one.add(oneNine);
list.add(one);
List<PoiUtil.PoiUtilCell> two=new ArrayList<>();
PoiUtil.PoiUtilCell twoOne=new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoTwo=new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoThree=new PoiUtil.PoiUtilCell("1", 1, 1);
PoiUtil.PoiUtilCell twoFour=new PoiUtil.PoiUtilCell("2", 1, 1);
PoiUtil.PoiUtilCell twoFive=new PoiUtil.PoiUtilCell("3", 1, 1);
PoiUtil.PoiUtilCell twoSix=new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoSeven=new PoiUtil.PoiUtilCell("1", 1, 1);
PoiUtil.PoiUtilCell twoEight=new PoiUtil.PoiUtilCell("2", 1, 1);
PoiUtil.PoiUtilCell twoNight=new PoiUtil.PoiUtilCell("3", 1, 1);
PoiUtil.PoiUtilCell twoThree=new PoiUtil.PoiUtilCell();
PoiUtil.PoiUtilCell twoFour=new PoiUtil.PoiUtilCell("1", 1, 1);
PoiUtil.PoiUtilCell twoFive=new PoiUtil.PoiUtilCell("2", 1, 1);
two.add(twoOne);
two.add(twoTwo);
two.add(twoThree);
two.add(twoFour);
return null;
two.add(twoFive);
list.add(two);
countScoreCurrentSites.forEach(mes->{
List<PoiUtil.PoiUtilCell> three=new ArrayList<>();
PoiUtil.PoiUtilCell threeOne=new PoiUtil.PoiUtilCell(mes.getGroupName(),1,1);
PoiUtil.PoiUtilCell threeTwo=new PoiUtil.PoiUtilCell(mes.getCompanyName(),1,1);
PoiUtil.PoiUtilCell threeThree=new PoiUtil.PoiUtilCell(mes.getName(),1,1);
PoiUtil.PoiUtilCell threeFour=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getMainOneScore()),1,1);
PoiUtil.PoiUtilCell threeFive=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getMainTwoScore()),1,1);
PoiUtil.PoiUtilCell threeSix=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getShouldScore()),1,1);
PoiUtil.PoiUtilCell threeSeven=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getDeductTime()),1,1);
PoiUtil.PoiUtilCell threeEight=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getFinalScore()),1,1);
PoiUtil.PoiUtilCell threeNine=new PoiUtil.PoiUtilCell(StringUtil.valueOf(mes.getRangee()),1,1);
PoiUtil.PoiUtilCell threeTen=new PoiUtil.PoiUtilCell(mes.getRemark(),1,1);
three.add(threeOne);
three.add(threeTwo);
three.add(threeThree);
three.add(threeFour);
three.add(threeFive);
three.add(threeSix);
three.add(threeSeven);
three.add(threeEight);
three.add(threeNine);
three.add(threeTen);
list.add(three);
});
Workbook workbook = new XSSFWorkbook();
PoiUtil.exportWB("计数赛成绩公示",list,workbook);
String filepath = "mt/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
String path = PropUtil.path + filepath;
File tmpFile = new File(path);
if (!tmpFile.getParentFile().exists()) {
tmpFile.getParentFile().mkdirs();
}
File file = new File(path);
try {
OutputStream outputStream = new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return PropUtil.domain + "file/download/know?path="+path;
}
}

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

@ -5,6 +5,7 @@ import com.ccsens.mt.bean.dto.ScoreDto;
import com.ccsens.mt.bean.vo.CompeteVo;
import com.ccsens.mt.bean.vo.ScoreVo;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import java.io.FileNotFoundException;
import java.io.IOException;
@ -154,6 +155,7 @@ public interface ICompeteService {
void submitOrderList(ScoreDto.InformationSubmitted param);
PageInfo<CompeteVo.TotalScoreDisplay> showResultPage(ScoreDto.ShowResult param);
List<CompeteVo.TotalScoreDisplay> showResult(ScoreDto.ShowResult param);

5
mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java

@ -4,6 +4,7 @@ import com.ccsens.mt.bean.dto.VideoDto;
import com.ccsens.mt.bean.po.CompetePlayerLook;
import com.ccsens.mt.bean.vo.VideoProjectVo;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import java.util.List;
@ -28,7 +29,7 @@ public interface ICompeteVedioService {
List<VideoProjectVo.GetAllCompany> selectAllCompany(QueryDto<VideoDto.GetAllCompany> params);
List<VideoProjectVo.PeoSignStatu> selectCompanySignStatus(QueryDto<VideoDto.GetSignStatus> params);
PageInfo<VideoProjectVo.PeoSignStatu> selectCompanySignStatus(QueryDto<VideoDto.GetSignStatus> params);
List<VideoProjectVo.CoachSignStatu> selectCoachSignStatus(QueryDto<VideoDto.GetSignStatus> params);
PageInfo<VideoProjectVo.CoachSignStatu> selectCoachSignStatus(QueryDto<VideoDto.GetSignStatus> params);
}

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

@ -86,4 +86,6 @@ public interface IExcelService {
List<TableVo.SchedulePlanDetail> schedulePlanning(CompeteDto.CompeteTime params);
String patternExpTable(ScoreDto.ShowResult param);
String countExpTable(ScoreDto.ShowResult param);
}

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

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

18
mt/src/main/resources/mapper_dao/CompeteVideoDao.xml

@ -14,17 +14,17 @@
select company_id,max(look_time) as `look_time`
FROM t_compete_player_look
where `rec_status`=0
<if test="param.signEndTime!=null and param.signEndTime!=0">
and t_compete_player_look.`look_time` &lt;= #{param.signEndTime}
<if test="param.signEndTime!=null">
and t_compete_player_look.`look_time` &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if>
) tcpl on tcpl.company_id=tcc.id
where
tct.id= #{param.id}
<if test="param.name!=null and param.name!=''">
and tcc.`name`=#{param.name}
and tcc.`name` like concat('%',#{param.name},'%')
</if>
<if test="param.phone!=null and param.phone!=''">
and tcc.`contacts_name`=#{param.phone}
and tcc.`contacts_name` like concat('%',#{param.phone},'%')
</if>
and tcc.`rec_status`=0
and tct.`rec_status`=0
@ -43,18 +43,18 @@
user_id
From tall.t_sys_log
where `url`='/users/signin' and `rec_status`=0
<if test="param.signEndTime!=null and param.signEndTime!=0">
and tall.t_sys_log.created_at &lt;= #{param.signEndTime}
<if test="param.signEndTime!=null">
and tall.t_sys_log.created_at &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if>
) tt on tt.`user_id`=tcj.`user_id`
LEFT JOIN t_compete_time tct on tct.id =tcj.`compete_time_id`
WHERE
tct.id=#{param.id}
<if test="param.name!=null and param.name!=''">
and tcj.`name`=#{param.name}
and tcj.`name` like CONCAT('%',#{param.name},'%')
</if>
<if test="param.phone!=null and param.phone!='' ">
and tcj.`phone`=#{param.phone}
<if test="param.phone!=null and param.phone!=''">
and tcj.`phone`like concat('%',#{param.phone},'%')
</if>
and tcj.`rec_status`=0
and tct.`rec_status`=0

Loading…
Cancel
Save