完善计划机位和登机桥联动变更,同时加入基础数据缓存
This commit is contained in:
@@ -0,0 +1,281 @@
|
||||
package com.gzzn.omms.msgexchangeapi.basicdata.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
|
||||
/**
|
||||
* 机位
|
||||
* @author zhouxiunai
|
||||
*/
|
||||
public class OrmsStand {
|
||||
private String standCode; //停机位号
|
||||
|
||||
private BigDecimal currentFlightId; //当前航班ID
|
||||
|
||||
private String ddgt; //该机位默认的国内登机门
|
||||
|
||||
private String digt; //该机位默认的国际登机门
|
||||
|
||||
private String fstandCode; //父停机位号
|
||||
|
||||
private BigDecimal iconLength; //资源图标长度(单位:像素)
|
||||
|
||||
private BigDecimal iconWidth; //资源图标宽度(单位:像素)
|
||||
|
||||
private String lstandCode;
|
||||
|
||||
private BigDecimal maxPermit; //该停机位可容纳的最大旅客数/最大翼展
|
||||
|
||||
private BigDecimal maxflightnum; //最大可停靠航班数
|
||||
|
||||
private BigDecimal operate;
|
||||
|
||||
private String pierCode; //指廊代码
|
||||
|
||||
private BigDecimal posX; //坐标位置的X值
|
||||
|
||||
private BigDecimal posY; //坐标位置的Y值
|
||||
|
||||
private String rstandCode;
|
||||
|
||||
private String satc; //该停机位可以停放的最大机型种类
|
||||
|
||||
private String standAreaCode; //停机位区域代码
|
||||
|
||||
private BigDecimal standLayouted; //资源已布局标志:1-已布局 0-未布局
|
||||
|
||||
private BigDecimal standLength; //停机位长度(单位:米)
|
||||
|
||||
private String standName; //停机位名称
|
||||
|
||||
private BigDecimal standOrder; //停机位顺序号
|
||||
|
||||
private BigDecimal standStatus; //停机位状态(0-可用、1-在用、2-锁定、3-禁用、4-预分...)
|
||||
|
||||
//停机位类别可取值:bridge-靠桥机位、remote-远机位、near-近机位、night-过夜机位、specific-专机位...
|
||||
private String standType;
|
||||
|
||||
private BigDecimal standWidth; //停机位宽度
|
||||
|
||||
private String stml; //航站楼代码
|
||||
|
||||
private String terminalAreaCode; //航站楼区域代码
|
||||
|
||||
public OrmsStand() {
|
||||
}
|
||||
|
||||
public String getStandCode() {
|
||||
return this.standCode;
|
||||
}
|
||||
|
||||
public void setStandCode(String standCode) {
|
||||
this.standCode = standCode;
|
||||
}
|
||||
|
||||
public BigDecimal getCurrentFlightId() {
|
||||
return this.currentFlightId;
|
||||
}
|
||||
|
||||
public void setCurrentFlightId(BigDecimal currentFlightId) {
|
||||
this.currentFlightId = currentFlightId;
|
||||
}
|
||||
|
||||
public String getDdgt() {
|
||||
return this.ddgt;
|
||||
}
|
||||
|
||||
public void setDdgt(String ddgt) {
|
||||
this.ddgt = ddgt;
|
||||
}
|
||||
|
||||
public String getDigt() {
|
||||
return this.digt;
|
||||
}
|
||||
|
||||
public void setDigt(String digt) {
|
||||
this.digt = digt;
|
||||
}
|
||||
|
||||
public String getFstandCode() {
|
||||
return this.fstandCode;
|
||||
}
|
||||
|
||||
public void setFstandCode(String fstandCode) {
|
||||
this.fstandCode = fstandCode;
|
||||
}
|
||||
|
||||
public BigDecimal getIconLength() {
|
||||
return this.iconLength;
|
||||
}
|
||||
|
||||
public void setIconLength(BigDecimal iconLength) {
|
||||
this.iconLength = iconLength;
|
||||
}
|
||||
|
||||
public BigDecimal getIconWidth() {
|
||||
return this.iconWidth;
|
||||
}
|
||||
|
||||
public void setIconWidth(BigDecimal iconWidth) {
|
||||
this.iconWidth = iconWidth;
|
||||
}
|
||||
|
||||
public String getLstandCode() {
|
||||
return this.lstandCode;
|
||||
}
|
||||
|
||||
public void setLstandCode(String lstandCode) {
|
||||
this.lstandCode = lstandCode;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxPermit() {
|
||||
return this.maxPermit;
|
||||
}
|
||||
|
||||
public void setMaxPermit(BigDecimal maxPermit) {
|
||||
this.maxPermit = maxPermit;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxflightnum() {
|
||||
return this.maxflightnum;
|
||||
}
|
||||
|
||||
public void setMaxflightnum(BigDecimal maxflightnum) {
|
||||
this.maxflightnum = maxflightnum;
|
||||
}
|
||||
|
||||
public BigDecimal getOperate() {
|
||||
return this.operate;
|
||||
}
|
||||
|
||||
public void setOperate(BigDecimal operate) {
|
||||
this.operate = operate;
|
||||
}
|
||||
|
||||
public String getPierCode() {
|
||||
return this.pierCode;
|
||||
}
|
||||
|
||||
public void setPierCode(String pierCode) {
|
||||
this.pierCode = pierCode;
|
||||
}
|
||||
|
||||
public BigDecimal getPosX() {
|
||||
return this.posX;
|
||||
}
|
||||
|
||||
public void setPosX(BigDecimal posX) {
|
||||
this.posX = posX;
|
||||
}
|
||||
|
||||
public BigDecimal getPosY() {
|
||||
return this.posY;
|
||||
}
|
||||
|
||||
public void setPosY(BigDecimal posY) {
|
||||
this.posY = posY;
|
||||
}
|
||||
|
||||
public String getRstandCode() {
|
||||
return this.rstandCode;
|
||||
}
|
||||
|
||||
public void setRstandCode(String rstandCode) {
|
||||
this.rstandCode = rstandCode;
|
||||
}
|
||||
|
||||
public String getSatc() {
|
||||
return this.satc;
|
||||
}
|
||||
|
||||
public void setSatc(String satc) {
|
||||
this.satc = satc;
|
||||
}
|
||||
|
||||
public String getStandAreaCode() {
|
||||
return this.standAreaCode;
|
||||
}
|
||||
|
||||
public void setStandAreaCode(String standAreaCode) {
|
||||
this.standAreaCode = standAreaCode;
|
||||
}
|
||||
|
||||
public BigDecimal getStandLayouted() {
|
||||
return this.standLayouted;
|
||||
}
|
||||
|
||||
public void setStandLayouted(BigDecimal standLayouted) {
|
||||
this.standLayouted = standLayouted;
|
||||
}
|
||||
|
||||
public BigDecimal getStandLength() {
|
||||
return this.standLength;
|
||||
}
|
||||
|
||||
public void setStandLength(BigDecimal standLength) {
|
||||
this.standLength = standLength;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return this.standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
|
||||
public BigDecimal getStandOrder() {
|
||||
return this.standOrder;
|
||||
}
|
||||
|
||||
public void setStandOrder(BigDecimal standOrder) {
|
||||
this.standOrder = standOrder;
|
||||
}
|
||||
|
||||
public BigDecimal getStandStatus() {
|
||||
return this.standStatus;
|
||||
}
|
||||
|
||||
public void setStandStatus(BigDecimal standStatus) {
|
||||
this.standStatus = standStatus;
|
||||
}
|
||||
|
||||
public String getStandType() {
|
||||
return this.standType;
|
||||
}
|
||||
|
||||
public void setStandType(String standType) {
|
||||
this.standType = standType;
|
||||
}
|
||||
|
||||
public BigDecimal getStandWidth() {
|
||||
return this.standWidth;
|
||||
}
|
||||
|
||||
public void setStandWidth(BigDecimal standWidth) {
|
||||
this.standWidth = standWidth;
|
||||
}
|
||||
|
||||
public String getStml() {
|
||||
return this.stml;
|
||||
}
|
||||
|
||||
public void setStml(String stml) {
|
||||
this.stml = stml;
|
||||
}
|
||||
|
||||
public String getTerminalAreaCode() {
|
||||
return this.terminalAreaCode;
|
||||
}
|
||||
|
||||
public void setTerminalAreaCode(String terminalAreaCode) {
|
||||
this.terminalAreaCode = terminalAreaCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gzzn.omms.msgexchangeapi.basicdata.manager;
|
||||
|
||||
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.basicdata.entity.OrmsStand;
|
||||
import com.gzzn.omms.msgexchangeapi.basicdata.service.IOrmsStandService;
|
||||
import com.gzzn.omms.msgexchangeapi.utils.SpringUtil;
|
||||
|
||||
/**
|
||||
* 登记位基础数据管理
|
||||
* @author zhouxiunai
|
||||
*
|
||||
*/
|
||||
public class OrmsStandManager {
|
||||
private static Hashtable dataCache = null;
|
||||
|
||||
private static OrmsStandManager instance = new OrmsStandManager();
|
||||
|
||||
private OrmsStandManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static OrmsStandManager getInstance()
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
public OrmsStand getOrmsStandByStandCode(String standCode)
|
||||
{
|
||||
OrmsStand ormsStand = null;
|
||||
synchronized (OrmsStandManager.class) {
|
||||
if(null == dataCache)
|
||||
{
|
||||
//远程获取
|
||||
IOrmsStandService ormsStandService = (IOrmsStandService) SpringUtil
|
||||
.getBean("ormsStandService");
|
||||
List<OrmsStand> lsOrmsStand = ormsStandService.findAll();
|
||||
|
||||
|
||||
dataCache = new Hashtable<>();
|
||||
for(OrmsStand node: lsOrmsStand)
|
||||
{
|
||||
dataCache.put(node.getStandCode(), node);
|
||||
}
|
||||
}
|
||||
|
||||
//本地获取
|
||||
ormsStand = (OrmsStand) dataCache.get(standCode);
|
||||
}
|
||||
|
||||
return ormsStand;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gzzn.omms.msgexchangeapi.basicdata.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.basicdata.entity.OrmsStand;
|
||||
|
||||
/**
|
||||
* 停机位service
|
||||
* @author zhouxiunai
|
||||
*
|
||||
*/
|
||||
public interface IOrmsStandService {
|
||||
/**
|
||||
* 获取所有停机位信息
|
||||
* @return
|
||||
*/
|
||||
public List<OrmsStand> findAll();
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.gzzn.omms.msgexchangeapi.basicdata.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.gzzn.omms.msgexchangeapi.basicdata.entity.OrmsStand;
|
||||
import com.gzzn.omms.msgexchangeapi.dto.ResponseDto;
|
||||
|
||||
@Service("ormsStandService")
|
||||
public class OrmsStandServiceImpl implements IOrmsStandService{
|
||||
|
||||
@Value("${adminApi.ormsStandsUrl}")
|
||||
private String ormsStandsUrl;
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Override
|
||||
public List<OrmsStand> findAll() {
|
||||
ResponseEntity<ResponseDto> responseEntity = restTemplate
|
||||
.getForEntity(
|
||||
ormsStandsUrl,
|
||||
ResponseDto.class);
|
||||
ResponseDto responseDto = responseEntity.getBody();
|
||||
if (responseDto.getIs_success()) {
|
||||
|
||||
List<OrmsStand> rt = (List<OrmsStand>)responseDto.getBody();
|
||||
return rt;
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("未知错误"+responseDto.getErr_msg());
|
||||
}
|
||||
}//end function
|
||||
}
|
||||
Reference in New Issue
Block a user