|
|
|
@ -1,13 +1,5 @@
|
|
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
@ -41,6 +33,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 比赛信息Service业务层处理
|
|
|
|
@ -50,8 +49,7 @@ import javax.annotation.Resource;
|
|
|
|
|
*/
|
|
|
|
|
@Log4j2
|
|
|
|
|
@Service
|
|
|
|
|
public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Competition> implements ICompetitionService
|
|
|
|
|
{
|
|
|
|
|
public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Competition> implements ICompetitionService {
|
|
|
|
|
@Resource
|
|
|
|
|
private CompetitionMapper competitionMapper;
|
|
|
|
|
@Resource
|
|
|
|
@ -87,6 +85,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
private String winLocation;
|
|
|
|
|
@Value("${image.domainName}")
|
|
|
|
|
private String domainName;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询比赛信息
|
|
|
|
|
*
|
|
|
|
@ -94,8 +93,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 比赛信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Competition selectCompetitionById(Long id)
|
|
|
|
|
{
|
|
|
|
|
public Competition selectCompetitionById(Long id) {
|
|
|
|
|
return competitionMapper.selectCompetitionById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -106,8 +104,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 比赛信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<Competition> selectCompetitionList(Competition competition)
|
|
|
|
|
{
|
|
|
|
|
public List<Competition> selectCompetitionList(Competition competition) {
|
|
|
|
|
return competitionMapper.selectCompetitionList(competition);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -118,8 +115,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int insertCompetition(Competition competition)
|
|
|
|
|
{
|
|
|
|
|
public int insertCompetition(Competition competition) {
|
|
|
|
|
return competitionMapper.insertCompetition(competition);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -130,8 +126,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int updateCompetition(Competition competition)
|
|
|
|
|
{
|
|
|
|
|
public int updateCompetition(Competition competition) {
|
|
|
|
|
return competitionMapper.updateCompetition(competition);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -142,8 +137,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteCompetitionByIds(Long[] ids)
|
|
|
|
|
{
|
|
|
|
|
public int deleteCompetitionByIds(Long[] ids) {
|
|
|
|
|
return competitionMapper.deleteCompetitionByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -154,8 +148,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteCompetitionById(Long id)
|
|
|
|
|
{
|
|
|
|
|
public int deleteCompetitionById(Long id) {
|
|
|
|
|
return competitionMapper.deleteCompetitionById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -173,7 +166,22 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Competition> getCompetitionByCondition(CompetitionVo competition) {
|
|
|
|
|
return competitionMapper.getCompetitionByCondition(competition);
|
|
|
|
|
List<Competition> competitionList = competitionMapper.getCompetitionByCondition(competition);
|
|
|
|
|
for (Competition comp : competitionList) {
|
|
|
|
|
if (comp.getCompetitionNature() == 0) {
|
|
|
|
|
WxBasketballTeam mainTeam = wxBasketballTeamMapper.selectWxBasketballTeamById(comp.getMainTeamId());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(mainTeam)) {
|
|
|
|
|
comp.setMainTeamLogo(mainTeam.getTeamLogo());
|
|
|
|
|
}
|
|
|
|
|
if (comp.getGuestTeamId() != null) {
|
|
|
|
|
WxBasketballTeam guestTeam = wxBasketballTeamMapper.selectWxBasketballTeamById(comp.getGuestTeamId());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(guestTeam)) {
|
|
|
|
|
comp.setGuestTeamLogo(guestTeam.getTeamLogo());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return competitionList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -362,6 +370,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean add(Competition entity) {
|
|
|
|
@ -439,6 +448,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean edit(Competition entity) {
|
|
|
|
|
LoginUser user = SecurityUtils.getLoginUser();
|
|
|
|
|