Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-zhouyin

This commit is contained in:
tiger_zhou 2022-11-28 14:10:36 +08:00
commit a2ee2e1858
5 changed files with 37 additions and 96 deletions

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.controller.training2;
import club.joylink.rtss.services.training2.Training2PublishService;
import club.joylink.rtss.services.training2.Training2TypeEnum;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.training2.publish.*;
import lombok.extern.slf4j.Slf4j;
@ -47,20 +48,31 @@ public class TrainingV2PublishController {
public DeletePublishedTraining2RspVo deletePublishedTrainings(@RequestBody DeletePublishedTraining2ReqVo req){
return this.publishService.deletePublishedTrainings(req);
}
/**
* 根据mapId查所有的已发布单操实训的基础信息
*/
@GetMapping("/{mapId}/singles")
public List<PublishedTraining2InfoRspVo> findAllSingleTrainingBasicInfo(@PathVariable("mapId") Long mapId){
public List<PublishedTraining2InfoRspVo> findSingleTrainingBasicInfo(@PathVariable("mapId") Long mapId){
return this.publishService.findAllSingleTrainingBasicInfoByMapId(mapId);
}
/**
* 根据mapId查所有的已发布场景实训的基础信息
*/
@GetMapping("/{mapId}/scenes")
public List<PublishedTraining2InfoRspVo> findAllSceneTrainingBasicInfo(@PathVariable("mapId") Long mapId){
public List<PublishedTraining2InfoRspVo> findSceneTrainingBasicInfo(@PathVariable("mapId") Long mapId){
return this.publishService.findAllSceneTrainingBasicInfoByMapId(mapId);
}
/**
* 查所有的已发布场景实训的基础信息
*/
@GetMapping("/list")
public List<PublishedTraining2InfoRspVo> findTrainingList(Long mapId,Training2TypeEnum type){
return this.publishService.findTrainingInfo(mapId, type);
}
/**
* 根据实训id查该已发布实训的所有信息
*/

View File

@ -394,76 +394,6 @@ public class ProjectExample {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andViewShowIsNull() {
addCriterion("`view_show` is null");
return (Criteria) this;
}
public Criteria andViewShowIsNotNull() {
addCriterion("`view_show` is not null");
return (Criteria) this;
}
public Criteria andViewShowEqualTo(Integer value) {
addCriterion("`view_show` =", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowNotEqualTo(Integer value) {
addCriterion("`view_show` <>", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowGreaterThan(Integer value) {
addCriterion("`view_show` >", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowGreaterThanOrEqualTo(Integer value) {
addCriterion("`view_show` >=", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowLessThan(Integer value) {
addCriterion("`view_show` <", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowLessThanOrEqualTo(Integer value) {
addCriterion("`view_show` <=", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowLike(Integer value) {
addCriterion("`view_show` like", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowNotLike(Integer value) {
addCriterion("`view_show` not like", value, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowIn(List<Integer> values) {
addCriterion("`view_show` in", values, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowNotIn(List<Integer> values) {
addCriterion("`view_show` not in", values, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowBetween(Integer value1, Integer value2) {
addCriterion("`view_show` between", value1, value2, "viewShow");
return (Criteria) this;
}
public Criteria andViewShowNotBetween(Integer value1, Integer value2) {
addCriterion("`view_show` not between", value1, value2, "viewShow");
return (Criteria) this;
}
}
/**

View File

@ -57,7 +57,6 @@ public class OrgUserManageService {
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
example.setLimit(10);
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(example);
if (CollectionUtils.isEmpty(sysAccounts)) {
return new ArrayList<>();

View File

@ -19,6 +19,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 已发布实训管理业务实现
@ -202,18 +203,7 @@ public class Training2PublishService {
*/
@Transactional(readOnly = true)
public List<PublishedTraining2InfoRspVo> findAllSingleTrainingBasicInfoByMapId(Long mapId) {
List<PublishedTraining2InfoRspVo> rsp = new ArrayList<>();
//
PublishedTraining2Example example = new PublishedTraining2Example();
example.createCriteria().andMapIdEqualTo(mapId).andTypeEqualTo(Training2TypeEnum.single.value());
List<PublishedTraining2> list = this.publishedDao.selectByExample(example);
if (!CollectionUtils.isEmpty(list)) {
list.forEach(p -> {
rsp.add(Training2Convertor.convertFrom(p));
});
}
//
return rsp;
return findTrainingInfo(mapId, Training2TypeEnum.single);
}
/**
@ -221,18 +211,28 @@ public class Training2PublishService {
*/
@Transactional(readOnly = true)
public List<PublishedTraining2InfoRspVo> findAllSceneTrainingBasicInfoByMapId(Long mapId) {
List<PublishedTraining2InfoRspVo> rsp = new ArrayList<>();
//
PublishedTraining2Example example = new PublishedTraining2Example();
example.createCriteria().andMapIdEqualTo(mapId).andTypeEqualTo(Training2TypeEnum.scene.value());
List<PublishedTraining2> list = this.publishedDao.selectByExample(example);
if (!CollectionUtils.isEmpty(list)) {
list.forEach(p -> {
rsp.add(Training2Convertor.convertFrom(p));
});
return findTrainingInfo(mapId, Training2TypeEnum.scene);
}
/**
* 根据地图ID和类型查询实训列表
*/
public List<PublishedTraining2InfoRspVo> findTrainingInfo(Long mapId, Training2TypeEnum type) {
PublishedTraining2Example example = new PublishedTraining2Example();
PublishedTraining2Example.Criteria criteria = example.createCriteria();
if (mapId != null) {
criteria.andMapIdEqualTo(mapId);
}
if (type != null) {
criteria.andTypeEqualTo(type.value());
}
List<PublishedTraining2> list = this.publishedDao.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
return List.of();
} else {
return list.stream().map(Training2Convertor::convertFrom).collect(Collectors.toList());
}
//
return rsp;
}
/**

View File

@ -275,7 +275,7 @@
FROM org_user os
LEFT JOIN org o ON o.id = os.org_id
LEFT JOIN org ro ON o.root_id = ro.id
WHERE os.user_id = #{userId}
WHERE os.user_id = #{userId} and o.status = 1
</select>
</mapper>