Commit 14e11061 authored by tangwei's avatar tangwei

航空器对象

parent d0b31215
......@@ -16,6 +16,9 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
*/
public interface IAircraftService {
AircraftDto queryByAircraftSeq(String agencyCode, Long seq);
AircraftDto queryByAircraftSeqx(String agencyCode, Long seq);
List<Aircraft> queryByAircraftSeqList(String agencyCode, Long seq);
Aircraft queryByaircraftModel(String seq);
List<AircraftListTreeDto> getAircraft();
......
......@@ -146,6 +146,26 @@ public class AircraftController extends BaseController {
return ResponseHelper.buildResponse(aircraftServiceImpl.queryByAircraftSeq(RequestContext.getAgencyCode(),
sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "findOnex/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个航空器信息", notes = "根据sequenceNbr查询单个航空器信息")
public ResponseModel<AircraftDto> seleteOnex(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(aircraftServiceImpl.queryByAircraftSeqx(RequestContext.getAgencyCode(),
sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "aircraftUrlList/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个航空器信息", notes = "根据sequenceNbr查询单个航空器信息")
public ResponseModel<List<Aircraft>> aircraftUrlList(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(aircraftServiceImpl.queryByAircraftSeqList(RequestContext.getAgencyCode(),
sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
......
......@@ -152,6 +152,81 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
return aircraftDto;
}
@Override
public List<Aircraft> queryByAircraftSeqList(String agencyCode, Long seq) {
AlertCalledObjsDto dto = (AlertCalledObjsDto)iAlertCalledService.selectAlertCalledByIdNoRedisNew(seq);
List<AlertFormValue> list = dto.getAlertFormValue();
String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
if(list1.size() > 0) {
if(!ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
} else {
aircraft = list1.get(0).getFieldValueCode();
}
}
LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Aircraft::getAircraftModel,aircraft);
List<Aircraft> one = this.list(queryWrapper);
LambdaQueryWrapper<Aircraft> queryWrapper2 = new LambdaQueryWrapper<>();
if(aircraft!=null&&aircraft.length()>3){
queryWrapper2.likeRight(Aircraft::getAircraftModel,aircraft.substring(0,3));
}else{
queryWrapper2.likeRight(Aircraft::getAircraftModel,aircraft);
}
if(one!=null){
queryWrapper2.notIn(Aircraft::getAircraftModel,aircraft);
}
List<Aircraft> one1 = this.list(queryWrapper2);
if(one!=null){
if(one1!=null){
one.addAll(one1);
}
}else{
if(one1!=null){
return one1;
}
}
return one;
}
@Override
public AircraftDto queryByAircraftSeqx(String agencyCode, Long seq) {
LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Aircraft::getSequenceNbr,seq);
AircraftDto aircraftDto = new AircraftDto();
Aircraft one = this.getOne(queryWrapper);
Bean.toPo(one,aircraftDto);
if(one!=null){
//填充航空器附件信息
FeignClientResult<List<FileInfoModel>> fileInfoModelResult = Systemctl.fileInfoClient.queryByEntity(
agencyCode, Aircraft.class.getSimpleName(), String.valueOf(one.getSequenceNbr()));
List<FileInfoModel> fileInfoModels = fileInfoModelResult.getResult();
if (!ValidationUtil.isEmpty(fileInfoModels)) {
aircraftDto.setAppearanceImages(processToStr(fileInfoModels, AircraftFileTypeEnum.APPEARANCE.getCode()));
aircraftDto.setPlaneImages(processToStr(fileInfoModels, AircraftFileTypeEnum.PLANE.getCode()));
aircraftDto.setRescueImages(processToStr(fileInfoModels, AircraftFileTypeEnum.RESCUE.getCode()));
aircraftDto.setPositionImages(processToStr(fileInfoModels, AircraftFileTypeEnum.POSITION.getCode()));
aircraftDto.setModels(processToStr(fileInfoModels, AircraftFileTypeEnum.MODEL.getCode()));
}
}
return aircraftDto;
}
public AircraftDto queryBySeq(String agencyCode, Long seq) {
AircraftDto aircraftDto = this.queryBySeq(seq);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment