新增机型Dto、Convert接口实现
This commit is contained in:
+22
-3
@@ -1,12 +1,19 @@
|
||||
package com.gzzn.omms.adminapi.controller.basicdata;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.SysAircrafttypeDao;
|
||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.SysAircrafttype;
|
||||
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
||||
import com.gzzn.omms.adminapi.dto.basicdata.SysAircrafttypeDto;
|
||||
import com.gzzn.omms.adminapi.dto.basicdata.convert.SysAircrafttypeConvert;
|
||||
|
||||
/**
|
||||
* 机型
|
||||
@@ -20,14 +27,26 @@ public class SysAircrafttypeController {
|
||||
*/
|
||||
@Autowired
|
||||
private SysAircrafttypeDao sysAircrafttypeDao;
|
||||
|
||||
/**
|
||||
* 机型Dto接口
|
||||
*/
|
||||
@Autowired
|
||||
private SysAircrafttypeConvert sysAircrafttypeConvert;
|
||||
/**
|
||||
* 获取所有机型数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="获取机型列表",tags="基础数据")
|
||||
@GetMapping(value="/basicdata/sysAircrafttypes")
|
||||
public ResponseDto getSysAircrafttype() {
|
||||
public ResponseDto<List<SysAircrafttypeDto>> getSysAircrafttype() {
|
||||
List<SysAircrafttype> sysAircrafttypeList = (List<SysAircrafttype>) sysAircrafttypeDao.findAll();
|
||||
return ResponseDto.success(sysAircrafttypeList);
|
||||
|
||||
//转换dto
|
||||
List<SysAircrafttypeDto> sysAircrafttypeListDto = sysAircrafttypeList.stream().map(x -> {
|
||||
SysAircrafttypeDto dto = sysAircrafttypeConvert.sysAircrafttypeToSysAircrafttypeDto(x);
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return ResponseDto.success(sysAircrafttypeListDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.gzzn.omms.adminapi.dto.basicdata;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class SysAircrafttypeDto {
|
||||
|
||||
private String aircraftTypeCode; //机型代码
|
||||
|
||||
private BigDecimal aircraftHeight; //飞机机身高度
|
||||
|
||||
private BigDecimal aircraftLength; //飞机机身长度
|
||||
|
||||
private String aircraftTypeCodeCaa; //机型代码(CAA格式)
|
||||
|
||||
private String aircraftTypeCodeIata; //机型代码(IATA格式)
|
||||
|
||||
private String aircraftTypeCodeIcao; //机型代码(ICAO格式)
|
||||
|
||||
private String aircraftTypeName; //机型名称(机型说明)
|
||||
|
||||
private BigDecimal aircraftWidth; //飞机宽度(翼展宽度)
|
||||
|
||||
private BigDecimal aircrafttypegroupId; //机型组记录ID
|
||||
|
||||
private String chap; //机型分类
|
||||
|
||||
private BigDecimal maxAirbridges; //飞机使用廊桥的最大数目
|
||||
|
||||
private BigDecimal maxFreightWeight; //最大货物重量
|
||||
|
||||
private BigDecimal maxPassengers; //最大乘客数
|
||||
|
||||
private BigDecimal maxTakeoffWeight; //最大起飞重量
|
||||
|
||||
private BigDecimal operate; //操作标识 1-使用 0-删除标识
|
||||
|
||||
private BigDecimal transitstoptime; //过站经停时长(单位:分钟)
|
||||
|
||||
public String getAircraftTypeCode() {
|
||||
return this.aircraftTypeCode;
|
||||
}
|
||||
|
||||
public void setAircraftTypeCode(String aircraftTypeCode) {
|
||||
this.aircraftTypeCode = aircraftTypeCode;
|
||||
}
|
||||
|
||||
public BigDecimal getAircraftHeight() {
|
||||
return this.aircraftHeight;
|
||||
}
|
||||
|
||||
public void setAircraftHeight(BigDecimal aircraftHeight) {
|
||||
this.aircraftHeight = aircraftHeight;
|
||||
}
|
||||
|
||||
public BigDecimal getAircraftLength() {
|
||||
return this.aircraftLength;
|
||||
}
|
||||
|
||||
public void setAircraftLength(BigDecimal aircraftLength) {
|
||||
this.aircraftLength = aircraftLength;
|
||||
}
|
||||
|
||||
public String getAircraftTypeCodeCaa() {
|
||||
return this.aircraftTypeCodeCaa;
|
||||
}
|
||||
|
||||
public void setAircraftTypeCodeCaa(String aircraftTypeCodeCaa) {
|
||||
this.aircraftTypeCodeCaa = aircraftTypeCodeCaa;
|
||||
}
|
||||
|
||||
public String getAircraftTypeCodeIata() {
|
||||
return this.aircraftTypeCodeIata;
|
||||
}
|
||||
|
||||
public void setAircraftTypeCodeIata(String aircraftTypeCodeIata) {
|
||||
this.aircraftTypeCodeIata = aircraftTypeCodeIata;
|
||||
}
|
||||
|
||||
public String getAircraftTypeCodeIcao() {
|
||||
return this.aircraftTypeCodeIcao;
|
||||
}
|
||||
|
||||
public void setAircraftTypeCodeIcao(String aircraftTypeCodeIcao) {
|
||||
this.aircraftTypeCodeIcao = aircraftTypeCodeIcao;
|
||||
}
|
||||
|
||||
public String getAircraftTypeName() {
|
||||
return this.aircraftTypeName;
|
||||
}
|
||||
|
||||
public void setAircraftTypeName(String aircraftTypeName) {
|
||||
this.aircraftTypeName = aircraftTypeName;
|
||||
}
|
||||
|
||||
public BigDecimal getAircraftWidth() {
|
||||
return this.aircraftWidth;
|
||||
}
|
||||
|
||||
public void setAircraftWidth(BigDecimal aircraftWidth) {
|
||||
this.aircraftWidth = aircraftWidth;
|
||||
}
|
||||
|
||||
public BigDecimal getAircrafttypegroupId() {
|
||||
return this.aircrafttypegroupId;
|
||||
}
|
||||
|
||||
public void setAircrafttypegroupId(BigDecimal aircrafttypegroupId) {
|
||||
this.aircrafttypegroupId = aircrafttypegroupId;
|
||||
}
|
||||
|
||||
public String getChap() {
|
||||
return this.chap;
|
||||
}
|
||||
|
||||
public void setChap(String chap) {
|
||||
this.chap = chap;
|
||||
}
|
||||
|
||||
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 getTransitstoptime() {
|
||||
return this.transitstoptime;
|
||||
}
|
||||
|
||||
public void setTransitstoptime(BigDecimal transitstoptime) {
|
||||
this.transitstoptime = transitstoptime;
|
||||
}
|
||||
}
|
||||
+12
@@ -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.SysAircrafttype;
|
||||
import com.gzzn.omms.adminapi.dto.basicdata.SysAircrafttypeDto;
|
||||
|
||||
@Mapper(componentModel="spring")
|
||||
public interface SysAircrafttypeConvert {
|
||||
|
||||
public SysAircrafttypeDto sysAircrafttypeToSysAircrafttypeDto(SysAircrafttype sysAircrafttype);
|
||||
}
|
||||
Reference in New Issue
Block a user