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

This commit is contained in:
joylink_zhangsai 2022-12-13 10:24:04 +08:00
commit 94d914e8d7
6 changed files with 44 additions and 25 deletions

View File

@ -214,6 +214,7 @@ public class OldPermissionDataSyncService {
List<RtsPermissionDistributeRef> refList = PermissionDistributeConvertor.convertDistributeRefListTo(dataVO.getPermissionIds(),null);
for (RtsPermissionDistributeRef ref : refList) {
ref.setRemains(0);
ref.setIsSync(true);
allRefList.add(ref);
}
@ -232,6 +233,7 @@ public class OldPermissionDataSyncService {
}
for (PermissionSubject ps : psList) {
ps.setIsSync(true);
ps.setRemains(0);
}
this.subjectDAO.batchInsert(psList);
}
@ -429,17 +431,19 @@ public class OldPermissionDataSyncService {
dataVO.setCreatorId(vo.permission.getCreatorId());
dataVO.setId(vo.getDistributeId());
dataVO.setDsc(vo.getPermission().getName());
dataVO.setCreateTime(vo.getPermission().getCreateTime());
dataVO.setUpdateTime(vo.getPermission().getUpdateTime());
dataVO.setCreateTime(vo.getStartTime());
dataVO.setUpdateTime(vo.getStartTime());
dataVO.setForever(vo.forever);
dataVO.setStartTime(vo.getStartTime());
dataVO.setEndTime(vo.getEndTime());
dataVO.setStatus(PermissionDistributeStatusEnum.Valid.getValue());
dataVO.setDsc(vo.getOrganizationName());
DistributeDataVO.DistributePermissionVO dpVO = new DistributeDataVO.DistributePermissionVO();
dpVO.setPermissionId(vo.getPermission().getId());
dpVO.setDistributeId(vo.getDistributeId());
dpVO.setAmount(vo.getAmount());
dpVO.setRemains(vo.getRemains());
dpVO.setRemains(0);
dataVO.setPermissionIds(Arrays.asList(dpVO));
return dataVO;
}
@ -452,6 +456,7 @@ public class OldPermissionDataSyncService {
syncVO.setStartTime(permissionVO.getStartTime());
syncVO.setEndTime(permissionVO.getEndTime());
syncVO.setDistributeId(permissionVO.getDistributeId());
syncVO.setOrganizationName(permissionVO.getOrganizationName());
return syncVO;
}
}
@ -465,6 +470,7 @@ public class OldPermissionDataSyncService {
Integer amount;
Integer remains;
Long distributeId;
String organizationName;
List<PermissionSystemAbility> systemAbility;
public SyncVO(Permission permission, List<PermissionSystemAbility> systemAbility) {

View File

@ -34,6 +34,8 @@ public class UserPermissionVO {
private Integer amount;
private Integer remains;
private String mapName;
private Long organizationId;
private String organizationName;
// private boolean errorData;
private List<PermissionVO> permissionVO;
}

View File

@ -7,10 +7,7 @@ import lombok.Getter;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -121,6 +118,9 @@ public enum MapDeviceRule {
if (route.getInterlockStation().isDepot() || !route.getInterlockStation().isInterlock()) {
return false;
}
if (!Objects.equals(route.getInterlockStation(), route.getStart().getDeviceStation())) {
return false;
}
if (route.getSectionList().size() < 2) {
return false;
}

View File

@ -107,11 +107,14 @@ public enum MapLocationRule {
private static String calcMapLocation(Simulation simulation, Supplier<Point> devicePoint) {
Point point = devicePoint.get();
String s = simulation.getBuildParams().getMap().getGraphDataNew().getScaling(); // 默认缩放比
s = StringUtils.isEmpty(s) ? "1" : s;
MapStationNewVO stationNewVO = simulation.getBuildParams().getMap().getGraphDataNew().getStationList().stream()
.filter(mapStationNewVO -> !mapStationNewVO.isDepot()).findFirst().get();
// 横向偏差
int x = point.getX() - 960; // 屏幕一般宽度
int y = point.getY() + stationNewVO.getPosition().getY();
// 纵向偏差
Point origin = simulation.getBuildParams().getMap().getGraphDataNew().getOrigin();
int y = (origin == null) ? stationNewVO.getPosition().getY() - 200 : origin.getY();
return String.format("{\"x\":%d,\"y\":%d,\"scale\":\"%s\"}", x, y, s);
}
}

View File

@ -17,8 +17,12 @@ public enum PropertyValueRule {
NAME("地图设备名称") {
@Override
public String resolve(Simulation simulation, Object mapElement) {
if (mapElement instanceof Signal) {
return ((Signal) mapElement).getShowName();
} else {
return ((MapNamedElement) mapElement).getName();
}
}
},
CODE("地图设备编码") {
@Override
@ -79,26 +83,29 @@ public enum PropertyValueRule {
ROUTE_END_SIGNAL_NAME("进路末端名称") {
@Override
public String resolve(Simulation simulation, Object mapElement) {
return ((Route) mapElement).getDestination().getShowName();
Route route = (Route) mapElement;
if (route.getDestinationButtonSignal() != null) {
return route.getDestinationButtonSignal().getShowName();
} else {
return route.getDestination().getShowName();
}
}
},
ROUTE_END_SIGNAL_CODE("进路末端信号机编码") {
@Override
public String resolve(Simulation simulation, Object mapElement) {
return ((Route) mapElement).getDestination().getCode();
Route route = (Route) mapElement;
if (route.getDestinationButtonSignal() != null) {
return route.getDestinationButtonSignal().getCode();
} else {
return route.getDestination().getCode();
}
}
},
ROUTE_END_BUTTON_CODE("进路末端按钮编码") {
ROUTE_END_BUTTON_SIGNAL_NAME("进路终端按钮信号机名称") {
@Override
public String resolve(Simulation simulation, Object mapElement) {
Route route = (Route) mapElement;
List<MapSignalButtonVO> signalButtonList = simulation.getBuildParams().getMap().getGraphDataNew().getSignalButtonList();
MapSignalButtonVO buttonVO = signalButtonList.stream().filter(button -> MapSignalButtonVO.Type.PICK.equals(button.getType())
&& Objects.equals(button.getSignalCode(), route.getDestination().getCode())).findFirst().orElse(null);
if (buttonVO == null) {
throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "错误数据");
}
return buttonVO.getCode();
public Object resolve(Simulation simulation, Object mapElement) {
return ((Route) mapElement).getDestinationButtonSignal().getShowName();
}
},
SIGNAL_BUTTON_CODE("信号机按钮编码") {
@ -133,8 +140,7 @@ public enum PropertyValueRule {
SIGNAL_ROUTE_CODE_LIST("信号机关联的所有进路编码") {
@Override
public Object resolve(Simulation simulation, Object mapElement) {
Signal signal = (Signal) mapElement;
return signal.getRouteList().stream().map(Route::getCode).collect(Collectors.toList());
return ((Signal) mapElement).getRouteList().stream().map(Route::getCode).sorted().collect(Collectors.toList());
}
},
CENTER_CONTROL_STATION_CODE_LIST("站控转中控时车站列表") {

View File

@ -4,10 +4,12 @@
<select id="findCanUsedData" parameterType="arraylist" resultType="club.joylink.rtss.vo.permission.sync.UserPermissionVO">
select A.id,A.permission_id,A.distribute_id,A.start_time,A.end_time,A.user_id,trim(B.name) as permission_name
,C.id as map_id,B.create_time,B.update_time,B.remarks,B.creator_id,B.type,B.prd_id,B.prd_type,B.is_package,B.rel_permissions
,A.forever,A.amount,A.remains,C.name as map_name
,A.forever,A.amount,A.remains,C.name as map_name,E.id as organization_id ,E.name as organization_name
from user_permission A left join permission B on A.permission_id = B.id
left join map_info C on B.map_id = C.id
where 1 = 1 and C.id is not null and C.status = '1'
left join permission_distribute D on A.distribute_id = D.id
left join organization E on E.id = D.organization_id
where 1 = 1 and C.id is not null and C.status = '1' and A.status = '1'
</select>