|
|
@@ -73,39 +73,39 @@ public class UpdateInspectionService { |
|
|
|
/** |
|
|
|
* 检查参数 |
|
|
|
* @param tenantId |
|
|
|
* @param editInspectionRequest |
|
|
|
* @param request |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private JsonResult check(String tenantId, EditInspectionRequest editInspectionRequest) { |
|
|
|
if (StringUtils.isEmpty(editInspectionRequest.getId())) { |
|
|
|
private JsonResult check(String tenantId, EditInspectionRequest request) { |
|
|
|
if (StringUtils.isEmpty(request.getId())) { |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.ID_IS_NULL.getCode(), EditInspectionCodeEnum.ID_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(editInspectionRequest.getName())){ |
|
|
|
if(StringUtils.isEmpty(request.getName())){ |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_NAME_IS_NULL.getCode(),EditInspectionCodeEnum.INSPECTION_NAME_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
if (null == editInspectionRequest.getAirportId() || StringUtils.isEmpty(editInspectionRequest.getAirportName())) { |
|
|
|
if (ObjectUtil.isEmpty(request.getAirportId()) || 0 == request.getAirportId()) { |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.AIRPORT_IS_NULL.getCode(), EditInspectionCodeEnum.AIRPORT_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
if (null == editInspectionRequest.getInspectionLine() || StringUtils.isEmpty(editInspectionRequest.getInspectionLineName())) { |
|
|
|
if (ObjectUtil.isEmpty(request.getInspectionLine()) || 0 == request.getInspectionLine()) { |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getCode(), EditInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
if (null == editInspectionRequest.getInspectionTime()) { |
|
|
|
if (ObjectUtil.isEmpty(request.getInspectionTime())) { |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_TIME_IS_NULL.getCode(), EditInspectionCodeEnum.INSPECTION_TIME_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
int timaDiff = DateUtils.compareToDate(editInspectionRequest.getInspectionTime(), DateUtils.now()); |
|
|
|
int timaDiff = DateUtils.compareToDate(request.getInspectionTime(), DateUtils.now()); |
|
|
|
if (2 != timaDiff) { |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_TIME_NOT_AFTER_THAN_CURRENT_TIME.getCode(), EditInspectionCodeEnum.INSPECTION_TIME_NOT_AFTER_THAN_CURRENT_TIME.getMsg()); |
|
|
|
} |
|
|
|
//飞行高度 |
|
|
|
if(StringUtils.isEmpty(editInspectionRequest.getFlyHeight())){ |
|
|
|
if(StringUtils.isEmpty(request.getFlyHeight())){ |
|
|
|
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_FLY_HEIGHT_IS_NULL.getCode(),EditInspectionCodeEnum.INSPECTION_FLY_HEIGHT_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
//查询当前对应的任务 |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getId, editInspectionRequest.getId()) |
|
|
|
.eq(Inspection::getId, request.getId()) |
|
|
|
.eq(Inspection::getTenantId,tenantId) |
|
|
|
.eq(Inspection::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNull(inspection)) { |