大赛管理功能

This commit is contained in:
tiger_zhou 2024-02-26 14:03:39 +08:00
parent 2647a26869
commit 8200bd7c76
3 changed files with 26 additions and 9 deletions

View File

@ -41,9 +41,6 @@ public interface RacetrScoringRuleDAO extends MyBatisBaseDao<RacetrScoringRule,
+ " 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

@ -122,12 +122,14 @@ public class RaceScoreRuleService {
ModifyInfoVO modifyInfoVO = RaceServiceUtil.createModifyInfo(detailVO.getCreatorId(), detailVO.getCreatorName(), detailVO.getUpdaterId(), detailVO.getUpdaterName(), detailVO.getCreateTime(),
detailVO.getUpdateTime());
builder.setModifyInfo(modifyInfoVO);
try {
Rule rulePro = Rule.parseFrom(detailVO.getRule());
builder.setRule(rulePro);
} catch (Exception e) {
log.error("竞赛评分详情规则解析失败,msg:{} ", e.getMessage(), e);
BusinessExceptionAssertEnum.DATA_ERROR.fail("评分规则数据解析失败");
if (Objects.nonNull(detailVO.getRule())) {
try {
Rule rulePro = Rule.parseFrom(detailVO.getRule());
builder.setRule(rulePro);
} catch (Exception e) {
log.error("竞赛评分详情规则解析失败,msg:{} ", e.getMessage(), e);
BusinessExceptionAssertEnum.DATA_ERROR.fail("评分规则数据解析失败");
}
}
return builder.build();
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.services.race;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class ScoreRuleServiceTest {
@Autowired
private RaceScoreRuleService ruleService;
@Test
public void detail() {
this.ruleService.detail(2L);
}
}