| | |
| | | import java.util.List; |
| | | |
| | | import com.moral.api.entity.Device; |
| | | import com.moral.api.entity.Organization; |
| | | import com.moral.api.entity.MonitorPoint; |
| | | import com.moral.api.pojo.vo.device.AppDeviceVo; |
| | | import com.moral.api.service.DeviceService; |
| | | import com.moral.api.service.OrganizationService; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.api.service.MonitorPointService; |
| | | import com.moral.api.service.SpecialDeviceService; |
| | | import com.moral.constant.ResultMessage; |
| | | |
| | | |
| | |
| | | public class AppDevicController { |
| | | |
| | | @Autowired |
| | | private OrganizationService organizationService; |
| | | private MonitorPointService monitorPointService; |
| | | |
| | | @Autowired |
| | | private DeviceService deviceService; |
| | | |
| | | @Autowired |
| | | private SpecialDeviceService specialDeviceService; |
| | | |
| | | |
| | | |
| | | @GetMapping("selectOrganization") |
| | | @ApiOperation(value = "小程序获取组织") |
| | | @ApiOperation(value = "小程序获取站点") |
| | | public ResultMessage selectOrganization(){ |
| | | List<Organization> organizations = organizationService.getOrganizations(); |
| | | return ResultMessage.ok(organizations); |
| | | List<MonitorPoint> monitorPoints = monitorPointService.getOrganizations(); |
| | | return ResultMessage.ok(monitorPoints); |
| | | } |
| | | |
| | | |
| | | @GetMapping("selectDevice") |
| | | @ApiOperation(value = "小程序获取设备") |
| | | public ResultMessage selectDevice(@RequestParam @ApiParam(value = "organizationId",name = "组织ID") Integer organizationId){ |
| | | List<Device> organizationDevice = deviceService.getOrganizationDevice(organizationId); |
| | | public ResultMessage selectDevice(@RequestParam @ApiParam(value = "monitorPointId",name = "站点ID") Integer monitorPointId){ |
| | | List<Device> organizationDevice = deviceService.getOrganizationDevice(monitorPointId); |
| | | return ResultMessage.ok(ObjectUtils.isEmpty(organizationDevice)?null:organizationDevice); |
| | | } |
| | | |
| | | @GetMapping("fuzzySearch") |
| | | @ApiOperation(value = "小程序模糊搜索") |
| | | public ResultMessage fuzzySearch(@RequestParam @ApiParam(value = "mac",name = "设备mac号") String mac){ |
| | | List<Device> devices = deviceService.getFuzzySearch(mac); |
| | | List<AppDeviceVo> devices = deviceService.getFuzzySearch(mac); |
| | | return ResultMessage.ok(devices); |
| | | } |
| | | |
| | | |
| | | @GetMapping("specialDevice") |
| | | @ApiOperation(value = "查询特殊设备") |
| | | public ResultMessage selectSpecialDevice(){ |
| | | List<AppDeviceVo> appDeviceVos = specialDeviceService.selectSpecialDevice(); |
| | | return ResultMessage.ok(appDeviceVos); |
| | | } |
| | | } |