Browse Source

20210526修改跳绳比赛导出表格

recovery
zy_Java 4 years ago
parent
commit
b20ea3be4e
  1. 3
      mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java
  2. 4
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java
  3. 262
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  4. 4
      mt/src/main/resources/druid-dev.yml
  5. 16
      mt/src/main/resources/mapper_dao/CompetePlayerDao.xml
  6. 32
      mt/src/main/resources/mapper_dao/CompeteProjectDao.xml
  7. 6
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml
  8. 6
      tall/src/main/resources/application-dev.yml
  9. 4
      tall/src/main/resources/application.yml

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

@ -4,6 +4,7 @@ package com.ccsens.mt.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -170,6 +171,8 @@ public class TableVo {
public static class JoinGroupNum{
@ApiModelProperty("组别id")
private Long groupId;
@JsonIgnore
private String groupName;
@ApiModelProperty("人数")
private String num;
}

4
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java

@ -102,13 +102,13 @@ public interface CompeteScoreDao {
*/
CompeteVo.OneScore getVarietyScore(@Param("projectId") Long projectId, @Param("siteOrderId")Long siteOrderId);
List<CompeteVo.DaiBiaoDUi> selAllDaiBiaoDui(@Param("identity") byte identity);
List<CompeteVo.DaiBiaoDUi> selAllDaiBiaoDui(@Param("identity") byte identity,@Param("type") Long type);
/**
* 查询参赛队伍信息导出表格用
* @return
*/
List<CompeteVo.MesBiao> selCanSaiDuiWuMes();
List<CompeteVo.MesBiao> selCanSaiDuiWuMes(@Param("type") Long type);
/**
* 查询出场顺序表导出表格用

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

@ -78,7 +78,7 @@ public class ExcelService implements IExcelService {
@Override
public String dasaiduiwuxinxiWPS(QueryDto<CompeteDto.CompeteTime> params) {
List<CompeteVo.MesBiao> mesBiaos = competeScoreDao.selCanSaiDuiWuMes();
List<CompeteVo.MesBiao> mesBiaos = competeScoreDao.selCanSaiDuiWuMes(params.getParam().getCompeteTimeId());
List<List<PoiUtil.PoiUtilCell>> biao = new ArrayList<>();
//先把联系人的都添加进去
@ -168,8 +168,8 @@ public class ExcelService implements IExcelService {
@Override
public String iTeamListService(QueryDto<CompeteDto.CompeteTime> params) {
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis0 = competeScoreDao.selAllDaiBiaoDui((byte) 0);
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis1 = competeScoreDao.selAllDaiBiaoDui((byte) 1);
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis0 = competeScoreDao.selAllDaiBiaoDui((byte) 0,params.getParam().getCompeteTimeId());
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis1 = competeScoreDao.selAllDaiBiaoDui((byte) 1,params.getParam().getCompeteTimeId());
//查出所有的单位的id
List<CompeteCompany> competeCompanyList= competeCompanyDao.selectByCompeteTimeId(params.getParam().getCompeteTimeId());
@ -756,24 +756,24 @@ public class ExcelService implements IExcelService {
//创建行对象
List<PoiUtil.PoiUtilCell> title = new ArrayList<>();
//给首行单元格赋值
title.add(new PoiUtil.PoiUtilCell("序号"));
title.add(new PoiUtil.PoiUtilCell("参赛项目"));
title.add(new PoiUtil.PoiUtilCell("小学男子组"));
title.add(new PoiUtil.PoiUtilCell("小学女子组"));
title.add(new PoiUtil.PoiUtilCell("小学混合组"));
title.add(new PoiUtil.PoiUtilCell("中学男子组"));
title.add(new PoiUtil.PoiUtilCell("中学女子组"));
title.add(new PoiUtil.PoiUtilCell("中学混合组"));
title.add(new PoiUtil.PoiUtilCell("高职院校男子组"));
title.add(new PoiUtil.PoiUtilCell("高职院校女子组"));
title.add(new PoiUtil.PoiUtilCell("高职院校混合组"));
title.add(new PoiUtil.PoiUtilCell("本科院校男子组"));
title.add(new PoiUtil.PoiUtilCell("本科院校女子组"));
title.add(new PoiUtil.PoiUtilCell("本科院校混合组"));
title.add(new PoiUtil.PoiUtilCell("俱乐部男子组(14岁及以下)"));
title.add(new PoiUtil.PoiUtilCell("俱乐部女子组(14岁及以下)"));
title.add(new PoiUtil.PoiUtilCell("俱乐部混合组(14岁及以下)"));
title.add(new PoiUtil.PoiUtilCell("合计"));
// title.add(new PoiUtil.PoiUtilCell("序号"));
// title.add(new PoiUtil.PoiUtilCell("参赛项目"));
// title.add(new PoiUtil.PoiUtilCell("小学男子组"));
// title.add(new PoiUtil.PoiUtilCell("小学女子组"));
// title.add(new PoiUtil.PoiUtilCell("小学混合组"));
// title.add(new PoiUtil.PoiUtilCell("中学男子组"));
// title.add(new PoiUtil.PoiUtilCell("中学女子组"));
// title.add(new PoiUtil.PoiUtilCell("中学混合组"));
// title.add(new PoiUtil.PoiUtilCell("高职院校男子组"));
// title.add(new PoiUtil.PoiUtilCell("高职院校女子组"));
// title.add(new PoiUtil.PoiUtilCell("高职院校混合组"));
// title.add(new PoiUtil.PoiUtilCell("本科院校男子组"));
// title.add(new PoiUtil.PoiUtilCell("本科院校女子组"));
// title.add(new PoiUtil.PoiUtilCell("本科院校混合组"));
// title.add(new PoiUtil.PoiUtilCell("俱乐部男子组(14岁及以下)"));
// title.add(new PoiUtil.PoiUtilCell("俱乐部女子组(14岁及以下)"));
// title.add(new PoiUtil.PoiUtilCell("俱乐部混合组(14岁及以下)"));
// title.add(new PoiUtil.PoiUtilCell("合计"));
list.add(title);
//创建整个excel表格对象
Workbook workbook = new XSSFWorkbook();
@ -797,120 +797,120 @@ public class ExcelService implements IExcelService {
}
PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell();
poiUtilCell.setValue("");
poiUtilCell.setFunction("sum(C"+a+":Q"+a+")");
// poiUtilCell.setFunction("sum(C"+a+":Q"+a+")");
cells.add(poiUtilCell);
list.add(cells);
i++;
a++;
if (competeAllCount.getProjectId()==2017){
cells = new ArrayList<>();
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell();
poiUtilCel.setValue("--");
cells.add(poiUtilCel);
PoiUtil.PoiUtilCell poiUtilCel1 = new PoiUtil.PoiUtilCell();
poiUtilCel1.setValue("合计");
cells.add(poiUtilCel1);
for (int j = 3; j <19 ; j++) {
PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell();
if (j==3){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(C2:C8)");
cells.add(poiUtilCel2);
}
if (j==4){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(D2:D8)");
cells.add(poiUtilCel2);
}
if (j==5){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(E2:E8)");
cells.add(poiUtilCel2);
}
if (j==6){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(F2:F8)");
cells.add(poiUtilCel2);
} if (j==7){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(G2:G8)");
cells.add(poiUtilCel2);
} if (j==8){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(H2:H8)");
cells.add(poiUtilCel2);
} if (j==9){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(I2:I8)");
cells.add(poiUtilCel2);
} if (j==10){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(J2:J8)");
cells.add(poiUtilCel2);
} if (j==11){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(K2:K8)");
cells.add(poiUtilCel2);
}
if (j==12){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(L2:L8)");
cells.add(poiUtilCel2);
}
if (j==13){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(M2:N8)");
cells.add(poiUtilCel2);
}
if (j==14){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(N2:N8)");
cells.add(poiUtilCel2);
}
if (j==15){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(O2:O8)");
cells.add(poiUtilCel2);
}
if (j==16){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(P2:P8)");
cells.add(poiUtilCel2);
}
if (j==17){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(Q2:Q8)");
cells.add(poiUtilCel2);
}
if (j==18){
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(R2:R8)");
cells.add(poiUtilCel2);
}
// String T1 = PoiUtil.toRadix(j);
// poiUtilCel2.setFunction("sum(c"+2+":c"+8+")");
}
list.add(cells);
}
if (competeAllCount.getProjectId()==2026){
cells = new ArrayList<>();
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell();
poiUtilCel.setValue("--");
cells.add(poiUtilCel);
PoiUtil.PoiUtilCell poiUtilCel1 = new PoiUtil.PoiUtilCell();
poiUtilCel1.setValue("合计");
cells.add(poiUtilCel1);
PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(3 + "", 15, 1, 300, 18);
poiUtilCel2.setValue("");
poiUtilCel2.setFunction("sum(C10:C18)");
cells.add(poiUtilCel2);
PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell();
poiUtilCel3.setValue("");
poiUtilCel3.setFunction("sum(R2:C19)");
cells.add(poiUtilCel3);
list.add(cells);
}
// if (competeAllCount.getProjectId()==2017){
// cells = new ArrayList<>();
// PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell();
// poiUtilCel.setValue("--");
// cells.add(poiUtilCel);
// PoiUtil.PoiUtilCell poiUtilCel1 = new PoiUtil.PoiUtilCell();
// poiUtilCel1.setValue("合计");
// cells.add(poiUtilCel1);
// for (int j = 3; j <19 ; j++) {
// PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell();
// if (j==3){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(C2:C8)");
// cells.add(poiUtilCel2);
// }
// if (j==4){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(D2:D8)");
// cells.add(poiUtilCel2);
// }
// if (j==5){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(E2:E8)");
// cells.add(poiUtilCel2);
// }
// if (j==6){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(F2:F8)");
// cells.add(poiUtilCel2);
// } if (j==7){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(G2:G8)");
// cells.add(poiUtilCel2);
// } if (j==8){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(H2:H8)");
// cells.add(poiUtilCel2);
// } if (j==9){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(I2:I8)");
// cells.add(poiUtilCel2);
// } if (j==10){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(J2:J8)");
// cells.add(poiUtilCel2);
// } if (j==11){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(K2:K8)");
// cells.add(poiUtilCel2);
// }
// if (j==12){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(L2:L8)");
// cells.add(poiUtilCel2);
// }
// if (j==13){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(M2:N8)");
// cells.add(poiUtilCel2);
// }
// if (j==14){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(N2:N8)");
// cells.add(poiUtilCel2);
// }
// if (j==15){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(O2:O8)");
// cells.add(poiUtilCel2);
// }
// if (j==16){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(P2:P8)");
// cells.add(poiUtilCel2);
// }
// if (j==17){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(Q2:Q8)");
// cells.add(poiUtilCel2);
// }
// if (j==18){
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(R2:R8)");
// cells.add(poiUtilCel2);
// }
//// String T1 = PoiUtil.toRadix(j);
//// poiUtilCel2.setFunction("sum(c"+2+":c"+8+")");
// }
// list.add(cells);
// }
//
// if (competeAllCount.getProjectId()==2026){
// cells = new ArrayList<>();
// PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell();
// poiUtilCel.setValue("--");
// cells.add(poiUtilCel);
// PoiUtil.PoiUtilCell poiUtilCel1 = new PoiUtil.PoiUtilCell();
// poiUtilCel1.setValue("合计");
// cells.add(poiUtilCel1);
// PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(3 + "", 15, 1, 300, 18);
// poiUtilCel2.setValue("");
// poiUtilCel2.setFunction("sum(C10:C18)");
// cells.add(poiUtilCel2);
// PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell();
// poiUtilCel3.setValue("");
// poiUtilCel3.setFunction("sum(R2:C19)");
// cells.add(poiUtilCel3);
// list.add(cells);
// }

4
mt/src/main/resources/druid-dev.yml

@ -28,8 +28,8 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/mt?useUnicode=true&characterEncoding=UTF-8
# url: jdbc:mysql://www.tall.wiki/mt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
# url: jdbc:mysql://49.233.89.188:3306/mt?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://www.tall.wiki/mt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
# env: CCSENS_GAME

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

@ -351,8 +351,8 @@
t_compete_project p ,
t_compete_group gr
WHERE
p.type = 0
and gr.type = 0
p.type = #{type}
and gr.type = #{type}
and p.team = 0
and p.`level` = 2
and p.rec_status = 0
@ -372,7 +372,7 @@
LEFT JOIN t_compete_project p on pp.project_id = p.id
WHERE
pp.rec_status = 0
and p.type = 0
and p.type = #{type}
and p.team = 0
and p.`level` = 2
and p.rec_status = 0
@ -382,7 +382,7 @@
and t.group_remark = g.group_remark
and t.projectId = g.projectId
WHERE
g.type = 0
g.type = #{type}
and g.rec_status = 0
GROUP BY g.projectId,g.id
ORDER BY g.projectId,g.sequence
@ -431,8 +431,8 @@
t_compete_project p ,
t_compete_group gr
WHERE
p.type = 0
and gr.type = 0
p.type = #{type}
and gr.type = #{type}
and p.team = 1
and p.`level` = 2
and p.join_rule = 0
@ -452,7 +452,7 @@
LEFT JOIN t_compete_project p on t.project_id = p.id
WHERE
t.rec_status = 0
and p.type = 0
and p.type = #{type}
and p.team = 1
and p.`level` = 2
and p.join_rule = 0
@ -462,7 +462,7 @@
and t.group_remark = g.group_remark
and t.projectId = g.projectId
WHERE
g.type = 0
g.type = #{type}
and g.rec_status = 0
GROUP BY g.projectId,g.id
ORDER BY g.projectId,g.sequence

32
mt/src/main/resources/mapper_dao/CompeteProjectDao.xml

@ -17,21 +17,17 @@
tcp.`name` as name,
if(tcp.gender = 1,'男','女') as gender,
tcp.id_card as idCard,
(2020 - SUBSTR(tcp.id_card FROM 7 FOR 4)) as age,
(2021 - SUBSTR(tcp.id_card FROM 7 FOR 4)) as age,
tcpro.join_rule as joinRule
from t_compete_project tcpro
LEFT JOIN t_compete_project_player tcpp on tcpro.id = tcpp.project_id
LEFT JOIN t_compete_player tcp on tcp.id = tcpp.player_id
LEFT JOIN t_compete_company tcc on tcc.id= tcp.company_id
LEFT JOIN t_compete_group tcg on tcg.id =tcp.compete_group_id
LEFT JOIN t_compete_project_player tcpp on tcpro.id = tcpp.project_id and tcpp.rec_status =0
LEFT JOIN t_compete_player tcp on tcp.id = tcpp.player_id and tcp.rec_status=0
LEFT JOIN t_compete_company tcc on tcc.id= tcp.company_id and tcc.rec_status=0
LEFT JOIN t_compete_group tcg on tcg.id =tcp.compete_group_id and tcg.rec_status=0
WHERE tcpro.`level`=#{level}
and tcpro.type = #{type}
and tcpro.team = 0
and tcpro.rec_status=0
and tcpp.rec_status =0
and tcp.rec_status=0
and tcc.rec_status=0
and tcg.rec_status=0
</select>
<select id="getPlayerForTeam" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteJoin" parameterType="java.util.Map">
@ -43,25 +39,21 @@
pl.`name` as name ,
pl.id_card as idCard,
if(pl.gender = 1,'男','女') as gender,
(2020 - SUBSTR(pl.id_card FROM 7 FOR 4)) as age,
(2021 - SUBSTR(pl.id_card FROM 7 FOR 4)) as age,
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_team_member m on t.id = m.compete_team_id
LEFT JOIN t_compete_company c on t.company_id = c.id
LEFT JOIN t_compete_player pl on m.player_id = pl.id
LEFT JOIN t_compete_group g on t.gender_group = g.sex and t.group_remark = g.group_remark
LEFT JOIN t_compete_team t on p.id = t.project_id and t.rec_status = 0
LEFT JOIN t_compete_team_member m on t.id = m.compete_team_id and m.rec_status = 0
LEFT JOIN t_compete_company c on t.company_id = c.id and c.rec_status = 0
LEFT JOIN t_compete_player pl on m.player_id = pl.id and pl.rec_status = 0
LEFT JOIN t_compete_group g on t.gender_group = g.sex and t.group_remark = g.group_remark and g.rec_status = 0 and g.type = 5
WHERE
p.type = #{type}
and p.`level` = #{level}
and p.team = 1
and p.rec_status = 0
and m.rec_status = 0
and t.rec_status = 0
and pl.rec_status = 0
and g.rec_status = 0
and c.rec_status = 0
</select>
<select id="queryProject" resultMap="com.ccsens.mt.persist.mapper.CompeteProjectMapper.BaseResultMap">
SELECT

6
mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

@ -1496,7 +1496,7 @@ ORDER BY
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
AND tcc.compete_time_id = #{type}
) t
WHERE
`after` != 0
@ -1548,7 +1548,7 @@ ORDER BY
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
AND tcc.compete_time_id = #{type}
) t
WHERE
`after` != 0
@ -1594,7 +1594,7 @@ ORDER BY
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
AND tcc.compete_time_id = #{type}
) t
WHERE
`after` != 0

6
tall/src/main/resources/application-dev.yml

@ -11,11 +11,11 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 192.168.31.13
host: test.tall.wiki
# host: 127.0.0.1
password: 111111
password: guest
port: 5672
username: admin
username: guest
redis:
database: 0
host: 127.0.0.1

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

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

Loading…
Cancel
Save