|
@@ -39,42 +39,28 @@ public class GetDeviceInfoController {
|
|
|
@ApiOperation("获取遥控设备信息")
|
|
|
@PostMapping("/getDeviceInfo")
|
|
|
public R<List<GetDeviceInfoVo>> getDeviceInfo(@RequestBody BaseParam param) {
|
|
|
- List<GetDeviceInfoVo> list = new ArrayList<>();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- List<TemplateLibrary> templaList = templateLibraryService.list(new LambdaQueryWrapper<TemplateLibrary>().eq(TemplateLibrary::getDelFlag, 0));
|
|
|
- for (TemplateLibrary templateLibrary : templaList) {
|
|
|
+
|
|
|
+ Long temId = null;
|
|
|
+ if (param.getId() == null) {
|
|
|
+ temId = 1L;
|
|
|
+ }else {
|
|
|
+ temId = param.getId();
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- BasicLibrary basicLibrary = basicLibraryService.getOne(new LambdaQueryWrapper<BasicLibrary>().eq(BasicLibrary::getDelFlag, 0)
|
|
|
- .eq(BasicLibrary::getId, templateLibrary.getId()), false);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ List<GetDeviceInfoVo> list = new ArrayList<>();
|
|
|
+ TemplateLibrary templateLibrary = templateLibraryService.getOne(new LambdaQueryWrapper<TemplateLibrary>().eq(TemplateLibrary::getId, temId), false);
|
|
|
+
|
|
|
+ BasicLibrary basicLibrary = basicLibraryService.getOne(new LambdaQueryWrapper<BasicLibrary>().eq(BasicLibrary::getDelFlag, 0)
|
|
|
+ .eq(BasicLibrary::getId, templateLibrary.getBaseId()), false);
|
|
|
+ GetDeviceInfoVo deviceInfoVo = new GetDeviceInfoVo();
|
|
|
+ deviceInfoVo.setBandValue(basicLibrary.getBandValue());
|
|
|
+ deviceInfoVo.setComponentsString(templateLibrary.getComponents());
|
|
|
+ deviceInfoVo.setBasicLibrary(basicLibrary);
|
|
|
+
|
|
|
+ list.add(deviceInfoVo);
|
|
|
|
|
|
- GetDeviceInfoVo deviceInfoVo = new GetDeviceInfoVo();
|
|
|
- deviceInfoVo.setBandValue(basicLibrary.getBandValue());
|
|
|
- deviceInfoVo.setComponentsString(templateLibrary.getComponents());
|
|
|
-
|
|
|
-
|
|
|
- deviceInfoVo.setBasicLibrary(basicLibrary);
|
|
|
- list.add(deviceInfoVo);
|
|
|
- }
|
|
|
return R.ok(list);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|