赛会赛程
parent
0d5e13affe
commit
a8fdd22503
|
|
@ -3,6 +3,12 @@ package com.ruoyi.common.core.web.controller;
|
|||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.sql.SqlUtil;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
|
|
@ -45,7 +51,17 @@ public class BaseController
|
|||
*/
|
||||
protected void startPage()
|
||||
{
|
||||
PageUtils.startPage();
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}else {
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.orderBy(orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.ruoyi.system.controller;
|
|||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -43,7 +45,7 @@ public class CompetitionTeamVsTeamController extends BaseController
|
|||
public TableDataInfo list(CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
startPage();
|
||||
List<CompetitionTeamVsTeam> list = competitionTeamVsTeamService.selectCompetitionTeamVsTeamList(competitionTeamVsTeam);
|
||||
List<CompetitionTeamVsTeamVo> list = competitionTeamVsTeamService.selectCompetitionTeamVsTeamList(competitionTeamVsTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -55,8 +57,8 @@ public class CompetitionTeamVsTeamController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
List<CompetitionTeamVsTeam> list = competitionTeamVsTeamService.selectCompetitionTeamVsTeamList(competitionTeamVsTeam);
|
||||
ExcelUtil<CompetitionTeamVsTeam> util = new ExcelUtil<CompetitionTeamVsTeam>(CompetitionTeamVsTeam.class);
|
||||
List<CompetitionTeamVsTeamVo> list = competitionTeamVsTeamService.selectCompetitionTeamVsTeamList(competitionTeamVsTeam);
|
||||
ExcelUtil<CompetitionTeamVsTeamVo> util = new ExcelUtil<CompetitionTeamVsTeamVo>(CompetitionTeamVsTeamVo.class);
|
||||
util.exportExcel(response, list, "赛会中-球队VS球队关系数据");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ public class CompetitionTeamVsTeam extends BaseEntity
|
|||
private String guestTeamName;
|
||||
|
||||
/** 比赛时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "比赛时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "比赛时间", width = 60, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date competitionTime;
|
||||
|
||||
/** 球场ID */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.system.domain.CompetitionTeamVsTeam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 吴一博
|
||||
* @date 2022年11月11日 17:02
|
||||
* @Description
|
||||
*/
|
||||
@Data
|
||||
public class CompetitionTeamVsTeamVo extends CompetitionTeamVsTeam {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "比赛时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date competitionDate;
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.CompetitionTeamVsTeam;
|
||||
import com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo;
|
||||
|
||||
/**
|
||||
* 赛会中-球队VS球队关系Mapper接口
|
||||
|
|
@ -17,7 +18,7 @@ public interface CompetitionTeamVsTeamMapper
|
|||
* @param id 赛会中-球队VS球队关系主键
|
||||
* @return 赛会中-球队VS球队关系
|
||||
*/
|
||||
public CompetitionTeamVsTeam selectCompetitionTeamVsTeamById(Long id);
|
||||
public CompetitionTeamVsTeamVo selectCompetitionTeamVsTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询赛会中-球队VS球队关系列表
|
||||
|
|
@ -25,7 +26,7 @@ public interface CompetitionTeamVsTeamMapper
|
|||
* @param competitionTeamVsTeam 赛会中-球队VS球队关系
|
||||
* @return 赛会中-球队VS球队关系集合
|
||||
*/
|
||||
public List<CompetitionTeamVsTeam> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam);
|
||||
public List<CompetitionTeamVsTeamVo> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam);
|
||||
|
||||
/**
|
||||
* 新增赛会中-球队VS球队关系
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.CompetitionTeamVsTeam;
|
||||
import com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo;
|
||||
|
||||
/**
|
||||
* 赛会中-球队VS球队关系Service接口
|
||||
|
|
@ -17,7 +18,7 @@ public interface ICompetitionTeamVsTeamService
|
|||
* @param id 赛会中-球队VS球队关系主键
|
||||
* @return 赛会中-球队VS球队关系
|
||||
*/
|
||||
public CompetitionTeamVsTeam selectCompetitionTeamVsTeamById(Long id);
|
||||
public CompetitionTeamVsTeamVo selectCompetitionTeamVsTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询赛会中-球队VS球队关系列表
|
||||
|
|
@ -25,7 +26,7 @@ public interface ICompetitionTeamVsTeamService
|
|||
* @param competitionTeamVsTeam 赛会中-球队VS球队关系
|
||||
* @return 赛会中-球队VS球队关系集合
|
||||
*/
|
||||
public List<CompetitionTeamVsTeam> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam);
|
||||
public List<CompetitionTeamVsTeamVo> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam);
|
||||
|
||||
/**
|
||||
* 新增赛会中-球队VS球队关系
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.CompetitionTeamVsTeamMapper;
|
||||
|
|
@ -26,7 +28,7 @@ public class CompetitionTeamVsTeamServiceImpl implements ICompetitionTeamVsTeamS
|
|||
* @return 赛会中-球队VS球队关系
|
||||
*/
|
||||
@Override
|
||||
public CompetitionTeamVsTeam selectCompetitionTeamVsTeamById(Long id)
|
||||
public CompetitionTeamVsTeamVo selectCompetitionTeamVsTeamById(Long id)
|
||||
{
|
||||
return competitionTeamVsTeamMapper.selectCompetitionTeamVsTeamById(id);
|
||||
}
|
||||
|
|
@ -38,7 +40,7 @@ public class CompetitionTeamVsTeamServiceImpl implements ICompetitionTeamVsTeamS
|
|||
* @return 赛会中-球队VS球队关系
|
||||
*/
|
||||
@Override
|
||||
public List<CompetitionTeamVsTeam> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
public List<CompetitionTeamVsTeamVo> selectCompetitionTeamVsTeamList(CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
return competitionTeamVsTeamMapper.selectCompetitionTeamVsTeamList(competitionTeamVsTeam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectCompetitionTeamVsTeamVo">
|
||||
select id, competition_id, main_team_id, main_team_name, guest_team_id, guest_team_name, competition_time, building_id, building_name, competition_address, competition_group, status, created_time, last_updated_time, created_by, modified_by, is_deleted, remark, main_team_score, guest_team_score, vs_type, batch_number from competition_team_vs_team
|
||||
select id, competition_id, main_team_id, main_team_name, guest_team_id, guest_team_name, competition_time, DATE_FORMAT(competition_time,'%Y-%m-%d') as competitionDate, building_id, building_name, competition_address, competition_group, status, created_time, last_updated_time, created_by, modified_by, is_deleted, remark, main_team_score, guest_team_score, vs_type, batch_number from competition_team_vs_team
|
||||
</sql>
|
||||
|
||||
<select id="selectCompetitionTeamVsTeamList" parameterType="CompetitionTeamVsTeam" resultMap="CompetitionTeamVsTeamResult">
|
||||
|
||||
|
||||
<select id="selectCompetitionTeamVsTeamList"
|
||||
resultType="com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo">
|
||||
<include refid="selectCompetitionTeamVsTeamVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="competitionId != null "> and competition_id = #{competitionId}</if>
|
||||
<if test="mainTeamId != null "> and main_team_id = #{mainTeamId}</if>
|
||||
<if test="mainTeamName != null and mainTeamName != ''"> and main_team_name like concat('%', #{mainTeamName}, '%')</if>
|
||||
|
|
@ -58,12 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCompetitionTeamVsTeamById" parameterType="Long" resultMap="CompetitionTeamVsTeamResult">
|
||||
<select id="selectCompetitionTeamVsTeamById"
|
||||
resultType="com.ruoyi.system.domain.vo.CompetitionTeamVsTeamVo">
|
||||
<include refid="selectCompetitionTeamVsTeamVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertCompetitionTeamVsTeam" parameterType="CompetitionTeamVsTeam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into competition_team_vs_team
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@
|
|||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="球队审核" name="competitionTeamApprove"><span slot="label"><i class="el-icon-s-check"></i> 球队审核</span>
|
||||
<el-table v-loading="loading" :data="competitionOfTeamList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
max-height="800"
|
||||
v-loading="loading" :data="competitionOfTeamList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="球队ID" align="center" prop="teamId" />
|
||||
<el-table-column label="球队名" align="center" prop="teamName" />
|
||||
<el-table-column label="球队所属的组" align="center" prop="competitionGroup" />
|
||||
|
|
@ -107,9 +109,10 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="球队分组" name="competitionTeamGroup"> <span slot="label"><i class="el-icon-film"></i> 球队分组</span>
|
||||
<el-container style="height: 700px; border: 1px solid #eee">
|
||||
<el-container style="height: 800px; border: 1px solid #eee">
|
||||
<el-aside width="300px" style="background-color: rgb(238, 241, 246)">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
|
|
@ -164,7 +167,48 @@
|
|||
</el-container>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="赛程设置" name="competitionVsSet"> <span slot="label"><i class="el-icon-c-scale-to-original"></i> 赛程设置</span> 赛程设置</el-tab-pane>
|
||||
<el-tab-pane label="赛程设置" name="competitionVsSet"> <span slot="label"><i class="el-icon-c-scale-to-original"></i> 赛程设置</span>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-time"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:competitionOfTeam:add']"
|
||||
>手动设置赛程</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-bangzhu"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:competitionOfTeam:edit']"
|
||||
>系统智能设置小组循环赛赛程</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table
|
||||
title="赛程列表"
|
||||
:data="competitionTeamVsTeamList"
|
||||
:span-method="(...arg)=>objectSpanMethod(...arg,competitionTeamVsTeamList)"
|
||||
border
|
||||
max-height="800"
|
||||
style=" margin-top: 20px">
|
||||
<el-table-column label="比赛日期" align="center" prop="competitionDate" width="180"/>
|
||||
<el-table-column label="主队名" align="center" prop="mainTeamName" />
|
||||
<el-table-column label="主队得分" align="center" prop="mainTeamScore" />
|
||||
<el-table-column label="比赛时间" align="center" prop="competitionTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="plain" size="medium" >{{ parseTime(scope.row.competitionTime, '{h}:{i}') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客队得分" align="center" prop="guestTeamScore" />
|
||||
<el-table-column label="客队名" align="center" prop="guestTeamName" />
|
||||
<el-table-column label="球场名称" align="center" prop="buildingName" />
|
||||
<el-table-column label="比赛类型" align="center" prop="vsType" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="赛会推广" name="competitionSpread"> <span slot="label"><i class="el-icon-s-promotion"></i> 赛会推广</span> 赛会推广</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
|
@ -269,6 +313,7 @@ import { listCompetition, getCompetition, delCompetition, addCompetition, update
|
|||
import { listCompetitionOfTeam, batchEditById, intoTeamGroup, removeTeamGroup, updateCompetitionOfTeam } from "@/api/system/competitionOfTeam";
|
||||
import { listCompetitionMembers, getCompetitionMembers, delCompetitionMembers, addCompetitionMembers, updateCompetitionMembers } from "@/api/system/competitionMembers";
|
||||
import { listCompetitionTeamGroup, getCompetitionTeamGroup, delCompetitionTeamGroup, addCompetitionTeamGroup, updateCompetitionTeamGroup } from "@/api/system/competitionTeamGroup";
|
||||
import { listCompetitionTeamVsTeam, getCompetitionTeamVsTeam, delCompetitionTeamVsTeam, addCompetitionTeamVsTeam, updateCompetitionTeamVsTeam } from "@/api/system/competitionTeamVsTeam";
|
||||
export default {
|
||||
name: "CompetitionSet",
|
||||
dicts: ['competition_status'],
|
||||
|
|
@ -289,6 +334,7 @@ export default {
|
|||
//已经分组的球队数据
|
||||
alreadyGroupTeamList: [],
|
||||
selectTeamList:[],
|
||||
competitionTeamVsTeamList:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
|
@ -465,6 +511,41 @@ export default {
|
|||
// 表单重置
|
||||
reset() {
|
||||
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex },data) {
|
||||
if (columnIndex === 0) {
|
||||
if(column.property==='competitionDate') {
|
||||
var spanArr = this.getSpanArr(data, column.property)
|
||||
const _row = spanArr[rowIndex]
|
||||
const _col = _row > 0 ? 1 : 0
|
||||
return {
|
||||
rowspan: _row,
|
||||
colspan: _col
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 处理合并行的数据
|
||||
getSpanArr: function(data, spanKey) {
|
||||
var that = this
|
||||
var spanArr = []
|
||||
var pos = ''
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (i === 0) {
|
||||
spanArr.push(1)
|
||||
pos = 0
|
||||
} else {
|
||||
// 判断当前元素与上一个元素是否相同
|
||||
if (data[i][spanKey] === data[i - 1][spanKey]) {
|
||||
spanArr[pos] += 1
|
||||
spanArr.push(0)
|
||||
} else {
|
||||
spanArr.push(1)
|
||||
pos = i
|
||||
}
|
||||
}
|
||||
}
|
||||
return spanArr
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.currentGroupRow = val;
|
||||
|
|
@ -496,7 +577,9 @@ export default {
|
|||
this.competitionTeamGroupList.push({"competitionGroup":"未分","id":null})
|
||||
});
|
||||
}else if(tab.name=='competitionVsSet'){
|
||||
|
||||
listCompetitionTeamVsTeam({"orderByColumn":"competition_time","pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => {
|
||||
this.competitionTeamVsTeamList = response.rows;
|
||||
});
|
||||
}else if(tab.name=='competitionSpread'){
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue