refactor(system): 优化车头朝向逻辑
- 修改 PathPlanningServiceImpl 中的车头朝向处理
This commit is contained in:
parent
bd3aadaffd
commit
5c9ef72ba0
@ -7,7 +7,6 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@ -62,6 +61,23 @@ public class PositionMapLineDTO {
|
||||
@Schema(description = "膨胀区域右")
|
||||
private BigDecimal expansionZoneRight;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
@Schema(description = "车头朝向( 0:正正 1:正反 2:反正 3:反反)", example = "15890")
|
||||
private Integer toward;
|
||||
|
||||
/**
|
||||
* 双向车道 反向行走变更车头朝向
|
||||
* @param toward
|
||||
* @return
|
||||
*/
|
||||
public Integer changeToward(Integer toward) {
|
||||
if (toward == 0) {
|
||||
return 3;
|
||||
} else if (toward == 1) {
|
||||
return 2;
|
||||
} else if (toward == 2) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,6 @@ public class PositionMapLineDTO {
|
||||
@Schema(description = "膨胀区域右")
|
||||
private BigDecimal expansionZoneRight;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)")
|
||||
@Schema(description = "车头朝向( 0:正正 1:正反 2:反正 3:反反)")
|
||||
private Integer toward;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class PositionMapLinePageReqVO extends PageParam {
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
@Schema(description = "车头朝向( 0:正正 1:正反 2:反正 3:反反)", example = "15890")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -90,8 +90,8 @@ public class PositionMapLineRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
@ExcelProperty("车头朝向( 0:正向 1:反向)")
|
||||
@Schema(description = "车头朝向( 0:正正 1:正反 2:反正 3:反反)", example = "15890")
|
||||
@ExcelProperty("车头朝向( 0:正正 1:正反 2:反正 3:反反)")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class PositionMapLineSaveReqVO {
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
@Schema(description = "车头朝向( 0:正正 1:正反 2:反正 3:反反)", example = "15890")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public class PositionMapLineDO extends BaseDO {
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
/**
|
||||
* 车头朝向( 0:正向 1:反向)
|
||||
* 车头朝向(0:正正 1:正反 2:反正 3:反反)
|
||||
*/
|
||||
private Integer toward;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ public class PathPlanningServiceImpl implements PathPlanningService {
|
||||
.expansionZoneAfter(positionMapLineDO.getExpansionZoneFront())
|
||||
.expansionZoneLeft(positionMapLineDO.getExpansionZoneRight())
|
||||
.expansionZoneRight(positionMapLineDO.getExpansionZoneLeft())
|
||||
.toward(positionMapLineDO.getToward())
|
||||
.toward(positionMapLineDO.changeToward(positionMapLineDO.getToward()))
|
||||
.build();
|
||||
return build;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user