|
@@ -23,14 +23,13 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
|
* 设备列Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author zhengjie
|
|
|
* @date 2023-08-30
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/system/device")
|
|
|
-public class TDeviceListController extends BaseController
|
|
|
-{
|
|
|
+public class TDeviceListController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITDeviceListService tDeviceListService;
|
|
|
|
|
@@ -39,8 +38,7 @@ public class TDeviceListController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(TDeviceList tDeviceList)
|
|
|
- {
|
|
|
+ public TableDataInfo list(TDeviceList tDeviceList) {
|
|
|
startPage();
|
|
|
List<TDeviceList> list = tDeviceListService.selectTDeviceListList(tDeviceList);
|
|
|
return getDataTable(list);
|
|
@@ -52,8 +50,7 @@ public class TDeviceListController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:export')")
|
|
|
@Log(title = "设备列", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, TDeviceList tDeviceList)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, TDeviceList tDeviceList) {
|
|
|
List<TDeviceList> list = tDeviceListService.selectTDeviceListList(tDeviceList);
|
|
|
ExcelUtil<TDeviceList> util = new ExcelUtil<TDeviceList>(TDeviceList.class);
|
|
|
util.exportExcel(response, list, "设备列数据");
|
|
@@ -64,8 +61,7 @@ public class TDeviceListController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Integer id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
|
|
return success(tDeviceListService.selectTDeviceListById(id));
|
|
|
}
|
|
|
|
|
@@ -75,8 +71,7 @@ public class TDeviceListController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:add')")
|
|
|
@Log(title = "设备列", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TDeviceList tDeviceList)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody TDeviceList tDeviceList) {
|
|
|
return toAjax(tDeviceListService.insertTDeviceList(tDeviceList));
|
|
|
}
|
|
|
|
|
@@ -86,8 +81,7 @@ public class TDeviceListController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:edit')")
|
|
|
@Log(title = "设备列", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody TDeviceList tDeviceList)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody TDeviceList tDeviceList) {
|
|
|
return toAjax(tDeviceListService.updateTDeviceList(tDeviceList));
|
|
|
}
|
|
|
|
|
@@ -96,9 +90,8 @@ public class TDeviceListController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:device:remove')")
|
|
|
@Log(title = "设备列", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Integer[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Integer[] ids) {
|
|
|
return toAjax(tDeviceListService.deleteTDeviceListByIds(ids));
|
|
|
}
|
|
|
|
|
@@ -106,8 +99,7 @@ public class TDeviceListController extends BaseController
|
|
|
* 下载模板
|
|
|
*/
|
|
|
@PostMapping("/importTemplate")
|
|
|
- public void importTemplate(HttpServletResponse response)
|
|
|
- {
|
|
|
+ public void importTemplate(HttpServletResponse response) {
|
|
|
ExcelUtil<TDeviceList> util = new ExcelUtil<TDeviceList>(TDeviceList.class);
|
|
|
util.importTemplateExcel(response, "设备列表模板");
|
|
|
}
|
|
@@ -125,6 +117,7 @@ public class TDeviceListController extends BaseController
|
|
|
// String message = tDeviceListService.importTDeviceList(tDeviceLists);
|
|
|
// return AjaxResult.success(message);
|
|
|
// }
|
|
|
+
|
|
|
/**
|
|
|
* 导入
|
|
|
*/
|
|
@@ -137,15 +130,15 @@ public class TDeviceListController extends BaseController
|
|
|
String message = tDeviceListService.importTDeviceListV2(tDeviceLists);
|
|
|
return AjaxResult.success(message);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询心率列表
|
|
|
*/
|
|
|
@GetMapping("/heartRate")
|
|
|
- public TableDataInfo heartRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo heartRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByDeviceId(device_id_code);
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
HeartRateDto heartRateDto = JSONObject.parseObject(dto.getContent(), HeartRateDto.class);
|
|
|
dto.setContent(heartRateDto.getHeart_rate());
|
|
|
}
|
|
@@ -156,11 +149,10 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询血氧列表
|
|
|
*/
|
|
|
@GetMapping("/oxygenRate")
|
|
|
- public TableDataInfo oxygenRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo oxygenRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByOxygen(device_id_code);
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
OxygenRateDto oxygenRateDto = JSONObject.parseObject(dto.getContent(), OxygenRateDto.class);
|
|
|
dto.setContent(oxygenRateDto.getOxygen());
|
|
|
}
|
|
@@ -171,11 +163,10 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询体温列表
|
|
|
*/
|
|
|
@GetMapping("/tempRate")
|
|
|
- public TableDataInfo tempRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo tempRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByTemp(device_id_code);
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
TempRateDto tempRateDto = JSONObject.parseObject(dto.getContent(), TempRateDto.class);
|
|
|
dto.setContent(tempRateDto.getTemp());
|
|
|
}
|
|
@@ -186,12 +177,11 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询血压列表
|
|
|
*/
|
|
|
@GetMapping("/bloodRate")
|
|
|
- public TableDataInfo bloodRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo bloodRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByBlood(device_id_code);
|
|
|
List<BloodRateDto> list1 = new ArrayList<>();
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
BloodRateDto bloodRateDto = JSONObject.parseObject(dto.getContent(), BloodRateDto.class);
|
|
|
bloodRateDto.setCreatetime(dto.getCreatetime());
|
|
|
list1.add(bloodRateDto);
|
|
@@ -203,12 +193,11 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询步数列表
|
|
|
*/
|
|
|
@GetMapping("/stepRate")
|
|
|
- public TableDataInfo stepRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo stepRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByStep(device_id_code);
|
|
|
List<StepRateDto> list1 = new ArrayList<>();
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
StepRateDto stepRateDto = JSONObject.parseObject(dto.getContent(), StepRateDto.class);
|
|
|
stepRateDto.setCreatetime(dto.getCreatetime());
|
|
|
list1.add(stepRateDto);
|
|
@@ -220,12 +209,11 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询翻滚列表
|
|
|
*/
|
|
|
@GetMapping("/rollRate")
|
|
|
- public TableDataInfo rollRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo rollRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<RateDto> list = tDeviceListService.selectTDeviceByStep(device_id_code);
|
|
|
List<RollRateDto> list1 = new ArrayList<>();
|
|
|
- for(RateDto dto : list){
|
|
|
+ for (RateDto dto : list) {
|
|
|
RollRateDto rollRateDto = JSONObject.parseObject(dto.getContent(), RollRateDto.class);
|
|
|
rollRateDto.setCreatetime(dto.getCreatetime());
|
|
|
list1.add(rollRateDto);
|
|
@@ -237,12 +225,11 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询步数列表
|
|
|
*/
|
|
|
@GetMapping("/messageRate")
|
|
|
- public TableDataInfo messageRate(String device_id_code)
|
|
|
- {
|
|
|
+ public TableDataInfo messageRate(String device_id_code) {
|
|
|
startPage();
|
|
|
List<MessageDto> list = tDeviceListService.selectTDeviceByMessage(device_id_code);
|
|
|
List<RateDto> list1 = new ArrayList<>();
|
|
|
- for(MessageDto dto : list){
|
|
|
+ for (MessageDto dto : list) {
|
|
|
RateDto rateDto = new RateDto();
|
|
|
rateDto.setContent(tDeviceListService.checkMessage(dto.getAlarm_type()));
|
|
|
rateDto.setCreatetime(dto.getCreatetime());
|
|
@@ -255,8 +242,7 @@ public class TDeviceListController extends BaseController
|
|
|
* 查询设备消息日志
|
|
|
*/
|
|
|
@GetMapping("/messageLogRate")
|
|
|
- public TableDataInfo messageLogRate(MessageLogDto messageLogDto)
|
|
|
- {
|
|
|
+ public TableDataInfo messageLogRate(MessageLogDto messageLogDto) {
|
|
|
startPage();
|
|
|
List<MessageLogDto> list = tDeviceListService.selectTDeviceByMessageLog(messageLogDto);
|
|
|
return getDataTable(list);
|
|
@@ -267,8 +253,7 @@ public class TDeviceListController extends BaseController
|
|
|
*/
|
|
|
@Log(title = "设备阈值", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/deviceValue")
|
|
|
- public AjaxResult deviceValue(@RequestBody CallPoliceDto callPoliceDto)
|
|
|
- {
|
|
|
+ public AjaxResult deviceValue(@RequestBody CallPoliceDto callPoliceDto) {
|
|
|
return toAjax(tDeviceListService.deviceValue(callPoliceDto));
|
|
|
}
|
|
|
}
|