地图绘制进路数据、延续保护数据、信号机接近区段数据维护接口添加

This commit is contained in:
walker-sheng 2021-05-27 10:19:56 +08:00
parent d656a5071b
commit bc5b9c5009
20 changed files with 456 additions and 144 deletions

View File

@ -34,8 +34,8 @@ public class AuthenticateInterceptor implements HandlerInterceptor {
throws Exception {
// 登陆权限验证
if(RequestMethod.OPTIONS.name().equals(request.getMethod())) return true;
log.debug(String.format("request[Method: '%s', RequestURI: '%s']",
request.getMethod(), request.getRequestURI()));
log.debug(String.format("request[%s %s from:%s]",
request.getMethod(), request.getRequestURI(), request.getRemoteAddr()));
String token = request.getHeader("X-Token");
BusinessExceptionAssertEnum.NOT_LOGIN.assertTrue(StringUtils.hasText(token));
LoginUserInfoVO loginUserInfoVO = null;

View File

@ -342,38 +342,38 @@ public class DraftMapController {
}
/*-------------- 延续保护 ------------------*/
@ApiOperation(value = "创建延续保护")
@PostMapping(path = "/overlap")
public void createOverlap(@RequestBody @Validated MapOverlapVO mapOverlapVO) {
this.iDraftMapService.createOverlap(mapOverlapVO);
}
@ApiOperation(value = "分页查询延续保护列表")
@GetMapping(path = "/{mapId}/overlap/paging")
public PageVO<MapOverlapVO> queryPagedOverlap(
@PathVariable Long mapId,
MapOverlapQueryVO queryVO) {
return this.iDraftMapService.queryPagedOverlap(mapId, queryVO);
}
@ApiOperation(value = "根据id查询延续保护")
@GetMapping(path = "/overlap/{id}")
public MapOverlapVO getOverlapById(@PathVariable Long id) {
return this.iDraftMapService.getOverlapById(id);
}
@ApiOperation(value = "更新延续保护")
@PutMapping(path = "/overlap/{id}")
public void updateOverlap(@PathVariable Long id, @RequestBody @Validated MapOverlapVO mapOverlapVO) {
this.iDraftMapService.updateOverlap(id, mapOverlapVO);
}
@ApiOperation(value = "删除延续保护")
@DeleteMapping(path = "/overlap/{id}")
public void deleteOverlap(@PathVariable Long id) {
this.iDraftMapService.deleteOverlap(id);
}
//
// @ApiOperation(value = "创建延续保护")
// @PostMapping(path = "/overlap")
// public void createOverlap(@RequestBody @Validated MapOverlapVO mapOverlapVO) {
// this.iDraftMapService.createOverlap(mapOverlapVO);
// }
//
// @ApiOperation(value = "分页查询延续保护列表")
// @GetMapping(path = "/{mapId}/overlap/paging")
// public PageVO<MapOverlapVO> queryPagedOverlap(
// @PathVariable Long mapId,
// MapOverlapQueryVO queryVO) {
// return this.iDraftMapService.queryPagedOverlap(mapId, queryVO);
// }
//
// @ApiOperation(value = "根据id查询延续保护")
// @GetMapping(path = "/overlap/{id}")
// public MapOverlapVO getOverlapById(@PathVariable Long id) {
// return this.iDraftMapService.getOverlapById(id);
// }
//
// @ApiOperation(value = "更新延续保护")
// @PutMapping(path = "/overlap/{id}")
// public void updateOverlap(@PathVariable Long id, @RequestBody @Validated MapOverlapVO mapOverlapVO) {
// this.iDraftMapService.updateOverlap(id, mapOverlapVO);
// }
//
// @ApiOperation(value = "删除延续保护")
// @DeleteMapping(path = "/overlap/{id}")
// public void deleteOverlap(@PathVariable Long id) {
// this.iDraftMapService.deleteOverlap(id);
// }
/*-------------- 自动折返 ------------------*/

View File

@ -0,0 +1,41 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapOverlapService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/draftMap/{id}/overlap")
@Slf4j
public class DraftMapOverlapController {
@Autowired
private DraftMapOverlapService draftMapOverlapService;
@GetMapping("/paging")
public PageVO<MapOverlapVO> pagingQuery(@PathVariable Long id, MapOverlapQueryVO queryVO) {
return this.draftMapOverlapService.pagingQuery(id, queryVO);
}
@GetMapping("/all")
public List<MapOverlapVO> queryAll(@PathVariable Long id) {
return this.draftMapOverlapService.queryAll(id);
}
@PutMapping("/{code}")
public void update(@PathVariable Long id, @PathVariable String code, @RequestBody MapOverlapVO vo) {
this.draftMapOverlapService.update(id, code, vo);
}
@DeleteMapping("/{code}")
public void delete(@PathVariable Long id, @PathVariable String code) {
this.draftMapOverlapService.delete(id, code);
}
}

View File

@ -1,6 +1,8 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapRouteService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapRouteNewVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,11 +23,21 @@ public class DraftMapRouteController {
return this.draftMapRouteService.createRailwayRoute(id, routeNewVO);
}
@GetMapping("/paging")
public PageVO<MapRouteNewVO> pagingQuery(@PathVariable Long id, MapRouteQueryVO queryVO) {
return this.draftMapRouteService.pagingQuery(id, queryVO);
}
@GetMapping("/all")
public List<MapRouteNewVO> queryAllRoutes(@PathVariable Long id) {
return this.draftMapRouteService.queryAllRoutes(id);
}
@PutMapping("/{code}")
public void update(@PathVariable Long id, @PathVariable String code, @RequestBody MapRouteNewVO routeNewVO) {
this.draftMapRouteService.update(id, code, routeNewVO);
}
@DeleteMapping("/{code}")
public void delete(@PathVariable Long id, @PathVariable String code) {
this.draftMapRouteService.deleteRoute(id, code);

View File

@ -0,0 +1,36 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapSignalApproachSectionService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapSASQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapSignalApproachSectionVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/draftMap/{id}/signalApproachSection")
@Slf4j
public class DraftMapSignalApproachSectionController {
@Autowired
private DraftMapSignalApproachSectionService draftMapSignalApproachSectionService;
@GetMapping("/paging")
public PageVO<MapSignalApproachSectionVO> pagingQuery(@PathVariable Long id, MapSASQueryVO queryVO) {
return this.draftMapSignalApproachSectionService.pagingQuery(id, queryVO);
}
@GetMapping("/all")
public List<MapSignalApproachSectionVO> queryAll(@PathVariable Long id) {
return this.draftMapSignalApproachSectionService.queryAll(id);
}
@PutMapping("/{signalCode}")
public void update(@PathVariable Long id, @PathVariable String signalCode, @RequestBody MapSignalApproachSectionVO vo) {
this.draftMapSignalApproachSectionService.update(id, signalCode, vo);
}
}

View File

@ -865,9 +865,6 @@ public class DraftMapService implements IDraftMapService {
if (StringUtils.hasText(queryVO.getEndSignalCode())) {
criteria.andEndSignalCodeEqualTo(queryVO.getEndSignalCode());
}
if (StringUtils.hasText(queryVO.getNearSectionCode())) {
criteria.andNearSectionCodeEqualTo(queryVO.getNearSectionCode());
}
Page<DraftMapRoute> pageTotal = (Page<DraftMapRoute>) draftMapRouteDAO.selectByExampleWithBLOBs(example);
List<MapRouteVO> routeVOList = pageTotal.getResult().stream().map(MapRouteVO::convert2VO).collect(Collectors.toList());
return PageVO.convert(pageTotal, routeVOList);
@ -936,50 +933,50 @@ public class DraftMapService implements IDraftMapService {
/*------------ Route END ---------------------*/
/*------------overlap start ---------------------*/
@Override
public void createOverlap(MapOverlapVO mapOverlapVO) {
if (StringUtils.hasText(mapOverlapVO.getName())) {
confirmOverlapNameNotRepeat(mapOverlapVO);
}
DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft();
this.draftMapOverlapDAO.insert(draftMapOverlap);
}
@Override
public PageVO<MapOverlapVO> queryPagedOverlap(Long mapId, MapOverlapQueryVO queryVO) {
Objects.requireNonNull(mapId);
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
DraftMapOverlapExample example = new DraftMapOverlapExample();
DraftMapOverlapExample.Criteria criteria = example.createCriteria();
criteria.andMapIdEqualTo(mapId);
if (StringUtils.hasText(queryVO.getCode())) {
criteria.andCodeEqualTo(queryVO.getCode());
}
Page<DraftMapOverlap> page = (Page<DraftMapOverlap>)
this.draftMapOverlapDAO.selectByExampleWithBLOBs(example);
List<MapOverlapVO> voList = page.getResult().stream().map(MapOverlapVO::convert2VO).collect(Collectors.toList());
return PageVO.convert(page, voList);
}
@Override
public MapOverlapVO getOverlapById(Long id) {
Objects.requireNonNull(id);
DraftMapOverlap draftMapOverlap = getDraftMapOverlapEntity(id);
return MapOverlapVO.convert2VO(draftMapOverlap);
}
@Override
public void updateOverlap(Long id, MapOverlapVO mapOverlapVO) {
getDraftMapOverlapEntity(id);
DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft();
draftMapOverlap.setId(id);
this.draftMapOverlapDAO.updateByPrimaryKeySelective(draftMapOverlap);
}
@Override
public void deleteOverlap(Long id) {
this.draftMapOverlapDAO.deleteByPrimaryKey(id);
}
// @Override
// public void createOverlap(MapOverlapVO mapOverlapVO) {
// if (StringUtils.hasText(mapOverlapVO.getName())) {
// confirmOverlapNameNotRepeat(mapOverlapVO);
// }
// DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft();
// this.draftMapOverlapDAO.insert(draftMapOverlap);
// }
//
// @Override
// public PageVO<MapOverlapVO> queryPagedOverlap(Long mapId, MapOverlapQueryVO queryVO) {
// Objects.requireNonNull(mapId);
// PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
// DraftMapOverlapExample example = new DraftMapOverlapExample();
// DraftMapOverlapExample.Criteria criteria = example.createCriteria();
// criteria.andMapIdEqualTo(mapId);
// if (StringUtils.hasText(queryVO.getCode())) {
// criteria.andCodeEqualTo(queryVO.getCode());
// }
// Page<DraftMapOverlap> page = (Page<DraftMapOverlap>)
// this.draftMapOverlapDAO.selectByExampleWithBLOBs(example);
// List<MapOverlapVO> voList = page.getResult().stream().map(MapOverlapVO::convert2VO).collect(Collectors.toList());
// return PageVO.convert(page, voList);
// }
//
// @Override
// public MapOverlapVO getOverlapById(Long id) {
// Objects.requireNonNull(id);
// DraftMapOverlap draftMapOverlap = getDraftMapOverlapEntity(id);
// return MapOverlapVO.convert2VO(draftMapOverlap);
// }
//
// @Override
// public void updateOverlap(Long id, MapOverlapVO mapOverlapVO) {
// getDraftMapOverlapEntity(id);
// DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft();
// draftMapOverlap.setId(id);
// this.draftMapOverlapDAO.updateByPrimaryKeySelective(draftMapOverlap);
// }
//
// @Override
// public void deleteOverlap(Long id) {
// this.draftMapOverlapDAO.deleteByPrimaryKey(id);
// }
/*------------ Overlap END ---------------------*/

View File

@ -241,15 +241,15 @@ public interface IDraftMapService {
void deleteRoute(Long routeId);
/*------------overlap start ---------------------*/
void createOverlap(MapOverlapVO mapOverlapVO);
PageVO<MapOverlapVO> queryPagedOverlap(Long mapId, MapOverlapQueryVO queryVO);
MapOverlapVO getOverlapById(Long id);
void updateOverlap(Long id, MapOverlapVO mapOverlapVO);
void deleteOverlap(Long id);
//
// void createOverlap(MapOverlapVO mapOverlapVO);
//
// PageVO<MapOverlapVO> queryPagedOverlap(Long mapId, MapOverlapQueryVO queryVO);
//
// MapOverlapVO getOverlapById(Long id);
//
// void updateOverlap(Long id, MapOverlapVO mapOverlapVO);
// void deleteOverlap(Long id);
/*------------autoReentry start ---------------------*/

View File

@ -79,23 +79,23 @@ public class DraftMapDataHandleServiceImpl implements DraftMapDataHandleService
if (!CollectionUtils.isEmpty(draftMapOverlapList)) {
for (DraftMapOverlap overlap : draftMapOverlapList) {
// 丢失道岔处理
MapOverlapVO mapOverlapVO = MapOverlapVO.convertRel2VO(overlap);
List<MapOverlapRelSectionSwitchVO> list = mapOverlapVO.getRelSectionSwitchList();
for (MapOverlapRelSectionSwitchVO vo : list) {
if (!CollectionUtils.isEmpty(vo.getRouteOverlapSwitchList())) {
List<MapCISwitchVO> removeList = new ArrayList<>();
for (MapCISwitchVO mapCISwitchVO : vo.getRouteOverlapSwitchList()) {
if (Objects.isNull(switchMap.get(mapCISwitchVO.getSwitchCode()))) {
removeList.add(mapCISwitchVO);
}
}
if (!CollectionUtils.isEmpty(removeList)) {
vo.getRouteOverlapSwitchList().removeAll(removeList);
overlap.setRelData(mapOverlapVO.convert2Draft().getRelData());
this.draftMapOverlapDAO.updateByPrimaryKeyWithBLOBs(overlap);
}
}
}
// MapOverlapVO mapOverlapVO = MapOverlapVO.convertRel2VO(overlap);
// List<MapOverlapRelSectionSwitchVO> list = mapOverlapVO.getRelSectionSwitchList();
// for (MapOverlapRelSectionSwitchVO vo : list) {
// if (!CollectionUtils.isEmpty(vo.getRouteOverlapSwitchList())) {
// List<MapCISwitchVO> removeList = new ArrayList<>();
// for (MapCISwitchVO mapCISwitchVO : vo.getRouteOverlapSwitchList()) {
// if (Objects.isNull(switchMap.get(mapCISwitchVO.getSwitchCode()))) {
// removeList.add(mapCISwitchVO);
// }
// }
// if (!CollectionUtils.isEmpty(removeList)) {
// vo.getRouteOverlapSwitchList().removeAll(removeList);
// overlap.setRelData(mapOverlapVO.convert2Draft().getRelData());
// this.draftMapOverlapDAO.updateByPrimaryKeyWithBLOBs(overlap);
// }
// }
// }
}
}
}

View File

@ -0,0 +1,17 @@
package club.joylink.rtss.services.draftData;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapVO;
import java.util.List;
public interface DraftMapOverlapService {
PageVO<MapOverlapVO> pagingQuery(Long id, MapOverlapQueryVO queryVO);
List<MapOverlapVO> queryAll(Long id);
void update(Long id, String code, MapOverlapVO vo);
void delete(Long id, String code);
}

View File

@ -0,0 +1,79 @@
package club.joylink.rtss.services.draftData;
import club.joylink.rtss.dao.DraftMapOverlapDAO;
import club.joylink.rtss.entity.DraftMapOverlap;
import club.joylink.rtss.entity.DraftMapOverlapExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapOverlapVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class DraftMapOverlapServiceImpl implements DraftMapOverlapService {
@Autowired
private DraftMapOverlapDAO draftMapOverlapDAO;
@Override
public PageVO<MapOverlapVO> pagingQuery(Long id, MapOverlapQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
DraftMapOverlapExample example = new DraftMapOverlapExample();
DraftMapOverlapExample.Criteria criteria = example.createCriteria()
.andMapIdEqualTo(id);
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
Page<DraftMapOverlap> mapOverlaps = (Page<DraftMapOverlap>) this.draftMapOverlapDAO.selectByExampleWithBLOBs(example);
List<MapOverlapVO> voList = mapOverlaps.getResult().stream()
.map(MapOverlapVO::convert2VO).collect(Collectors.toList());
return PageVO.convert(mapOverlaps, voList);
}
@Override
public List<MapOverlapVO> queryAll(Long id) {
DraftMapOverlapExample example = new DraftMapOverlapExample();
example.createCriteria()
.andMapIdEqualTo(id);
List<DraftMapOverlap> overlapList = this.draftMapOverlapDAO.selectByExampleWithBLOBs(example);
return overlapList.stream()
.map(MapOverlapVO::convert2VO)
.collect(Collectors.toList());
}
@Override
public void update(Long id, String code, MapOverlapVO vo) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(vo.getName());
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(vo.getPathList());
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(vo.getUnlockTime());
DraftMapOverlapExample example = new DraftMapOverlapExample();
example.createCriteria()
.andMapIdEqualTo(id)
.andCodeEqualTo(code);
List<DraftMapOverlap> draftMapOverlaps = this.draftMapOverlapDAO.selectByExampleWithBLOBs(example);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(draftMapOverlaps);
MapOverlapVO update = MapOverlapVO.convert2VO(draftMapOverlaps.get(0));
update.setName(vo.getName());
update.setUnlockTime(vo.getUnlockTime());
update.setPathList(vo.getPathList());
DraftMapOverlap db = update.convert2Draft();
this.draftMapOverlapDAO.updateByPrimaryKeyWithBLOBs(db);
}
@Override
public void delete(Long id, String code) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(code);
DraftMapOverlapExample example = new DraftMapOverlapExample();
example.createCriteria()
.andMapIdEqualTo(id)
.andCodeEqualTo(code);
this.draftMapOverlapDAO.deleteByExample(example);
}
}

View File

@ -1,5 +1,7 @@
package club.joylink.rtss.services.draftData;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapRouteNewVO;
import java.util.List;
@ -7,7 +9,11 @@ import java.util.List;
public interface DraftMapRouteService {
MapRouteNewVO createRailwayRoute(Long id, MapRouteNewVO routeNewVO);
PageVO<MapRouteNewVO> pagingQuery(Long id, MapRouteQueryVO queryVO);
List<MapRouteNewVO> queryAllRoutes(Long id);
void update(Long id, String routeCode, MapRouteNewVO routeNewVO);
void deleteRoute(Long id, String code);
}

View File

@ -7,12 +7,17 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.IDraftMapService;
import club.joylink.rtss.simulation.rt.repo.CommonRepository;
import club.joylink.rtss.simulation.rt.repo.CommonRepositoryBuilder;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapGraphDataNewVO;
import club.joylink.rtss.vo.client.map.newmap.MapRouteNewVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
@ -62,6 +67,34 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
return routeNewVO;
}
@Override
public PageVO<MapRouteNewVO> pagingQuery(Long id, MapRouteQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
DraftMapRouteExample example = new DraftMapRouteExample();
DraftMapRouteExample.Criteria criteria = example.createCriteria();
criteria.andMapIdEqualTo(id);
if (StringUtils.hasText(queryVO.getCode())) {
criteria.andCodeEqualTo(queryVO.getCode());
}
if (StringUtils.hasText(queryVO.getName())) {
queryVO.setName(String.format("%%%s%%", queryVO.getName()));
criteria.andNameLike(queryVO.getName());
}
if (StringUtils.hasText(queryVO.getStationCode())) {
criteria.andStationCodeEqualTo(queryVO.getStationCode());
}
if (StringUtils.hasText(queryVO.getStartSignalCode())) {
criteria.andStartSignalCodeEqualTo(queryVO.getStartSignalCode());
}
if (StringUtils.hasText(queryVO.getEndSignalCode())) {
criteria.andEndSignalCodeEqualTo(queryVO.getEndSignalCode());
}
Page<DraftMapRoute> pageTotal = (Page<DraftMapRoute>) draftMapRouteDAO.selectByExampleWithBLOBs(example);
List<MapRouteNewVO> routeVOList = pageTotal.getResult().stream()
.map(MapRouteNewVO::convert2VO).collect(Collectors.toList());
return PageVO.convert(pageTotal, routeVOList);
}
@Override
public List<MapRouteNewVO> queryAllRoutes(Long id) {
DraftMapRouteExample example = new DraftMapRouteExample();
@ -71,6 +104,25 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
return MapRouteNewVO.convertDraft2VOList(routeList);
}
@Override
public void update(Long id, String routeCode, MapRouteNewVO routeNewVO) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(routeNewVO.getName());
DraftMapRouteExample example = new DraftMapRouteExample();
example.createCriteria()
.andMapIdEqualTo(id)
.andCodeEqualTo(routeCode);
List<DraftMapRoute> draftMapRoutes = this.draftMapRouteDAO.selectByExampleWithBLOBs(example);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(draftMapRoutes);
DraftMapRoute draftMapRoute = draftMapRoutes.get(0);
MapRouteNewVO update = MapRouteNewVO.convert2VO(draftMapRoute);
update.setFlt(routeNewVO.isFlt());
update.setArc(routeNewVO.isArc());
update.setArs(routeNewVO.isArs());
update.setName(routeNewVO.getName());
DraftMapRoute db = update.convert2Draft();
this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(db);
}
@Transactional
@Override
public void deleteRoute(Long id, String code) {

View File

@ -0,0 +1,16 @@
package club.joylink.rtss.services.draftData;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapSASQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapSignalApproachSectionVO;
import java.util.List;
public interface DraftMapSignalApproachSectionService {
PageVO<MapSignalApproachSectionVO> pagingQuery(Long id, MapSASQueryVO queryVO);
List<MapSignalApproachSectionVO> queryAll(Long id);
void update(Long id, String signalCode, MapSignalApproachSectionVO vo);
}

View File

@ -0,0 +1,67 @@
package club.joylink.rtss.services.draftData;
import club.joylink.rtss.dao.DraftMapSignalApproachSectionDAO;
import club.joylink.rtss.entity.DraftMapSignalApproachSection;
import club.joylink.rtss.entity.DraftMapSignalApproachSectionExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapSASQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapSignalApproachSectionVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class DraftMapSignalApproachSectionServiceImpl implements DraftMapSignalApproachSectionService {
@Autowired
private DraftMapSignalApproachSectionDAO draftMapSignalApproachSectionDAO;
@Override
public PageVO<MapSignalApproachSectionVO> pagingQuery(Long id, MapSASQueryVO queryVO) {
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
DraftMapSignalApproachSectionExample example = new DraftMapSignalApproachSectionExample();
DraftMapSignalApproachSectionExample.Criteria criteria = example.createCriteria()
.andMapIdEqualTo(id);
if (StringUtils.hasText(queryVO.getSignalCode())) {
criteria.andSignalCodeEqualTo(queryVO.getSignalCode());
}
Page<DraftMapSignalApproachSection> mapOverlaps = (Page<DraftMapSignalApproachSection>) this.draftMapSignalApproachSectionDAO.selectByExampleWithBLOBs(example);
List<MapSignalApproachSectionVO> voList = mapOverlaps.getResult().stream()
.map(MapSignalApproachSectionVO::convert2VO)
.collect(Collectors.toList());
return PageVO.convert(mapOverlaps, voList);
}
@Override
public List<MapSignalApproachSectionVO> queryAll(Long id) {
DraftMapSignalApproachSectionExample example = new DraftMapSignalApproachSectionExample();
DraftMapSignalApproachSectionExample.Criteria criteria = example.createCriteria()
.andMapIdEqualTo(id);
Page<DraftMapSignalApproachSection> mapOverlaps = (Page<DraftMapSignalApproachSection>) this.draftMapSignalApproachSectionDAO.selectByExampleWithBLOBs(example);
return mapOverlaps.getResult().stream()
.map(MapSignalApproachSectionVO::convert2VO)
.collect(Collectors.toList());
}
@Override
public void update(Long id, String signalCode, MapSignalApproachSectionVO vo) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(vo.getReleaseTime());
DraftMapSignalApproachSectionExample example = new DraftMapSignalApproachSectionExample();
example.createCriteria()
.andMapIdEqualTo(id)
.andSignalCodeEqualTo(signalCode);
List<DraftMapSignalApproachSection> approachSections = this.draftMapSignalApproachSectionDAO.selectByExampleWithBLOBs(example);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(approachSections);
MapSignalApproachSectionVO update = MapSignalApproachSectionVO.convert2VO(approachSections.get(0));
update.setReleaseTime(vo.getReleaseTime());
update.setSectionPathList(vo.getSectionPathList());
DraftMapSignalApproachSection db = update.convert2Draft();
this.draftMapSignalApproachSectionDAO.updateByPrimaryKeyWithBLOBs(db);
}
}

View File

@ -26,7 +26,4 @@ public class MapRouteQueryVO extends PageQueryVO {
@ApiModelProperty(value="终端信号机")
private String endSignalCode;
@ApiModelProperty(value="接近区段")
private String nearSectionCode;
}

View File

@ -11,6 +11,6 @@ import lombok.Setter;
@Setter
public class MapOverlapQueryVO extends PageQueryVO {
@ApiModelProperty(value="延续保护唯一编号")
private String code;
@ApiModelProperty(value="延续保护名称")
private String name;
}

View File

@ -13,9 +13,7 @@ import lombok.Setter;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
/**
@ -70,17 +68,11 @@ public class MapOverlapVO {
private List<MapSectionPathVO> triggerPathList;
/**
* 延续保护线路列表
*/
@NotEmpty(message="延续保护线路列表至少有一条")
private List<MapOverlapRelSectionSwitchVO> relSectionSwitchList;
@ApiModelProperty(value = "延续保护路径列表")
private List<MapSectionPathVO> pathList;
public MapOverlapVO() {
relSectionSwitchList = new ArrayList<>();
}
public static MapOverlapVO convert2VO(DraftMapOverlap draftMapOverlap) {
@ -114,7 +106,7 @@ public class MapOverlapVO {
draftMapOverlap.setId(getId());
draftMapOverlap.setCode(getCode());
draftMapOverlap.setMapId(getMapId());
// draftMapOverlap.setName(getName());
draftMapOverlap.setName(getName());
// relData中不包含id和mapId
draftMapOverlap.setRelData(getJsonData());
return draftMapOverlap;

View File

@ -15,7 +15,9 @@ import org.springframework.util.CollectionUtils;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ApiModel
@ -135,10 +137,6 @@ public class MapRouteNewVO {
*/
private boolean flt;
/** 是否先锁闭——办理过程直接先锁闭区段 */
@ApiModelProperty(value = "是否先锁闭——办理过程直接先锁闭区段")
private boolean lockFirst;
/**
* 延时解锁时间单位秒s
*/

View File

@ -0,0 +1,13 @@
package club.joylink.rtss.vo.client.map.newmap;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class MapSASQueryVO extends PageQueryVO {
private String signalCode;
}

View File

@ -1,11 +1,11 @@
package club.joylink.rtss.vo.client.map.newmap;
import club.joylink.rtss.entity.DraftMapSignalApproachSection;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.util.JsonUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.entity.DraftMapSignalApproachSection;
import club.joylink.rtss.util.JsonUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
@ -33,9 +33,6 @@ public class MapSignalApproachSectionVO {
@NotNull(message = "地图id不能为空")
private Long mapId;
// @NotBlank(message = "接近区段编号不能为空")
// private String code;
/**
* 始端信号机 编号
*/
@ -43,21 +40,14 @@ public class MapSignalApproachSectionVO {
@ApiModelProperty(value="始端信号机", required=true)
private String signalCode;
@ApiModelProperty(value="接近区段CBTC模式数据列表")
private List<String> routeSectionList;
@ApiModelProperty(value = "接近区段(后备模式)列表")
private List<String> blockSectionList;
@ApiModelProperty(value = "是否引导信号机")
private Boolean callOn;
/**
* 接近锁闭解锁时间
*/
private Integer releaseTime;
private List<MapSectionPathVO> sectionPathList;
public MapSignalApproachSectionVO() {
this.routeSectionList = new ArrayList<>();
}
public static MapSignalApproachSectionVO convert2VO(DraftMapSignalApproachSection approachSection) {
@ -88,7 +78,6 @@ public class MapSignalApproachSectionVO {
DraftMapSignalApproachSection approachSection = new DraftMapSignalApproachSection();
approachSection.setId(this.getId());
approachSection.setMapId(this.getMapId());
// approachSection.setCode(this.getCode());
approachSection.setSignalCode(this.getSignalCode());
approachSection.setRelData(this.getJsonData());
return approachSection;