|
@@ -16,9 +16,11 @@ import cn.iocoder.yudao.module.pms.convert.iotmodeltemplate.IotModelTemplateConv
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicetemplate.IotDeviceTemplateDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplate.IotModelTemplateDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplate.IotModelTemplateDO;
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import cn.iocoder.yudao.module.pms.service.iotdevicetemplate.IotDeviceTemplateService;
|
|
import cn.iocoder.yudao.module.pms.service.iotdevicetemplate.IotDeviceTemplateService;
|
|
import cn.iocoder.yudao.module.pms.service.iotmodeltemplate.IotModelTemplateService;
|
|
import cn.iocoder.yudao.module.pms.service.iotmodeltemplate.IotModelTemplateService;
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -30,8 +32,8 @@ import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
@@ -47,6 +49,9 @@ public class IotModelTemplateController {
|
|
private IotModelTemplateService iotDeviceTemplateService;
|
|
private IotModelTemplateService iotDeviceTemplateService;
|
|
@Resource
|
|
@Resource
|
|
private IotProductClassifyService iotProductClassifyService;
|
|
private IotProductClassifyService iotProductClassifyService;
|
|
|
|
+ @Resource
|
|
|
|
+ private IotOpeationFillService iotOpeationFillService;
|
|
|
|
+
|
|
|
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
@Operation(summary = "创建PMS 功能优化 设备模板")
|
|
@Operation(summary = "创建PMS 功能优化 设备模板")
|
|
@@ -93,7 +98,14 @@ public class IotModelTemplateController {
|
|
@Operation(summary = "获得PMS 功能优化 设备模板分页")
|
|
@Operation(summary = "获得PMS 功能优化 设备模板分页")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-model-template:query')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-model-template:query')")
|
|
public CommonResult<PageResult<IotModelTemplateRespVO>> getIotDeviceTemplatePage(@Valid IotModelTemplatePageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<IotModelTemplateRespVO>> getIotDeviceTemplatePage(@Valid IotModelTemplatePageReqVO pageReqVO) {
|
|
- PageResult<IotModelTemplateDO> pageResult = iotDeviceTemplateService.getIotDeviceTemplatePage(pageReqVO);
|
|
|
|
|
|
+
|
|
|
|
+ Set<Long> idList = new HashSet<>();
|
|
|
|
+ if(Objects.nonNull(pageReqVO.getDeviceCategoryId())){
|
|
|
|
+ idList=iotProductClassifyService.getChildIotProductClassifyList(pageReqVO.getDeviceCategoryId());
|
|
|
|
+ idList.add(pageReqVO.getDeviceCategoryId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ PageResult<IotModelTemplateDO> pageResult = iotDeviceTemplateService.getIotDeviceTemplatePage(pageReqVO,idList);
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
}
|
|
}
|
|
@@ -104,6 +116,18 @@ public class IotModelTemplateController {
|
|
pageResult.getTotal()));
|
|
pageResult.getTotal()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping("/isRelated")
|
|
|
|
+ @Operation(summary = "获得PMS 功能优化 设备模板分页")
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('rq:iot-model-template:query')")
|
|
|
|
+ public CommonResult<List<IotModelTemplateRespVO>> getIsRlated(@RequestParam("deviceId") Long deviceId) {
|
|
|
|
+ IotModelTemplatePageReqVO reqVO = new IotModelTemplatePageReqVO();
|
|
|
|
+ reqVO.setDeviceCategoryId(deviceId);
|
|
|
|
+ List<IotModelTemplateDO> related = iotDeviceTemplateService.isRelated(reqVO);
|
|
|
|
+ return success(BeanUtils.toBean(related, IotModelTemplateRespVO.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@GetMapping("/list-by-model-category-id")
|
|
@GetMapping("/list-by-model-category-id")
|
|
@Operation(summary = "根据设备分类id获取模板属性列表")
|
|
@Operation(summary = "根据设备分类id获取模板属性列表")
|
|
@Parameter(name = "deviceCategoryId", description = "设备分类id", required = true, example = "1024")
|
|
@Parameter(name = "deviceCategoryId", description = "设备分类id", required = true, example = "1024")
|
|
@@ -113,7 +137,7 @@ public class IotModelTemplateController {
|
|
return success(BeanUtils.toBean(deviceTemplate, IotModelTemplateRespVO.class));
|
|
return success(BeanUtils.toBean(deviceTemplate, IotModelTemplateRespVO.class));
|
|
}
|
|
}
|
|
|
|
|
|
- @GetMapping("/export-excel")
|
|
|
|
|
|
+ /*@GetMapping("/export-excel")
|
|
@Operation(summary = "导出PMS 功能优化 设备模板 Excel")
|
|
@Operation(summary = "导出PMS 功能优化 设备模板 Excel")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-model-template:export')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-model-template:export')")
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
@@ -124,6 +148,6 @@ public class IotModelTemplateController {
|
|
// 导出 Excel
|
|
// 导出 Excel
|
|
ExcelUtils.write(response, "PMS 功能优化 设备模板.xls", "数据", IotModelTemplateRespVO.class,
|
|
ExcelUtils.write(response, "PMS 功能优化 设备模板.xls", "数据", IotModelTemplateRespVO.class,
|
|
BeanUtils.toBean(list, IotModelTemplateRespVO.class));
|
|
BeanUtils.toBean(list, IotModelTemplateRespVO.class));
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
}
|