Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
joylink_zhangsai 2022-06-30 14:43:08 +08:00
commit 155401847b
4 changed files with 69 additions and 27 deletions

10
Dockerfile-local-test Normal file
View File

@ -0,0 +1,10 @@
FROM openjdk:11
ADD target/rtss-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 9000 19000/tcp
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
CMD java -jar -Dfile.encoding=UTF-8 -Dspring.profiles.active=local-test /app.jar

View File

@ -2,12 +2,12 @@ package club.joylink.rtss.simulation.cbtc.ATS.service.runplan;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcEffectRepository;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcStationRunPlanLog;
import club.joylink.rtss.simulation.cbtc.CTC.data.RouteSequence;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcRunPlanVO;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcStationRunPlanLogVO;
import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.simulation.cbtc.data.map.Station;
@ -222,6 +222,7 @@ public class CtcStationRunPlanLogService {
boolean change = false;
if (runPlanLog != null) {
runPlanLog.setBaseAttribute(ctcRunPlanVO.getRunPlan());
runPlanLog.setDelete(ctcRunPlanVO.getStatus() == -1);
// 到达
if (ctcRunPlanVO.getRunPlan().arriveIsExist()) { // 不存在到达信息则直接浮空
change = modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), ctcRunPlanVO.getRunPlan(), true);
@ -243,17 +244,17 @@ public class CtcStationRunPlanLogService {
runPlanLogList.add(runPlanLog);
}
});
// 编辑过轨道的行车记录
runPlanLogList.stream()
.filter(r -> r.getArriveRunPlan() != null || r.getDepartRunPlan() != null)
.forEach(r -> {
if (r.getArriveRunPlan() != null && r.getArriveRunPlan().getTrackSection() != null) {
ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getArriveRunPlan(), false);
}
if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getDepartRunPlan(), true);
}
});
// 编辑过轨道的行车记录 ,暂时注释
// runPlanLogList.stream()
// .filter(r -> r.getArriveRunPlan() != null || r.getDepartRunPlan() != null)
// .forEach(r -> {
// if (r.getArriveRunPlan() != null && r.getArriveRunPlan().getTrackSection() != null) {
// ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getArriveRunPlan(), false);
// }
// if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
// ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getDepartRunPlan(), true);
// }
// });
}
/**

View File

@ -349,10 +349,29 @@ public class CtcStationRunPlanLog {
String stationCode = arrive ? paramInfo.getArriveStationCode() : paramInfo.getDepartStationCode();
// 车次
String tripNumber = arrive ? paramInfo.getArriveTripNumber() : paramInfo.getDepartTripNumber();
// 运行方向
String directionCode = arrive ? paramInfo.getArriveDirectionCode() : paramInfo.getDepartDirectionCode();
RunPlanItem runPlanItem = null;
if (!StringUtils.isEmpty(stationCode) && !StringUtils.isEmpty(tripNumber)) {
if ((!StringUtils.isEmpty(stationCode) && !StringUtils.isEmpty(tripNumber)) || !StringUtils.isEmpty(directionCode)) {
runPlanItem = new RunPlanItem(paramInfo);
Station adjacentStation = simulation.getRepository().getByCode(stationCode, Station.class);
Station adjacentStation = null;
if (!StringUtils.isEmpty(directionCode)) {
// 出入口
StationDirection stationDirection = simulation.getRepository().getByCode(directionCode, StationDirection.class);
// 接发状态
runPlanItem.setStationDirection(stationDirection);
runPlanItem.setAccessName(stationDirection.getName());
if (stationDirection.getRight() == null) {
runPlanItem.setRight(false);
} else {
runPlanItem.setRight(stationDirection.getRight());
}
runPlanItem.setRunModel(stationDirection.getDefaultRunStatus());
runPlanItem.initAccessName();
adjacentStation = stationDirection.getRelativeStationDirection().getStation();
}
// 如果车站信息不为空则用指定车站信息
adjacentStation = StringUtils.isEmpty(stationCode) ? adjacentStation : simulation.getRepository().getByCode(stationCode, Station.class);
runPlanItem.setStation(adjacentStation);
runPlanItem.setTripNumber(tripNumber);
// 计划时间
@ -376,17 +395,6 @@ public class CtcStationRunPlanLog {
StationDirection.ReceiveAndDeliverModel runStatus = arrive ?
StationDirection.ReceiveAndDeliverModel.R : StationDirection.ReceiveAndDeliverModel.D;
runPlanItem.setRunModel(runStatus);
// 运行方向
String directionCode = arrive ? paramInfo.getArriveDirectionCode() : paramInfo.getDepartDirectionCode();
if (!StringUtils.isEmpty(directionCode)) {
StationDirection stationDirection = simulation.getRepository().getByCode(directionCode, StationDirection.class);
// 接发状态
runPlanItem.setStationDirection(stationDirection);
runPlanItem.setAccessName(stationDirection.getName());
runPlanItem.setRight(stationDirection.getRight());
runPlanItem.setRunModel(stationDirection.getDefaultRunStatus());
runPlanItem.initAccessName();
}
}
return runPlanItem;
}

View File

@ -5,7 +5,7 @@ modbus-tcp:
port: 19000
udp:
serverPort: 20000
serverPort: 20002
clientPort: 20001
spring:
@ -95,7 +95,7 @@ springfox:
spring:
profiles: dev
datasource:
url: jdbc:mysql://localhost:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
url: jdbc:mysql://localhost:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root
password: root
@ -136,6 +136,29 @@ logging:
common:
env: test
---
spring:
profiles: local-test
datasource:
url: jdbc:mysql://192.168.53.22:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: joylink0503
wechat:
wx-api-url: https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wechat.app-id}&redirect_uri=https://test.joylink.club/wx/%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect
wx-module-url: https://joylink.club/jlwxs
tencent-cloud:
allow-send: false
logging:
file:
path: /usr/local/joylink/logs/rtss
level:
club.joylink.rtss: INFO
common:
env: test
---
spring:
profiles: prd