mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
赛会选择球队
This commit is contained in:
@@ -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.CompetitionVsRecordVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -51,13 +53,13 @@ public class CompetitionResultController extends BaseController
|
||||
* 导出赛会中-赛程结果记录列表
|
||||
*/
|
||||
@RequiresPermissions("system:competitionResult:export")
|
||||
@Log(title = "赛会中-赛程结果记录", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "赛会中赛程结果记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CompetitionResult competitionResult)
|
||||
{
|
||||
List<CompetitionResult> list = competitionResultService.selectCompetitionResultList(competitionResult);
|
||||
ExcelUtil<CompetitionResult> util = new ExcelUtil<CompetitionResult>(CompetitionResult.class);
|
||||
util.exportExcel(response, list, "赛会中-赛程结果记录数据");
|
||||
util.exportExcel(response, list, "赛会中赛程结果记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +76,7 @@ public class CompetitionResultController extends BaseController
|
||||
* 新增赛会中-赛程结果记录
|
||||
*/
|
||||
@RequiresPermissions("system:competitionResult:add")
|
||||
@Log(title = "赛会中-赛程结果记录", businessType = BusinessType.INSERT)
|
||||
@Log(title = "赛会中赛程结果记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CompetitionResult competitionResult)
|
||||
{
|
||||
@@ -85,24 +87,32 @@ public class CompetitionResultController extends BaseController
|
||||
* 修改赛会中-赛程结果记录
|
||||
*/
|
||||
@RequiresPermissions("system:competitionResult:edit")
|
||||
@Log(title = "赛会中-赛程结果记录", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "赛会中赛程结果记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CompetitionResult competitionResult)
|
||||
{
|
||||
return toAjax(competitionResultService.updateCompetitionResult(competitionResult));
|
||||
}
|
||||
@RequiresPermissions("system:competitionResult:batchEdit")
|
||||
@Log(title = "赛会中-批量保存赛程结果记录", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "赛会中批量保存赛程结果记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/batchEdit")
|
||||
public AjaxResult batchEdit(@RequestBody List<CompetitionResult> list)
|
||||
{
|
||||
return toAjax(competitionResultService.batchUpdateCompetitionResult(list));
|
||||
}
|
||||
@RequiresPermissions("system:competitionResult:editData")
|
||||
@Log(title = "赛会中保存赛程结果记录2", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/editData")
|
||||
public AjaxResult editData(@RequestBody CompetitionVsRecordVo obj)
|
||||
{
|
||||
return toAjax(competitionResultService.editData(obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除赛会中-赛程结果记录
|
||||
*/
|
||||
@RequiresPermissions("system:competitionResult:remove")
|
||||
@Log(title = "赛会中-赛程结果记录", businessType = BusinessType.DELETE)
|
||||
@Log(title = "赛会中赛程结果记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CompetitionTeamVsTeamController extends BaseController
|
||||
* 导出赛会中-球队VS球队关系列表
|
||||
*/
|
||||
@RequiresPermissions("system:competitionTeamVsTeam:export")
|
||||
@Log(title = "赛会中-球队VS球队关系", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "赛会中球队VS球队关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class CompetitionTeamVsTeamController extends BaseController
|
||||
* 新增赛会中-球队VS球队关系
|
||||
*/
|
||||
@RequiresPermissions("system:competitionTeamVsTeam:add")
|
||||
@Log(title = "赛会中-球队VS球队关系", businessType = BusinessType.INSERT)
|
||||
@Log(title = "赛会中球队VS球队关系", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class CompetitionTeamVsTeamController extends BaseController
|
||||
* 修改赛会中-球队VS球队关系
|
||||
*/
|
||||
@RequiresPermissions("system:competitionTeamVsTeam:edit")
|
||||
@Log(title = "赛会中-球队VS球队关系", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "赛会中球队VS球队关系", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CompetitionTeamVsTeam competitionTeamVsTeam)
|
||||
{
|
||||
@@ -94,20 +94,20 @@ public class CompetitionTeamVsTeamController extends BaseController
|
||||
* 删除赛会中-球队VS球队关系
|
||||
*/
|
||||
@RequiresPermissions("system:competitionTeamVsTeam:remove")
|
||||
@Log(title = "赛会中-球队VS球队关系", businessType = BusinessType.DELETE)
|
||||
@Log(title = "赛会中球队VS球队关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(competitionTeamVsTeamService.deleteCompetitionTeamVsTeamByIds(ids));
|
||||
}
|
||||
@Log(title = "赛会中-球队VS球队比赛结果数据", businessType = BusinessType.OTHER)
|
||||
@Log(title = "赛会中球队VS球队比赛结果数据", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("根据ID获取当前比赛赛程的所有统分结果")
|
||||
@GetMapping("/competitionUnifiedRecord/{id}")
|
||||
public AjaxResult getCompetitionUnifiedRecordById(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(competitionTeamVsTeamService.getCompetitionUnifiedRecordById(id));
|
||||
}
|
||||
|
||||
@Log(title = "赛会中-球队VS球队比赛结果数据2", businessType = BusinessType.OTHER)
|
||||
@Log(title = "赛会中球队VS球队比赛结果数据2", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("根据ID获取当前比赛赛程的所有统分结果2")
|
||||
@GetMapping("/getCompetitionVsRecordById/{id}")
|
||||
public AjaxResult getCompetitionVsRecordById(@PathVariable("id") Long id) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.CompetitionResult;
|
||||
import com.ruoyi.system.domain.vo.CompetitionVsRecordVo;
|
||||
|
||||
/**
|
||||
* 赛会中-赛程结果记录Service接口
|
||||
@@ -60,4 +61,6 @@ public interface ICompetitionResultService
|
||||
public int deleteCompetitionResultById(Long id);
|
||||
|
||||
public int batchUpdateCompetitionResult(List<CompetitionResult> list);
|
||||
|
||||
int editData(CompetitionVsRecordVo obj);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.vo.CompetitionResultVo;
|
||||
import com.ruoyi.system.domain.vo.CompetitionVsRecordVo;
|
||||
import com.ruoyi.system.mapper.CompetitionTeamVsTeamMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.CompetitionResultMapper;
|
||||
import com.ruoyi.system.domain.CompetitionResult;
|
||||
import com.ruoyi.system.service.ICompetitionResultService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 赛会中-赛程结果记录Service业务层处理
|
||||
@@ -16,8 +23,10 @@ import com.ruoyi.system.service.ICompetitionResultService;
|
||||
@Service
|
||||
public class CompetitionResultServiceImpl implements ICompetitionResultService
|
||||
{
|
||||
@Autowired
|
||||
@Resource
|
||||
private CompetitionResultMapper competitionResultMapper;
|
||||
@Resource
|
||||
private CompetitionTeamVsTeamMapper competitionTeamVsTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询赛会中-赛程结果记录
|
||||
@@ -102,4 +111,32 @@ public class CompetitionResultServiceImpl implements ICompetitionResultService
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int editData(CompetitionVsRecordVo obj) {
|
||||
//编辑比赛总分数据
|
||||
competitionTeamVsTeamMapper.updateCompetitionTeamVsTeam(obj.getTeamVsTeamVo());
|
||||
if(obj.getMainTeam().getId()==null) {
|
||||
CompetitionResultVo team = obj.getMainTeam();
|
||||
team.setCompetitionId(obj.getTeamVsTeamVo().getCompetitionId());
|
||||
team.setCompetitionVsId(obj.getTeamVsTeamVo().getId());
|
||||
team.setTeamId(obj.getTeamVsTeamVo().getMainTeamId());
|
||||
team.setTeamName(obj.getTeamVsTeamVo().getMainTeamName());
|
||||
competitionResultMapper.insertCompetitionResult(team);
|
||||
}else {
|
||||
competitionResultMapper.updateCompetitionResult(obj.getMainTeam());
|
||||
}
|
||||
if(obj.getGuestTeam().getId()==null) {
|
||||
CompetitionResultVo team = obj.getGuestTeam();
|
||||
team.setCompetitionId(obj.getTeamVsTeamVo().getCompetitionId());
|
||||
team.setCompetitionVsId(obj.getTeamVsTeamVo().getId());
|
||||
team.setTeamId(obj.getTeamVsTeamVo().getGuestTeamId());
|
||||
team.setTeamName(obj.getTeamVsTeamVo().getGuestTeamName());
|
||||
competitionResultMapper.insertCompetitionResult(team);
|
||||
}else {
|
||||
competitionResultMapper.updateCompetitionResult(obj.getGuestTeam());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user