赛会选择球队
parent
453f400068
commit
7a0f0c2268
|
|
@ -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.CompetitionOfTeamVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -40,10 +42,10 @@ public class CompetitionOfTeamController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:competitionOfTeam:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CompetitionOfTeam competitionOfTeam)
|
||||
public TableDataInfo list(CompetitionOfTeamVo competitionOfTeam)
|
||||
{
|
||||
startPage();
|
||||
List<CompetitionOfTeam> list = competitionOfTeamService.selectCompetitionOfTeamList(competitionOfTeam);
|
||||
List<CompetitionOfTeamVo> list = competitionOfTeamService.selectCompetitionOfTeamList(competitionOfTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +93,13 @@ public class CompetitionOfTeamController extends BaseController
|
|||
{
|
||||
return toAjax(competitionOfTeamService.updateCompetitionOfTeam(competitionOfTeam));
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:competitionOfTeam:batchEditById")
|
||||
@Log(title = "赛会中-参赛队伍", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult batchEditById(@RequestBody List<CompetitionOfTeam> list)
|
||||
{
|
||||
return toAjax(competitionOfTeamService.batchUpdateCompetitionOfTeam(list));
|
||||
}
|
||||
/**
|
||||
* 删除赛会中-参赛队伍
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.ruoyi.system.domain.CompetitionOfTeam;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 吴一博
|
||||
* @date 2022年11月11日 11:12
|
||||
* @Description
|
||||
*/
|
||||
@Data
|
||||
public class CompetitionOfTeamVo extends CompetitionOfTeam {
|
||||
/** 球队logo */
|
||||
private String teamLogo;
|
||||
private String defaultPicture;
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.CompetitionOfTeam;
|
||||
import com.ruoyi.system.domain.vo.CompetitionOfTeamVo;
|
||||
|
||||
/**
|
||||
* 赛会中-参赛队伍Mapper接口
|
||||
|
|
@ -25,7 +26,7 @@ public interface CompetitionOfTeamMapper
|
|||
* @param competitionOfTeam 赛会中-参赛队伍
|
||||
* @return 赛会中-参赛队伍集合
|
||||
*/
|
||||
public List<CompetitionOfTeam> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam);
|
||||
public List<CompetitionOfTeamVo> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam);
|
||||
|
||||
/**
|
||||
* 新增赛会中-参赛队伍
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.CompetitionOfTeam;
|
||||
import com.ruoyi.system.domain.vo.CompetitionOfTeamVo;
|
||||
|
||||
/**
|
||||
* 赛会中-参赛队伍Service接口
|
||||
|
|
@ -25,7 +26,7 @@ public interface ICompetitionOfTeamService
|
|||
* @param competitionOfTeam 赛会中-参赛队伍
|
||||
* @return 赛会中-参赛队伍集合
|
||||
*/
|
||||
public List<CompetitionOfTeam> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam);
|
||||
public List<CompetitionOfTeamVo> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam);
|
||||
|
||||
/**
|
||||
* 新增赛会中-参赛队伍
|
||||
|
|
@ -42,6 +43,13 @@ public interface ICompetitionOfTeamService
|
|||
* @return 结果
|
||||
*/
|
||||
public int updateCompetitionOfTeam(CompetitionOfTeam competitionOfTeam);
|
||||
/**
|
||||
* 修改赛会中-参赛队伍
|
||||
*
|
||||
* @param list 赛会中-参赛队伍
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchUpdateCompetitionOfTeam(List<CompetitionOfTeam> list);
|
||||
|
||||
/**
|
||||
* 批量删除赛会中-参赛队伍
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.vo.CompetitionOfTeamVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.CompetitionOfTeamMapper;
|
||||
|
|
@ -38,7 +40,7 @@ public class CompetitionOfTeamServiceImpl implements ICompetitionOfTeamService
|
|||
* @return 赛会中-参赛队伍
|
||||
*/
|
||||
@Override
|
||||
public List<CompetitionOfTeam> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam)
|
||||
public List<CompetitionOfTeamVo> selectCompetitionOfTeamList(CompetitionOfTeam competitionOfTeam)
|
||||
{
|
||||
return competitionOfTeamMapper.selectCompetitionOfTeamList(competitionOfTeam);
|
||||
}
|
||||
|
|
@ -67,6 +69,15 @@ public class CompetitionOfTeamServiceImpl implements ICompetitionOfTeamService
|
|||
return competitionOfTeamMapper.updateCompetitionOfTeam(competitionOfTeam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchUpdateCompetitionOfTeam(List<CompetitionOfTeam> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
CompetitionOfTeam team = list.get(i);
|
||||
competitionOfTeamMapper.updateCompetitionOfTeam(team);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除赛会中-参赛队伍
|
||||
*
|
||||
|
|
|
|||
|
|
@ -26,32 +26,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectCompetitionOfTeamVo">
|
||||
select id, competition_id, team_id, team_name, competition_group, created_time, status, last_updated_time, created_by, modified_by, is_deleted, remark, contacts, contacts_tel, contacts_area_code, serial_number from competition_of_team
|
||||
</sql>
|
||||
|
||||
<select id="selectCompetitionOfTeamList" parameterType="CompetitionOfTeam" resultMap="CompetitionOfTeamResult">
|
||||
<include refid="selectCompetitionOfTeamVo"/>
|
||||
<where>
|
||||
<if test="competitionId != null "> and competition_id = #{competitionId}</if>
|
||||
<if test="teamId != null "> and team_id = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
||||
<if test="competitionGroup != null and competitionGroup != ''"> and competition_group = #{competitionGroup}</if>
|
||||
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="lastUpdatedTime != null "> and last_updated_time = #{lastUpdatedTime}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||
<if test="modifiedBy != null and modifiedBy != ''"> and modified_by = #{modifiedBy}</if>
|
||||
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
||||
<if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
|
||||
<if test="contactsTel != null and contactsTel != ''"> and contacts_tel = #{contactsTel}</if>
|
||||
<if test="contactsAreaCode != null and contactsAreaCode != ''"> and contacts_area_code = #{contactsAreaCode}</if>
|
||||
<if test="serialNumber != null "> and serial_number = #{serialNumber}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCompetitionOfTeamById" parameterType="Long" resultMap="CompetitionOfTeamResult">
|
||||
<include refid="selectCompetitionOfTeamVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectCompetitionOfTeamList" resultType="com.ruoyi.system.domain.vo.CompetitionOfTeamVo">
|
||||
select t.*,team.* from competition_of_team t left join basketball_team team on team.id = t.team_id
|
||||
<where>
|
||||
<if test="competitionId != null "> and t.competition_id = #{competitionId}</if>
|
||||
<if test="teamId != null "> and t.team_id = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and t.team_name like concat('%', #{teamName}, '%')</if>
|
||||
<if test="competitionGroup != null and competitionGroup != ''"> and t.competition_group = #{competitionGroup}</if>
|
||||
<if test="createdTime != null "> and t.created_time = #{createdTime}</if>
|
||||
<if test="status != null "> and t.status = #{status}</if>
|
||||
<if test="lastUpdatedTime != null "> and t.last_updated_time = #{lastUpdatedTime}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and t.created_by = #{createdBy}</if>
|
||||
<if test="modifiedBy != null and modifiedBy != ''"> and t.modified_by = #{modifiedBy}</if>
|
||||
<if test="isDeleted != null "> and t.is_deleted = #{isDeleted}</if>
|
||||
<if test="contacts != null and contacts != ''"> and t.contacts = #{contacts}</if>
|
||||
<if test="contactsTel != null and contactsTel != ''"> and t.contacts_tel = #{contactsTel}</if>
|
||||
<if test="contactsAreaCode != null and contactsAreaCode != ''"> and t.contacts_area_code = #{contactsAreaCode}</if>
|
||||
<if test="serialNumber != null "> and t.serial_number = #{serialNumber}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertCompetitionOfTeam" parameterType="CompetitionOfTeam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into competition_of_team
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
@click="handleAddGroup"
|
||||
v-hasPermi="['system:competition:add']"
|
||||
>新增分组</el-button>
|
||||
</el-col>
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column property="remark" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" v-if="scope.row.id" plain icon="el-icon-delete">删除</el-button>
|
||||
<el-button type="primary" v-if="scope.row.id" @click="delGroup(scope.row)" plain icon="el-icon-delete">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
<el-container>
|
||||
<el-header style="text-align: left; font-size: 25px;font-weight: bold;color: #ae192a">
|
||||
<span>分组球队-{{currentGroupRow.competitionGroup}}组</span>
|
||||
<el-button v-if="currentGroupRow.competitionGroup" type="primary" style="margin-left: 150px">新增球队</el-button>
|
||||
<el-button v-if="currentGroupRow.competitionGroup&¤tGroupRow.id" type="primary" @click="addTeamDialog(currentGroupRow)" style="margin-left: 150px">新增球队</el-button>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-table :data="alreadyGroupTeamList">
|
||||
|
|
@ -215,6 +215,52 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog
|
||||
title="新增分组"
|
||||
:visible.sync="addGroupDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
<el-select v-model="addGroupCode" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in groupNumbers"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>组
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addGroupDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addGroupIsOk">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="选择球队"
|
||||
:visible.sync="addTeamDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="selectTeamList"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionTeamChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column label="球队名" align="center" prop="teamName" />
|
||||
<el-table-column label="球队所属的组" align="center" prop="competitionGroup" />
|
||||
<el-table-column label="联系人" align="center" prop="contacts" />
|
||||
<el-table-column label="联系人电话" align="center" prop="contactsTel" />
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addTeamDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="selectTeamIsOk">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -223,7 +269,6 @@ import { listCompetition, getCompetition, delCompetition, addCompetition, update
|
|||
import { listCompetitionOfTeam, getCompetitionOfTeam, delCompetitionOfTeam, addCompetitionOfTeam, 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";
|
||||
|
||||
export default {
|
||||
name: "CompetitionSet",
|
||||
dicts: ['competition_status'],
|
||||
|
|
@ -243,10 +288,16 @@ export default {
|
|||
competitionTeamGroupList:[],
|
||||
//已经分组的球队数据
|
||||
alreadyGroupTeamList: [],
|
||||
selectTeamList:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
groupNumbers:[],
|
||||
addGroupCode:"",
|
||||
addGroupDialogVisible:false,
|
||||
addTeamDialogVisible:false,
|
||||
teamMultipleSelection:[],
|
||||
// 查询参数
|
||||
};
|
||||
},
|
||||
|
|
@ -273,6 +324,100 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//点击新增分组按钮
|
||||
handleAddGroup(){
|
||||
//循环获取0-25的组的数据值
|
||||
for (let i = 0; i < 26; i++) {
|
||||
let groupList = {"value":String.fromCharCode(65+i),"label":String.fromCharCode(65+i)}
|
||||
this.groupNumbers[i] = groupList;
|
||||
}
|
||||
this.addGroupDialogVisible=true;
|
||||
},
|
||||
//新增分组保存
|
||||
addGroupIsOk(){
|
||||
if(this.addGroupCode) {
|
||||
addCompetitionTeamGroup({
|
||||
"status": 1,
|
||||
"competitionId": this.competitionObj.id,
|
||||
"competitionGroup": this.addGroupCode
|
||||
}).then(response => {
|
||||
this.$message({
|
||||
message: '恭喜你,新增分组成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.addGroupDialogVisible=false;
|
||||
listCompetitionTeamGroup({"pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => {
|
||||
this.competitionTeamGroupList = response.rows;
|
||||
this.competitionTeamGroupList.push({"competitionGroup":"未分","id":null})
|
||||
});
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请选择分组值',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
//删除分组
|
||||
delGroup(row){
|
||||
console.info(row)
|
||||
listCompetitionOfTeam({"pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id,"competitionGroup":row.competitionGroup}).then(response => {
|
||||
if(response.rows.length>0){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '当前分组下已有球队数据,请删除分组下的球队数据后再做删除分组操作',
|
||||
type: 'warning'
|
||||
});
|
||||
}else {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除赛会中分组数据为"' + row.competitionGroup + '"的数据?').then(function() {
|
||||
return delCompetitionTeamGroup(id);
|
||||
}).then(() => {
|
||||
listCompetitionTeamGroup({"pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => {
|
||||
this.competitionTeamGroupList = response.rows;
|
||||
this.competitionTeamGroupList.push({"competitionGroup":"未分","id":null})
|
||||
});
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
});
|
||||
},
|
||||
addTeamDialog(row){
|
||||
console.info(row)
|
||||
this.addTeamDialogVisible = true
|
||||
listCompetitionOfTeam({"pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => {
|
||||
let newArr = response.rows.filter(item => !item.competitionGroup);
|
||||
this.selectTeamList = newArr;
|
||||
});
|
||||
},
|
||||
handleSelectionTeamChange(val){
|
||||
for (let i = 0;i<val.length;i++){
|
||||
let team = val[i];
|
||||
let selectedTeam = {
|
||||
"id": team.id,
|
||||
"competitionGroup": team.competitionGroup
|
||||
};
|
||||
this.teamMultipleSelection.push(selectedTeam);
|
||||
}
|
||||
|
||||
//this.multipleSelection = val;
|
||||
},
|
||||
//保存选择的分组数据
|
||||
selectTeamIsOk(){
|
||||
if(this.teamMultipleSelection.length==0){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请选择球队',
|
||||
type: 'warning'
|
||||
});
|
||||
}else {
|
||||
this.addTeamDialogVisible = false;
|
||||
updateCompetitionOfTeam({"id": id, "status": tage}).then(response => {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue