@@ -1,10 +1,12 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.entity.request.airport.PointFlightRequest; | |||
import com.tuoheng.admin.service.airport.AirportService; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
@@ -31,5 +33,11 @@ public class AirPortController { | |||
return airportService.getList(); | |||
} | |||
/** | |||
* 定点飞行 | |||
*/ | |||
@PostMapping("/pointFlight") | |||
public JsonResult pointFlight(PointFlightRequest request) { | |||
return airportService.pointFlight(request); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
package com.tuoheng.admin.entity.request.airport; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
/** | |||
* 查询巡检任务请求实体 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2023-02-15 | |||
*/ | |||
@Data | |||
public class PointFlightRequest implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty(value = "机场id") | |||
private String airportId; | |||
@ApiModelProperty(value = "业务系统任务id") | |||
private String requestId; | |||
@ApiModelProperty(value = "业务系统标识") | |||
private String code; | |||
@ApiModelProperty(value = "租户代码") | |||
private String tenantCode; | |||
@ApiModelProperty(value = "指点高度") | |||
private String alt; | |||
@ApiModelProperty(value = "经度") | |||
private String lon; | |||
@ApiModelProperty(value = "纬度") | |||
private String lat; | |||
} |
@@ -1,9 +1,21 @@ | |||
package com.tuoheng.admin.service.airport; | |||
import com.tuoheng.admin.entity.request.airport.PointFlightRequest; | |||
import com.tuoheng.common.utils.JsonResult; | |||
public interface AirportService { | |||
/** | |||
* 获取机场列表 | |||
* | |||
* @return | |||
*/ | |||
JsonResult getList(); | |||
/** | |||
* 定点飞行 | |||
* @param request | |||
* @return | |||
*/ | |||
JsonResult pointFlight(PointFlightRequest request); | |||
} |
@@ -1,14 +1,29 @@ | |||
package com.tuoheng.admin.service.airport; | |||
import com.tuoheng.admin.entity.request.airport.PointFlightRequest; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import org.springframework.stereotype.Service; | |||
@Service | |||
public class AirportServiceImpl implements AirportService { | |||
/** | |||
* 获取机场列表 | |||
* | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getList() { | |||
return JsonResult.success(); | |||
} | |||
/** | |||
* 定点飞行 | |||
* @param request | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult pointFlight(PointFlightRequest request) { | |||
return JsonResult.success(); | |||
} | |||
} |
@@ -1,12 +1,20 @@ | |||
package com.tuoheng.admin.service.camera.query; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.domain.Camera; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.mapper.CameraMapper; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.entity.User; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.Optional; | |||
/** | |||
* 根据Id查询摄像头业务层处理 | |||
* | |||
@@ -21,10 +29,17 @@ public class QueryCameraByIdService { | |||
@Autowired | |||
private CameraMapper cameraMapper; | |||
public JsonResult getOneById(String id) { | |||
public JsonResult getOneById(Integer id) { | |||
// log.info("进入根据Id查询摄像头业务"); | |||
return JsonResult.success(); | |||
User user = ShiroUtils.getUserInfo(); | |||
Integer tenantId = user.getTenantId(); | |||
JsonResult result = this.check(tenantId, id); | |||
if (0 != result.getCode()) { | |||
log.info("进入根据ID查询摄像头业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
Camera camera = (Camera) result.getData(); | |||
return JsonResult.success(camera); | |||
} | |||
/** | |||
@@ -34,21 +49,22 @@ public class QueryCameraByIdService { | |||
* @param id | |||
* @return | |||
*/ | |||
private JsonResult check(String tenantId, String id) { | |||
private JsonResult check(Integer tenantId, Integer id) { | |||
// 判断部门id是否为空 | |||
if (StringUtils.isEmpty(id)) { | |||
return JsonResult.error(500, "id为空"); | |||
if (Optional.ofNullable(id).orElse(0) == 0) { | |||
log.info("摄像头ID为空, id:{}", id); | |||
throw new ServiceException("摄像头ID为空"); | |||
} | |||
// 判断摄像头是否存在 | |||
Camera camera = cameraMapper.selectOne(new LambdaQueryWrapper<Camera>() | |||
.eq(Camera::getTenantId, tenantId) | |||
.eq(Camera::getId, id) | |||
.eq(Camera::getMark, MarkTypeEnum.VALID)); | |||
if (ObjectUtil.isNull(camera)) { | |||
log.info("摄像头不存在, id:{}", id); | |||
throw new ServiceException("摄像头不存在"); | |||
} | |||
// | |||
// // 判断部门是否存在 | |||
// Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>() | |||
// .eq(Dept::getTenantId, tenantId) | |||
// .eq(Dept::getId, queryInspectionRequest.getDeptId()) | |||
// .eq(Dept::getMark, 1)); | |||
// if (null == dept) { | |||
// return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getMsg()); | |||
// } | |||
return JsonResult.success(); | |||
return JsonResult.success(camera); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.domain.Goods; | |||
import com.tuoheng.admin.entity.domain.Warehouse; | |||
import com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.mapper.GoodsMapper; | |||
import com.tuoheng.admin.mapper.WarehouseMapper; | |||
import com.tuoheng.common.exception.ServiceException; | |||
@@ -66,6 +67,7 @@ public class QueryGoodsListByWarehouseIdService { | |||
} | |||
Warehouse warehouse = warehouseMapper.selectOne(new LambdaQueryWrapper<Warehouse>() | |||
.eq(Warehouse::getTenantId, request.getTenantId()) | |||
.eq(Warehouse::getMark, MarkTypeEnum.VALID) | |||
.eq(Warehouse::getId, request.getWarehouseId())); | |||
if (ObjectUtil.isNull(warehouse)) { | |||
log.info("仓库不存在, warehouseId:{}", request.getWarehouseId()); |
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.domain.Warehouse; | |||
import com.tuoheng.admin.entity.request.warehouse.QueryWarehouseListRequest; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.mapper.WarehouseMapper; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.system.entity.User; | |||
@@ -41,7 +42,8 @@ public class QueryWarehouseListService { | |||
} | |||
List<Warehouse> warehouseList = warehouseMapper.selectList(new LambdaQueryWrapper<Warehouse>() | |||
.eq(Warehouse::getTenantId, request.getTenantId())); | |||
.eq(Warehouse::getMark, MarkTypeEnum.VALID) | |||
.eq(Warehouse::getTenantId, request.getTenantId())); | |||
if (CollectionUtil.isEmpty(warehouseList)) { | |||
log.info("仓库列表数据为空"); | |||
} |
@@ -37,7 +37,7 @@ public class QueryWarningByIdService { | |||
Integer tenantId = user.getTenantId(); | |||
JsonResult result = this.check(tenantId, id); | |||
if (0 != result.getCode()) { | |||
log.info("根据查询Id查询预警信息业务:校验失败:{}", result.getMsg()); | |||
log.info("根据Id查询预警信息业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
Warning warning = (Warning) result.getData(); |