Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
1f94e0ff6d
10
sql/20210312-zhangsai.sql
Normal file
10
sql/20210312-zhangsai.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-- auto-generated definition
|
||||||
|
create table cgy_record
|
||||||
|
(
|
||||||
|
id int not null
|
||||||
|
primary key,
|
||||||
|
browse_count int null comment '浏览次数',
|
||||||
|
download_count int null comment '百度网盘链接打开次数'
|
||||||
|
)
|
||||||
|
comment '成都工业项目使用记录';
|
||||||
|
|
@ -56,6 +56,8 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
whiteList.add("/api/learn/{postId}/message/pagedQuery/postId");
|
whiteList.add("/api/learn/{postId}/message/pagedQuery/postId");
|
||||||
whiteList.add("/api/learn/{messageId}/comment");
|
whiteList.add("/api/learn/{messageId}/comment");
|
||||||
whiteList.add("/api/learn/cgy/updateMessageTime");
|
whiteList.add("/api/learn/cgy/updateMessageTime");
|
||||||
|
// 成都工业使用记录
|
||||||
|
whiteList.add("/api/cgy/**");
|
||||||
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
|
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package club.joylink.rtss.controller;
|
||||||
|
|
||||||
|
import club.joylink.rtss.services.CgyRecordService;
|
||||||
|
import club.joylink.rtss.vo.client.CgyRecordVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成都工业
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cgy")
|
||||||
|
public class CGYController {
|
||||||
|
@Autowired
|
||||||
|
private CgyRecordService cgyRecordService;
|
||||||
|
|
||||||
|
@GetMapping("/record")
|
||||||
|
public CgyRecordVO getBrowseCount() {
|
||||||
|
return cgyRecordService.getRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/browse")
|
||||||
|
public void browseCount() {
|
||||||
|
cgyRecordService.browseCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/download")
|
||||||
|
public void downloadCount() {
|
||||||
|
cgyRecordService.downloadCount();
|
||||||
|
}
|
||||||
|
}
|
@ -40,7 +40,7 @@ public class IscsController {
|
|||||||
|
|
||||||
@ApiOperation(value = "根据条件获取iscs数据")
|
@ApiOperation(value = "根据条件获取iscs数据")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public IscsVO getIscsDataBy(IscsVO iscsVO, @ApiIgnore @RequestAttribute UserVO user) {
|
public IscsVO getIscsDataBy(@Validated IscsVO iscsVO, @ApiIgnore @RequestAttribute UserVO user) {
|
||||||
return this.iscsService.getIscsDataBy(iscsVO);
|
return this.iscsService.getIscsDataBy(iscsVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ public class RunPlanDraftController {
|
|||||||
return this.iRunPlanDraftService.ifServerExists(planId, serviceNumber);
|
return this.iRunPlanDraftService.ifServerExists(planId, serviceNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询交路列表")
|
@ApiOperation(value = "查询地图默认交路列表")
|
||||||
@GetMapping(path = "/{planId}/routingList")
|
@GetMapping(path = "/{planId}/routingList")
|
||||||
public List getRoutingList(@PathVariable Long planId) {
|
public List getRoutingList(@PathVariable Long planId) {
|
||||||
return this.iRunPlanDraftService.getRoutingList(planId);
|
return this.iRunPlanDraftService.getRoutingList(planId);
|
||||||
|
@ -37,13 +37,13 @@ public class RunPlanUserDataController {
|
|||||||
@PostMapping(path = "/routing")
|
@PostMapping(path = "/routing")
|
||||||
public void createUserRouting(@RequestBody @Validated RunPlanRoutingVO routingVO, @RequestAttribute UserVO user) {
|
public void createUserRouting(@RequestBody @Validated RunPlanRoutingVO routingVO, @RequestAttribute UserVO user) {
|
||||||
routingVO.setUserId(user.getId());
|
routingVO.setUserId(user.getId());
|
||||||
iRunPlanRoutingService.createUserRouting(routingVO);
|
iRunPlanRoutingService.createUserRouting(routingVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "生成通用交路区段数据")
|
@ApiOperation(value = "生成通用交路区段数据")
|
||||||
@PostMapping(path = "/routing/path/generate")
|
@PostMapping(path = "/routing/path/generate")
|
||||||
public RunPlanRoutingVO generateUserRoutingPath(@RequestBody @Validated RunPlanRoutingVO routingVO) {
|
public RunPlanRoutingVO generateUserRoutingPath(@RequestBody @Validated RunPlanRoutingVO routingVO) {
|
||||||
return iRunPlanRoutingService.generateUserRoutingSections(routingVO);
|
return iRunPlanRoutingService.generateUserRoutingData(routingVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "分页获取用户交路")
|
@ApiOperation(value = "分页获取用户交路")
|
||||||
@ -52,6 +52,18 @@ public class RunPlanUserDataController {
|
|||||||
return iRunPlanRoutingService.queryPagedUserRouting(user.getId(), mapId, queryVO);
|
return iRunPlanRoutingService.queryPagedUserRouting(user.getId(), mapId, queryVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页获取地图默认交路")
|
||||||
|
@GetMapping(path = "/{mapId}/default/routing/page")
|
||||||
|
public PageVO<RunPlanRoutingVO> queryPagedDefaultRouting(@PathVariable Long mapId, RunPlanRoutingQueryVO queryVO) {
|
||||||
|
return iRunPlanRoutingService.queryPagedUserRouting(null, mapId, queryVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "用户拉取地图默认交路")
|
||||||
|
@PutMapping(path = "/{mapId}/default/routing/pull")
|
||||||
|
public void pullDefaultRouting(@PathVariable Long mapId, @RequestBody List<Long> routings,@RequestAttribute UserVO user) {
|
||||||
|
iRunPlanRoutingService.pullDefaultRoutings(user.getId(), mapId, routings);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取用户交路数据")
|
@ApiOperation(value = "获取用户交路数据")
|
||||||
@GetMapping(path = "/{mapId}/routing")
|
@GetMapping(path = "/{mapId}/routing")
|
||||||
public List<RunPlanRoutingVO> queryUserRoutings(@PathVariable Long mapId, @RequestAttribute UserVO user) {
|
public List<RunPlanRoutingVO> queryUserRoutings(@PathVariable Long mapId, @RequestAttribute UserVO user) {
|
||||||
|
@ -64,7 +64,10 @@ public class SimulationV1Controller {
|
|||||||
public String simulation(Long mapId, String prdType,
|
public String simulation(Long mapId, String prdType,
|
||||||
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||||
LoginUserInfoVO loginUserInfoVO) {
|
LoginUserInfoVO loginUserInfoVO) {
|
||||||
return this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO);
|
String simulation = this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO);
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
System.out.println(end);
|
||||||
|
return simulation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "创建实训仿真")
|
@ApiOperation(value = "创建实训仿真")
|
||||||
|
12
src/main/java/club/joylink/rtss/dao/CgyRecordDAO.java
Normal file
12
src/main/java/club/joylink/rtss/dao/CgyRecordDAO.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package club.joylink.rtss.dao;
|
||||||
|
|
||||||
|
import club.joylink.rtss.entity.CgyRecord;
|
||||||
|
import club.joylink.rtss.entity.CgyRecordExample;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CgyRecordDAO继承基类
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface CgyRecordDAO extends MyBatisBaseDao<CgyRecord, Integer, CgyRecordExample> {
|
||||||
|
}
|
@ -42,7 +42,12 @@ public interface RunPlanRoutingDAO {
|
|||||||
"SELECT COUNT(*) " +
|
"SELECT COUNT(*) " +
|
||||||
"FROM run_plan_routing " +
|
"FROM run_plan_routing " +
|
||||||
"WHERE map_id = #{mapId} " +
|
"WHERE map_id = #{mapId} " +
|
||||||
"AND user_id = #{userId} " +
|
"<if test=\"userId == null\">\n" +
|
||||||
|
"AND user_id IS NULL " +
|
||||||
|
"</if> " +
|
||||||
|
"<if test=\"userId != null\">\n" +
|
||||||
|
"AND user_id = #{userId}\n" +
|
||||||
|
"</if> " +
|
||||||
"AND section_data = #{sectionData} " +
|
"AND section_data = #{sectionData} " +
|
||||||
"</script>")
|
"</script>")
|
||||||
Integer countUserRoutingBySectionData(@Param("userId") Long userId, @Param("mapId") Long mapId, @Param("sectionData") String sectionData);
|
Integer countUserRoutingBySectionData(@Param("userId") Long userId, @Param("mapId") Long mapId, @Param("sectionData") String sectionData);
|
||||||
@ -56,4 +61,5 @@ public interface RunPlanRoutingDAO {
|
|||||||
"AND section_data = #{sectionData} " +
|
"AND section_data = #{sectionData} " +
|
||||||
"</script>")
|
"</script>")
|
||||||
RunPlanRouting getUserRoutingBySectionData(@Param("userId") Long userId, @Param("mapId") Long mapId, @Param("sectionData") String sectionData);
|
RunPlanRouting getUserRoutingBySectionData(@Param("userId") Long userId, @Param("mapId") Long mapId, @Param("sectionData") String sectionData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
88
src/main/java/club/joylink/rtss/entity/CgyRecord.java
Normal file
88
src/main/java/club/joylink/rtss/entity/CgyRecord.java
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
package club.joylink.rtss.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
* 成都工业项目使用记录
|
||||||
|
*/
|
||||||
|
public class CgyRecord implements Serializable {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览次数
|
||||||
|
*/
|
||||||
|
private Integer browseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百度网盘链接打开次数
|
||||||
|
*/
|
||||||
|
private Integer downloadCount;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBrowseCount() {
|
||||||
|
return browseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrowseCount(Integer browseCount) {
|
||||||
|
this.browseCount = browseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDownloadCount() {
|
||||||
|
return downloadCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDownloadCount(Integer downloadCount) {
|
||||||
|
this.downloadCount = downloadCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object that) {
|
||||||
|
if (this == that) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (that == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != that.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CgyRecord other = (CgyRecord) that;
|
||||||
|
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||||
|
&& (this.getBrowseCount() == null ? other.getBrowseCount() == null : this.getBrowseCount().equals(other.getBrowseCount()))
|
||||||
|
&& (this.getDownloadCount() == null ? other.getDownloadCount() == null : this.getDownloadCount().equals(other.getDownloadCount()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||||
|
result = prime * result + ((getBrowseCount() == null) ? 0 : getBrowseCount().hashCode());
|
||||||
|
result = prime * result + ((getDownloadCount() == null) ? 0 : getDownloadCount().hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(getClass().getSimpleName());
|
||||||
|
sb.append(" [");
|
||||||
|
sb.append("Hash = ").append(hashCode());
|
||||||
|
sb.append(", id=").append(id);
|
||||||
|
sb.append(", browseCount=").append(browseCount);
|
||||||
|
sb.append(", downloadCount=").append(downloadCount);
|
||||||
|
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||||
|
sb.append("]");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
402
src/main/java/club/joylink/rtss/entity/CgyRecordExample.java
Normal file
402
src/main/java/club/joylink/rtss/entity/CgyRecordExample.java
Normal file
@ -0,0 +1,402 @@
|
|||||||
|
package club.joylink.rtss.entity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CgyRecordExample {
|
||||||
|
protected String orderByClause;
|
||||||
|
|
||||||
|
protected boolean distinct;
|
||||||
|
|
||||||
|
protected List<Criteria> oredCriteria;
|
||||||
|
|
||||||
|
private Integer limit;
|
||||||
|
|
||||||
|
private Long offset;
|
||||||
|
|
||||||
|
public CgyRecordExample() {
|
||||||
|
oredCriteria = new ArrayList<Criteria>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderByClause(String orderByClause) {
|
||||||
|
this.orderByClause = orderByClause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderByClause() {
|
||||||
|
return orderByClause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistinct(boolean distinct) {
|
||||||
|
this.distinct = distinct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDistinct() {
|
||||||
|
return distinct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criteria> getOredCriteria() {
|
||||||
|
return oredCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void or(Criteria criteria) {
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria or() {
|
||||||
|
Criteria criteria = createCriteriaInternal();
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria createCriteria() {
|
||||||
|
Criteria criteria = createCriteriaInternal();
|
||||||
|
if (oredCriteria.size() == 0) {
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
}
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criteria createCriteriaInternal() {
|
||||||
|
Criteria criteria = new Criteria();
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
oredCriteria.clear();
|
||||||
|
orderByClause = null;
|
||||||
|
distinct = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimit(Integer limit) {
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimit() {
|
||||||
|
return limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(Long offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract static class GeneratedCriteria {
|
||||||
|
protected List<Criterion> criteria;
|
||||||
|
|
||||||
|
protected GeneratedCriteria() {
|
||||||
|
super();
|
||||||
|
criteria = new ArrayList<Criterion>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid() {
|
||||||
|
return criteria.size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criterion> getAllCriteria() {
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criterion> getCriteria() {
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition) {
|
||||||
|
if (condition == null) {
|
||||||
|
throw new RuntimeException("Value for condition cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition, Object value, String property) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||||
|
if (value1 == null || value2 == null) {
|
||||||
|
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition, value1, value2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdIsNull() {
|
||||||
|
addCriterion("id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdIsNotNull() {
|
||||||
|
addCriterion("id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdEqualTo(Integer value) {
|
||||||
|
addCriterion("id =", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdNotEqualTo(Integer value) {
|
||||||
|
addCriterion("id <>", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdGreaterThan(Integer value) {
|
||||||
|
addCriterion("id >", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("id >=", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdLessThan(Integer value) {
|
||||||
|
addCriterion("id <", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("id <=", value, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdIn(List<Integer> values) {
|
||||||
|
addCriterion("id in", values, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdNotIn(List<Integer> values) {
|
||||||
|
addCriterion("id not in", values, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("id between", value1, value2, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("id not between", value1, value2, "id");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountIsNull() {
|
||||||
|
addCriterion("browse_count is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountIsNotNull() {
|
||||||
|
addCriterion("browse_count is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountEqualTo(Integer value) {
|
||||||
|
addCriterion("browse_count =", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountNotEqualTo(Integer value) {
|
||||||
|
addCriterion("browse_count <>", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountGreaterThan(Integer value) {
|
||||||
|
addCriterion("browse_count >", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("browse_count >=", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountLessThan(Integer value) {
|
||||||
|
addCriterion("browse_count <", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("browse_count <=", value, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountIn(List<Integer> values) {
|
||||||
|
addCriterion("browse_count in", values, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountNotIn(List<Integer> values) {
|
||||||
|
addCriterion("browse_count not in", values, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("browse_count between", value1, value2, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andBrowseCountNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("browse_count not between", value1, value2, "browseCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountIsNull() {
|
||||||
|
addCriterion("download_count is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountIsNotNull() {
|
||||||
|
addCriterion("download_count is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountEqualTo(Integer value) {
|
||||||
|
addCriterion("download_count =", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountNotEqualTo(Integer value) {
|
||||||
|
addCriterion("download_count <>", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountGreaterThan(Integer value) {
|
||||||
|
addCriterion("download_count >", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("download_count >=", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountLessThan(Integer value) {
|
||||||
|
addCriterion("download_count <", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("download_count <=", value, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountIn(List<Integer> values) {
|
||||||
|
addCriterion("download_count in", values, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountNotIn(List<Integer> values) {
|
||||||
|
addCriterion("download_count not in", values, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("download_count between", value1, value2, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDownloadCountNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("download_count not between", value1, value2, "downloadCount");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
|
||||||
|
protected Criteria() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Criterion {
|
||||||
|
private String condition;
|
||||||
|
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
private Object secondValue;
|
||||||
|
|
||||||
|
private boolean noValue;
|
||||||
|
|
||||||
|
private boolean singleValue;
|
||||||
|
|
||||||
|
private boolean betweenValue;
|
||||||
|
|
||||||
|
private boolean listValue;
|
||||||
|
|
||||||
|
private String typeHandler;
|
||||||
|
|
||||||
|
public String getCondition() {
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getSecondValue() {
|
||||||
|
return secondValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNoValue() {
|
||||||
|
return noValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSingleValue() {
|
||||||
|
return singleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBetweenValue() {
|
||||||
|
return betweenValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isListValue() {
|
||||||
|
return listValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeHandler() {
|
||||||
|
return typeHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.typeHandler = null;
|
||||||
|
this.noValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, String typeHandler) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.value = value;
|
||||||
|
this.typeHandler = typeHandler;
|
||||||
|
if (value instanceof List<?>) {
|
||||||
|
this.listValue = true;
|
||||||
|
} else {
|
||||||
|
this.singleValue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value) {
|
||||||
|
this(condition, value, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.value = value;
|
||||||
|
this.secondValue = secondValue;
|
||||||
|
this.typeHandler = typeHandler;
|
||||||
|
this.betweenValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, Object secondValue) {
|
||||||
|
this(condition, value, secondValue, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -14,6 +14,9 @@ public class RunPlanRouting implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long mapId;
|
private Long mapId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空值为地图默认生成的交路
|
||||||
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
package club.joylink.rtss.services;
|
||||||
|
|
||||||
|
import club.joylink.rtss.constants.Project;
|
||||||
|
import club.joylink.rtss.dao.CgyRecordDAO;
|
||||||
|
import club.joylink.rtss.dao.SysUserLoginDAO;
|
||||||
|
import club.joylink.rtss.entity.CgyRecord;
|
||||||
|
import club.joylink.rtss.entity.SysUserLoginExample;
|
||||||
|
import club.joylink.rtss.vo.client.CgyRecordVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成都工业项目使用记录
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CgyRecordService {
|
||||||
|
@Autowired
|
||||||
|
private SysUserLoginDAO sysUserLoginDAO;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CgyRecordDAO cgyRecordDAO;
|
||||||
|
|
||||||
|
public CgyRecordVO getRecord() {
|
||||||
|
long loginCount = getLoginCount();
|
||||||
|
CgyRecord entity = findEntity();
|
||||||
|
if (entity == null) {
|
||||||
|
return new CgyRecordVO(loginCount, 0, 0);
|
||||||
|
} else {
|
||||||
|
return new CgyRecordVO(loginCount, entity.getBrowseCount(), entity.getDownloadCount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void browseCount() {
|
||||||
|
CgyRecord entity = findEntity();
|
||||||
|
if (entity == null) {
|
||||||
|
CgyRecord cgyRecord = new CgyRecord();
|
||||||
|
cgyRecord.setBrowseCount(1);
|
||||||
|
cgyRecord.setDownloadCount(0);
|
||||||
|
cgyRecordDAO.insert(cgyRecord);
|
||||||
|
} else {
|
||||||
|
entity.setBrowseCount(entity.getBrowseCount() + 1);
|
||||||
|
cgyRecordDAO.updateByPrimaryKey(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadCount() {
|
||||||
|
CgyRecord entity = findEntity();
|
||||||
|
if (entity == null) {
|
||||||
|
CgyRecord cgyRecord = new CgyRecord();
|
||||||
|
cgyRecord.setBrowseCount(0);
|
||||||
|
cgyRecord.setDownloadCount(1);
|
||||||
|
cgyRecordDAO.insert(cgyRecord);
|
||||||
|
} else {
|
||||||
|
entity.setDownloadCount(entity.getDownloadCount() + 1);
|
||||||
|
cgyRecordDAO.updateByPrimaryKey(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getLoginCount() {
|
||||||
|
SysUserLoginExample example = new SysUserLoginExample();
|
||||||
|
example.createCriteria().andProjectEqualTo(Project.CGY.name());
|
||||||
|
return sysUserLoginDAO.countByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CgyRecord findEntity() {
|
||||||
|
return cgyRecordDAO.selectByPrimaryKey(1);
|
||||||
|
}
|
||||||
|
}
|
@ -203,6 +203,7 @@ public class DraftMapService implements IDraftMapService {
|
|||||||
@Override
|
@Override
|
||||||
public void saveMapElsDetail(Long id, String shapeData) {
|
public void saveMapElsDetail(Long id, String shapeData) {
|
||||||
DraftMapWithBLOBs draftMap = draftMapDAO.selectByPrimaryKey(id);
|
DraftMapWithBLOBs draftMap = draftMapDAO.selectByPrimaryKey(id);
|
||||||
|
System.out.println(shapeData);
|
||||||
MapGraphDataNewVO graphDataNewVO = JsonUtils.read(shapeData, MapGraphDataNewVO.class);
|
MapGraphDataNewVO graphDataNewVO = JsonUtils.read(shapeData, MapGraphDataNewVO.class);
|
||||||
this.handleSectionData(graphDataNewVO);
|
this.handleSectionData(graphDataNewVO);
|
||||||
draftMap.setGraphData(JsonUtils.writeValueAsString(graphDataNewVO));
|
draftMap.setGraphData(JsonUtils.writeValueAsString(graphDataNewVO));
|
||||||
@ -226,8 +227,7 @@ public class DraftMapService implements IDraftMapService {
|
|||||||
section.setDestinationCode(null);
|
section.setDestinationCode(null);
|
||||||
section.setDestinationCodePoint(null);
|
section.setDestinationCodePoint(null);
|
||||||
}
|
}
|
||||||
if (Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type04) ||
|
if (Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type04)) {
|
||||||
Objects.equals(section.getType(), BusinessConsts.Section.SectionType.Type05)) {
|
|
||||||
section.setParentCode(null);
|
section.setParentCode(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1122,7 +1122,7 @@ public class DraftMapService implements IDraftMapService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建交路时检查站间运行等级,不存在就创建
|
* 创建交路
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
@ -10,6 +10,7 @@ import club.joylink.rtss.entity.*;
|
|||||||
import club.joylink.rtss.exception.BaseException;
|
import club.joylink.rtss.exception.BaseException;
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.cache.ICacheService;
|
import club.joylink.rtss.services.cache.ICacheService;
|
||||||
|
import club.joylink.rtss.services.runplan.IRunPlanRoutingService;
|
||||||
import club.joylink.rtss.services.simulation.SchedulingService;
|
import club.joylink.rtss.services.simulation.SchedulingService;
|
||||||
import club.joylink.rtss.services.training.ITrainingV1Service;
|
import club.joylink.rtss.services.training.ITrainingV1Service;
|
||||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams;
|
import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams;
|
||||||
@ -22,12 +23,10 @@ import club.joylink.rtss.vo.client.MapQueryVO;
|
|||||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
import club.joylink.rtss.vo.client.map.*;
|
import club.joylink.rtss.vo.client.map.*;
|
||||||
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO;
|
import club.joylink.rtss.vo.client.map.newmap.*;
|
||||||
import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO;
|
|
||||||
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
|
|
||||||
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
|
|
||||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
||||||
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||||
|
import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO;
|
||||||
import club.joylink.rtss.vo.client.schedulingNew.SchedulingPlanNewVO;
|
import club.joylink.rtss.vo.client.schedulingNew.SchedulingPlanNewVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@ -43,6 +42,7 @@ import java.text.Collator;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collector;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,6 +99,9 @@ public class MapService implements IMapService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPermissionService iPermissionService;
|
private IPermissionService iPermissionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRunPlanRoutingService runPlanDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictionaryDetailVO> queryCityHasMap(String dicCode) {
|
public List<DictionaryDetailVO> queryCityHasMap(String dicCode) {
|
||||||
MapInfoExample example = new MapInfoExample();
|
MapInfoExample example = new MapInfoExample();
|
||||||
@ -344,9 +347,7 @@ public class MapService implements IMapService {
|
|||||||
public MapVO publish(MapVO mapVO, MapDataVO mapDataVO, UserVO userVO) {
|
public MapVO publish(MapVO mapVO, MapDataVO mapDataVO, UserVO userVO) {
|
||||||
//地图信息
|
//地图信息
|
||||||
MapInfoExample infoExample = new MapInfoExample();
|
MapInfoExample infoExample = new MapInfoExample();
|
||||||
infoExample.createCriteria()
|
infoExample.createCriteria().andNameEqualTo(mapVO.getName()).andStatusNotEqualTo(MapStatus.Delete.getCode());
|
||||||
.andNameEqualTo(mapVO.getName())
|
|
||||||
.andStatusNotEqualTo(MapStatus.Delete.getCode());
|
|
||||||
List<MapInfo> mapInfoList = mapInfoDAO.selectByExample(infoExample);
|
List<MapInfo> mapInfoList = mapInfoDAO.selectByExample(infoExample);
|
||||||
MapInfo map;
|
MapInfo map;
|
||||||
if (ObjectUtils.isEmpty(mapInfoList)) {
|
if (ObjectUtils.isEmpty(mapInfoList)) {
|
||||||
@ -381,6 +382,8 @@ public class MapService implements IMapService {
|
|||||||
// 更新地图当前使用的地图数据版本
|
// 更新地图当前使用的地图数据版本
|
||||||
map.setVersion(mapData.getVersion());
|
map.setVersion(mapData.getVersion());
|
||||||
mapInfoDAO.updateByPrimaryKey(map);
|
mapInfoDAO.updateByPrimaryKey(map);
|
||||||
|
//更新系统默认交路及相关运行图基础数据
|
||||||
|
createDefaultRouting(mapDataVO, map.getId());
|
||||||
// 保存站间运行数据
|
// 保存站间运行数据
|
||||||
iCacheService.remove(BusinessConsts.CachePrefix.Map + map.getId()); //删除地图数据缓存
|
iCacheService.remove(BusinessConsts.CachePrefix.Map + map.getId()); //删除地图数据缓存
|
||||||
MapVO newMapVO = new MapVO(map);
|
MapVO newMapVO = new MapVO(map);
|
||||||
@ -459,6 +462,15 @@ public class MapService implements IMapService {
|
|||||||
// return newMapVO;
|
// return newMapVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createDefaultRouting(MapDataVO mapDataVO,Long mapId) {
|
||||||
|
runPlanDataService.deleteDefaultRouting(mapId);
|
||||||
|
List<MapRoutingDataVO> routingList = mapDataVO.getLogicDataNew().getRoutingList();
|
||||||
|
if (!CollectionUtils.isEmpty(routingList)) {
|
||||||
|
List<RunPlanRoutingVO> defaultRoutings = routingList.stream().map(r-> RunPlanRoutingVO.fromMapRoutingData(r, mapId)).collect(Collectors.toList());
|
||||||
|
runPlanDataService.createDefaultRoutings(defaultRoutings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void publish3DData(MapVO mapVO, Map3dDataVO map3dDataVO, UserVO user) {
|
public void publish3DData(MapVO mapVO, Map3dDataVO map3dDataVO, UserVO user) {
|
||||||
// 地图信息
|
// 地图信息
|
||||||
@ -721,26 +733,30 @@ public class MapService implements IMapService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public void updateBasicInfo(Long id, MapInfoUpdateVO updateVO, UserVO user) {
|
public void updateBasicInfo(Long id, MapInfoUpdateVO updateVO, UserVO user) {
|
||||||
MapInfo mapInfo = findMapInfoEntity(id);
|
MapInfo mapInfo = findMapInfoEntity(id);
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
if (StringUtils.hasText(updateVO.getName())) {
|
if (StringUtils.hasText(updateVO.getName()) && !Objects.equals(mapInfo.getName(), updateVO.getName())) {
|
||||||
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertNotTrue(isNameExistExcept(updateVO.getName(), id),
|
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertNotTrue(isNameExistExcept(updateVO.getName(), id),
|
||||||
"名称已存在");
|
"名称已存在");
|
||||||
mapInfo.setName(updateVO.getName());
|
mapInfo.setName(updateVO.getName());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(updateVO.getCityCode())) {
|
if (StringUtils.hasText(updateVO.getCityCode()) && !Objects.equals(mapInfo.getCityCode(), updateVO.getCityCode())) {
|
||||||
mapInfo.setCityCode(updateVO.getCityCode());
|
mapInfo.setCityCode(updateVO.getCityCode());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(updateVO.getLineCode()) &&
|
if (StringUtils.hasText(updateVO.getLineCode()) && !Objects.equals(mapInfo.getLineCode(), updateVO.getLineCode())
|
||||||
this.iRealLineService.checkCodeExist(updateVO.getLineCode())) {
|
&& this.iRealLineService.checkCodeExist(updateVO.getLineCode())) {
|
||||||
mapInfo.setLineCode(updateVO.getLineCode());
|
mapInfo.setLineCode(updateVO.getLineCode());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(updateVO.getVersion()) && versionExist(id, updateVO.getVersion())) {
|
if (StringUtils.hasText(updateVO.getVersion()) /*&& !Objects.equals(mapInfo.getVersion(), updateVO.getVersion())*/
|
||||||
|
&& versionExist(id, updateVO.getVersion())) {
|
||||||
mapInfo.setVersion(updateVO.getVersion());
|
mapInfo.setVersion(updateVO.getVersion());
|
||||||
|
MapDataVO mapDataVO = getMapData(id, updateVO.getVersion());
|
||||||
|
createDefaultRouting(mapDataVO, id);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update) {
|
if (update) {
|
||||||
|
@ -123,7 +123,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
List<MapStationRunLevelVO> stationRunLevelList;
|
List<MapStationRunLevelVO> stationRunLevelList;
|
||||||
|
|
||||||
public CiGenerateResult(List<String> errMsgList, List<Signal> approachList, List<AutoSignal> autoSignalList, List<Route> routeList,
|
public CiGenerateResult(List<String> errMsgList, List<Signal> approachList, List<AutoSignal> autoSignalList, List<Route> routeList,
|
||||||
List<RouteOverlap> overlapList, List<RouteFls> flsList, List<Cycle> generateCycleList, /*List<MapRoutingDataVO> routingList,*/
|
List<RouteOverlap> overlapList, List<RouteFls> flsList, List<Cycle> generateCycleList, List<MapRoutingDataVO> routingList,
|
||||||
List<MapStationRunLevelVO> stationRunLevelList, List<DestinationCodeDefinition> destinationCodeDefinitionList) {
|
List<MapStationRunLevelVO> stationRunLevelList, List<DestinationCodeDefinition> destinationCodeDefinitionList) {
|
||||||
this.errMsgList = errMsgList;
|
this.errMsgList = errMsgList;
|
||||||
this.approachList = approachList;
|
this.approachList = approachList;
|
||||||
@ -133,7 +133,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
this.flsList = flsList;
|
this.flsList = flsList;
|
||||||
this.cycleList = generateCycleList;
|
this.cycleList = generateCycleList;
|
||||||
this.destinationCodeDefinitionList = destinationCodeDefinitionList;
|
this.destinationCodeDefinitionList = destinationCodeDefinitionList;
|
||||||
// this.routingList = routingList;
|
this.routingList = routingList;
|
||||||
this.stationRunLevelList = stationRunLevelList;
|
this.stationRunLevelList = stationRunLevelList;
|
||||||
log.info(String.format("生成信号机接近区段数据[%s]条", approachList.size()));
|
log.info(String.format("生成信号机接近区段数据[%s]条", approachList.size()));
|
||||||
log.info(String.format("生成进路数据总计[%s]条", routeList.size()));
|
log.info(String.format("生成进路数据总计[%s]条", routeList.size()));
|
||||||
@ -141,7 +141,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
log.info(String.format("生成侧防数据[%s]条", flsList.size()));
|
log.info(String.format("生成侧防数据[%s]条", flsList.size()));
|
||||||
log.info(String.format("生成自动信号数据[%s]条", autoSignalList.size()));
|
log.info(String.format("生成自动信号数据[%s]条", autoSignalList.size()));
|
||||||
log.info(String.format("生成自动折返数据[%s]条", generateCycleList.size()));
|
log.info(String.format("生成自动折返数据[%s]条", generateCycleList.size()));
|
||||||
// log.info(String.format("生成交路数据[%s]条", routingList.size()));
|
log.info(String.format("生成交路数据[%s]条", routingList.size()));
|
||||||
log.info(String.format("生成站间运行数据[%s]条", stationRunLevelList.size()));
|
log.info(String.format("生成站间运行数据[%s]条", stationRunLevelList.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
resultVO.setOverlapCount(this.overlapList.size());
|
resultVO.setOverlapCount(this.overlapList.size());
|
||||||
resultVO.setCycleCount(this.cycleList.size());
|
resultVO.setCycleCount(this.cycleList.size());
|
||||||
resultVO.setAutoSignalCount(this.autoSignalList.size());
|
resultVO.setAutoSignalCount(this.autoSignalList.size());
|
||||||
// resultVO.setRoutingCount(this.routingList.size());
|
resultVO.setRoutingCount(this.routingList.size());
|
||||||
resultVO.setStationRunlevelCount(this.stationRunLevelList.size());
|
resultVO.setStationRunlevelCount(this.stationRunLevelList.size());
|
||||||
resultVO.setDestinationCodeDefinitionCount(this.destinationCodeDefinitionList.size());
|
resultVO.setDestinationCodeDefinitionCount(this.destinationCodeDefinitionList.size());
|
||||||
return resultVO;
|
return resultVO;
|
||||||
@ -299,8 +299,8 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
autoSignal.getSignal().setAutoSignal(autoSignal);
|
autoSignal.getSignal().setAutoSignal(autoSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 生成交路数据
|
// 生成交路数据
|
||||||
// List<MapRoutingDataVO> generateRoutingList = this.generateRoutings(deviceMap, generatedRouteList, autoSignalList, errorList);
|
List<MapRoutingDataVO> generateRoutingList = this.generateRoutings(deviceMap, generatedRouteList, autoSignalList, errorList);
|
||||||
|
|
||||||
//站间运行等级生成
|
//站间运行等级生成
|
||||||
List<MapStationRunLevelVO> generatedStationRunLevelList = new ArrayList<>();
|
List<MapStationRunLevelVO> generatedStationRunLevelList = new ArrayList<>();
|
||||||
@ -370,7 +370,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
|||||||
|
|
||||||
return new CiGenerateResult(errorList, approachList,
|
return new CiGenerateResult(errorList, approachList,
|
||||||
autoSignalList, generatedRouteList, generatedOverlapList, flsList,
|
autoSignalList, generatedRouteList, generatedOverlapList, flsList,
|
||||||
generateCycleList, generatedStationRunLevelList, destinationCodeDefinitionList);
|
generateCycleList, generateRoutingList,generatedStationRunLevelList, destinationCodeDefinitionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,8 @@ public interface IRunPlanRoutingService {
|
|||||||
|
|
||||||
void deleteUserRouting(Long routingId);
|
void deleteUserRouting(Long routingId);
|
||||||
|
|
||||||
|
void deleteDefaultRouting(Long mapId);
|
||||||
|
|
||||||
PageVO<RunPlanRoutingVO> queryPagedUserRouting(Long userId, Long mapId, RunPlanRoutingQueryVO queryVO);
|
PageVO<RunPlanRoutingVO> queryPagedUserRouting(Long userId, Long mapId, RunPlanRoutingQueryVO queryVO);
|
||||||
|
|
||||||
List<RunPlanRoutingVO> getUserRoutingBy(Long userId, Long mapId);
|
List<RunPlanRoutingVO> getUserRoutingBy(Long userId, Long mapId);
|
||||||
@ -30,5 +32,11 @@ public interface IRunPlanRoutingService {
|
|||||||
|
|
||||||
List<RunPlanRoutingSection> getRoutingSectionDataBy(Long userId, Long planId, String routingCode);
|
List<RunPlanRoutingSection> getRoutingSectionDataBy(Long userId, Long planId, String routingCode);
|
||||||
|
|
||||||
RunPlanRoutingVO generateUserRoutingSections(RunPlanRoutingVO routingVO);
|
@Transactional
|
||||||
|
void createDefaultRoutings(List<RunPlanRoutingVO> defaultRoutings);
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
void pullDefaultRoutings(Long userId, Long mapId, List<Long> defaultRoutingIds);
|
||||||
|
|
||||||
|
RunPlanRoutingVO generateUserRoutingData(RunPlanRoutingVO routingVO);
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
package club.joylink.rtss.services.runplan;
|
package club.joylink.rtss.services.runplan;
|
||||||
|
|
||||||
import club.joylink.rtss.dao.RunPlanParktimeDAO;
|
import club.joylink.rtss.dao.RunPlanParktimeDAO;
|
||||||
import club.joylink.rtss.dao.RunPlanRunlevelDAO;
|
|
||||||
import club.joylink.rtss.entity.RunPlanParktime;
|
import club.joylink.rtss.entity.RunPlanParktime;
|
||||||
import club.joylink.rtss.entity.RunPlanParktimeExample;
|
import club.joylink.rtss.entity.RunPlanParktimeExample;
|
||||||
import club.joylink.rtss.entity.RunPlanRunlevel;
|
|
||||||
import club.joylink.rtss.entity.RunPlanRunlevelExample;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanParkingTimeVO;
|
import club.joylink.rtss.vo.client.runplan.user.RunPlanParkingTimeVO;
|
||||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanParktimeQueryVO;
|
import club.joylink.rtss.vo.client.runplan.user.RunPlanParktimeQueryVO;
|
||||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanRunLevelQueryVO;
|
|
||||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO;
|
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -5,6 +5,7 @@ import club.joylink.rtss.dao.RunPlanRoutingDAO;
|
|||||||
import club.joylink.rtss.entity.RunPlanDraft;
|
import club.joylink.rtss.entity.RunPlanDraft;
|
||||||
import club.joylink.rtss.entity.RunPlanRouting;
|
import club.joylink.rtss.entity.RunPlanRouting;
|
||||||
import club.joylink.rtss.entity.RunPlanRoutingExample;
|
import club.joylink.rtss.entity.RunPlanRoutingExample;
|
||||||
|
import club.joylink.rtss.exception.BaseException;
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.IMapService;
|
import club.joylink.rtss.services.IMapService;
|
||||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
||||||
@ -55,48 +56,90 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void createUserRouting(RunPlanRoutingVO routingVO) {
|
public void createUserRouting(RunPlanRoutingVO routingVO) {
|
||||||
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifRoutingDataExist(routingVO), "存在相同经停轨道的交路");
|
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(routingDataExist(routingVO), "交路数据重复");
|
||||||
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
||||||
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
||||||
"地图基础数据校验不通过");
|
"地图基础数据校验不通过");
|
||||||
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||||
Section startSection = (Section) deviceMap.get(routingVO.getStartSectionCode());
|
setRoutingType(routingVO, deviceMap);
|
||||||
Section endSection = (Section) deviceMap.get(routingVO.getEndSectionCode());
|
|
||||||
if (startSection.isTransferTrack() && endSection.isTurnBackTrack()) {
|
|
||||||
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.OUTBOUND);
|
|
||||||
} else if (startSection.isTurnBackTrack() && endSection.isTransferTrack()) {
|
|
||||||
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.INBOUND);
|
|
||||||
} else if (startSection.isTurnBackTrack() && endSection.isTurnBackTrack()) {
|
|
||||||
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.LOOP);
|
|
||||||
} else {
|
|
||||||
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.OTHER);
|
|
||||||
}
|
|
||||||
RunPlanRouting routing = routingVO.convert2Entity();
|
RunPlanRouting routing = routingVO.convert2Entity();
|
||||||
runPlanRoutingDAO.insert(routing);
|
runPlanRoutingDAO.insert(routing);
|
||||||
|
createRoutingRefData(deviceMap, routingVO);
|
||||||
|
if (Objects.equals(RunPlanRoutingVO.UserRoutingType.LOOP, routingVO.getRoutingType())) {
|
||||||
|
RunPlanRoutingVO routingDataLoop = routingVO.getRoutingDataLoop();
|
||||||
|
generateUserRoutingSections(routingDataLoop, deviceMap);
|
||||||
|
if (routingDataExist(routingDataLoop)) return;
|
||||||
|
runPlanRoutingDAO.insert(routingDataLoop.convert2Entity());
|
||||||
|
createRoutingRefData(deviceMap, routingDataLoop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void createDefaultRoutings(List<RunPlanRoutingVO> defaultRoutings) {
|
||||||
|
if (CollectionUtils.isEmpty(defaultRoutings)) return;
|
||||||
|
MapVO map = this.iMapService.getMapDetail(defaultRoutings.get(0).getMapId());
|
||||||
|
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
||||||
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(), "地图基础数据校验不通过");
|
||||||
|
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||||
|
defaultRoutings.forEach(routingVO -> {
|
||||||
|
routingVO.setUserId(null);
|
||||||
|
if (routingDataExist(routingVO)) return;
|
||||||
|
setRoutingType(routingVO, deviceMap);
|
||||||
|
RunPlanRouting routing = routingVO.convert2Entity();
|
||||||
|
runPlanRoutingDAO.insert(routing);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void pullDefaultRoutings(Long userId, Long mapId, List<Long> defaultRoutingIds) {
|
||||||
|
if (CollectionUtils.isEmpty(defaultRoutingIds)) return;
|
||||||
|
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(this.iMapService.getMapDetail(mapId));
|
||||||
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),"地图基础数据校验不通过");
|
||||||
|
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||||
|
defaultRoutingIds.forEach(id -> {
|
||||||
|
RunPlanRoutingVO defaultRouting = getUserRouting(id);
|
||||||
|
if(Objects.equals(defaultRouting.getMapId(),mapId) && Objects.isNull(defaultRouting.getUserId()) ){
|
||||||
|
defaultRouting.setUserId(userId);
|
||||||
|
if (routingDataExist(defaultRouting)) return;
|
||||||
|
RunPlanRouting routing = defaultRouting.convert2Entity();
|
||||||
|
defaultRouting.setId(null);
|
||||||
|
runPlanRoutingDAO.insert(routing);
|
||||||
|
createRoutingRefData(deviceMap, defaultRouting);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createRoutingRefData(Map<String, MapElement> deviceMap, RunPlanRoutingVO routingVO) {
|
||||||
generateUserRunlevels(routingVO, deviceMap);
|
generateUserRunlevels(routingVO, deviceMap);
|
||||||
generateUserParktimes(routingVO, deviceMap);
|
generateUserParktimes(routingVO, deviceMap);
|
||||||
generateUserStationReentryTimes(routingVO, deviceMap);
|
generateUserStationReentryTimes(routingVO, deviceMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RunPlanRoutingVO generateUserRoutingSections(RunPlanRoutingVO routingVO) {
|
public RunPlanRoutingVO generateUserRoutingData(RunPlanRoutingVO routingVO) {
|
||||||
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
||||||
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
||||||
"地图基础数据校验不通过");
|
"地图基础数据校验不通过");
|
||||||
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||||
|
generateUserRoutingSections(routingVO, deviceMap);
|
||||||
|
return routingVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateUserRoutingSections(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
||||||
Section startSection = (Section) deviceMap.get(routingVO.getStartSectionCode());
|
Section startSection = (Section) deviceMap.get(routingVO.getStartSectionCode());
|
||||||
Section endSection = (Section) deviceMap.get(routingVO.getEndSectionCode());
|
Section endSection = (Section) deviceMap.get(routingVO.getEndSectionCode());
|
||||||
//中间经停所有站台轨
|
//中间经停所有站台轨
|
||||||
List<Section> passingStandTrack = CalculateService.findPassingStandTrack(startSection, endSection, routingVO.getRight());
|
List<Section> passingStandTrack = CalculateService.findPassingStandTrack(startSection, endSection, routingVO.getRight());
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotNull(passingStandTrack,
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotNull(passingStandTrack,
|
||||||
"没有找到对应方向的中间经停区段,是否需要更换方向/手动添加/直接保存交路");
|
String.format("没有找到线路方向[%s]的中间经停区段,是否需要更换方向/手动添加/直接保存交路", routingVO.getRight() ? "右向" : "左向"));
|
||||||
LinkedList<RunPlanRoutingSection> parkSectionCodeList = passingStandTrack.stream().map(section -> new RunPlanRoutingSection(section.getStation().getCode(), section.getCode())).collect(Collectors.toCollection(LinkedList::new));
|
LinkedList<RunPlanRoutingSection> parkSectionCodeList = passingStandTrack.stream().map(section -> new RunPlanRoutingSection(section.getStation().getCode(), section.getCode())).collect(Collectors.toCollection(LinkedList::new));
|
||||||
parkSectionCodeList.addFirst(new RunPlanRoutingSection(routingVO.getStartStationCode(), routingVO.getStartSectionCode()));
|
parkSectionCodeList.addFirst(new RunPlanRoutingSection(routingVO.getStartStationCode(), routingVO.getStartSectionCode()));
|
||||||
parkSectionCodeList.addLast(new RunPlanRoutingSection(routingVO.getEndStationCode(), routingVO.getEndSectionCode()));
|
parkSectionCodeList.addLast(new RunPlanRoutingSection(routingVO.getEndStationCode(), routingVO.getEndSectionCode()));
|
||||||
routingVO.setParkSectionCodeList(parkSectionCodeList);
|
routingVO.setParkSectionCodeList(parkSectionCodeList);
|
||||||
return routingVO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -108,12 +151,25 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void updateUserRouting(Long routingId, RunPlanRoutingVO routingVO) {
|
public void updateUserRouting(Long routingId, RunPlanRoutingVO routingVO) {
|
||||||
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifRoutingDataExist(routingVO),"存在相同经停轨道的交路");
|
|
||||||
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
MapVO map = this.iMapService.getMapDetail(routingVO.getMapId());
|
||||||
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
||||||
"地图基础数据校验不通过");
|
"地图基础数据校验不通过");
|
||||||
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||||
|
setRoutingType(routingVO, deviceMap);
|
||||||
|
RunPlanRouting newRouting = routingVO.convert2Entity();
|
||||||
|
newRouting.setId(routingId);
|
||||||
|
if (routingDataExist(routingVO)) {
|
||||||
|
runPlanRoutingDAO.updateByPrimaryKey(newRouting);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
runPlanRoutingDAO.updateByPrimaryKeyWithBLOBs(newRouting);
|
||||||
|
generateUserRunlevels(routingVO, deviceMap);
|
||||||
|
generateUserParktimes(routingVO, deviceMap);
|
||||||
|
generateUserStationReentryTimes(routingVO, deviceMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRoutingType(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
||||||
Section startSection = (Section) deviceMap.get(routingVO.getStartSectionCode());
|
Section startSection = (Section) deviceMap.get(routingVO.getStartSectionCode());
|
||||||
Section endSection = (Section) deviceMap.get(routingVO.getEndSectionCode());
|
Section endSection = (Section) deviceMap.get(routingVO.getEndSectionCode());
|
||||||
if (startSection.isTransferTrack() && endSection.isTurnBackTrack()) {
|
if (startSection.isTransferTrack() && endSection.isTurnBackTrack()) {
|
||||||
@ -125,18 +181,11 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
} else {
|
} else {
|
||||||
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.OTHER);
|
routingVO.setRoutingType(RunPlanRoutingVO.UserRoutingType.OTHER);
|
||||||
}
|
}
|
||||||
RunPlanRouting newRouting = routingVO.convert2Entity();
|
|
||||||
newRouting.setId(routingId);
|
|
||||||
runPlanRoutingDAO.updateByPrimaryKeyWithBLOBs(newRouting);
|
|
||||||
generateUserRunlevels(routingVO, deviceMap);
|
|
||||||
generateUserParktimes(routingVO, deviceMap);
|
|
||||||
generateUserStationReentryTimes(routingVO, deviceMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateUserParktimes(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
private void generateUserParktimes(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
||||||
List<RunPlanParkingTimeVO> parkingTimeVOS = RunPlanParkingTimeVO.parkingTimeFromRouting(routingVO);
|
List<RunPlanParkingTimeVO> parkingTimeVOS = RunPlanParkingTimeVO.parkingTimeFromRouting(routingVO);
|
||||||
parkingTimeVOS.forEach(p -> {
|
parkingTimeVOS.forEach(p -> {
|
||||||
// if (!((Section) deviceMap.get(p.getSectionCode())).isTransferTrack() && !planParktimeService.isExisted(p)) {
|
|
||||||
if (((Section) deviceMap.get(p.getSectionCode())).isStandTrack() && !planParktimeService.isExisted(p)) {
|
if (((Section) deviceMap.get(p.getSectionCode())).isStandTrack() && !planParktimeService.isExisted(p)) {
|
||||||
planParktimeService.createUserParktime(p);
|
planParktimeService.createUserParktime(p);
|
||||||
}
|
}
|
||||||
@ -146,13 +195,13 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
private void generateUserRunlevels(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
private void generateUserRunlevels(RunPlanRoutingVO routingVO, Map<String, MapElement> deviceMap) {
|
||||||
List<RunPlanRunlevelVO> levels = RunPlanRunlevelVO.runLevelsFromRouting(routingVO);
|
List<RunPlanRunlevelVO> levels = RunPlanRunlevelVO.runLevelsFromRouting(routingVO);
|
||||||
levels.forEach(l -> {
|
levels.forEach(l -> {
|
||||||
Section startSection = (Section) deviceMap.get(l.getStartSectionCode());
|
|
||||||
Section endSection = (Section) deviceMap.get(l.getEndSectionCode());
|
|
||||||
if ((startSection.isTurnBackTrack() && !startSection.isStandTrack())
|
|
||||||
|| (endSection.isTurnBackTrack() && !endSection.isStandTrack())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!planRunlevelService.isExisted(l)) {
|
if (!planRunlevelService.isExisted(l)) {
|
||||||
|
Section startSection = (Section) deviceMap.get(l.getStartSectionCode());
|
||||||
|
Section endSection = (Section) deviceMap.get(l.getEndSectionCode());
|
||||||
|
if ((startSection.isTurnBackTrack() && !startSection.isStandTrack())
|
||||||
|
|| (endSection.isTurnBackTrack() && !endSection.isStandTrack())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((startSection.isStandTrack() && endSection.isTransferTrack()) || (endSection.isStandTrack() && startSection.isTransferTrack())) {
|
if ((startSection.isStandTrack() && endSection.isTransferTrack()) || (endSection.isStandTrack() && startSection.isTransferTrack())) {
|
||||||
Float distance;
|
Float distance;
|
||||||
try {
|
try {
|
||||||
@ -200,13 +249,25 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
runPlanRoutingDAO.deleteByPrimaryKey(routingId);
|
runPlanRoutingDAO.deleteByPrimaryKey(routingId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDefaultRouting(Long mapId) {
|
||||||
|
RunPlanRoutingExample example = new RunPlanRoutingExample();
|
||||||
|
example.createCriteria().andMapIdEqualTo(mapId).andUserIdIsNull();
|
||||||
|
runPlanRoutingDAO.deleteByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageVO<RunPlanRoutingVO> queryPagedUserRouting(Long userId, Long mapId, RunPlanRoutingQueryVO queryVO) {
|
public PageVO<RunPlanRoutingVO> queryPagedUserRouting(Long userId, Long mapId, RunPlanRoutingQueryVO queryVO) {
|
||||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||||
RunPlanRoutingExample example = new RunPlanRoutingExample();
|
RunPlanRoutingExample example = new RunPlanRoutingExample();
|
||||||
example.setOrderByClause("id");
|
example.setOrderByClause("id");
|
||||||
RunPlanRoutingExample.Criteria criteria = example.createCriteria();
|
RunPlanRoutingExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andMapIdEqualTo(mapId).andUserIdEqualTo(userId);
|
criteria.andMapIdEqualTo(mapId);
|
||||||
|
if(Objects.isNull(userId)){
|
||||||
|
criteria.andUserIdIsNull();
|
||||||
|
}else{
|
||||||
|
criteria.andUserIdEqualTo(userId);
|
||||||
|
}
|
||||||
if (StringUtils.hasText(queryVO.getStartStationCode())) {
|
if (StringUtils.hasText(queryVO.getStartStationCode())) {
|
||||||
criteria.andStartStationCodeEqualTo(queryVO.getStartStationCode());
|
criteria.andStartStationCodeEqualTo(queryVO.getStartStationCode());
|
||||||
}
|
}
|
||||||
@ -266,13 +327,13 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean ifRoutingDataExist(RunPlanRoutingVO routingVO) {
|
private boolean routingDataExist(RunPlanRoutingVO routingVO) {
|
||||||
return runPlanRoutingDAO.countUserRoutingBySectionData(routingVO.getUserId(), routingVO.getMapId(), JsonUtils.writeValueAsString(routingVO.getParkSectionCodeList())) > 0;
|
return runPlanRoutingDAO.countUserRoutingBySectionData(routingVO.getUserId(), routingVO.getMapId(), JsonUtils.writeValueAsString(routingVO.getParkSectionCodeList())) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunPlanRouting getRunPlanRoutingData(Long routingId) {
|
private RunPlanRouting getRunPlanRoutingData(Long routingId) {
|
||||||
RunPlanRouting routing = runPlanRoutingDAO.selectByPrimaryKey(routingId);
|
RunPlanRouting routing = runPlanRoutingDAO.selectByPrimaryKey(routingId);
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(routing);
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(routing,String.format("交路[%s]不存在",routingId));
|
||||||
return routing;
|
return routing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,18 +624,15 @@ public class CiApiServiceImpl implements CiApiService {
|
|||||||
*/
|
*/
|
||||||
private VirtualRealitySectionAxleCounter getAxleCounterAndCheck4Reset(Simulation simulation, String sectionCode) {
|
private VirtualRealitySectionAxleCounter getAxleCounterAndCheck4Reset(Simulation simulation, String sectionCode) {
|
||||||
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||||
Section chooseSection = section;
|
Section axleSection = section.findAxleCounterSection();
|
||||||
if (!section.isAxleCounter()) {
|
|
||||||
section = section.getParent();
|
|
||||||
}
|
|
||||||
//条件检查
|
//条件检查
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section != null && section.isAxleCounter(),
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(axleSection != null && axleSection.isAxleCounter(),
|
||||||
chooseSection.debugStr() + "不是计轴区段");
|
section.debugStr() + "不是计轴区段也不归属于任何计轴区段");
|
||||||
VirtualRealitySectionAxleCounter virtualAxleCounter = section.getVirtualAxleCounter();
|
VirtualRealitySectionAxleCounter virtualAxleCounter = axleSection.getVirtualAxleCounter();
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(virtualAxleCounter.isOccupy(), chooseSection.debugStr() + "计轴未占用,无需预复位");
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(virtualAxleCounter.isOccupy(), section.debugStr() + "计轴未占用,无需预复位");
|
||||||
if (simulation.getRepository().getConfig().isStationPreResetBeforeAxlePreReset()) {
|
if (simulation.getRepository().getConfig().isStationPreResetBeforeAxlePreReset()) {
|
||||||
Station station = section.getStation();
|
Station station = axleSection.getStation();
|
||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(station, chooseSection.debugStr() + "没有所属车站");
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(station, section.debugStr() + "没有所属车站");
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(station.isPreReset(), station.debugStr() + "需处于预复位状态");
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(station.isPreReset(), station.debugStr() + "需处于预复位状态");
|
||||||
}
|
}
|
||||||
return virtualAxleCounter;
|
return virtualAxleCounter;
|
||||||
|
@ -299,6 +299,7 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||||||
Simulation simulation = this.create(loginUserInfoVO, mapId,
|
Simulation simulation = this.create(loginUserInfoVO, mapId,
|
||||||
prdType,
|
prdType,
|
||||||
Simulation.FunctionalType.SIMULATION);
|
Simulation.FunctionalType.SIMULATION);
|
||||||
|
|
||||||
if (Objects.equals(MapPrdTypeEnum.BIG_SCREEN, prdType)) {
|
if (Objects.equals(MapPrdTypeEnum.BIG_SCREEN, prdType)) {
|
||||||
// 大屏仿真,直接按计划行车
|
// 大屏仿真,直接按计划行车
|
||||||
RunAsPlanParam param = new RunAsPlanParam();
|
RunAsPlanParam param = new RunAsPlanParam();
|
||||||
|
@ -34,6 +34,7 @@ public class InterlockBuilder2 {
|
|||||||
// ------------侧防end-------------
|
// ------------侧防end-------------
|
||||||
|
|
||||||
// ------------延续保护start-------------
|
// ------------延续保护start-------------
|
||||||
|
long overlapStart = System.currentTimeMillis();
|
||||||
List<MapOverlapVO> overlapList = logicData.getOverlapList();
|
List<MapOverlapVO> overlapList = logicData.getOverlapList();
|
||||||
for (MapOverlapVO mapOverlapVO : overlapList) {
|
for (MapOverlapVO mapOverlapVO : overlapList) {
|
||||||
RouteOverlap routeOverlap = new RouteOverlap(mapOverlapVO.getCode(), mapOverlapVO.getName());
|
RouteOverlap routeOverlap = new RouteOverlap(mapOverlapVO.getCode(), mapOverlapVO.getName());
|
||||||
@ -99,6 +100,7 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.debug("构建延续保护耗时:" + (System.currentTimeMillis() - overlapStart));
|
||||||
// ------------延续保护end-------------
|
// ------------延续保护end-------------
|
||||||
// 接近区段
|
// 接近区段
|
||||||
List<MapSignalApproachSectionVO> signalApproachSectionList = logicData.getSignalApproachSectionList();
|
List<MapSignalApproachSectionVO> signalApproachSectionList = logicData.getSignalApproachSectionList();
|
||||||
@ -128,6 +130,7 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ------------进路start-------------
|
// ------------进路start-------------
|
||||||
|
long routeStart = System.currentTimeMillis();
|
||||||
List<MapRouteNewVO> routeList = logicData.getRouteList();
|
List<MapRouteNewVO> routeList = logicData.getRouteList();
|
||||||
for (MapRouteNewVO mapRouteVO : routeList) {
|
for (MapRouteNewVO mapRouteVO : routeList) {
|
||||||
Route route = new Route(mapRouteVO.getCode(), mapRouteVO.getName());
|
Route route = new Route(mapRouteVO.getCode(), mapRouteVO.getName());
|
||||||
@ -245,6 +248,7 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.debug("构建进路耗时:" + (System.currentTimeMillis() - routeStart));
|
||||||
// 敌对进路关系构建
|
// 敌对进路关系构建
|
||||||
for (MapRouteNewVO mapRouteVO : routeList) {
|
for (MapRouteNewVO mapRouteVO : routeList) {
|
||||||
Route route = (Route) elementMap.get(mapRouteVO.getCode());
|
Route route = (Route) elementMap.get(mapRouteVO.getCode());
|
||||||
@ -485,6 +489,7 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, RouteFls> checkAndBuildRouteFls(List<MapRouteFlankProtectionNewVO> flankProtectionList, Map<String, MapElement> elementMap) {
|
private static Map<String, RouteFls> checkAndBuildRouteFls(List<MapRouteFlankProtectionNewVO> flankProtectionList, Map<String, MapElement> elementMap) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
Map<String, RouteFls> map = new HashMap<>();
|
Map<String, RouteFls> map = new HashMap<>();
|
||||||
for (MapRouteFlankProtectionNewVO fpVO : flankProtectionList) {
|
for (MapRouteFlankProtectionNewVO fpVO : flankProtectionList) {
|
||||||
RouteFls routeFls = new RouteFls(fpVO.getCode(), new SwitchElement((Switch) elementMap.get(fpVO.getSource().getSwitchCode()), fpVO.getSource().isNormal()));
|
RouteFls routeFls = new RouteFls(fpVO.getCode(), new SwitchElement((Switch) elementMap.get(fpVO.getSource().getSwitchCode()), fpVO.getSource().isNormal()));
|
||||||
@ -494,6 +499,7 @@ public class InterlockBuilder2 {
|
|||||||
routeFls.setLevel2List(level2List);
|
routeFls.setLevel2List(level2List);
|
||||||
map.put(routeFls.getCode(), routeFls);
|
map.put(routeFls.getCode(), routeFls);
|
||||||
}
|
}
|
||||||
|
log.debug("构建侧防耗时:" + (System.currentTimeMillis() - start));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -861,6 +867,8 @@ public class InterlockBuilder2 {
|
|||||||
private static void buildRoutePathFromStationRunLevel(List<StationRunLevel> stationRunLevelList,
|
private static void buildRoutePathFromStationRunLevel(List<StationRunLevel> stationRunLevelList,
|
||||||
SimulationBuilder.SimulationDeviceBuildResult buildResult,
|
SimulationBuilder.SimulationDeviceBuildResult buildResult,
|
||||||
List<String> errMsgList) {
|
List<String> errMsgList) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
log.debug("构建进路路径开始:" + start);
|
||||||
if (CollectionUtils.isEmpty(stationRunLevelList)) {
|
if (CollectionUtils.isEmpty(stationRunLevelList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -877,6 +885,7 @@ public class InterlockBuilder2 {
|
|||||||
routePathMap.put(routePaths.get(0).getKey(), routePaths);
|
routePathMap.put(routePaths.get(0).getKey(), routePaths);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.debug("构建进路路径耗时:" + (System.currentTimeMillis() - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
@ -1291,6 +1300,8 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void checkBetweenRouteSameDirectionSignal(Map<String, MapElement> elementMap, List<String> errMsgList) {
|
private static void checkBetweenRouteSameDirectionSignal(Map<String, MapElement> elementMap, List<String> errMsgList) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
log.debug("构建自动折返进路开始");
|
||||||
if (!CollectionUtils.isEmpty(errMsgList)) { // 数据中本身存在错误,不检查
|
if (!CollectionUtils.isEmpty(errMsgList)) { // 数据中本身存在错误,不检查
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1323,5 +1334,6 @@ public class InterlockBuilder2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.debug("构建自动折返进路耗时:" + (System.currentTimeMillis() - start));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,110 +42,7 @@ public class MapDeviceBuilder {
|
|||||||
buildStation(graphData, elementMap, errMsgList);
|
buildStation(graphData, elementMap, errMsgList);
|
||||||
// 区段
|
// 区段
|
||||||
List<MapSectionNewVO> sectionList = graphData.getSectionList();
|
List<MapSectionNewVO> sectionList = graphData.getSectionList();
|
||||||
Map<String, Section> desCodeSectionMap = new HashMap<>();
|
buildSections(elementMap, deviceMap, errMsgList, sectionList);
|
||||||
for (MapSectionNewVO sectionVO : sectionList) {
|
|
||||||
Section section = new Section(sectionVO.getCode(), sectionVO.getName());
|
|
||||||
if (Objects.nonNull(elementMap.get(section.getCode()))) {
|
|
||||||
errMsgList.add(String.format("编码为[%s]的区段不唯一", section.getCode()));
|
|
||||||
}
|
|
||||||
elementMap.put(section.getCode(), section);
|
|
||||||
section.setRoadType(sectionVO.getRoadType());
|
|
||||||
section.setPhysical(isPhysicalSection(sectionVO.getType()));
|
|
||||||
section.setAxleCounter(isAxleCounterSection(sectionVO.getType()));
|
|
||||||
section.setCross(isCross(sectionVO.getType()));
|
|
||||||
// 计轴区段和道岔区段,校验实际长度
|
|
||||||
if (isPhysicalSection(sectionVO.getType()) &&
|
|
||||||
(Objects.isNull(sectionVO.getLengthFact()) ||
|
|
||||||
sectionVO.getLengthFact() <= 0 ||
|
|
||||||
Float.isInfinite(sectionVO.getLengthFact()) ||
|
|
||||||
Float.isNaN(sectionVO.getLengthFact()))) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]实际距离未设置或不为正数", sectionVO.getName(), sectionVO.getCode()));
|
|
||||||
} else if (isPhysicalSection(sectionVO.getType())) {
|
|
||||||
section.setLen(sectionVO.getLengthFact());
|
|
||||||
}
|
|
||||||
if (Objects.equals(sectionVO.getType(), BusinessConsts.Section.SectionType.Type02)) { // 逻辑区段
|
|
||||||
Float startOffset = sectionVO.getLogicSectionStartOffset();
|
|
||||||
Float endOffset = sectionVO.getLogicSectionEndOffset();
|
|
||||||
section.setLen(sectionVO.getLengthFact());
|
|
||||||
if ((Objects.isNull(sectionVO.getLengthFact()) || sectionVO.getLengthFact() <= 0) &&
|
|
||||||
(Objects.isNull(startOffset) || Objects.isNull(endOffset))) {
|
|
||||||
errMsgList.add(String.format("逻辑区段[%s(%s)]既没有设置实际长度且所在物理区段起始/终止偏移量也未设置",
|
|
||||||
section.getName(), section.getCode()));
|
|
||||||
} else {
|
|
||||||
float max = Math.max(startOffset, endOffset);
|
|
||||||
float min = Math.min(startOffset, endOffset);
|
|
||||||
section.setMaxOffset(max);
|
|
||||||
section.setMinOffset(min);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 所属设备集中站
|
|
||||||
Station deviceStation = (Station) elementMap.get(sectionVO.getStationCode());
|
|
||||||
if (Objects.isNull(deviceStation)) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]未关联设备集中站或设备集中站不存在", section.getName(), section.getCode()));
|
|
||||||
} else {
|
|
||||||
section.setDeviceStation(deviceStation);
|
|
||||||
}
|
|
||||||
section.setStandTrack(sectionVO.isStandTrack());
|
|
||||||
section.setTurnBackTrack(sectionVO.isReentryTrack());
|
|
||||||
section.setFirstTurnBack(sectionVO.isFirstTurnBack());
|
|
||||||
section.setTransferTrack(sectionVO.isTransferTrack());
|
|
||||||
if (section.isTransferTrack()) {
|
|
||||||
if (section.isTurnBackTrack() || section.isStandTrack()) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]是转换轨,就不能再设置为站台轨或折返轨",
|
|
||||||
section.getName(), section.getCode()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 是站台轨/折返轨/转换轨,校验左右停车点
|
|
||||||
if ((section.isStandTrack() || section.isTransferTrack() || section.isTurnBackTrack())
|
|
||||||
&&
|
|
||||||
(Objects.isNull(sectionVO.getLeftStopPointOffset()) ||
|
|
||||||
Objects.isNull(sectionVO.getRightStopPointOffset()) ||
|
|
||||||
(0 == sectionVO.getLeftStopPointOffset().floatValue() &&
|
|
||||||
0 == sectionVO.getRightStopPointOffset().floatValue()))) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]是站台轨/折返轨/转换轨,却未设置左右停车点偏移量或左右停车点偏移量都为0", sectionVO.getName(), sectionVO.getCode()));
|
|
||||||
} else {
|
|
||||||
section.setStopPointLeft(sectionVO.getLeftStopPointOffset());
|
|
||||||
section.setStopPointRight(sectionVO.getRightStopPointOffset());
|
|
||||||
}
|
|
||||||
// 转换轨/折返轨,构建关联车站,站台轨在后面处理站台逻辑里做了
|
|
||||||
if (section.isStandTrack() || section.isTransferTrack() || section.isTurnBackTrack()) {
|
|
||||||
if (!StringUtils.hasText(sectionVO.getBelongStation())) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]是站台轨或转换轨或折返轨,却未设置关联车站",
|
|
||||||
sectionVO.getName(), sectionVO.getCode()));
|
|
||||||
} else {
|
|
||||||
//归属车站
|
|
||||||
Station station = (Station) elementMap.get(sectionVO.getBelongStation());
|
|
||||||
if (Objects.isNull(station)) {
|
|
||||||
errMsgList.add(String.format("折返轨/转换轨/站台轨区段[%s(%s)]关联的车站[(%s)]不存在", section.getName(), section.getCode(), sectionVO.getBelongStation()));
|
|
||||||
} else {
|
|
||||||
section.setStation(station);
|
|
||||||
if (section.isTransferTrack()) {
|
|
||||||
station.addTransferTrack(section);
|
|
||||||
}
|
|
||||||
if (section.isTurnBackTrack()) {
|
|
||||||
station.addTurnBackSection(section);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
section.setDestinationCode(sectionVO.getDestinationCode());
|
|
||||||
if (StringUtils.hasText(sectionVO.getDestinationCode())) {
|
|
||||||
Section section1 = desCodeSectionMap.get(sectionVO.getDestinationCode());
|
|
||||||
if (Objects.nonNull(section1)) {
|
|
||||||
errMsgList.add(String.format("区段[%s(%s)]和区段[%s(%s)]目的地码相同[%s],目的地码必须唯一",
|
|
||||||
section.getName(), section.getCode(),
|
|
||||||
section1.getName(), section1.getCode(),
|
|
||||||
sectionVO.getDestinationCode()));
|
|
||||||
}
|
|
||||||
desCodeSectionMap.put(sectionVO.getDestinationCode(), section);
|
|
||||||
}
|
|
||||||
// 如果区段是计轴区段,构建区段虚拟真实计轴器
|
|
||||||
if (section.isAxleCounter()) {
|
|
||||||
VirtualRealitySectionAxleCounter axleCounter = new VirtualRealitySectionAxleCounter(section.getCode(), section.getName());
|
|
||||||
section.setVirtualAxleCounter(axleCounter);
|
|
||||||
deviceMap.put(axleCounter.getCode(), axleCounter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 道岔
|
// 道岔
|
||||||
List<MapSwitchVO> switchList = graphData.getSwitchList();
|
List<MapSwitchVO> switchList = graphData.getSwitchList();
|
||||||
switchList.forEach(switchVO -> {
|
switchList.forEach(switchVO -> {
|
||||||
@ -200,10 +97,11 @@ public class MapDeviceBuilder {
|
|||||||
sectionList.forEach(sectionVO -> {
|
sectionList.forEach(sectionVO -> {
|
||||||
Section section = (Section) elementMap.get(sectionVO.getCode());
|
Section section = (Section) elementMap.get(sectionVO.getCode());
|
||||||
if (Objects.equals(BusinessConsts.Section.SectionType.Type02, sectionVO.getType()) ||
|
if (Objects.equals(BusinessConsts.Section.SectionType.Type02, sectionVO.getType()) ||
|
||||||
Objects.equals(BusinessConsts.Section.SectionType.Type03, sectionVO.getType())) { // 逻辑区段/道岔区段
|
Objects.equals(BusinessConsts.Section.SectionType.Type03, sectionVO.getType()) ||
|
||||||
|
isCross(sectionVO.getType())) { // 逻辑区段/道岔区段/岔心
|
||||||
Section parent = (Section) elementMap.get(sectionVO.getParentCode());
|
Section parent = (Section) elementMap.get(sectionVO.getParentCode());
|
||||||
if (Objects.isNull(parent)) {
|
if (Objects.isNull(parent)) {
|
||||||
errMsgList.add(String.format("逻辑区段/道岔区段[%s(%s)]没用关联(道岔)计轴区段或关联的(道岔)计轴区段不存在",
|
errMsgList.add(String.format("逻辑区段/道岔区段/岔心[%s(%s)]没用关联(道岔)计轴区段或关联的(道岔)计轴区段不存在",
|
||||||
section.getName(), section.getCode()));
|
section.getName(), section.getCode()));
|
||||||
} else {
|
} else {
|
||||||
parent.addLogicSection(section);
|
parent.addLogicSection(section);
|
||||||
@ -256,8 +154,8 @@ public class MapDeviceBuilder {
|
|||||||
if (Objects.isNull(physicalSectionOfCross)) {
|
if (Objects.isNull(physicalSectionOfCross)) {
|
||||||
errMsgList.add(String.format("岔心[%s(%s)]关联的物理区段[(%s)]不存在",
|
errMsgList.add(String.format("岔心[%s(%s)]关联的物理区段[(%s)]不存在",
|
||||||
section.getName(), section.getCode(), s));
|
section.getName(), section.getCode(), s));
|
||||||
} else if (!physicalSectionOfCross.isAxleCounterSection()) {
|
} else if (!physicalSectionOfCross.isPhysical()) {
|
||||||
errMsgList.add(String.format("岔心[%s(%s)]关联的区段[%s(%s)]不是一般计轴物理区段",
|
errMsgList.add(String.format("岔心[%s(%s)]关联的区段[%s(%s)]不是物理区段",
|
||||||
section.getName(), section.getCode(), physicalSectionOfCross.getName(), s));
|
section.getName(), section.getCode(), physicalSectionOfCross.getName(), s));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -846,6 +744,117 @@ public class MapDeviceBuilder {
|
|||||||
buildResponderDataRef(graphData, elementMap, errMsgList, mapDataBuildResult.getSectionRespondersMap());
|
buildResponderDataRef(graphData, elementMap, errMsgList, mapDataBuildResult.getSectionRespondersMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建区段数据
|
||||||
|
*/
|
||||||
|
private static void buildSections(Map<String, MapElement> elementMap, Map<String, VirtualRealityDevice> deviceMap,
|
||||||
|
List<String> errMsgList, List<MapSectionNewVO> sectionList) {
|
||||||
|
Map<String, Section> desCodeSectionMap = new HashMap<>();
|
||||||
|
for (MapSectionNewVO sectionVO : sectionList) {
|
||||||
|
Section section = new Section(sectionVO.getCode(), sectionVO.getName());
|
||||||
|
if (Objects.nonNull(elementMap.get(section.getCode()))) {
|
||||||
|
errMsgList.add(String.format("编码为[%s]的区段不唯一", section.getCode()));
|
||||||
|
}
|
||||||
|
elementMap.put(section.getCode(), section);
|
||||||
|
section.setRoadType(sectionVO.getRoadType());
|
||||||
|
section.setPhysical(isPhysicalSection(sectionVO.getType()));
|
||||||
|
section.setAxleCounter(isAxleCounterSection(sectionVO, sectionList));
|
||||||
|
section.setCross(isCross(sectionVO.getType()));
|
||||||
|
// 计轴区段和道岔区段,校验实际长度
|
||||||
|
if (isPhysicalSection(sectionVO.getType()) &&
|
||||||
|
(Objects.isNull(sectionVO.getLengthFact()) ||
|
||||||
|
sectionVO.getLengthFact() <= 0 ||
|
||||||
|
Float.isInfinite(sectionVO.getLengthFact()) ||
|
||||||
|
Float.isNaN(sectionVO.getLengthFact()))) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]实际距离未设置或不为正数", sectionVO.getName(), sectionVO.getCode()));
|
||||||
|
} else if (isPhysicalSection(sectionVO.getType())) {
|
||||||
|
section.setLen(sectionVO.getLengthFact());
|
||||||
|
}
|
||||||
|
if (Objects.equals(sectionVO.getType(), BusinessConsts.Section.SectionType.Type02)) { // 逻辑区段
|
||||||
|
Float startOffset = sectionVO.getLogicSectionStartOffset();
|
||||||
|
Float endOffset = sectionVO.getLogicSectionEndOffset();
|
||||||
|
section.setLen(sectionVO.getLengthFact());
|
||||||
|
if ((Objects.isNull(sectionVO.getLengthFact()) || sectionVO.getLengthFact() <= 0) &&
|
||||||
|
(Objects.isNull(startOffset) || Objects.isNull(endOffset))) {
|
||||||
|
errMsgList.add(String.format("逻辑区段[%s(%s)]既没有设置实际长度且所在物理区段起始/终止偏移量也未设置",
|
||||||
|
section.getName(), section.getCode()));
|
||||||
|
} else {
|
||||||
|
float max = Math.max(startOffset, endOffset);
|
||||||
|
float min = Math.min(startOffset, endOffset);
|
||||||
|
section.setMaxOffset(max);
|
||||||
|
section.setMinOffset(min);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 所属设备集中站
|
||||||
|
Station deviceStation = (Station) elementMap.get(sectionVO.getStationCode());
|
||||||
|
if (Objects.isNull(deviceStation)) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]未关联设备集中站或设备集中站不存在", section.getName(), section.getCode()));
|
||||||
|
} else {
|
||||||
|
section.setDeviceStation(deviceStation);
|
||||||
|
}
|
||||||
|
section.setStandTrack(sectionVO.isStandTrack());
|
||||||
|
section.setTurnBackTrack(sectionVO.isReentryTrack());
|
||||||
|
section.setFirstTurnBack(sectionVO.isFirstTurnBack());
|
||||||
|
section.setTransferTrack(sectionVO.isTransferTrack());
|
||||||
|
if (section.isTransferTrack()) {
|
||||||
|
if (section.isTurnBackTrack() || section.isStandTrack()) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]是转换轨,就不能再设置为站台轨或折返轨",
|
||||||
|
section.getName(), section.getCode()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是站台轨/折返轨/转换轨,校验左右停车点
|
||||||
|
if ((section.isStandTrack() || section.isTransferTrack() || section.isTurnBackTrack())
|
||||||
|
&&
|
||||||
|
(Objects.isNull(sectionVO.getLeftStopPointOffset()) ||
|
||||||
|
Objects.isNull(sectionVO.getRightStopPointOffset()) ||
|
||||||
|
(0 == sectionVO.getLeftStopPointOffset().floatValue() &&
|
||||||
|
0 == sectionVO.getRightStopPointOffset().floatValue()))) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]是站台轨/折返轨/转换轨,却未设置左右停车点偏移量或左右停车点偏移量都为0", sectionVO.getName(), sectionVO.getCode()));
|
||||||
|
} else {
|
||||||
|
section.setStopPointLeft(sectionVO.getLeftStopPointOffset());
|
||||||
|
section.setStopPointRight(sectionVO.getRightStopPointOffset());
|
||||||
|
}
|
||||||
|
// 转换轨/折返轨,构建关联车站,站台轨在后面处理站台逻辑里做了
|
||||||
|
if (section.isStandTrack() || section.isTransferTrack() || section.isTurnBackTrack()) {
|
||||||
|
if (!StringUtils.hasText(sectionVO.getBelongStation())) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]是站台轨或转换轨或折返轨,却未设置关联车站",
|
||||||
|
sectionVO.getName(), sectionVO.getCode()));
|
||||||
|
} else {
|
||||||
|
//归属车站
|
||||||
|
Station station = (Station) elementMap.get(sectionVO.getBelongStation());
|
||||||
|
if (Objects.isNull(station)) {
|
||||||
|
errMsgList.add(String.format("折返轨/转换轨/站台轨区段[%s(%s)]关联的车站[(%s)]不存在", section.getName(), section.getCode(), sectionVO.getBelongStation()));
|
||||||
|
} else {
|
||||||
|
section.setStation(station);
|
||||||
|
if (section.isTransferTrack()) {
|
||||||
|
station.addTransferTrack(section);
|
||||||
|
}
|
||||||
|
if (section.isTurnBackTrack()) {
|
||||||
|
station.addTurnBackSection(section);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
section.setDestinationCode(sectionVO.getDestinationCode());
|
||||||
|
if (StringUtils.hasText(sectionVO.getDestinationCode())) {
|
||||||
|
Section section1 = desCodeSectionMap.get(sectionVO.getDestinationCode());
|
||||||
|
if (Objects.nonNull(section1)) {
|
||||||
|
errMsgList.add(String.format("区段[%s(%s)]和区段[%s(%s)]目的地码相同[%s],目的地码必须唯一",
|
||||||
|
section.getName(), section.getCode(),
|
||||||
|
section1.getName(), section1.getCode(),
|
||||||
|
sectionVO.getDestinationCode()));
|
||||||
|
}
|
||||||
|
desCodeSectionMap.put(sectionVO.getDestinationCode(), section);
|
||||||
|
}
|
||||||
|
// 如果区段是计轴区段,构建区段虚拟真实计轴器
|
||||||
|
if (section.isAxleCounter()) {
|
||||||
|
VirtualRealitySectionAxleCounter axleCounter = new VirtualRealitySectionAxleCounter(section.getCode(), section.getName());
|
||||||
|
section.setVirtualAxleCounter(axleCounter);
|
||||||
|
deviceMap.put(axleCounter.getCode(), axleCounter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void buildSignal(MapGraphDataNewVO graphData, Map<String, MapElement> elementMap, Map<String, VirtualRealityDevice> deviceMap, List<String> errMsgList) {
|
private static void buildSignal(MapGraphDataNewVO graphData, Map<String, MapElement> elementMap, Map<String, VirtualRealityDevice> deviceMap, List<String> errMsgList) {
|
||||||
List<MapSignalNewVO> signalList = graphData.getSignalList();
|
List<MapSignalNewVO> signalList = graphData.getSignalList();
|
||||||
@ -1186,8 +1195,16 @@ public class MapDeviceBuilder {
|
|||||||
return Objects.equals(type, BusinessConsts.Section.SectionType.Type01) || Objects.equals(type, BusinessConsts.Section.SectionType.Type03);
|
return Objects.equals(type, BusinessConsts.Section.SectionType.Type01) || Objects.equals(type, BusinessConsts.Section.SectionType.Type03);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isAxleCounterSection(String type) {
|
private static boolean isAxleCounterSection(MapSectionNewVO sectionVO, List<MapSectionNewVO> sectionList) {
|
||||||
return Objects.equals(type, BusinessConsts.Section.SectionType.Type01) || Objects.equals(type, BusinessConsts.Section.SectionType.Type04);
|
String type = sectionVO.getType();
|
||||||
|
if (Objects.equals(type, BusinessConsts.Section.SectionType.Type04))
|
||||||
|
return true;
|
||||||
|
if (Objects.equals(type, BusinessConsts.Section.SectionType.Type01)) {
|
||||||
|
String parentCode = sectionVO.getParentCode();
|
||||||
|
return sectionList.stream().noneMatch(section -> isCross(section.getType()) && section.getCode().equals(parentCode));
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCross(String type) {
|
private static boolean isCross(String type) {
|
||||||
|
@ -88,7 +88,7 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
private Section parent;
|
private Section parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岔心关联的计轴区段;道岔计轴区段关联的道岔区段;物理区段关联的逻辑区段
|
* 岔心关联的物理区段;道岔计轴区段关联的道岔区段、岔心;物理区段关联的逻辑区段
|
||||||
*/
|
*/
|
||||||
private List<Section> logicList;
|
private List<Section> logicList;
|
||||||
|
|
||||||
@ -740,6 +740,10 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
aSwitch.getC().setNctOccupied(true);
|
aSwitch.getC().setNctOccupied(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Section cross = queryCross();
|
||||||
|
if (cross != null) {
|
||||||
|
cross.crossJudgeInvalid();
|
||||||
|
}
|
||||||
} else if (!CollectionUtils.isEmpty(this.logicList)) {
|
} else if (!CollectionUtils.isEmpty(this.logicList)) {
|
||||||
for (Section logic : this.logicList) {
|
for (Section logic : this.logicList) {
|
||||||
logic.setNctOccupied(true);
|
logic.setNctOccupied(true);
|
||||||
@ -778,6 +782,21 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岔心判断失效
|
||||||
|
*/
|
||||||
|
private void crossJudgeInvalid(){
|
||||||
|
if (!this.cross)
|
||||||
|
return;
|
||||||
|
this.logicList.forEach(logic->{
|
||||||
|
Section leftSection = logic.getLeftSection();
|
||||||
|
boolean leftSectionNctOccupied = leftSection.isNctOccupied() && leftSection.getParent().equals(this.parent);
|
||||||
|
Section rightSection = logic.getRightSection();
|
||||||
|
boolean rightSectionNctOccupied = rightSection.isNctOccupied() && rightSection.getParent().equals(this.parent);
|
||||||
|
logic.setNctOccupied(leftSectionNctOccupied || rightSectionNctOccupied);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判定为有效
|
* 判定为有效
|
||||||
*/
|
*/
|
||||||
@ -806,6 +825,13 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询道岔计轴区段关联的岔心
|
||||||
|
*/
|
||||||
|
private Section queryCross() {
|
||||||
|
return this.logicList.stream().filter(Section::isCross).limit(1).findAny().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认计轴有效
|
* 确认计轴有效
|
||||||
*/
|
*/
|
||||||
@ -952,12 +978,25 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
if (switchTrack) {
|
if (switchTrack) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (virtualAxleCounter == null) {
|
Section axleCounterSection = findAxleCounterSection();
|
||||||
if (parent != null)
|
if (axleCounterSection != null) {
|
||||||
return parent.isPreReset();
|
return axleCounterSection.getVirtualAxleCounter().isPreReset() && this.isNctOccupied();
|
||||||
|
} else{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找计轴区段
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Section findAxleCounterSection() {
|
||||||
|
if (this.isAxleCounter()) {
|
||||||
|
return this;
|
||||||
|
} else if (parent != null) {
|
||||||
|
return parent.findAxleCounterSection();
|
||||||
} else {
|
} else {
|
||||||
return virtualAxleCounter.isPreReset();
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,9 @@ public class VRTrainRunningService {
|
|||||||
if (!headAxleCounterSectionNew.isAxleCounter()) {
|
if (!headAxleCounterSectionNew.isAxleCounter()) {
|
||||||
headAxleCounterSectionNew = headAxleCounterSectionNew.getParent();
|
headAxleCounterSectionNew = headAxleCounterSectionNew.getParent();
|
||||||
}
|
}
|
||||||
|
if (!headAxleCounterSectionNew.isAxleCounter()) { //当是——物理区段-岔心-道岔计轴区段三层结构的时候需要多这次判断
|
||||||
|
headAxleCounterSectionNew = headAxleCounterSectionNew.getParent();
|
||||||
|
}
|
||||||
if (headAxleCounterSectionNew != null && headAxleCounterSectionNew.isAxleCounter()) { //新的区段是计轴区段
|
if (headAxleCounterSectionNew != null && headAxleCounterSectionNew.isAxleCounter()) { //新的区段是计轴区段
|
||||||
Section headSectionOld = headPosition.getSection();
|
Section headSectionOld = headPosition.getSection();
|
||||||
if (!headAxleCounterSectionNew.equals(headSectionOld) && !headAxleCounterSectionNew.equals(headSectionOld.getParent())) { //新计轴区段和老区段不一样
|
if (!headAxleCounterSectionNew.equals(headSectionOld) && !headAxleCounterSectionNew.equals(headSectionOld.getParent())) { //新计轴区段和老区段不一样
|
||||||
|
25
src/main/java/club/joylink/rtss/vo/client/CgyRecordVO.java
Normal file
25
src/main/java/club/joylink/rtss/vo/client/CgyRecordVO.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package club.joylink.rtss.vo.client;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成都工业使用记录
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CgyRecordVO {
|
||||||
|
private long loginCount;
|
||||||
|
|
||||||
|
private int browseCount;
|
||||||
|
|
||||||
|
private int downloadCount;
|
||||||
|
|
||||||
|
public CgyRecordVO(long loginCount, int browseCount, int downloadCount) {
|
||||||
|
this.loginCount = loginCount;
|
||||||
|
this.browseCount = browseCount;
|
||||||
|
this.downloadCount = downloadCount;
|
||||||
|
}
|
||||||
|
}
|
@ -167,9 +167,14 @@ public class MapSectionNewVO {
|
|||||||
/**
|
/**
|
||||||
* 岔心关联计轴区段列表
|
* 岔心关联计轴区段列表
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "岔心关联计轴区段列表")
|
@ApiModelProperty(value = "岔心关联物理区段列表")
|
||||||
List<String> relateSectionList;
|
List<String> relateSectionList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 道岔计轴区段关联的岔心区段
|
||||||
|
*/
|
||||||
|
String relCrossSection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否站台轨
|
* 是否站台轨
|
||||||
*/
|
*/
|
||||||
|
@ -3,6 +3,7 @@ package club.joylink.rtss.vo.client.runplan.user;
|
|||||||
import club.joylink.rtss.entity.RunPlanRouting;
|
import club.joylink.rtss.entity.RunPlanRouting;
|
||||||
import club.joylink.rtss.util.JsonUtils;
|
import club.joylink.rtss.util.JsonUtils;
|
||||||
import club.joylink.rtss.vo.client.map.MapVO;
|
import club.joylink.rtss.vo.client.map.MapVO;
|
||||||
|
import club.joylink.rtss.vo.client.map.newmap.MapRoutingDataVO;
|
||||||
import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO;
|
import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
@ -15,7 +16,6 @@ import javax.validation.constraints.NotBlank;
|
|||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -140,6 +140,21 @@ public class RunPlanRoutingVO {
|
|||||||
return routing;
|
return routing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static RunPlanRoutingVO fromMapRoutingData(MapRoutingDataVO mapRoutingDataVO,Long mapId){
|
||||||
|
RunPlanRoutingVO routingVO = new RunPlanRoutingVO();
|
||||||
|
routingVO.setMapId(mapId);
|
||||||
|
routingVO.setName(mapRoutingDataVO.getName());
|
||||||
|
routingVO.setCode(mapRoutingDataVO.getCode());
|
||||||
|
routingVO.setStartStationCode(mapRoutingDataVO.getStartStationCode());
|
||||||
|
routingVO.setStartSectionCode(mapRoutingDataVO.getStartSectionCode());
|
||||||
|
routingVO.setEndStationCode(mapRoutingDataVO.getEndStationCode());
|
||||||
|
routingVO.setEndSectionCode(mapRoutingDataVO.getEndSectionCode());
|
||||||
|
routingVO.setRight(mapRoutingDataVO.getRight());
|
||||||
|
routingVO.setDestinationCode(mapRoutingDataVO.getDestinationCode());
|
||||||
|
routingVO.setRemarks(mapRoutingDataVO.getDescription());
|
||||||
|
routingVO.setParkSectionCodeList(JsonUtils.readCollection(JsonUtils.writeValueAsString(mapRoutingDataVO.getParkSectionCodeList()), List.class, RunPlanRoutingSection.class));
|
||||||
|
return routingVO;
|
||||||
|
}
|
||||||
// public RunPlanRoutingVO generateLoopRoutingBasicData(){
|
// public RunPlanRoutingVO generateLoopRoutingBasicData(){
|
||||||
// RunPlanRoutingVO routing = new RunPlanRoutingVO();
|
// RunPlanRoutingVO routing = new RunPlanRoutingVO();
|
||||||
// routing.setMapId(mapId);
|
// routing.setMapId(mapId);
|
||||||
@ -186,7 +201,26 @@ public class RunPlanRoutingVO {
|
|||||||
startTbFront = startReentrySection.isReentryTrack() && startReentrySection.isStandTrack();
|
startTbFront = startReentrySection.isReentryTrack() && startReentrySection.isStandTrack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public enum UserRoutingType{
|
private final static String LOOP_MARK = "-LOOP";
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public RunPlanRoutingVO getRoutingDataLoop() {
|
||||||
|
RunPlanRoutingVO routing = new RunPlanRoutingVO();
|
||||||
|
routing.setMapId(mapId);
|
||||||
|
routing.setUserId(userId);
|
||||||
|
routing.setName(name);
|
||||||
|
routing.setCode(code + LOOP_MARK);
|
||||||
|
routing.setRoutingType(routingType);
|
||||||
|
routing.setStartStationCode(endStationCode);
|
||||||
|
routing.setStartSectionCode(endSectionCode);
|
||||||
|
routing.setEndStationCode(startStationCode);
|
||||||
|
routing.setEndSectionCode(startSectionCode);
|
||||||
|
routing.setRight(!right);
|
||||||
|
routing.setRemarks(remarks + LOOP_MARK);
|
||||||
|
return routing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum UserRoutingType {
|
||||||
OUTBOUND,
|
OUTBOUND,
|
||||||
INBOUND,
|
INBOUND,
|
||||||
LOOP,
|
LOOP,
|
||||||
|
181
src/main/resources/mybatis/mapper/CgyRecordDAO.xml
Normal file
181
src/main/resources/mybatis/mapper/CgyRecordDAO.xml
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="club.joylink.rtss.dao.CgyRecordDAO">
|
||||||
|
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.CgyRecord">
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="browse_count" jdbcType="INTEGER" property="browseCount" />
|
||||||
|
<result column="download_count" jdbcType="INTEGER" property="downloadCount" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, browse_count, download_count
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="club.joylink.rtss.entity.CgyRecordExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from cgy_record
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
<if test="limit != null">
|
||||||
|
<if test="offset != null">
|
||||||
|
limit ${offset}, ${limit}
|
||||||
|
</if>
|
||||||
|
<if test="offset == null">
|
||||||
|
limit ${limit}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from cgy_record
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
delete from cgy_record
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.CgyRecordExample">
|
||||||
|
delete from cgy_record
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CgyRecord" useGeneratedKeys="true">
|
||||||
|
insert into cgy_record (browse_count, download_count)
|
||||||
|
values (#{browseCount,jdbcType=INTEGER}, #{downloadCount,jdbcType=INTEGER})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CgyRecord" useGeneratedKeys="true">
|
||||||
|
insert into cgy_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="browseCount != null">
|
||||||
|
browse_count,
|
||||||
|
</if>
|
||||||
|
<if test="downloadCount != null">
|
||||||
|
download_count,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="browseCount != null">
|
||||||
|
#{browseCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="downloadCount != null">
|
||||||
|
#{downloadCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="club.joylink.rtss.entity.CgyRecordExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from cgy_record
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update cgy_record
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.browseCount != null">
|
||||||
|
browse_count = #{record.browseCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.downloadCount != null">
|
||||||
|
download_count = #{record.downloadCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update cgy_record
|
||||||
|
set id = #{record.id,jdbcType=INTEGER},
|
||||||
|
browse_count = #{record.browseCount,jdbcType=INTEGER},
|
||||||
|
download_count = #{record.downloadCount,jdbcType=INTEGER}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.CgyRecord">
|
||||||
|
update cgy_record
|
||||||
|
<set>
|
||||||
|
<if test="browseCount != null">
|
||||||
|
browse_count = #{browseCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="downloadCount != null">
|
||||||
|
download_count = #{downloadCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.CgyRecord">
|
||||||
|
update cgy_record
|
||||||
|
set browse_count = #{browseCount,jdbcType=INTEGER},
|
||||||
|
download_count = #{downloadCount,jdbcType=INTEGER}
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -78,7 +78,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, map_id, user_id, `name`, code, `type`, start_station_code, start_section_code,
|
id, map_id, user_id, `name`, code, `type`, start_station_code, start_section_code,
|
||||||
end_station_code, end_section_code, `right`, destination_code, remarks
|
end_station_code, end_section_code, `right`, destination_code, remarks
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
@ -131,7 +131,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
,
|
,
|
||||||
<include refid="Blob_Column_List" />
|
<include refid="Blob_Column_List" />
|
||||||
@ -149,15 +149,15 @@
|
|||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanRouting" useGeneratedKeys="true">
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanRouting" useGeneratedKeys="true">
|
||||||
insert into run_plan_routing (map_id, user_id, `name`,
|
insert into run_plan_routing (map_id, user_id, `name`,
|
||||||
code, `type`, start_station_code,
|
code, `type`, start_station_code,
|
||||||
start_section_code, end_station_code, end_section_code,
|
start_section_code, end_station_code, end_section_code,
|
||||||
`right`, destination_code, remarks,
|
`right`, destination_code, remarks,
|
||||||
section_data)
|
section_data)
|
||||||
values (#{mapId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
values (#{mapId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||||
#{code,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{startStationCode,jdbcType=VARCHAR},
|
#{code,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{startStationCode,jdbcType=VARCHAR},
|
||||||
#{startSectionCode,jdbcType=VARCHAR}, #{endStationCode,jdbcType=VARCHAR}, #{endSectionCode,jdbcType=VARCHAR},
|
#{startSectionCode,jdbcType=VARCHAR}, #{endStationCode,jdbcType=VARCHAR}, #{endSectionCode,jdbcType=VARCHAR},
|
||||||
#{right,jdbcType=BIT}, #{destinationCode,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
|
#{right,jdbcType=BIT}, #{destinationCode,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
|
||||||
#{sectionData,jdbcType=LONGVARCHAR})
|
#{sectionData,jdbcType=LONGVARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanRouting" useGeneratedKeys="true">
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanRouting" useGeneratedKeys="true">
|
||||||
@ -418,4 +418,4 @@
|
|||||||
remarks = #{remarks,jdbcType=VARCHAR}
|
remarks = #{remarks,jdbcType=VARCHAR}
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user