大赛管理功能

This commit is contained in:
tiger_zhou 2024-02-26 13:35:39 +08:00
parent 68fdecdf31
commit 2647a26869
19 changed files with 550 additions and 149 deletions

@ -1 +1 @@
Subproject commit c012a4e5df8a80af99801c810dc2a7b88d21bc2b
Subproject commit d82430dee341b47f4d3049f9724c65a7b3c7a75a

View File

@ -33,4 +33,16 @@ public interface RacetrPaperDAO extends MyBatisBaseDao<RacetrPaper, Long, Racetr
+ "</if> "
+ "</script>")
List<RacePaperPageVO> pages(@Param("vo") RacePaperQueryVO vo);
@Select("<script>"
+ " select A.id,A.name,A.`desc`,A.season_id as seasonId ,B.code as seasonName,A.support_copy "
+ " ,A.configs,A.creator_id,A.create_time,A.updater_id,A.update_time,C.nickname as creatorName,D.nickname as updaterName "
+ " from racetr_paper A left join racetr_season B on A.season_id = B.id "
+ " left join sys_account C on A.creator_id = C.id "
+ " left JOIN sys_account D on A.updater_id = D.id "
+ " where 1 = 1 "
+ " and A.id = #{id}"
+ "</script>")
RacePaperPageVO detail(@Param("id") Long id);
}

View File

@ -31,9 +31,17 @@ public interface RacetrSceneDAO extends MyBatisBaseDao<RacetrScene, Long, Racetr
+ "<if test='vo.type!= null and vo.type!= \"\"'> "
+ " and A.type = ${vo.type}"
+ "</if> "
+ "</script>")
List<RaceScenePageVO> pages(@Param("vo") RaceSceneQueryVO vo);
@Select("<script>"
+ "select A.id,A.name,A.type,A.map_id as mapId, B.name as mapName, A.proto"
+ ",A.creator_id,A.create_time,A.updater_id,A.update_time,C.nickname as creatorName,D.nickname as updaterName "
+ "from racetr_scene A left join map_info B on A.map_id = B.id "
+ "left join sys_account C on A.creator_id = C.id "
+ "left JOIN sys_account D on A.updater_id = D.id "
+ " where 1 = 1 "
+ " and A.id = #{id} "
+ "</script>")
RaceScenePageVO detail(@Param("id") Long id);
}

View File

@ -3,7 +3,12 @@ package club.joylink.rtss.dao.racetr;
import club.joylink.rtss.dao.MyBatisBaseDao;
import club.joylink.rtss.entity.racetr.RacetrScoringRule;
import club.joylink.rtss.entity.racetr.RacetrScoringRuleExample;
import club.joylink.rtss.vo.race.RaceRuleListVO;
import club.joylink.rtss.vo.race.TaskRuleQueryVO;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
/**
@ -13,4 +18,33 @@ import org.springframework.stereotype.Repository;
@Repository
public interface RacetrScoringRuleDAO extends MyBatisBaseDao<RacetrScoringRule, Long, RacetrScoringRuleExample> {
@Select("<script>"
+ " select A.id,A.name"
+ " ,A.creator_id,A.create_time,A.updater_id,A.update_time,C.nickname as creatorName,D.nickname as updaterName "
+ " from racetr_scoring_rule A "
+ " left join sys_account C on A.creator_id = C.id "
+ " left JOIN sys_account D on A.updater_id = D.id "
+ " where 1 = 1 "
+ "<if test='vo.name!= null and vo.name!= \"\"'> "
+ " and A.name like CONCAT('%',#{vo.name},'%') "
+ "</if> "
+ "<if test='vo.id!= null and vo.id >=0'> "
+ " and A.id = #{vo.id}"
+ "</if> "
+ "</script>")
List<RaceRuleListVO> pages(@Param("vo") TaskRuleQueryVO vo);
@Select("<script>"
+ " select A.id,A.name,A.rule"
+ " ,A.creator_id,A.create_time,A.updater_id,A.update_time,C.nickname as creatorName,D.nickname as updaterName "
+ " from racetr_scoring_rule A "
+ " left join sys_account C on A.creator_id = C.id "
+ " left JOIN sys_account D on A.updater_id = D.id "
+ " where 1 = 1 "
+ "<if test='vo.name!= null and vo.name!= \"\"'> "
+ " and A.name like CONCAT('%',#{vo.name},'%') "
+ "</if> "
+ " and A.id = #{id}"
+ "</script>")
RaceRuleListVO detail(@Param("id") Long id);
}

View File

@ -3,7 +3,9 @@ package club.joylink.rtss.dao.racetr;
import club.joylink.rtss.dao.MyBatisBaseDao;
import club.joylink.rtss.entity.racetr.RacetrTask;
import club.joylink.rtss.entity.racetr.RacetrTaskExample;
import org.apache.ibatis.annotations.Mapper;
import club.joylink.rtss.vo.race.RaceTaskDetailDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
/**
@ -13,4 +15,16 @@ import org.springframework.stereotype.Repository;
@Repository
public interface RacetrTaskDAO extends MyBatisBaseDao<RacetrTask, Long, RacetrTaskExample> {
@Select("<script>"
+ "select A.id,A.name,A.desc,A.content,A.standards,A.scene_id,B.name as sceneName, "
+ "A.score_rule_id as rule_id,C.name as ruleName,A.parent_id,"
+ "A.creator_id,A.create_time,A.updater_id,A.update_time,D.nickname as creatorName,E.nickname as updaterName "
+ " from racetr_task A left join racetr_scene B on A.scene_id = B.id "
+ " left join racetr_scoring_rule C on A.score_rule_id = C.id "
+ " left join sys_account D on A.creator_id = D.id "
+ " left JOIN sys_account E on A.updater_id = E.id "
+ " where 1 = 1 "
+ " and A.id = #{id}"
+ "</script>")
RaceTaskDetailDTO details(@Param("id") Long id);
}

View File

@ -29,7 +29,8 @@ import org.springframework.util.CollectionUtils;
@Service
@Slf4j
public class RaceModuleService extends RaceService {
@Deprecated
public class RaceModuleService extends RaceServiceUtil {
@Autowired
private RacetrModuleDAO moduleDAO;

View File

@ -1,14 +1,8 @@
package club.joylink.rtss.services.race;
import club.joylink.rtss.dao.racetr.RacetrModuleDAO;
import club.joylink.rtss.dao.racetr.RacetrPaperDAO;
import club.joylink.rtss.entity.SysAccount;
import club.joylink.rtss.entity.racetr.RacetrModule;
import club.joylink.rtss.entity.racetr.RacetrModuleExample;
import club.joylink.rtss.entity.racetr.RacetrPaper;
import club.joylink.rtss.entity.racetr.RacetrPaperExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO;
@ -22,29 +16,20 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestAttribute;
@Service
@Slf4j
public class RacePaperService extends RaceService {
public class RacePaperService {
@Autowired
private RacetrPaperDAO paperDAO;
/*@Autowired
private ISysUserService iSysUserService;
@Autowired
private RacetrModuleDAO moduleDAO;*/
private RacetrPaper findId(Long id) {
RacetrPaper rp = this.paperDAO.selectByPrimaryKey(id);
@ -88,7 +73,7 @@ public class RacePaperService extends RaceService {
private RacePaperVO convertVO(RacePaperPageVO rp) {
RacePaperVO.Builder builder = RacePaperVO.newBuilder();
ModifyInfoVO modifyInfoVO = this.createModifyInfo(rp.getCreatorId(), rp.getCreatorName(), rp.getUpdaterId(), rp.getUpdaterName(), rp.getCreateTime(), rp.getUpdateTime());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(rp.getCreatorId(), rp.getCreatorName(), rp.getUpdaterId(), rp.getUpdaterName(), rp.getCreateTime(), rp.getUpdateTime());
builder.setId(rp.getId());
builder.setName(rp.getName());
@ -112,36 +97,33 @@ public class RacePaperService extends RaceService {
}
public void delete(long id) {
// RacetrModuleExample moduleExample = new RacetrModuleExample();
// moduleExample.createCriteria().andPaperIdEqualTo(id);
// List<RacetrModule> modules = this.moduleDAO.selectByExample(moduleExample);
// BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(CollectionUtils.isEmpty(modules),
// String.format("已被模块[%s]关联不能删除", modules.stream().map(RacetrModule::getCode).collect(Collectors.joining(","))));
this.paperDAO.deleteByPrimaryKey(id);
}
public RacePaperDetailVO detail(Long id) {
RacePaperQueryVO query = new RacePaperQueryVO();
query.setId(id);
List<RacePaperPageVO> list = this.paperDAO.pages(query);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(!CollectionUtils.isEmpty(list), "未找到对应的试卷");
RacePaperPageVO paper = list.get(0);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(id), "请选择对应的试卷");
RacePaperPageVO paper = this.paperDAO.detail(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(paper), "未找到对应的试卷");
RacePaperDetailVO.Builder vo = RacePaperDetailVO.newBuilder();
vo.setId(paper.getId());
vo.setName(paper.getName());
vo.setDesc(paper.getDesc());
vo.setSupportCopy(!Objects.isNull(paper.getSupportCopy()) && paper.getSupportCopy());
vo.setModifyInfo(this.createModifyInfo(paper.getCreatorId(), paper.getCreatorName(), paper.getUpdaterId(), paper.getUpdaterName(), paper.getCreateTime(), paper.getUpdateTime()));
vo.setSeasonId(paper.getSeasonId());
vo.setSeasonName(Objects.isNull(paper.getSeasonName()) ? "" : paper.getSeasonName());
try {
RacePaperModuleVO moduleVO = RacePaperModuleVO.parseFrom(paper.getConfigs());
vo.setModuleVo(moduleVO);
} catch (Exception e) {
log.error("试卷[{}][{}] 配置解析失败 msg:[{}]", paper.getName(), paper.getId(), e.getMessage());
BusinessExceptionAssertEnum.DATA_ERROR.fail("数据配置解析失败");
vo.setModifyInfo(RaceServiceUtil.createModifyInfo(paper.getCreatorId(), paper.getCreatorName(), paper.getUpdaterId(), paper.getUpdaterName(), paper.getCreateTime(), paper.getUpdateTime()));
if (Objects.nonNull(paper.getSeasonId())) {
vo.setSeasonId(paper.getSeasonId());
vo.setSeasonName(paper.getSeasonName());
}
if (Objects.nonNull(paper.getConfigs())) {
try {
RacePaperModuleVO moduleVO = RacePaperModuleVO.parseFrom(paper.getConfigs());
vo.setModuleVo(moduleVO);
} catch (Exception e) {
log.error("试卷[{}][{}] 配置解析失败 msg:[{}]", paper.getName(), paper.getId(), e.getMessage());
BusinessExceptionAssertEnum.DATA_ERROR.fail("数据配置解析失败");
}
}
return vo.build();
}

View File

@ -1,23 +1,18 @@
package club.joylink.rtss.services.race;
import club.joylink.rtss.dao.DraftTraining2DAO;
import club.joylink.rtss.dao.MapInfoDAO;
import club.joylink.rtss.dao.racetr.RacetrSceneDAO;
import club.joylink.rtss.dao.racetr.RacetrTaskDAO;
import club.joylink.rtss.entity.SysAccount;
import club.joylink.rtss.entity.racetr.RacetrScene;
import club.joylink.rtss.entity.racetr.RacetrSceneExample;
import club.joylink.rtss.entity.racetr.RacetrTaskExample;
import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.IMapService;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.simulation.cbtc.training2.Training2;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO;
import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScene.Type;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneListVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScenePublishVO;
@ -33,7 +28,6 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@ -43,18 +37,14 @@ import org.springframework.util.CollectionUtils;
@Service
@Slf4j
public class RaceSceneService extends RaceService {
public class RaceSceneService {
@Autowired
private RacetrSceneDAO sceneDAO;
@Autowired
private RacetrTaskDAO taskDAO;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private DraftTraining2DAO trainingDao;
@Autowired
private IMapService iMapService;
public RacetrScene findById(Long id) {
@ -67,7 +57,6 @@ public class RaceSceneService extends RaceService {
PageHelper.startPage(query.getPageNum(), query.getPageSize());
Page<RaceScenePageVO> page = (Page<RaceScenePageVO>) this.sceneDAO.pages(query);
List<RaceSceneListVO> voList = this.convertDto(page.getResult());
return PageVO.convert(page, voList);
}
@ -75,7 +64,7 @@ public class RaceSceneService extends RaceService {
RaceSceneListVO.Builder vo = RaceSceneListVO.newBuilder();
vo.setId(rs.getId());
vo.setName(rs.getName());
ModifyInfoVO modifyInfoVO = this.createModifyInfo(rs.getCreatorId(), rs.getCreatorName(), rs.getUpdaterId(), rs.getUpdaterName(), rs.getCreateTime(), rs.getUpdateTime());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(rs.getCreatorId(), rs.getCreatorName(), rs.getUpdaterId(), rs.getUpdaterName(), rs.getCreateTime(), rs.getUpdateTime());
vo.setModifyInfo(modifyInfoVO);
vo.setType(Type.valueOf(rs.getType()));
vo.setMapId(rs.getMapId());
@ -147,29 +136,34 @@ public class RaceSceneService extends RaceService {
ss.setMemberJson(bs.getMemberJson());
ss.setStepJson(bs.getStepJson());
ss.addAllPlayerIds(plays);
return new PublishHereVO(bs.getMapId(), ss.build());
}
public RaceSceneVO detail(Long id) {
RacetrScene rs = this.findById(id);
Map<Long, SysAccount> accountMap = this.iSysUserService.findEntitiesForMap(List.of(rs.getCreatorId(), rs.getUpdaterId()));
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id), "请选择对应的场景");
RaceScenePageVO rs = this.sceneDAO.detail(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(rs), "没有找到对应的场景");
RaceSceneVO.Builder builder = RaceSceneVO.newBuilder();
builder.setId(rs.getId());
builder.setName(rs.getName());
builder.setType(Type.valueOf(rs.getType()));
builder.setMapId(rs.getMapId());
ModifyInfoVO modifyInfoVO = this.createModifyInfo(accountMap, rs.getCreatorId(), rs.getUpdaterId(), rs.getCreateTime(), rs.getUpdateTime());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(rs.getCreatorId(), rs.getCreatorName(), rs.getUpdaterId(), rs.getUpdaterName(), rs.getCreateTime(), rs.getUpdateTime());
builder.setModifyInfo(modifyInfoVO);
MapVO mapVO = this.iMapService.findMapBaseInfoById(rs.getMapId());
builder.setMapName(mapVO.getName());
try {
Scene scene = Scene.parseFrom(rs.getProto());
builder.setScene(scene);
} catch (Exception e) {
log.error("场景解析数据失败id[{}] msg:{}", id, e.getMessage());
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.fail("数据获取失败");
if (Objects.nonNull(rs.getMapId())) {
builder.setMapId(rs.getMapId());
builder.setMapName(rs.getName());
}
if (Objects.nonNull(rs.getProto())) {
try {
Scene scene = Scene.parseFrom(rs.getProto());
builder.setScene(scene);
} catch (Exception e) {
log.error("场景解析数据失败id[{}] msg:{}", id, e.getMessage());
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.fail("数据获取失败");
}
}
return builder.build();
}

View File

@ -2,15 +2,14 @@ package club.joylink.rtss.services.race;
import club.joylink.rtss.dao.racetr.RacetrScoringRuleDAO;
import club.joylink.rtss.dao.racetr.RacetrTaskDAO;
import club.joylink.rtss.entity.SysAccount;
import club.joylink.rtss.entity.racetr.RacetrScoringRule;
import club.joylink.rtss.entity.racetr.RacetrScoringRuleExample;
import club.joylink.rtss.entity.racetr.RacetrTaskExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO;
import club.joylink.rtss.vo.race.RaceRuleListVO;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleListVO;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleVO;
import club.joylink.rtss.vo.race.RaceScoringRule.Rule;
@ -19,12 +18,9 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -33,12 +29,11 @@ import org.springframework.util.StringUtils;
@Service
@Slf4j
public class RaceScoreRuleService extends RaceService {
public class RaceScoreRuleService {
@Autowired
private RacetrScoringRuleDAO ruleDAO;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private RacetrTaskDAO taskDAO;
@ -70,17 +65,18 @@ public class RaceScoreRuleService extends RaceService {
public PageVO<RaceScoringRuleListVO> page(TaskRuleQueryVO query) {
PageHelper.startPage(query.getPageNum(), query.getPageSize());
RacetrScoringRuleExample example = new RacetrScoringRuleExample();
/*RacetrScoringRuleExample example = new RacetrScoringRuleExample();
if (StringUtils.hasText(query.getName())) {
example.createCriteria().andNameLike(String.format("%%%s%%", query.getName()));
}
Page<RacetrScoringRule> page = (Page<RacetrScoringRule>) this.ruleDAO.selectByExample(example);
}*/
// Page<RacetrScoringRule> page = (Page<RacetrScoringRule>) this.ruleDAO.selectByExample(example);
Page<RaceRuleListVO> page = (Page<RaceRuleListVO>) this.ruleDAO.pages(query);
List<RaceScoringRuleListVO> voList = this.convertEntity(page.getResult());
return PageVO.convert(page, voList);
}
private RaceScoringRuleListVO convertVO(RacetrScoringRule rule, Map<Long, SysAccount> accountMap) {
ModifyInfoVO modifyInfoVO = this.createModifyInfo(accountMap, rule.getCreatorId(), rule.getUpdaterId(), rule.getCreateTime(), rule.getUpdateTime());
private RaceScoringRuleListVO convertVO(RaceRuleListVO rule) {
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(rule.getCreatorId(), rule.getCreatorName(), rule.getUpdaterId(), rule.getUpdaterName(), rule.getCreateTime(), rule.getUpdateTime());
RaceScoringRuleListVO.Builder builder = RaceScoringRuleListVO.newBuilder();
builder.setId(rule.getId());
builder.setName(rule.getName());
@ -88,15 +84,13 @@ public class RaceScoreRuleService extends RaceService {
return builder.build();
}
private List<RaceScoringRuleListVO> convertEntity(List<RacetrScoringRule> list) {
private List<RaceScoringRuleListVO> convertEntity(List<RaceRuleListVO> list) {
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
List<RaceScoringRuleListVO> voList = Lists.newArrayListWithCapacity(list.size());
List<Long> userIdList = list.stream().map(d -> List.of(d.getCreatorId(), d.getUpdaterId())).flatMap(Collection::stream).distinct().collect(Collectors.toList());
Map<Long, SysAccount> accountMap = this.iSysUserService.findEntitiesForMap(userIdList);
for (RacetrScoringRule rs : list) {
voList.add(this.convertVO(rs, accountMap));
for (RaceRuleListVO rs : list) {
voList.add(this.convertVO(rs));
}
return voList;
}
@ -118,16 +112,22 @@ public class RaceScoreRuleService extends RaceService {
}
public RaceScoringRuleVO detail(Long id) {
RacetrScoringRule rule = this.findId(id);
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id), "请选择对应的评分规则");
RaceRuleListVO detailVO = this.ruleDAO.detail(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(detailVO), "未找到对应的评分规则");
RaceScoringRuleVO.Builder builder = RaceScoringRuleVO.newBuilder();
builder.setId(rule.getId());
builder.setName(rule.getName());
builder.setId(detailVO.getId());
builder.setName(detailVO.getName());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(detailVO.getCreatorId(), detailVO.getCreatorName(), detailVO.getUpdaterId(), detailVO.getUpdaterName(), detailVO.getCreateTime(),
detailVO.getUpdateTime());
builder.setModifyInfo(modifyInfoVO);
try {
Rule rulePro = Rule.parseFrom(rule.getRule());
Rule rulePro = Rule.parseFrom(detailVO.getRule());
builder.setRule(rulePro);
} catch (Exception e) {
log.error("竞赛评分详情规则解析失败,msg:{} ", e.getMessage(), e);
BusinessExceptionAssertEnum.DATA_ERROR.fail("");
BusinessExceptionAssertEnum.DATA_ERROR.fail("评分规则数据解析失败");
}
return builder.build();
}

View File

@ -32,7 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@Service
public class RaceSeasonService extends RaceService {
public class RaceSeasonService {
@Autowired
private RacetrSeasonDAO seasonDAO;
@ -100,7 +100,7 @@ public class RaceSeasonService extends RaceService {
voBuild.setCode(rs.getCode());
voBuild.setGroup(Group.valueOf(rs.getGroup()));
voBuild.setTerm(rs.getTerm());
ModifyInfoVO modifyInfoVO = this.createModifyInfo(accountMap, rs.getCreatorId(), rs.getUpdaterId(), rs.getCreateTime(), rs.getUdpateTime());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(accountMap, rs.getCreatorId(), rs.getUpdaterId(), rs.getCreateTime(), rs.getUdpateTime());
voBuild.setModifyInfo(modifyInfoVO);
return voBuild.build();
}

View File

@ -7,10 +7,10 @@ import java.time.LocalDateTime;
import java.util.Map;
import java.util.Objects;
public class RaceService {
public class RaceServiceUtil {
public ModifyInfoVO createModifyInfo(Map<Long, SysAccount> accountMap, Long createId, Long updateId, LocalDateTime createTime, LocalDateTime updateTime) {
public static ModifyInfoVO createModifyInfo(Map<Long, SysAccount> accountMap, Long createId, Long updateId, LocalDateTime createTime, LocalDateTime updateTime) {
SysAccount createAcc = accountMap.get(createId);
ModifyInfoVO.Builder builder = ModifyInfoVO.newBuilder();
if (Objects.nonNull(createAcc)) {
@ -32,13 +32,13 @@ public class RaceService {
return builder.build();
}
public ModifyInfoVO createModifyInfo(Long createId, String createName, Long updateId, String updateName, LocalDateTime createTime, LocalDateTime updateTime) {
public static ModifyInfoVO createModifyInfo(Long createId, String createName, Long updateId, String updateName, LocalDateTime createTime, LocalDateTime updateTime) {
ModifyInfoVO.Builder builder = ModifyInfoVO.newBuilder();
builder.setCreatorId(createId);
builder.setCreatorName(createName);
builder.setCreatorId(updateId);
builder.setCreatorName(updateName);
builder.setUpdaterId(updateId);
builder.setUpdaterName(updateName);
if (Objects.nonNull(createTime)) {
builder.setCreateTime(createTime.format(DateTimeUtil.DATE_TIME_DTF));
}

View File

@ -1,7 +1,6 @@
package club.joylink.rtss.services.race;
import club.joylink.rtss.dao.racetr.RacetrTaskDAO;
import club.joylink.rtss.entity.SysAccount;
import club.joylink.rtss.entity.racetr.RacetrTask;
import club.joylink.rtss.entity.racetr.RacetrTaskExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
@ -13,6 +12,7 @@ import club.joylink.rtss.vo.race.RaceTask.RaceTaskBind.TaskBindType;
import club.joylink.rtss.vo.race.RaceTask.RaceTaskCreateVO;
import club.joylink.rtss.vo.race.RaceTask.RaceTaskDetailVO;
import club.joylink.rtss.vo.race.RaceTaskDetailDTO;
import club.joylink.rtss.vo.race.RaceTaskTreeVO;
import com.google.common.collect.Lists;
import java.time.LocalDateTime;
@ -21,7 +21,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -32,13 +31,11 @@ import org.springframework.util.CollectionUtils;
@Service
@Transactional
@Slf4j
public class RaceTaskService extends RaceService {
public class RaceTaskService {
@Autowired
private RacetrTaskDAO raceTaskDAO;
@Autowired
private ISysUserService iSysUserService;
private final static Long TASK_ROOT_ID = 0L;
private RacetrTask findById(Long id) {
@ -48,8 +45,9 @@ public class RaceTaskService extends RaceService {
}
public RaceTaskDetailVO detail(Long id) {
RacetrTask task = this.findById(id);
Map<Long, SysAccount> accountMap = this.iSysUserService.findEntitiesForMap(Stream.of(task.getCreatorId(), task.getUpdaterId()).distinct().collect(Collectors.toList()));
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(id), "请选择对应的任务");
RaceTaskDetailDTO task = this.raceTaskDAO.details(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(task), "未找到对应的任务数据");
RaceTaskDetailVO.Builder vo = RaceTaskDetailVO.newBuilder();
vo.setId(task.getId());
@ -58,11 +56,16 @@ public class RaceTaskService extends RaceService {
vo.setContent(task.getContent());
vo.setStandards(task.getStandards());
vo.setParentId(task.getParentId());
ModifyInfoVO modifyInfoVO = this.createModifyInfo(accountMap, task.getCreatorId(), task.getUpdaterId(), task.getCreateTime(), task.getUpdateTime());
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(task.getCreatorId(), task.getCreatorName(), task.getUpdaterId(), task.getUpdaterName(), task.getCreateTime(), task.getUpdateTime());
vo.setModifyInfo(modifyInfoVO);
vo.setSceneId(Objects.isNull(task.getSceneId()) ? 0L : task.getSceneId());
vo.setRuleId(Objects.isNull(task.getScoreRuleId()) ? 0L : task.getScoreRuleId());
if (Objects.nonNull(task.getSceneId())) {
vo.setSceneId(task.getSceneId());
vo.setSceneName(task.getSceneName());
}
if (Objects.nonNull(task.getSceneId())) {
vo.setRuleId(task.getRuleId());
vo.setRuleName(task.getRuleName());
}
return vo.build();
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.vo.race;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class RaceRuleListVO {
private Long id;
private String name;
private Long creatorId;
private LocalDateTime createTime;
private Long updaterId;
private LocalDateTime updateTime;
private String creatorName;
private String updaterName;
private byte[] rule;
}

View File

@ -17,4 +17,5 @@ public class RaceScenePageVO {
private LocalDateTime updateTime;
private String creatorName;
private String updaterName;
private byte[] proto;
}

View File

@ -1796,9 +1796,21 @@ public final class RaceTask {
*/
long getSceneId();
/**
* <code>string sceneName = 7;</code>
* @return The sceneName.
*/
java.lang.String getSceneName();
/**
* <code>string sceneName = 7;</code>
* @return The bytes for sceneName.
*/
com.google.protobuf.ByteString
getSceneNameBytes();
/**
* <pre>
* int64 sceneName = 7;
*绑定的评分id
* </pre>
*
* <code>int64 rule_id = 8;</code>
@ -1806,9 +1818,21 @@ public final class RaceTask {
*/
long getRuleId();
/**
* <code>string ruleName = 9;</code>
* @return The ruleName.
*/
java.lang.String getRuleName();
/**
* <code>string ruleName = 9;</code>
* @return The bytes for ruleName.
*/
com.google.protobuf.ByteString
getRuleNameBytes();
/**
* <pre>
* int64 ruleName = 9;
*父任务的ID
* </pre>
*
* <code>int64 parent_id = 10;</code>
@ -1848,6 +1872,8 @@ public final class RaceTask {
desc_ = "";
content_ = "";
standards_ = "";
sceneName_ = "";
ruleName_ = "";
}
@java.lang.Override
@ -2076,11 +2102,50 @@ public final class RaceTask {
return sceneId_;
}
public static final int SCENENAME_FIELD_NUMBER = 7;
@SuppressWarnings("serial")
private volatile java.lang.Object sceneName_ = "";
/**
* <code>string sceneName = 7;</code>
* @return The sceneName.
*/
@java.lang.Override
public java.lang.String getSceneName() {
java.lang.Object ref = sceneName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sceneName_ = s;
return s;
}
}
/**
* <code>string sceneName = 7;</code>
* @return The bytes for sceneName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSceneNameBytes() {
java.lang.Object ref = sceneName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sceneName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RULE_ID_FIELD_NUMBER = 8;
private long ruleId_ = 0L;
/**
* <pre>
* int64 sceneName = 7;
*绑定的评分id
* </pre>
*
* <code>int64 rule_id = 8;</code>
@ -2091,11 +2156,50 @@ public final class RaceTask {
return ruleId_;
}
public static final int RULENAME_FIELD_NUMBER = 9;
@SuppressWarnings("serial")
private volatile java.lang.Object ruleName_ = "";
/**
* <code>string ruleName = 9;</code>
* @return The ruleName.
*/
@java.lang.Override
public java.lang.String getRuleName() {
java.lang.Object ref = ruleName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
ruleName_ = s;
return s;
}
}
/**
* <code>string ruleName = 9;</code>
* @return The bytes for ruleName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getRuleNameBytes() {
java.lang.Object ref = ruleName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
ruleName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PARENT_ID_FIELD_NUMBER = 10;
private long parentId_ = 0L;
/**
* <pre>
* int64 ruleName = 9;
*父任务的ID
* </pre>
*
* <code>int64 parent_id = 10;</code>
@ -2164,9 +2268,15 @@ public final class RaceTask {
if (sceneId_ != 0L) {
output.writeInt64(6, sceneId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sceneName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, sceneName_);
}
if (ruleId_ != 0L) {
output.writeInt64(8, ruleId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, ruleName_);
}
if (parentId_ != 0L) {
output.writeInt64(10, parentId_);
}
@ -2202,10 +2312,16 @@ public final class RaceTask {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, sceneId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sceneName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, sceneName_);
}
if (ruleId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(8, ruleId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ruleName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, ruleName_);
}
if (parentId_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(10, parentId_);
@ -2241,8 +2357,12 @@ public final class RaceTask {
.equals(other.getStandards())) return false;
if (getSceneId()
!= other.getSceneId()) return false;
if (!getSceneName()
.equals(other.getSceneName())) return false;
if (getRuleId()
!= other.getRuleId()) return false;
if (!getRuleName()
.equals(other.getRuleName())) return false;
if (getParentId()
!= other.getParentId()) return false;
if (hasModifyInfo() != other.hasModifyInfo()) return false;
@ -2275,9 +2395,13 @@ public final class RaceTask {
hash = (37 * hash) + SCENE_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getSceneId());
hash = (37 * hash) + SCENENAME_FIELD_NUMBER;
hash = (53 * hash) + getSceneName().hashCode();
hash = (37 * hash) + RULE_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getRuleId());
hash = (37 * hash) + RULENAME_FIELD_NUMBER;
hash = (53 * hash) + getRuleName().hashCode();
hash = (37 * hash) + PARENT_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getParentId());
@ -2422,7 +2546,9 @@ public final class RaceTask {
content_ = "";
standards_ = "";
sceneId_ = 0L;
sceneName_ = "";
ruleId_ = 0L;
ruleName_ = "";
parentId_ = 0L;
modifyInfo_ = null;
if (modifyInfoBuilder_ != null) {
@ -2481,12 +2607,18 @@ public final class RaceTask {
result.sceneId_ = sceneId_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.ruleId_ = ruleId_;
result.sceneName_ = sceneName_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.parentId_ = parentId_;
result.ruleId_ = ruleId_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.ruleName_ = ruleName_;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.parentId_ = parentId_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.modifyInfo_ = modifyInfoBuilder_ == null
? modifyInfo_
: modifyInfoBuilder_.build();
@ -2531,9 +2663,19 @@ public final class RaceTask {
if (other.getSceneId() != 0L) {
setSceneId(other.getSceneId());
}
if (!other.getSceneName().isEmpty()) {
sceneName_ = other.sceneName_;
bitField0_ |= 0x00000040;
onChanged();
}
if (other.getRuleId() != 0L) {
setRuleId(other.getRuleId());
}
if (!other.getRuleName().isEmpty()) {
ruleName_ = other.ruleName_;
bitField0_ |= 0x00000100;
onChanged();
}
if (other.getParentId() != 0L) {
setParentId(other.getParentId());
}
@ -2596,21 +2738,31 @@ public final class RaceTask {
bitField0_ |= 0x00000020;
break;
} // case 48
case 64: {
ruleId_ = input.readInt64();
case 58: {
sceneName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000040;
break;
} // case 58
case 64: {
ruleId_ = input.readInt64();
bitField0_ |= 0x00000080;
break;
} // case 64
case 74: {
ruleName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000100;
break;
} // case 74
case 80: {
parentId_ = input.readInt64();
bitField0_ |= 0x00000080;
bitField0_ |= 0x00000200;
break;
} // case 80
case 90: {
input.readMessage(
getModifyInfoFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000100;
bitField0_ |= 0x00000400;
break;
} // case 90
default: {
@ -3054,10 +3206,82 @@ public final class RaceTask {
return this;
}
private java.lang.Object sceneName_ = "";
/**
* <code>string sceneName = 7;</code>
* @return The sceneName.
*/
public java.lang.String getSceneName() {
java.lang.Object ref = sceneName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sceneName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string sceneName = 7;</code>
* @return The bytes for sceneName.
*/
public com.google.protobuf.ByteString
getSceneNameBytes() {
java.lang.Object ref = sceneName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sceneName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string sceneName = 7;</code>
* @param value The sceneName to set.
* @return This builder for chaining.
*/
public Builder setSceneName(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
sceneName_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
* <code>string sceneName = 7;</code>
* @return This builder for chaining.
*/
public Builder clearSceneName() {
sceneName_ = getDefaultInstance().getSceneName();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
/**
* <code>string sceneName = 7;</code>
* @param value The bytes for sceneName to set.
* @return This builder for chaining.
*/
public Builder setSceneNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
sceneName_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
private long ruleId_ ;
/**
* <pre>
* int64 sceneName = 7;
*绑定的评分id
* </pre>
*
* <code>int64 rule_id = 8;</code>
@ -3069,7 +3293,7 @@ public final class RaceTask {
}
/**
* <pre>
* int64 sceneName = 7;
*绑定的评分id
* </pre>
*
* <code>int64 rule_id = 8;</code>
@ -3079,29 +3303,101 @@ public final class RaceTask {
public Builder setRuleId(long value) {
ruleId_ = value;
bitField0_ |= 0x00000040;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
* <pre>
* int64 sceneName = 7;
*绑定的评分id
* </pre>
*
* <code>int64 rule_id = 8;</code>
* @return This builder for chaining.
*/
public Builder clearRuleId() {
bitField0_ = (bitField0_ & ~0x00000040);
bitField0_ = (bitField0_ & ~0x00000080);
ruleId_ = 0L;
onChanged();
return this;
}
private java.lang.Object ruleName_ = "";
/**
* <code>string ruleName = 9;</code>
* @return The ruleName.
*/
public java.lang.String getRuleName() {
java.lang.Object ref = ruleName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
ruleName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string ruleName = 9;</code>
* @return The bytes for ruleName.
*/
public com.google.protobuf.ByteString
getRuleNameBytes() {
java.lang.Object ref = ruleName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
ruleName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string ruleName = 9;</code>
* @param value The ruleName to set.
* @return This builder for chaining.
*/
public Builder setRuleName(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ruleName_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
* <code>string ruleName = 9;</code>
* @return This builder for chaining.
*/
public Builder clearRuleName() {
ruleName_ = getDefaultInstance().getRuleName();
bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
return this;
}
/**
* <code>string ruleName = 9;</code>
* @param value The bytes for ruleName to set.
* @return This builder for chaining.
*/
public Builder setRuleNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
ruleName_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
private long parentId_ ;
/**
* <pre>
* int64 ruleName = 9;
*父任务的ID
* </pre>
*
* <code>int64 parent_id = 10;</code>
@ -3113,7 +3409,7 @@ public final class RaceTask {
}
/**
* <pre>
* int64 ruleName = 9;
*父任务的ID
* </pre>
*
* <code>int64 parent_id = 10;</code>
@ -3123,20 +3419,20 @@ public final class RaceTask {
public Builder setParentId(long value) {
parentId_ = value;
bitField0_ |= 0x00000080;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
* <pre>
* int64 ruleName = 9;
*父任务的ID
* </pre>
*
* <code>int64 parent_id = 10;</code>
* @return This builder for chaining.
*/
public Builder clearParentId() {
bitField0_ = (bitField0_ & ~0x00000080);
bitField0_ = (bitField0_ & ~0x00000200);
parentId_ = 0L;
onChanged();
return this;
@ -3150,7 +3446,7 @@ public final class RaceTask {
* @return Whether the modifyInfo field is set.
*/
public boolean hasModifyInfo() {
return ((bitField0_ & 0x00000100) != 0);
return ((bitField0_ & 0x00000400) != 0);
}
/**
* <code>.common.ModifyInfoVO modify_info = 11;</code>
@ -3175,7 +3471,7 @@ public final class RaceTask {
} else {
modifyInfoBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
@ -3189,7 +3485,7 @@ public final class RaceTask {
} else {
modifyInfoBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
@ -3198,7 +3494,7 @@ public final class RaceTask {
*/
public Builder mergeModifyInfo(club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO value) {
if (modifyInfoBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0) &&
if (((bitField0_ & 0x00000400) != 0) &&
modifyInfo_ != null &&
modifyInfo_ != club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO.getDefaultInstance()) {
getModifyInfoBuilder().mergeFrom(value);
@ -3208,7 +3504,7 @@ public final class RaceTask {
} else {
modifyInfoBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000100;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
@ -3216,7 +3512,7 @@ public final class RaceTask {
* <code>.common.ModifyInfoVO modify_info = 11;</code>
*/
public Builder clearModifyInfo() {
bitField0_ = (bitField0_ & ~0x00000100);
bitField0_ = (bitField0_ & ~0x00000400);
modifyInfo_ = null;
if (modifyInfoBuilder_ != null) {
modifyInfoBuilder_.dispose();
@ -3229,7 +3525,7 @@ public final class RaceTask {
* <code>.common.ModifyInfoVO modify_info = 11;</code>
*/
public club.joylink.rtss.vo.common.ModifyInfo.ModifyInfoVO.Builder getModifyInfoBuilder() {
bitField0_ |= 0x00000100;
bitField0_ |= 0x00000400;
onChanged();
return getModifyInfoFieldBuilder().getBuilder();
}
@ -5219,19 +5515,20 @@ public final class RaceTask {
"c\030\003 \001(\t\022\017\n\007content\030\004 \001(\t\022\021\n\tstandards\030\005 " +
"\001(\t\022 \n\005scene\030\006 \001(\0132\021.race.RaceSceneVO\022\020\n" +
"\010parentId\030\007 \001(\003\022(\n\nmodifyInfo\030\010 \001(\0132\024.co" +
"mmon.ModifyInfoVO\"\277\001\n\020RaceTaskDetailVO\022\n" +
"mmon.ModifyInfoVO\"\344\001\n\020RaceTaskDetailVO\022\n" +
"\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\014\n\004desc\030\003 \001(\t\022\017" +
"\n\007content\030\004 \001(\t\022\021\n\tstandards\030\005 \001(\t\022\020\n\010sc" +
"ene_id\030\006 \001(\003\022\017\n\007rule_id\030\010 \001(\003\022\021\n\tparent_" +
"id\030\n \001(\003\022)\n\013modify_info\030\013 \001(\0132\024.common.M" +
"odifyInfoVO\"w\n\020RaceTaskCreateVO\022\014\n\004name\030" +
"\001 \001(\t\022\014\n\004desc\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\021\n\t" +
"standards\030\004 \001(\t\022\020\n\010scene_id\030\005 \001(\003\022\021\n\tpar" +
"ent_id\030\006 \001(\003\"\210\001\n\014RaceTaskBind\022\017\n\007bind_id" +
"\030\002 \001(\003\0222\n\tbind_type\030\003 \001(\0162\037.race.RaceTas" +
"kBind.TaskBindType\022\016\n\006status\030\004 \001(\005\"#\n\014Ta" +
"skBindType\022\010\n\004rule\020\000\022\t\n\005scene\020\001B\033\n\031club." +
"joylink.rtss.vo.raceb\006proto3"
"ene_id\030\006 \001(\003\022\021\n\tsceneName\030\007 \001(\t\022\017\n\007rule_" +
"id\030\010 \001(\003\022\020\n\010ruleName\030\t \001(\t\022\021\n\tparent_id\030" +
"\n \001(\003\022)\n\013modify_info\030\013 \001(\0132\024.common.Modi" +
"fyInfoVO\"w\n\020RaceTaskCreateVO\022\014\n\004name\030\001 \001" +
"(\t\022\014\n\004desc\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\021\n\tsta" +
"ndards\030\004 \001(\t\022\020\n\010scene_id\030\005 \001(\003\022\021\n\tparent" +
"_id\030\006 \001(\003\"\210\001\n\014RaceTaskBind\022\017\n\007bind_id\030\002 " +
"\001(\003\0222\n\tbind_type\030\003 \001(\0162\037.race.RaceTaskBi" +
"nd.TaskBindType\022\016\n\006status\030\004 \001(\005\"#\n\014TaskB" +
"indType\022\010\n\004rule\020\000\022\t\n\005scene\020\001B\033\n\031club.joy" +
"link.rtss.vo.raceb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@ -5250,7 +5547,7 @@ public final class RaceTask {
internal_static_race_RaceTaskDetailVO_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_race_RaceTaskDetailVO_descriptor,
new java.lang.String[] { "Id", "Name", "Desc", "Content", "Standards", "SceneId", "RuleId", "ParentId", "ModifyInfo", });
new java.lang.String[] { "Id", "Name", "Desc", "Content", "Standards", "SceneId", "SceneName", "RuleId", "RuleName", "ParentId", "ModifyInfo", });
internal_static_race_RaceTaskCreateVO_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_race_RaceTaskCreateVO_fieldAccessorTable = new

View File

@ -0,0 +1,28 @@
package club.joylink.rtss.vo.race;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class RaceTaskDetailDTO {
private Long id;
private String name;
private String desc;
private String content;
private String standards;
private Long sceneId;
private String sceneName;
private Long ruleId;
private String ruleName;
private Long parentId;
private Long creatorId;
private LocalDateTime createTime;
private Long updaterId;
private LocalDateTime updateTime;
private String creatorName;
private String updaterName;
}

View File

@ -7,4 +7,5 @@ import lombok.Data;
public class TaskRuleQueryVO extends PageQueryVO {
private String name;
private Long id;
}

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneListVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScenePublishVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneVO;
import club.joylink.rtss.vo.race.RaceSceneQueryVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@ -35,6 +36,7 @@ public class SceneServiceTest {
@Test
public void detailTest() {
RaceSceneVO vo = this.sceneService.detail(2L);
System.out.println(JsonUtils.writeValueAsString(vo));
}
}

View File

@ -82,6 +82,12 @@ public class TaskServiceTest {
System.out.println(JsonUtils.writeValueAsString(voList));
}
@Test
public void detail() {
RaceTaskDetailVO vo = this.taskService.detail(33L);
System.out.println(JsonUtils.writeValueAsString(vo));
}
@Test
public void deleteTest() {
this.taskService.delete(2L);