新增飞机Dto、Convert接口实现
This commit is contained in:
+20
-3
@@ -1,5 +1,8 @@
|
|||||||
package com.gzzn.omms.adminapi.controller.basicdata;
|
package com.gzzn.omms.adminapi.controller.basicdata;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -8,6 +11,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.SysAircraftDao;
|
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.SysAircraftDao;
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.SysAircraft;
|
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.SysAircraft;
|
||||||
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
||||||
|
import com.gzzn.omms.adminapi.dto.basicdata.SysAircraftDto;
|
||||||
|
import com.gzzn.omms.adminapi.dto.basicdata.convert.SysAircraftConvert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 飞机
|
* 飞机
|
||||||
@@ -21,14 +26,26 @@ public class SysAircraftController {
|
|||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysAircraftDao sysAircraftDao;
|
private SysAircraftDao sysAircraftDao;
|
||||||
|
/**
|
||||||
|
* 飞机Dto接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private SysAircraftConvert sysAircraftConvert;
|
||||||
/**
|
/**
|
||||||
* 获取所有飞机数据
|
* 获取所有飞机数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value="获取飞机列表",tags="基础数据")
|
||||||
@GetMapping(value="/basicdata/sysAircrafts")
|
@GetMapping(value="/basicdata/sysAircrafts")
|
||||||
public ResponseDto getSysAircraft() {
|
public ResponseDto<List<SysAircraftDto>> getSysAircraft() {
|
||||||
List<SysAircraft> sysAircraftList = (List<SysAircraft>) sysAircraftDao.findAll();
|
List<SysAircraft> sysAircraftList = (List<SysAircraft>) sysAircraftDao.findAll();
|
||||||
return ResponseDto.success(sysAircraftList);
|
|
||||||
|
//转换dto
|
||||||
|
List<SysAircraftDto> sysAircraftListDto = sysAircraftList.stream().map(x -> {
|
||||||
|
SysAircraftDto dto = sysAircraftConvert.sysAircraftToSysAircraftDto(x);
|
||||||
|
return dto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return ResponseDto.success(sysAircraftListDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.gzzn.omms.adminapi.dto.basicdata;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class SysAircraftDto {
|
||||||
|
|
||||||
|
private long aircraftId; //飞机号表记录ID
|
||||||
|
|
||||||
|
private String aircraftNumber; //飞机号(飞机机尾号)
|
||||||
|
|
||||||
|
private String aircraftOwnerCode; //机主航空公司代码
|
||||||
|
|
||||||
|
private String aircraftTypeCode; //机型代码
|
||||||
|
|
||||||
|
private String airlineCode; //航空公司代码
|
||||||
|
|
||||||
|
private BigDecimal maxAirbridges; //最大乘客数
|
||||||
|
|
||||||
|
private BigDecimal maxFreightWeight; //最大货物重量
|
||||||
|
|
||||||
|
private BigDecimal maxPassengers; //飞机使用廊桥的最大数目
|
||||||
|
|
||||||
|
private BigDecimal maxTakeoffWeight; //最大起飞重量
|
||||||
|
|
||||||
|
private BigDecimal operate; //操作标识 1-使用 0-删除标识
|
||||||
|
|
||||||
|
private BigDecimal owid; //所属机构ID
|
||||||
|
|
||||||
|
public long getAircraftId() {
|
||||||
|
return this.aircraftId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftId(long aircraftId) {
|
||||||
|
this.aircraftId = aircraftId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftNumber() {
|
||||||
|
return this.aircraftNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftNumber(String aircraftNumber) {
|
||||||
|
this.aircraftNumber = aircraftNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftOwnerCode() {
|
||||||
|
return this.aircraftOwnerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftOwnerCode(String aircraftOwnerCode) {
|
||||||
|
this.aircraftOwnerCode = aircraftOwnerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAircraftTypeCode() {
|
||||||
|
return this.aircraftTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAircraftTypeCode(String aircraftTypeCode) {
|
||||||
|
this.aircraftTypeCode = aircraftTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAirlineCode() {
|
||||||
|
return this.airlineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAirlineCode(String airlineCode) {
|
||||||
|
this.airlineCode = airlineCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxAirbridges() {
|
||||||
|
return this.maxAirbridges;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxAirbridges(BigDecimal maxAirbridges) {
|
||||||
|
this.maxAirbridges = maxAirbridges;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxFreightWeight() {
|
||||||
|
return this.maxFreightWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxFreightWeight(BigDecimal maxFreightWeight) {
|
||||||
|
this.maxFreightWeight = maxFreightWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxPassengers() {
|
||||||
|
return this.maxPassengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxPassengers(BigDecimal maxPassengers) {
|
||||||
|
this.maxPassengers = maxPassengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxTakeoffWeight() {
|
||||||
|
return this.maxTakeoffWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxTakeoffWeight(BigDecimal maxTakeoffWeight) {
|
||||||
|
this.maxTakeoffWeight = maxTakeoffWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getOperate() {
|
||||||
|
return this.operate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperate(BigDecimal operate) {
|
||||||
|
this.operate = operate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getOwid() {
|
||||||
|
return this.owid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwid(BigDecimal owid) {
|
||||||
|
this.owid = owid;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.gzzn.omms.adminapi.dto.basicdata.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.SysAircraft;
|
||||||
|
import com.gzzn.omms.adminapi.dto.basicdata.SysAircraftDto;
|
||||||
|
|
||||||
|
@Mapper(componentModel="spring")
|
||||||
|
public interface SysAircraftConvert {
|
||||||
|
|
||||||
|
public SysAircraftDto sysAircraftToSysAircraftDto(SysAircraft sysAircraft);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user