Commit 13152cd7 authored by linruibiao's avatar linruibiao

整改接口

parent b5c12fc1
......@@ -18,7 +18,7 @@ import java.util.List;
* @author : lin
* @date : 2021-03-25 18:39
**/
@RequestMapping("/depts")
@RequestMapping("/departments")
@RestController
@Api(value = "部门信息接口", description = "部门信息接口")
public class DeptController {
......
......@@ -2,12 +2,10 @@ package com.syc.slm.slmbi.controller;
import com.syc.slm.common.core.util.R;
import com.syc.slm.slmbi.dto.InstrumentPanelConfigDTO;
import com.syc.slm.slmbi.dto.InstrumentPanelPermissionDTO;
import com.syc.slm.slmbi.service.InstrumentPanelConfigService;
import com.syc.slm.slmbi.vo.InstrumentPanelConfigVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -22,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/panel-configs")
@RestController
@Api(value = "仪表板样式以及数据配置", description = "仪表板样式以及数据配置")
@Api(value = "仪表板样式以及数据配置")
public class InstrumentPanelConfigController {
@Autowired
......@@ -30,34 +28,22 @@ public class InstrumentPanelConfigController {
@PostMapping
@ApiOperation("保存仪表板样式以及数据配置")
@ApiImplicitParams({@ApiImplicitParam(name = "instrumentPanelId", value = "仪表板id", required = true),
@ApiImplicitParam(name = "visitPermission",
value = "访问权限",
required = true,
dataTypeClass = InstrumentPanelPermissionDTO.class),
@ApiImplicitParam(name = "configDetails", value = "仪表板配置详情", required = true)})
public R<String> saveInstrumentPanelConfig(@RequestBody InstrumentPanelConfigDTO config) {
return R.ok(instrumentPanelConfigService.saveInstrumentPanelConfig(config, 1));
return R.ok(instrumentPanelConfigService.saveConfig(config));
}
@PostMapping("/publish")
@ApiOperation("保存发布仪表板样式以及数据配置")
@ApiImplicitParams({@ApiImplicitParam(name = "instrumentPanelId", value = "仪表板id", required = true),
@ApiImplicitParam(name = "visitPermission",
value = "访问权限",
required = true,
dataTypeClass = InstrumentPanelPermissionDTO.class),
@ApiImplicitParam(name = "configDetails", value = "仪表板配置详情", required = true)})
public R<String> publish(@RequestBody InstrumentPanelConfigDTO config) {
return R.ok(instrumentPanelConfigService.publish(config));
}
@GetMapping("{panelId}")
@GetMapping("/{panelId}")
@ApiOperation("根据仪表板id获取仪表板配置")
@ApiImplicitParam(name = "panelId", value = "仪表板id")
public R<InstrumentPanelConfigVo> getInstrumentPanelConfigByInstrumentPanelId(
public R<InstrumentPanelConfigVo> getConfigByPanelId(
@PathVariable("panelId") String panelId) {
return R.ok(instrumentPanelConfigService.getInstrumentPanelConfigByInstrumentPanelId(panelId));
return R.ok(instrumentPanelConfigService.getConfigByPanelId(panelId));
}
}
......@@ -2,8 +2,8 @@ package com.syc.slm.slmbi.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.common.core.util.R;
import com.syc.slm.slmbi.dto.InstrumentPanelDTO;
import com.syc.slm.slmbi.entity.InstrumentPanel;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO;
import com.syc.slm.slmbi.service.InstrumentPanelService;
import com.syc.slm.slmbi.vo.InstrumentPanelVo;
import io.swagger.annotations.Api;
......@@ -29,24 +29,29 @@ public class InstrumentPanelController {
@Autowired
private InstrumentPanelService instrumentPanelService;
/**
* where :{name:'',creator:'',updater:'',startDate:'' ,endDate:'',recordStatus:''}
*
* @param where
* @return
*/
@GetMapping
@ApiOperation("仪表板列表")
public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody
InstrumentPanelDTO where) { //where :{name:'',creator:'',updater:'',startDate:'' ,endDate:'',recordStatus:''}
public R<IPage<InstrumentPanelVo>> selectInstrumentPanelList(@RequestBody SearchInstrumentPanelDTO where) {
return R.ok(instrumentPanelService.selectInstrumentPanelList(where));
}
@PostMapping
@ApiOperation("新增仪表板")
public R<String> saveInstrumentPanel(@RequestBody InstrumentPanel panel) {
return R.ok(instrumentPanelService.saveInstrumentPanel(panel));
public R<String> saveInstrumentPanel(@RequestBody SaveInstrumentPanelDTO panel) {
return R.ok(instrumentPanelService.savePanel(panel));
}
@PutMapping("/batch-push")
@PutMapping("/batch-publish")
@ApiOperation("批量发布")
@ApiImplicitParam(name = "ids", value = "仪表板id集合", required = true)
public R<Boolean> batchPush(@RequestBody List<String> ids) {
return R.ok(instrumentPanelService.batchPushInstrumentPanel(ids, 1));
public R<Boolean> batchPublish(@RequestBody List<String> ids) {
return R.ok(instrumentPanelService.batchPublish(ids));
}
@PutMapping("/{id}/offline")
......@@ -59,28 +64,28 @@ public class InstrumentPanelController {
@DeleteMapping("/{id}")
@ApiOperation("删除仪表板")
@ApiImplicitParam(name = "id", value = "仪表板id", required = true)
public R<String> delPushInstrumentPanel(@PathVariable("id") String id) {
return R.ok(instrumentPanelService.delPushInstrumentPanel(id));
public R<String> delInstrumentPanel(@PathVariable("id") String id) {
return R.ok(instrumentPanelService.delPanel(id));
}
@PostMapping("/save-as")
@ApiOperation("另存为")
public R<String> saveAs(@RequestBody InstrumentPanelDTO instrumentPanelDTO) {
return R.ok(instrumentPanelService.saveInstrumentPanel(instrumentPanelDTO));
public R<String> saveAs(@RequestBody SaveInstrumentPanelDTO panelDTO) {
return R.ok(instrumentPanelService.saveAsPanel(panelDTO));
}
@PostMapping("/show-recovery-btn/{id}")
@PostMapping("/{id}/show-recovery-btn")
@ApiOperation("是否显示恢复按钮")
@ApiImplicitParam(name = "id", value = "仪表板id", required = true)
public R<Boolean> showRecoveryBtn(@PathVariable("id") String id) {
return R.ok(instrumentPanelService.showRecoveryBtn(id));
}
@PutMapping("/recovery/{id}")
@PutMapping("/{id}/recovery")
@ApiOperation("恢复按钮操作")
@ApiImplicitParam(name = "id", value = "仪表板id", required = true)
public R<String> recoveryInstrumentPanel(@PathVariable("id") String id) {
return R.ok(instrumentPanelService.recoveryInstrumentPanel(id));
return R.ok(instrumentPanelService.recoveryPanel(id));
}
}
......@@ -2,7 +2,6 @@ package com.syc.slm.slmbi.controller;
import com.syc.slm.common.core.util.R;
import com.syc.slm.slmbi.dto.InstrumentPanelGroupDTO;
import com.syc.slm.slmbi.entity.InstrumentPanelGroup;
import com.syc.slm.slmbi.service.InstrumentPanelGroupService;
import com.syc.slm.slmbi.vo.InstrumentPanelGroupVo;
import com.syc.slm.slmbi.vo.PanelGroupVo;
......@@ -33,7 +32,7 @@ public class InstrumentPanelGroupController {
@GetMapping
@ApiOperation("第一次进入页面,或者点击查询,获取全部分组下的仪表板数据,以及分组数据")
@ApiImplicitParam(name = "name", value = "分组名称或者仪表板名称")
public R<List<PanelGroupVo>> selectInstrumentPanelGroupList(
public R<List<PanelGroupVo>> loadTrees(
@RequestParam(value = "name", required = false) String name) {
return R.ok(instrumentPanelGroupService.loadTrees(name));
}
......@@ -50,25 +49,25 @@ public class InstrumentPanelGroupController {
@GetMapping("/selectInstrumentPanelGroups")
@ApiOperation("获取所有的仪表板分组以及分组下的仪表板以及仪表板下的组件")
public R<List<InstrumentPanelGroupVo>> selectInstrumentPanelGroups() {
return R.ok(instrumentPanelGroupService.selectInstrumentPanelGroupList());
return R.ok(instrumentPanelGroupService.selectGroupList());
}
@PostMapping
@ApiOperation("保存仪表板分组")
public R<String> saveInstrumentPanelGroup(@RequestBody InstrumentPanelGroupDTO group) {
return R.ok(instrumentPanelGroupService.saveInstrumentPanelGroup(group));
public R<String> saveGroup(@RequestBody InstrumentPanelGroupDTO group) {
return R.ok(instrumentPanelGroupService.saveGroup(group));
}
@PutMapping
@ApiOperation("更新仪表板分组")
public R<String> updateInstrumentPanelGroup(@RequestBody InstrumentPanelGroupDTO group) {
return R.ok(instrumentPanelGroupService.updateInstrumentPanelGroup(group));
public R<String> updateGroup(@RequestBody InstrumentPanelGroupDTO group) {
return R.ok(instrumentPanelGroupService.updateGroup(group));
}
@DeleteMapping("/{groupId}")
@ApiOperation("删除仪表板分组")
public R<String> delInstrumentPanelGroup(@PathVariable String groupId) {
return R.ok(instrumentPanelGroupService.delInstrumentPanelGroup(groupId));
public R<String> delGroup(@PathVariable String groupId) {
return R.ok(instrumentPanelGroupService.delGroup(groupId));
}
}
......@@ -21,38 +21,37 @@ import java.util.List;
**/
@Api(value = "仪表板权限控制")
@RestController
@RequestMapping("/panel/permissions")
@RequestMapping("/panel-permissions")
public class InstrumentPanelPermissionController {
@Autowired
private InstrumentPanelPermissionService instrumentPanelPermissionService;
@PostMapping
@ApiOperation("保存仪表板权限")
public R<String> saveInstrumentPanelPermission(@RequestBody List<InstrumentPanelPermissionDTO> permissions) {
return R.ok(instrumentPanelPermissionService.saveInstrumentPanelPermission(permissions));
@ApiOperation("保存仪表板权限(列表的属性保存)")
public R<String> savePermission(@RequestBody List<InstrumentPanelPermissionDTO> permissions) {
return R.ok(instrumentPanelPermissionService.savePermission(permissions));
}
@PostMapping("/to-copy/{panelId}")
@PostMapping("/{panelId}/to-copy")
@ApiOperation("从其他仪表板复制配置")
@ApiImplicitParam(name = "panelId", value = "其他仪表板id", required = true)
public R<List<InstrumentPanelPermissionVo>> saveCopyOtherInstrumentPanelPermission(@PathVariable String panelId) {
return R.ok(instrumentPanelPermissionService.saveCopyOtherInstrumentPanelPermission(panelId));
public R<List<InstrumentPanelPermissionVo>> saveCopyOtherPermission(@PathVariable String panelId) {
return R.ok(instrumentPanelPermissionService.saveCopyOtherPermission(panelId));
}
@PostMapping("/copy-to/{panelId}")
@PostMapping("/{panelId}/copy-to")
@ApiOperation("将仪表板权限复制给其他仪表板")
@ApiImplicitParam(name = "panelId", value = "其他仪表板id", required = true)
public R<String> saveCopyToOtherInstrumentPanelPermission(
@RequestBody List<InstrumentPanelPermissionDTO> permissions, @PathVariable("panelId") String panelId) {
return R.ok(instrumentPanelPermissionService.saveCopyToOtherInstrumentPanelPermission(permissions, panelId));
public R<String> saveCopyToOtherPermission(@RequestBody List<InstrumentPanelPermissionDTO> permissions,
@PathVariable String panelId) {
return R.ok(instrumentPanelPermissionService.saveCopyToOtherPermission(permissions, panelId));
}
@GetMapping("/{panelId}")
@ApiOperation("根据仪表板id获取仪表板权限")
@ApiImplicitParam(name = "panelId", value = "仪表板id", required = true)
public R<List<InstrumentPanelPermissionVo>> selectInstrumentPanelPermissionById(
@PathVariable("panelId") String panelId) {
return R.ok(instrumentPanelPermissionService.selectInstrumentPanelPermissionById(panelId));
public R<List<InstrumentPanelPermissionVo>> selectPermissionByPanelId(@PathVariable String panelId) {
return R.ok(instrumentPanelPermissionService.selectPermissionByPanelId(panelId));
}
}
......@@ -2,14 +2,12 @@ package com.syc.slm.slmbi.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.common.core.util.R;
import com.syc.slm.slmbi.dto.HistoryVariableDTO;
import com.syc.slm.slmbi.dto.RealTimeVariableDTO;
import com.syc.slm.slmbi.dto.VariableDTO;
import com.syc.slm.slmbi.service.VariableService;
import com.syc.slm.slmbi.vo.VariableDeviceVo;
import com.syc.slm.slmbi.vo.VariableSourceVo;
import com.syc.slm.slmbi.vo.VariableVo;
import com.syc.slm.slmbi.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -18,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* slm-bi
......@@ -35,44 +34,32 @@ public class VariableController {
@GetMapping
@ApiOperation("获取变量列表")
@ApiImplicitParams({@ApiImplicitParam(name = "sourceId", value = "变量来源"),
@ApiImplicitParam(name = "deviceId", value = "所属设备"),
@ApiImplicitParam(name = "variableName", value = "变量名称"),
@ApiImplicitParam(name = "description", value = "描述")})
public R<IPage<VariableVo>> getVariableList(@RequestBody VariableDTO variableDTO) {
return R.ok(variableService.getVariableList(variableDTO));
}
@GetMapping("real-time")
@GetMapping("/real-time")
@ApiOperation("获取变量实时数据")
@ApiImplicitParams({@ApiImplicitParam(name = "variableIds", value = "变量集合ids", required = true),
@ApiImplicitParam(name = "format", value = "时间格式", required = true),
@ApiImplicitParam(name = "interval", value = "时间间隔,代表(天,时,分,秒)", required = true),
@ApiImplicitParam(name = "deviceId", value = "所属设备", required = true)})
public R getVariableRealTimeDataList(@RequestBody VariableDTO variableDTO) {
return R.ok();
public R<Map<String, List<Map<String, RealTimeVariableVo>>>> getVariableRealTimeDataList(
@RequestBody RealTimeVariableDTO variableDTO) {
return R.ok(variableService.getVariableRealTimeDataList(variableDTO));
}
@GetMapping("source")
@GetMapping("/source")
@ApiOperation("获取变量来源列表")
public R<List<VariableSourceVo>> getVariableSourceList() {
return R.ok(variableService.getVariableSourceList());
}
@GetMapping("device")
@GetMapping("/device")
@ApiOperation("获取变量所属设备列表")
public R<List<VariableDeviceVo>> getVariableDeviceList() {
return R.ok(variableService.getVariableDeviceList());
}
@GetMapping("history")
@GetMapping("/history")
@ApiOperation("获取变量历史数据")
@ApiImplicitParams({@ApiImplicitParam(name = "variableIds", value = "变量集合ids", required = true),
@ApiImplicitParam(name = "deviceId", value = "所属设备", required = true),
@ApiImplicitParam(name = "statisticsType", value = "统计类型,代表(合计值,平均值,最大值,最小值)", required = true),
@ApiImplicitParam(name = "startTime", value = "开始时间", required = true),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = true)})
public R getVariableHistoryDataList(@RequestBody VariableDTO variableDTO) {
return R.ok();
public R<Map<String, List<Map<String, HistoryVariableVo>>>> getVariableHistoryDataList(@RequestBody HistoryVariableDTO variableDTO) {
return R.ok(variableService.getVariableHistoryDataList(variableDTO));
}
}
package com.syc.slm.slmbi.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* slm-bi
* 历史变量数据查询DTO
* @author : lin
* @date : 2021-03-30 15:21
**/
@Data
@ApiModel(value = "历史变量数据查询DTO")
@EqualsAndHashCode(callSuper=false)
public class HistoryVariableDTO {
@ApiModelProperty(value = "所属设备", required = true)
private String deviceId;
@ApiModelProperty(value = "统计类型,代表(合计值 1,平均值 2,最大值 3,最小值 4)", required = true)
private Integer statisticsType;
@ApiModelProperty(value = "变量集合ids", required = true)
private List<String> variableIds;
@ApiModelProperty(value = "开始时间",required = true)
private Date startTime;
@ApiModelProperty(value = "结束时间", required = true)
private Date endTime;
@ApiModelProperty(value = "以变量为维度是1 , 以时间为维度是2", required = true)
private Integer dimension;
}
package com.syc.slm.slmbi.dto;
import com.syc.slm.slmbi.entity.InstrumentPanelConfig;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
/**
* slm-bi
* 仪表板样式,数据配置显示类
*
* @author : lin
* @date : 2021-03-25 15:39
**/
@Data
@ApiModel(value = "仪表板配置DTO",description ="仪表板配置DTO" )
@EqualsAndHashCode(callSuper=true)
public class InstrumentPanelConfigDTO extends InstrumentPanelConfig {
@ApiModelProperty("配置详情集合")
private List<Map<String,Object>> configs;
@ApiModel(value = "仪表板配置DTO")
@EqualsAndHashCode(callSuper = false)
public class InstrumentPanelConfigDTO {
@ApiModelProperty(value = "仪表板id", required = true)
private String instrumentPanelId;
@ApiModelProperty(value = "仪表板配置详情,包含了样式,数据配置", required = true)
private String configDetails;
@ApiModelProperty(value = "访问权限", required = true)
private InstrumentPanelPermissionDTO visitPermission;
}
package com.syc.slm.slmbi.dto;
import com.syc.slm.slmbi.entity.InstrumentPanelGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -12,9 +12,14 @@ import lombok.EqualsAndHashCode;
* @author : lin
* @date : 2021-03-25 16:47
**/
@ApiModel(value = "仪表板分组DTO",description = "仪表板分组DTO")
@ApiModel(value = "仪表板分组DTO", description = "仪表板分组DTO")
@Data
@EqualsAndHashCode(callSuper=true)
public class InstrumentPanelGroupDTO extends InstrumentPanelGroup {
@EqualsAndHashCode(callSuper = false)
public class InstrumentPanelGroupDTO {
@ApiModelProperty(value = "仪表板分组主键(保存非必填)", required = true)
private String id;
@ApiModelProperty(value = "仪表板分组父级主键", required = true)
private String parentId;
@ApiModelProperty(value = "仪表板分组名称", required = true)
private String name;
}
......@@ -18,19 +18,19 @@ import lombok.EqualsAndHashCode;
public class InstrumentPanelPermissionDTO {
@ApiModelProperty(value = "主键id")
private String id;
@ApiModelProperty(value = "仪表板id")
@ApiModelProperty(value = "仪表板id",required = true)
private String instrumentPanelId;
@ApiModelProperty(value = "仪表板名称")
@ApiModelProperty(value = "仪表板名称",required = true)
private String instrumentPanelName;
@ApiModelProperty(value = "仪表板分组id")
@ApiModelProperty(value = "仪表板分组id",required = true)
private String instrumentPanelGroupId;
@ApiModelProperty(value = "仪表板分组名称")
@ApiModelProperty(value = "仪表板分组名称",required = true)
private String instrumentPanelGroupName;
@ApiModelProperty(value = "存储类型,1代表岗位,2代表部门,3 代表个体用户")
@ApiModelProperty(value = "存储类型,1代表岗位,2代表部门,3 代表个体用户",required = true)
private Integer permissionType;
@ApiModelProperty(value = "代表岗位,部门,个体用户id")
@ApiModelProperty(value = "代表岗位1,部门2,个体用户id 3")
private String bizId;
@ApiModelProperty(value = "代表岗位,部门,个体用户名称")
private String bizName;
......
package com.syc.slm.slmbi.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* slm-bi
* 实时变量DTO
* @author : lin
* @date : 2021-03-30 15:05
**/
@ApiModel("实时变量DTO")
@Data
public class RealTimeVariableDTO {
@ApiModelProperty(value = "所属设备", required = true)
private String deviceId;
@ApiModelProperty(value = "时间格式", required = true)
private String format;
@ApiModelProperty(value = "时间间隔,代表(天,时,分,秒)", required = true)
private Integer interval;
@ApiModelProperty(value = "统计类型,代表(合计值,平均值,最大值,最小值)", required = true)
private Integer statisticsType;
@ApiModelProperty(value = "变量集合ids", required = true)
private List<String> variableIds;
@ApiModelProperty(value = "以变量为维度是1 , 以时间为维度是2", required = true)
private Integer dimension;
}
package com.syc.slm.slmbi.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* slm-bi
* 保存仪表板DTO
*
* @author : lin
* @date : 2021-03-30 16:11
**/
@ApiModel(value = "查询仪表板列表DTO")
@Data
@EqualsAndHashCode(callSuper = false)
public class SaveInstrumentPanelDTO {
@ApiModelProperty(value = "仪表板名称", required = true)
private String name;
@ApiModelProperty(value = "仪表板归属分组", required = true)
private String groupId;
}
package com.syc.slm.slmbi.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* slm-bi
* 查询仪表板列表DTO
*
* @author : lin
* @date : 2021-03-30 16:07
**/
@ApiModel(value = "查询仪表板列表DTO")
@Data
@EqualsAndHashCode(callSuper = false)
public class SearchInstrumentPanelDTO {
@ApiModelProperty(value = "仪表板名称")
private String name;
@ApiModelProperty(value = "仪表板归属分组")
private String groupId;
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ApiModelProperty(value = "修改人名称")
private String updaterName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "状态")
private Integer recordStatus;
}
......@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
* @date : 2021-03-25 19:05
**/
@Data
@ApiModel(value = "变量DTO",description = "变量DTO")
@ApiModel(value = "变量DTO")
@EqualsAndHashCode(callSuper=false)
public class VariableDTO {
@ApiModelProperty(value = "变量来源")
......
......@@ -22,6 +22,9 @@ public class InstrumentPanel extends BaseEntity<InstrumentPanel>{
private String name;
@ApiModelProperty(value = "仪表板归属分组")
private String groupId;
@ApiModelProperty(value = "访问权限(公开 1,自定义 2,私有 3)")
private String visitPermission;
}
......@@ -4,21 +4,31 @@ import com.sun.istack.NotNull;
import com.syc.slm.slmbi.dto.InstrumentPanelConfigDTO;
import com.syc.slm.slmbi.vo.InstrumentPanelConfigVo;
/**
* slm-bi
* 仪表板配置
*
* @author : lin
* @date : 2021-03-25 15:10
**/
public interface InstrumentPanelConfigService {
/**
* 保存仪表板配置
* @param config
* @param optType
* @return
*/
String saveInstrumentPanelConfig(InstrumentPanelConfigDTO config,Integer optType);
/**
* 根据仪表板id获取对应配置
* @param instrumentPanelId
* @return
*/
InstrumentPanelConfigVo getInstrumentPanelConfigByInstrumentPanelId(@NotNull String instrumentPanelId);
InstrumentPanelConfigVo getConfigByPanelId(@NotNull String instrumentPanelId);
/**
* 保存发布仪表板配置
* @param config
* @return
*/
String publish(InstrumentPanelConfigDTO config);
/**
* 保存仪表板配置
* @param config
* @return
*/
String saveConfig(InstrumentPanelConfigDTO config);
}
......@@ -22,28 +22,28 @@ public interface InstrumentPanelGroupService extends IService<InstrumentPanelGro
* 查询仪表板分组
* @return
*/
List<InstrumentPanelGroupVo> selectInstrumentPanelGroupList();
List<InstrumentPanelGroupVo> selectGroupList();
/**
* 删除仪表板分组
* @param groupId
* @return
*/
String delInstrumentPanelGroup(@NonNull String groupId);
String delGroup(@NonNull String groupId);
/**
* 修改仪表板分组
* @param group
* @return
*/
String updateInstrumentPanelGroup(InstrumentPanelGroupDTO group);
String updateGroup(InstrumentPanelGroupDTO group);
/**
* 保存仪表板分组
* @param group
* @return
*/
String saveInstrumentPanelGroup(InstrumentPanelGroupDTO group);
String saveGroup(InstrumentPanelGroupDTO group);
/**
* 加载仪表板树
......
......@@ -9,30 +9,34 @@ import java.util.List;
public interface InstrumentPanelPermissionService {
/**
* 保存仪表板权限
*
* @param permissions
* @return
*/
String saveInstrumentPanelPermission(List<InstrumentPanelPermissionDTO> permissions);
String savePermission(List<InstrumentPanelPermissionDTO> permissions);
/**
* 从其他仪表板复制配置
*
* @param instrumentPanelId
* @return
*/
List<InstrumentPanelPermissionVo> saveCopyOtherInstrumentPanelPermission(@NonNull String instrumentPanelId);
List<InstrumentPanelPermissionVo> saveCopyOtherPermission(@NonNull String instrumentPanelId);
/**
* 将仪表板权限复制给其他仪表板
*
* @param permissions
* @param otherInstrumentPanelId
* @return
*/
String saveCopyToOtherInstrumentPanelPermission(List<InstrumentPanelPermissionDTO> permissions, String otherInstrumentPanelId);
String saveCopyToOtherPermission(List<InstrumentPanelPermissionDTO> permissions, String otherInstrumentPanelId);
/**
* 根据仪表板id获取仪表板权限
*
* @param instrumentPanelId
* @return
*/
List<InstrumentPanelPermissionVo> selectInstrumentPanelPermissionById(@NonNull String instrumentPanelId);
List<InstrumentPanelPermissionVo> selectPermissionByPanelId(@NonNull String instrumentPanelId);
}
......@@ -2,7 +2,8 @@ package com.syc.slm.slmbi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.syc.slm.slmbi.dto.InstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO;
import com.syc.slm.slmbi.entity.InstrumentPanel;
import com.syc.slm.slmbi.vo.InstrumentPanelVo;
......@@ -18,42 +19,47 @@ import java.util.List;
public interface InstrumentPanelService extends IService<InstrumentPanel> {
/**
* 仪表板列表
*
* @param where
* @return
*/
IPage<InstrumentPanelVo> selectInstrumentPanelList(InstrumentPanelDTO where);
IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where);
/**
* 保存仪表板
*
* @param panel
* @return
*/
String saveInstrumentPanel(InstrumentPanel panel);
String savePanel(SaveInstrumentPanelDTO panel);
/**
* 批量推送
*
* @param ids
* @param optType
* @return
*/
Boolean batchPushInstrumentPanel(List<String> ids, Integer optType);
Boolean batchPublish(List<String> ids);
/**
* 删除仪表板
*
* @param id
* @return
*/
String delPushInstrumentPanel(String id);
String delPanel(String id);
/**
* 另存为
*
* @param instrumentPanelDTO
* @return
*/
String saveAsInstrumentPanel(InstrumentPanelDTO instrumentPanelDTO);
String saveAsPanel(SaveInstrumentPanelDTO instrumentPanelDTO);
/**
* 是否显示恢复按钮
*
* @param id
* @return
*/
......@@ -61,13 +67,15 @@ public interface InstrumentPanelService extends IService<InstrumentPanel> {
/**
* 恢复按钮操作
*
* @param id
* @return
*/
String recoveryInstrumentPanel(String id);
String recoveryPanel(String id);
/**
* 下线
*
* @param id
* @return
*/
......
package com.syc.slm.slmbi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.slmbi.dto.HistoryVariableDTO;
import com.syc.slm.slmbi.dto.RealTimeVariableDTO;
import com.syc.slm.slmbi.dto.VariableDTO;
import com.syc.slm.slmbi.vo.VariableDeviceVo;
import com.syc.slm.slmbi.vo.VariableSourceVo;
import com.syc.slm.slmbi.vo.VariableVo;
import com.syc.slm.slmbi.vo.*;
import java.util.List;
import java.util.Map;
/**
* slm-bi
......@@ -35,4 +36,7 @@ public interface VariableService {
*/
List<VariableDeviceVo> getVariableDeviceList();
Map<String, List<Map<String, RealTimeVariableVo>>> getVariableRealTimeDataList(RealTimeVariableDTO variableDTO);
Map<String, List<Map<String, HistoryVariableVo>>> getVariableHistoryDataList(HistoryVariableDTO variableDTO);
}
......@@ -14,18 +14,20 @@ import org.springframework.stereotype.Service;
**/
@Service
public class InstrumentPanelConfigServiceImpl implements InstrumentPanelConfigService {
@Override
public String saveInstrumentPanelConfig(InstrumentPanelConfigDTO config,Integer optType) {
public InstrumentPanelConfigVo getConfigByPanelId(String instrumentPanelId) {
return null;
}
@Override
public InstrumentPanelConfigVo getInstrumentPanelConfigByInstrumentPanelId(String instrumentPanelId) {
public String publish(InstrumentPanelConfigDTO config) {
return null;
}
@Override
public String publish(InstrumentPanelConfigDTO config) {
public String saveConfig(InstrumentPanelConfigDTO config) {
return null;
}
}
......@@ -24,22 +24,22 @@ import java.util.List;
@Service
public class InstrumentPanelGroupServiceImpl extends ServiceImpl<InstrumentPanelGroupMapper, InstrumentPanelGroup> implements InstrumentPanelGroupService {
@Override
public List<InstrumentPanelGroupVo> selectInstrumentPanelGroupList() {
public List<InstrumentPanelGroupVo> selectGroupList() {
return null;
}
@Override
public String delInstrumentPanelGroup(@NonNull String groupId) {
public String delGroup(@NonNull String groupId) {
return null;
}
@Override
public String updateInstrumentPanelGroup(InstrumentPanelGroupDTO group) {
public String updateGroup(InstrumentPanelGroupDTO group) {
return null;
}
@Override
public String saveInstrumentPanelGroup(InstrumentPanelGroupDTO group) {
public String saveGroup(InstrumentPanelGroupDTO group) {
return null;
}
......
......@@ -18,7 +18,7 @@ import java.util.List;
@Service
public class InstrumentPanelPermissionImpl implements InstrumentPanelPermissionService {
@Override
public String saveInstrumentPanelPermission(List<InstrumentPanelPermissionDTO> permissions){
public String savePermission(List<InstrumentPanelPermissionDTO> permissions){
//判断仪表板的名称是否重复
//删除原本的权限
//插入现有的权限
......@@ -27,17 +27,17 @@ public class InstrumentPanelPermissionImpl implements InstrumentPanelPermissionS
}
@Override
public List<InstrumentPanelPermissionVo> saveCopyOtherInstrumentPanelPermission(@NonNull String instrumentPanelId) {
public List<InstrumentPanelPermissionVo> saveCopyOtherPermission(@NonNull String instrumentPanelId) {
return null;
}
@Override
public String saveCopyToOtherInstrumentPanelPermission(List<InstrumentPanelPermissionDTO> permissions, String otherInstrumentPanelId) {
public String saveCopyToOtherPermission(List<InstrumentPanelPermissionDTO> permissions, String otherInstrumentPanelId) {
return null;
}
@Override
public List<InstrumentPanelPermissionVo> selectInstrumentPanelPermissionById(@NonNull String instrumentPanelId) {
public List<InstrumentPanelPermissionVo> selectPermissionByPanelId(@NonNull String instrumentPanelId) {
return null;
}
}
......@@ -3,7 +3,8 @@ package com.syc.slm.slmbi.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syc.slm.slmbi.dao.InstrumentPanelMapper;
import com.syc.slm.slmbi.dto.InstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SaveInstrumentPanelDTO;
import com.syc.slm.slmbi.dto.SearchInstrumentPanelDTO;
import com.syc.slm.slmbi.entity.InstrumentPanel;
import com.syc.slm.slmbi.service.InstrumentPanelService;
import com.syc.slm.slmbi.vo.InstrumentPanelVo;
......@@ -19,29 +20,30 @@ import java.util.List;
* @date : 2021-03-25 16:17
**/
@Service
public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMapper, InstrumentPanel> implements InstrumentPanelService {
public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMapper, InstrumentPanel>
implements InstrumentPanelService {
@Override
public IPage<InstrumentPanelVo> selectInstrumentPanelList(InstrumentPanelDTO where) {
public IPage<InstrumentPanelVo> selectInstrumentPanelList(SearchInstrumentPanelDTO where) {
return null;
}
@Override
public String saveInstrumentPanel(InstrumentPanel panel) {
public String savePanel(SaveInstrumentPanelDTO panel) {
return null;
}
@Override
public Boolean batchPushInstrumentPanel(List<String> ids, Integer optType) {
public Boolean batchPublish(List<String> ids) {
return null;
}
@Override
public String delPushInstrumentPanel(String id) {
public String delPanel(String id) {
return null;
}
@Override
public String saveAsInstrumentPanel(InstrumentPanelDTO instrumentPanelDTO) {
public String saveAsPanel(SaveInstrumentPanelDTO instrumentPanelDTO) {
return null;
}
......@@ -51,7 +53,7 @@ public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMappe
}
@Override
public String recoveryInstrumentPanel(String id) {
public String recoveryPanel(String id) {
return null;
}
......
package com.syc.slm.slmbi.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.syc.slm.slmbi.dto.HistoryVariableDTO;
import com.syc.slm.slmbi.dto.RealTimeVariableDTO;
import com.syc.slm.slmbi.dto.VariableDTO;
import com.syc.slm.slmbi.service.VariableService;
import com.syc.slm.slmbi.vo.VariableDeviceVo;
import com.syc.slm.slmbi.vo.VariableSourceVo;
import com.syc.slm.slmbi.vo.VariableVo;
import com.syc.slm.slmbi.vo.*;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* slm-bi
......@@ -33,4 +34,14 @@ public class VariableServiceImpl implements VariableService {
public List<VariableDeviceVo> getVariableDeviceList() {
return null;
}
@Override
public Map<String, List<Map<String, RealTimeVariableVo>>> getVariableRealTimeDataList(RealTimeVariableDTO variableDTO) {
return null;
}
@Override
public Map<String, List<Map<String, HistoryVariableVo>>> getVariableHistoryDataList(HistoryVariableDTO variableDTO) {
return null;
}
}
package com.syc.slm.slmbi.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* slm-bi
* 变量历史数据Vo
* @author : lin
* @date : 2021-03-30 15:29
**/
@Data
@ApiModel(value = "变量历史数据Vo")
@EqualsAndHashCode(callSuper=false)
public class HistoryVariableVo {
@ApiModelProperty(value = "所属设备id")
private String deviceId;
@ApiModelProperty(value = "所属设备名称")
private String deviceName;
@ApiModelProperty(value = "工作状态")
private String workStatus;
@ApiModelProperty(value = "时间")
private String time;
@ApiModelProperty(value = "变量id")
private String variableId;
@ApiModelProperty(value = "变量code")
private String variableCode;
@ApiModelProperty(value = "变量名称")
private String variableName;
@ApiModelProperty(value = "合计值")
private BigDecimal sum;
@ApiModelProperty(value = "平均值")
private BigDecimal avg;
@ApiModelProperty(value = "最大值")
private BigDecimal max;
@ApiModelProperty(value = "最小值")
private BigDecimal min;
}
package com.syc.slm.slmbi.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* slm-bi
* 实时变量查询vo
* @author : lin
* @date : 2021-03-30 14:22
**/
@Data
@ApiModel(value = "实时变量查询vo")
@EqualsAndHashCode(callSuper=false)
public class RealTimeVariableVo {
@ApiModelProperty(value = "所属设备id")
private String deviceId;
@ApiModelProperty(value = "所属设备名称")
private String deviceName;
@ApiModelProperty(value = "工作状态")
private String workStatus;
@ApiModelProperty(value = "时间")
private String time;
@ApiModelProperty(value = "变量id")
private String variableId;
@ApiModelProperty(value = "变量code")
private String variableCode;
@ApiModelProperty(value = "变量名称")
private String variableName;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment