52 changed files with 2555 additions and 2 deletions
@ -0,0 +1,31 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 大屏地图DTO |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "VisualComponentDTO对象", description = "可视化组件配置表") |
||||||
|
public class VisualComponentDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 地图名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "组件名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 大屏数据源DTO |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "VisualDbDTO对象", description = "可视化数据源表") |
||||||
|
public class VisualDbDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 驱动类 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "驱动类") |
||||||
|
private String driverClass; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.Visual; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualConfig; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 大屏展示DTO |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "VisualDTO对象", description = "可视化表") |
||||||
|
public class VisualDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 可视化主信息 |
||||||
|
*/ |
||||||
|
private Visual visual; |
||||||
|
|
||||||
|
/** |
||||||
|
* 可视化配置信息 |
||||||
|
*/ |
||||||
|
private VisualConfig config; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 大屏地图DTO |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "VisualMapDTO对象", description = "可视化地图配置表") |
||||||
|
public class VisualMapDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 地图名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "地图名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,55 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 大屏接口代理转发实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "接口代理对象", description = "接口代理") |
||||||
|
public class VisualProxyDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求地址 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "请求地址") |
||||||
|
private String url; |
||||||
|
|
||||||
|
/** |
||||||
|
* 方法类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "方法类型") |
||||||
|
private String method; |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求头 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "请求头") |
||||||
|
private Map<String, Object> headers; |
||||||
|
|
||||||
|
/** |
||||||
|
* 参数 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "参数") |
||||||
|
private Map<String, Object> params; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据") |
||||||
|
private Object data; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据集表 数据传输对象实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "VisualRecordDTO", description = "可视化数据集表") |
||||||
|
public class VisualRecordDto implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据类型") |
||||||
|
private Integer dataType; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化表实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "Visual对象", description = "可视化表") |
||||||
|
public class Visual extends CommonEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 大屏标题 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "大屏标题") |
||||||
|
private String title; |
||||||
|
/** |
||||||
|
* 大屏背景 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "大屏背景") |
||||||
|
private String backgroundUrl; |
||||||
|
/** |
||||||
|
* 大屏类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "大屏类型") |
||||||
|
private Integer category; |
||||||
|
/** |
||||||
|
* 发布密码 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "发布密码") |
||||||
|
private String password; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化分类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_category") |
||||||
|
@ApiModel(value = "VisualCategory对象", description = "可视化分类表") |
||||||
|
public class VisualCategory implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分类键值 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "分类键值") |
||||||
|
private String categoryKey; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分类名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "分类名称") |
||||||
|
private String categoryValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除标志(0代表存在 1代表删除 |
||||||
|
*/ |
||||||
|
@TableLogic |
||||||
|
@JsonIgnore |
||||||
|
private String delFlag; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化地图配置表实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_component") |
||||||
|
@ApiModel(value = "VisualComponent对象", description = "可视化组件表") |
||||||
|
public class VisualComponent implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 组件名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "组件名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 组件内容 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "组件内容") |
||||||
|
private String content; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,47 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化配置表实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_config") |
||||||
|
@ApiModel(value = "VisualConfig对象", description = "可视化配置表") |
||||||
|
public class VisualConfig implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 可视化表主键 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "可视化表主键") |
||||||
|
private String visualId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 配置json |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "配置json") |
||||||
|
private String detail; |
||||||
|
|
||||||
|
/** |
||||||
|
* 组件json |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "组件json") |
||||||
|
private String component; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 数据源配置表实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_db") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "VisualDb对象", description = "数据源配置表") |
||||||
|
public class VisualDb extends CommonEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 驱动类 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "驱动类") |
||||||
|
private String driverClass; |
||||||
|
|
||||||
|
/** |
||||||
|
* 连接地址 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "连接地址") |
||||||
|
private String url; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用户名 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "用户名") |
||||||
|
private String username; |
||||||
|
|
||||||
|
/** |
||||||
|
* 密码 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "密码") |
||||||
|
private String password; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化地图配置表实体类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_map") |
||||||
|
@ApiModel(value = "VisualMap对象", description = "可视化地图配置表") |
||||||
|
public class VisualMap implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 地图名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "地图名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 地图数据 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "地图数据") |
||||||
|
private String data; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,88 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.api.bigscreen.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据集表 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("common_visual_record") |
||||||
|
@ApiModel(value = "VisualRecord对象", description = "可视化数据集表") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class VisualRecord extends CommonEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据地址 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据地址") |
||||||
|
private String url; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据类型") |
||||||
|
private Integer dataType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据方法 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据方法") |
||||||
|
private String dataMethod; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据请求头 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据请求头") |
||||||
|
private String dataHeader; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据集 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据集") |
||||||
|
private String data; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据查询 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据查询") |
||||||
|
private String dataQuery; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据查询类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据查询类型") |
||||||
|
private String dataQueryType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据格式化 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "数据格式化") |
||||||
|
private String dataFormatter; |
||||||
|
|
||||||
|
/** |
||||||
|
* ws地址 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "ws地址") |
||||||
|
private String wsUrl; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,131 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.entity.VisualCategory; |
||||||
|
import org.springblade.modules.visual.service.IVisualCategoryService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化分类表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/category") |
||||||
|
@Api(value = "可视化分类表", tags = "可视化分类接口") |
||||||
|
public class VisualCategoryController extends BladeController { |
||||||
|
|
||||||
|
private final IVisualCategoryService visualCategoryService; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入visualCategory") |
||||||
|
public R<VisualCategory> detail(VisualCategory visualCategory) { |
||||||
|
VisualCategory detail = visualCategoryService.getOne(Condition.getQueryWrapper(visualCategory)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 列表 可视化分类表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "列表", notes = "传入visualCategory") |
||||||
|
public R<List<VisualCategory>> list(VisualCategory visualCategory) { |
||||||
|
List<VisualCategory> list = visualCategoryService.list(Condition.getQueryWrapper(visualCategory)); |
||||||
|
return R.data(list); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 分页 可视化分类表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/page") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "分页", notes = "传入visualCategory") |
||||||
|
public R<IPage<VisualCategory>> page(VisualCategory visualCategory, Query query) { |
||||||
|
IPage<VisualCategory> pages = visualCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(visualCategory)); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增 可视化分类表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入visualCategory") |
||||||
|
public R save(@Valid @RequestBody VisualCategory visualCategory) { |
||||||
|
return R.status(visualCategoryService.submit(visualCategory)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 修改 可视化分类表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入visualCategory") |
||||||
|
public R update(@Valid @RequestBody VisualCategory visualCategory) { |
||||||
|
return R.status(visualCategoryService.submit(visualCategory)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 删除 可视化分类表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualCategoryService.removeByIds(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,134 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.jackson.JsonUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.dto.VisualComponentDTO; |
||||||
|
import org.springblade.modules.visual.entity.VisualComponent; |
||||||
|
import org.springblade.modules.visual.service.IVisualComponentService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化组件表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/component") |
||||||
|
@Api(value = "可视化组件表", tags = "可视化组件接口") |
||||||
|
public class VisualComponentController extends BladeController { |
||||||
|
|
||||||
|
private final IVisualComponentService visualComponentService; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入visualComponent") |
||||||
|
public R<VisualComponent> detail(VisualComponent visualComponent) { |
||||||
|
VisualComponent detail = visualComponentService.getOne(Condition.getQueryWrapper(visualComponent)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 数据详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/content") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "组件详情", notes = "传入id") |
||||||
|
public Map<String, Object> content(Long id) { |
||||||
|
VisualComponent detail = visualComponentService.getById(id); |
||||||
|
return JsonUtil.toMap(detail.getContent()); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 自定义分页 可视化组件表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "分页", notes = "传入visualComponent") |
||||||
|
public R<IPage<VisualComponentDTO>> list(VisualComponentDTO visualComponent, Query query) { |
||||||
|
IPage<VisualComponentDTO> pages = visualComponentService.selectVisualComponentPage(Condition.getPage(query), visualComponent); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增 可视化组件表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入visualComponent") |
||||||
|
public R save(@Valid @RequestBody VisualComponent visualComponent) { |
||||||
|
return R.status(visualComponentService.save(visualComponent)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 修改 可视化组件表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入visualComponent") |
||||||
|
public R update(@Valid @RequestBody VisualComponent visualComponent) { |
||||||
|
return R.status(visualComponentService.updateById(visualComponent)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 删除 可视化组件表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualComponentService.removeByIds(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,181 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.SneakyThrows; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.oss.OssTemplate; |
||||||
|
import org.springblade.core.oss.model.BladeFile; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.support.Kv; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.dto.VisualDTO; |
||||||
|
import org.springblade.modules.visual.entity.Visual; |
||||||
|
import org.springblade.modules.visual.entity.VisualCategory; |
||||||
|
import org.springblade.modules.visual.log.DataLog; |
||||||
|
import org.springblade.modules.visual.service.IVisualCategoryService; |
||||||
|
import org.springblade.modules.visual.service.IVisualService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化表 控制器 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/visual") |
||||||
|
@Api(value = "可视化表", tags = "可视化数据接口") |
||||||
|
public class VisualController extends BladeController { |
||||||
|
|
||||||
|
private final IVisualService visualService; |
||||||
|
private final IVisualCategoryService categoryService; |
||||||
|
private final OssTemplate ossTemplate; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏详情") |
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入visual") |
||||||
|
public R<VisualDTO> detail(@RequestParam Long id) { |
||||||
|
VisualDTO detail = visualService.detail(id); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 分页 可视化表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏列表") |
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "分页", notes = "传入visual") |
||||||
|
public R<IPage<Visual>> list(Visual visual, Query query) { |
||||||
|
IPage<Visual> pages = visualService.page(Condition.getPage(query), Condition.getQueryWrapper(visual)); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增 可视化表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏新增") |
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "新增", notes = "传入visual") |
||||||
|
public R save(@Valid @RequestBody VisualDTO visual) { |
||||||
|
boolean temp = visualService.saveVisual(visual); |
||||||
|
if (temp) { |
||||||
|
Long id = visual.getVisual().getId(); |
||||||
|
return R.data(Kv.create().set("id", String.valueOf(id))); |
||||||
|
} else { |
||||||
|
return R.status(false); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 修改 可视化表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏修改") |
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "修改", notes = "传入visual") |
||||||
|
public R update(@Valid @RequestBody VisualDTO visual) { |
||||||
|
return R.status(visualService.updateVisual(visual)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 删除 可视化表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏删除") |
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 复制 可视化表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("大屏复制") |
||||||
|
@PostMapping("/copy") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "复制", notes = "传入id") |
||||||
|
public R<String> copy(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) { |
||||||
|
return R.data(visualService.copyVisual(id)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 获取分类 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("category") |
||||||
|
@ApiOperationSupport(order = 7) |
||||||
|
@ApiOperation(value = "获取类型") |
||||||
|
public R category() { |
||||||
|
List<VisualCategory> list = categoryService.list(); |
||||||
|
return R.data(list); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 上传文件 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@DataLog("资源上传") |
||||||
|
@SneakyThrows |
||||||
|
@PostMapping("/put-file") |
||||||
|
@ApiOperationSupport(order = 8) |
||||||
|
@ApiOperation(value = "上传", notes = "传入文件") |
||||||
|
public R<BladeFile> putFile(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file) { |
||||||
|
BladeFile bladeFile = ossTemplate.putFile(file); |
||||||
|
return R.data(bladeFile); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,185 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.api.crypto.annotation.decrypt.ApiDecryptAes; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.dto.VisualDbDTO; |
||||||
|
import org.springblade.modules.visual.dynamic.DynamicModel; |
||||||
|
import org.springblade.modules.visual.entity.VisualDb; |
||||||
|
import org.springblade.modules.visual.service.IVisualDbService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.LinkedHashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 数据源表 控制器 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/db") |
||||||
|
@Api(value = "可视化数据源配置表", tags = "可视化数据源配置接口") |
||||||
|
public class VisualDbController { |
||||||
|
|
||||||
|
private final IVisualDbService visualDbService; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入datasource") |
||||||
|
public R<VisualDb> detail(VisualDb db) { |
||||||
|
VisualDb detail = visualDbService.getOne(Condition.getQueryWrapper(db)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 分页 数据源配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "分页", notes = "传入datasource") |
||||||
|
public R<IPage<VisualDb>> list(VisualDb db, Query query) { |
||||||
|
IPage<VisualDb> pages = visualDbService.page(Condition.getPage(query), Condition.getQueryWrapper(db)); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增 数据源配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入datasource") |
||||||
|
public R save(@Valid @RequestBody VisualDb db) { |
||||||
|
db.setUrl(db.getUrl().replace("&", "&")); |
||||||
|
if (visualDbService.dbTest(db)) { |
||||||
|
return R.status(visualDbService.save(db)); |
||||||
|
} |
||||||
|
throw new ServiceException("系统检测数据库未能连通,请检查配置"); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 修改 数据源配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入datasource") |
||||||
|
public R update(@Valid @RequestBody VisualDb db) { |
||||||
|
db.setUrl(db.getUrl().replace("&", "&")); |
||||||
|
if (visualDbService.dbTest(db)) { |
||||||
|
return R.status(visualDbService.updateById(db)); |
||||||
|
} |
||||||
|
throw new ServiceException("系统检测数据库未能连通,请检查配置"); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增或修改 数据源配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/submit") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "新增或修改", notes = "传入datasource") |
||||||
|
public R submit(@Valid @RequestBody VisualDb db) { |
||||||
|
db.setUrl(db.getUrl().replace("&", "&")); |
||||||
|
if (visualDbService.dbTest(db)) { |
||||||
|
return R.status(visualDbService.saveOrUpdate(db)); |
||||||
|
} |
||||||
|
throw new ServiceException("系统检测数据库未能连通,请检查配置"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 删除 数据源配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 7) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualDbService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 数据源测试连接 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@ApiDecryptAes |
||||||
|
@PostMapping("/db-test") |
||||||
|
@ApiOperationSupport(order = 8) |
||||||
|
@ApiOperation(value = "数据源测试连接", notes = "数据源测试连接") |
||||||
|
public R<Boolean> dbTest(@RequestBody VisualDb db) { |
||||||
|
return R.status(visualDbService.dbTest(db)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 数据源列表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/db-list") |
||||||
|
@ApiOperationSupport(order = 9) |
||||||
|
@ApiOperation(value = "下拉数据源", notes = "数据源列表") |
||||||
|
public R<List<VisualDbDTO>> dbList() { |
||||||
|
return R.data(visualDbService.dbList()); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 动态执行SQL |
||||||
|
*//*
|
||||||
|
|
||||||
|
@ApiDecryptAes |
||||||
|
@PostMapping("dynamic-query") |
||||||
|
@ApiOperationSupport(order = 10) |
||||||
|
@ApiOperation(value = "动态执行SQL", notes = "动态执行SQL") |
||||||
|
public R dynamicQuery(@RequestBody DynamicModel model) { |
||||||
|
List<LinkedHashMap<String, Object>> linkedHashMaps = visualDbService.dynamicQuery(model.getId(), model.getSql()); |
||||||
|
return R.data(linkedHashMaps); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,134 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.jackson.JsonUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.dto.VisualMapDTO; |
||||||
|
import org.springblade.modules.visual.entity.VisualMap; |
||||||
|
import org.springblade.modules.visual.service.IVisualMapService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化地图配置表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/map") |
||||||
|
@Api(value = "可视化地图配置表", tags = "可视化地图配置接口") |
||||||
|
public class VisualMapController extends BladeController { |
||||||
|
|
||||||
|
private final IVisualMapService visualMapService; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入visualMap") |
||||||
|
public R<VisualMap> detail(VisualMap visualMap) { |
||||||
|
VisualMap detail = visualMapService.getOne(Condition.getQueryWrapper(visualMap)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 数据详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/data") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "数据详情", notes = "传入id") |
||||||
|
public Map<String, Object> data(Long id) { |
||||||
|
VisualMap detail = visualMapService.getById(id); |
||||||
|
return JsonUtil.toMap(detail.getData()); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 自定义分页 可视化地图配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "分页", notes = "传入visualMap") |
||||||
|
public R<IPage<VisualMapDTO>> list(VisualMapDTO visualMap, Query query) { |
||||||
|
IPage<VisualMapDTO> pages = visualMapService.selectVisualMapPage(Condition.getPage(query), visualMap); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 新增 可视化地图配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入visualMap") |
||||||
|
public R save(@Valid @RequestBody VisualMap visualMap) { |
||||||
|
return R.status(visualMapService.save(visualMap)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 修改 可视化地图配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入visualMap") |
||||||
|
public R update(@Valid @RequestBody VisualMap visualMap) { |
||||||
|
return R.status(visualMapService.updateById(visualMap)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 删除 可视化地图配置表 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualMapService.removeByIds(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,96 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.common.tool.RequestUtil; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.tool.jackson.JsonUtil; |
||||||
|
import org.springblade.core.tool.support.Kv; |
||||||
|
import org.springblade.core.tool.utils.CollectionUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.core.tool.utils.StringPool; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
import org.springblade.modules.visual.entity.VisualProxy; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 接口代理 控制器 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/visual") |
||||||
|
@ApiIgnore |
||||||
|
@Api(value = "接口代理", tags = "接口代理") |
||||||
|
public class VisualProxyController extends BladeController { |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 接口代理 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RequestMapping("/proxy") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "接口代理", notes = "接口代理") |
||||||
|
public Object proxy(@RequestBody VisualProxy proxy) { |
||||||
|
// 获取参数
|
||||||
|
String url = proxy.getUrl(); |
||||||
|
String method = proxy.getMethod(); |
||||||
|
Map<String, Object> headers = proxy.getHeaders(); |
||||||
|
Map<String, Object> params = proxy.getParams(); |
||||||
|
Object data = proxy.getData(); |
||||||
|
String request; |
||||||
|
// 获取参数提交格式
|
||||||
|
Boolean form = Func.toBoolean(proxy.getHeaders().get("form"), true); |
||||||
|
// 处理GET与DELETE方法请求
|
||||||
|
if (StringUtil.equalsIgnoreCase(method, RequestUtil.GET) || StringUtil.equalsIgnoreCase(method, RequestUtil.DELETE)) { |
||||||
|
request = RequestUtil.request(url, headers, params, method); |
||||||
|
} else { |
||||||
|
// 处理POST与PUT方法请求
|
||||||
|
if (form) { |
||||||
|
request = RequestUtil.requestForm(url + StringPool.QUESTION_MARK + StringUtil.trimAllWhitespace(String.valueOf(data)), headers, params, method); |
||||||
|
} else { |
||||||
|
request = RequestUtil.requestJson(url, headers, JsonUtil.toJson(data), method); |
||||||
|
} |
||||||
|
} |
||||||
|
// 判断返回结果集
|
||||||
|
if (StringUtil.isBlank(request)) { |
||||||
|
return Kv.create().set("code", 400).set("msg", "获取数据失败,请检查参数配置!"); |
||||||
|
} else { |
||||||
|
Map<String, Object> result = JsonUtil.toMap(request); |
||||||
|
return CollectionUtil.isEmpty(result) ? request : result; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,131 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.constant.LauncherConstant; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.dto.VisualRecordDTO; |
||||||
|
import org.springblade.modules.visual.entity.VisualRecord; |
||||||
|
import org.springblade.modules.visual.service.IVisualRecordService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping(LauncherConstant.APPLICATION_VISUAL_NAME + "/record") |
||||||
|
@Api(value = "可视化数据集表", tags = "可视化数据集接口") |
||||||
|
public class VisualRecordController extends BladeController { |
||||||
|
|
||||||
|
private final IVisualRecordService visualRecordService; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 详情 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "详情", notes = "传入visualRecord") |
||||||
|
public R<VisualRecord> detail(VisualRecord visualRecord) { |
||||||
|
VisualRecord detail = visualRecordService.getOne(Condition.getQueryWrapper(visualRecord)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 分页 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "分页", notes = "传入visualRecord") |
||||||
|
public R<IPage<VisualRecordDTO>> list(VisualRecordDTO record, Query query) { |
||||||
|
IPage<VisualRecordDTO> pages = visualRecordService.selectVisualRecordPage(Condition.getPage(query), record); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 新增 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "新增", notes = "传入visualRecord") |
||||||
|
public R save(@Valid @RequestBody VisualRecord visualRecord) { |
||||||
|
return R.status(visualRecordService.save(visualRecord)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 修改 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "修改", notes = "传入visualRecord") |
||||||
|
public R update(@Valid @RequestBody VisualRecord visualRecord) { |
||||||
|
return R.status(visualRecordService.updateById(visualRecord)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 新增或修改 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/submit") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "新增或修改", notes = "传入visualRecord") |
||||||
|
public R submit(@Valid @RequestBody VisualRecord visualRecord) { |
||||||
|
return R.status(visualRecordService.saveOrUpdate(visualRecord)); |
||||||
|
} |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化数据集表 删除 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(visualRecordService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,16 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualCategory; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化分类表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualCategoryMapper extends BaseMapper<VisualCategory> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualComponentDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualComponent; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化组件表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualComponentMapper extends BaseMapper<VisualComponent> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualComponent |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<VisualComponentDto> selectVisualComponentPage(IPage page, VisualComponentDto visualComponent); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualConfig; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化配置表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualConfigMapper extends BaseMapper<VisualConfig> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualDbDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualDb; |
||||||
|
|
||||||
|
import java.util.LinkedHashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据源配置表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualDbMapper extends BaseMapper<VisualDb> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据源列表 |
||||||
|
* |
||||||
|
* @return List |
||||||
|
*/ |
||||||
|
List<VisualDbDto> dbList(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义调用动态sql |
||||||
|
* |
||||||
|
* @param sql 可执行sql语句 |
||||||
|
* @return List |
||||||
|
*/ |
||||||
|
List<LinkedHashMap<String, Object>> dynamicQuery(String sql); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualMapDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualMap; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化地图配置表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualMapMapper extends BaseMapper<VisualMap> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualMap |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<VisualMapDto> selectVisualMapPage(IPage page, VisualMapDto visualMap); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.Visual; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualMapper extends BaseMapper<Visual> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualRecordDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualRecord; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据集表 Mapper 接口 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface VisualRecordMapper extends BaseMapper<VisualRecord> { |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualRecord |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<VisualRecordDto> selectVisualRecordPage(IPage page, VisualRecordDto visualRecord); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,43 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import org.springblade.modules.visual.entity.VisualCategory; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化分类表 服务类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
public interface IVisualCategoryService extends IService<VisualCategory> { |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 提交分类信息 |
||||||
|
* |
||||||
|
* @param visualCategory 分类 |
||||||
|
* @return boolean |
||||||
|
*//*
|
||||||
|
|
||||||
|
boolean submit(VisualCategory visualCategory); |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,46 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import org.springblade.modules.visual.dto.VisualComponentDTO; |
||||||
|
import org.springblade.modules.visual.entity.VisualComponent; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化地图配置表 服务类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
public interface IVisualComponentService extends IService<VisualComponent> { |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualComponent |
||||||
|
* @return |
||||||
|
*//*
|
||||||
|
|
||||||
|
IPage<VisualComponentDTO> selectVisualComponentPage(IPage<VisualComponentDTO> page, VisualComponentDTO visualComponent); |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,16 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualConfig; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化配置表 服务类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface IVisualConfigService extends IService<VisualConfig> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualDbDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualDb; |
||||||
|
|
||||||
|
import java.util.LinkedHashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据源配置表 服务类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface IVisualDbService extends IService<VisualDb> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据源测试连接 |
||||||
|
* |
||||||
|
* @param db 数据源 |
||||||
|
* @return Boolean |
||||||
|
*/ |
||||||
|
Boolean dbTest(VisualDb db); |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据源列表 |
||||||
|
* |
||||||
|
* @return List |
||||||
|
*/ |
||||||
|
List<VisualDbDto> dbList(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义调用动态sql |
||||||
|
* |
||||||
|
* @param id 数据源id |
||||||
|
* @param sql 可执行sql语句 |
||||||
|
* @return List |
||||||
|
*/ |
||||||
|
List<LinkedHashMap<String, Object>> dynamicQuery(String id, String sql); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualMapDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualMap; |
||||||
|
|
||||||
|
/** |
||||||
|
* 可视化地图配置表 服务类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*/ |
||||||
|
public interface IVisualMapService extends IService<VisualMap> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualMap |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
IPage<VisualMapDto> selectVisualMapPage(IPage<VisualMapDto> page, VisualMapDto visualMap); |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualRecordDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualRecord; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据集表 服务类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface IVisualRecordService extends IService<VisualRecord> { |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page |
||||||
|
* @param visualRecord |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
IPage<VisualRecordDto> selectVisualRecordPage(IPage<VisualRecordDto> page, VisualRecordDto visualRecord); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.Visual; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化表 服务类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
public interface IVisualService extends IService<Visual> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取 可视化信息 |
||||||
|
* |
||||||
|
* @param id 主键 |
||||||
|
* @return VisualDTO |
||||||
|
*/ |
||||||
|
VisualDto detail(String id); |
||||||
|
|
||||||
|
/** |
||||||
|
* 保存可视化信息 |
||||||
|
* |
||||||
|
* @param dto 配置信息 |
||||||
|
* @return boolean |
||||||
|
*/ |
||||||
|
boolean saveVisual(VisualDto dto); |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改可视化信息 |
||||||
|
* |
||||||
|
* @param dto 配置信息 |
||||||
|
* @return boolean |
||||||
|
*/ |
||||||
|
boolean updateVisual(VisualDto dto); |
||||||
|
|
||||||
|
/** |
||||||
|
* 复制可视化信息 |
||||||
|
* |
||||||
|
* @param id 主键 |
||||||
|
* @return 复制后主键 |
||||||
|
*/ |
||||||
|
String copyVisual(String id); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,53 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.tool.constant.BladeConstant; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.visual.entity.VisualCategory; |
||||||
|
import org.springblade.modules.visual.mapper.VisualCategoryMapper; |
||||||
|
import org.springblade.modules.visual.service.IVisualCategoryService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化分类表 服务实现类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Service |
||||||
|
public class VisualCategoryServiceImpl extends ServiceImpl<VisualCategoryMapper, VisualCategory> implements IVisualCategoryService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean submit(VisualCategory visualCategory) { |
||||||
|
LambdaQueryWrapper<VisualCategory> lqw = Wrappers.<VisualCategory>query().lambda().eq(VisualCategory::getCategoryValue, visualCategory.getCategoryValue()); |
||||||
|
Long cnt = baseMapper.selectCount((Func.isEmpty(visualCategory.getId())) ? lqw : lqw.notIn(VisualCategory::getId, visualCategory.getId())); |
||||||
|
if (cnt > 0L) { |
||||||
|
throw new ServiceException("当前模块键值已存在!"); |
||||||
|
} |
||||||
|
visualCategory.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
||||||
|
return saveOrUpdate(visualCategory); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,44 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import org.springblade.modules.visual.dto.VisualComponentDTO; |
||||||
|
import org.springblade.modules.visual.entity.VisualComponent; |
||||||
|
import org.springblade.modules.visual.mapper.VisualComponentMapper; |
||||||
|
import org.springblade.modules.visual.service.IVisualComponentService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化地图配置表 服务实现类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Service |
||||||
|
public class VisualComponentServiceImpl extends ServiceImpl<VisualComponentMapper, VisualComponent> implements IVisualComponentService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<VisualComponentDTO> selectVisualComponentPage(IPage<VisualComponentDTO> page, VisualComponentDTO visualComponent) { |
||||||
|
return page.setRecords(baseMapper.selectVisualComponentPage(page, visualComponent)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,37 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*//*
|
||||||
|
|
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import org.springblade.modules.visual.entity.VisualConfig; |
||||||
|
import org.springblade.modules.visual.mapper.VisualConfigMapper; |
||||||
|
import org.springblade.modules.visual.service.IVisualConfigService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
* 可视化配置表 服务实现类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Service |
||||||
|
public class VisualConfigServiceImpl extends ServiceImpl<VisualConfigMapper, VisualConfig> implements IVisualConfigService { |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,83 @@ |
|||||||
|
/* |
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.cloud.kicc.common.datasource.util.ConnUtil; |
||||||
|
import com.cloud.kicc.common.datasource.util.DynamicDataSourceUtil; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualDb; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.mapper.VisualDbMapper; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.service.IVisualDbService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.apache.commons.collections.map.LRUMap; |
||||||
|
import org.springblade.core.log.exception.ServiceException; |
||||||
|
import org.springblade.core.secure.BladeUser; |
||||||
|
import org.springblade.core.secure.utils.AuthUtil; |
||||||
|
import org.springblade.core.tool.support.Kv; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.core.tool.utils.PlaceholderUtil; |
||||||
|
import org.springblade.modules.visual.dto.VisualDbDTO; |
||||||
|
import org.springblade.modules.visual.dynamic.DynamicDataSourceHelper; |
||||||
|
import org.springblade.modules.visual.dynamic.DynamicDataSourceHolder; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.LinkedHashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据源配置表 服务实现类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class VisualDbServiceImpl extends ServiceImpl<VisualDbMapper, VisualDb> implements IVisualDbService { |
||||||
|
|
||||||
|
private final VisualDbMapper mapper; |
||||||
|
private final DynamicDataSourceUtil holder; |
||||||
|
private final ConnUtil helper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public Boolean dbTest(VisualDb db) { |
||||||
|
LRUMap |
||||||
|
return helper.dbTest(db.getDriverClass(), db.getUrl(), db.getUsername(), db.getPassword()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<VisualDbDTO> dbList() { |
||||||
|
return mapper.dbList(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<LinkedHashMap<String, Object>> dynamicQuery(String id, String sql) { |
||||||
|
try { |
||||||
|
//处理自定义数据源
|
||||||
|
holder.handleDataSource(id); |
||||||
|
//切换数据源
|
||||||
|
DynamicDataSourceContextHolder.push(id); |
||||||
|
//获取user信息
|
||||||
|
BladeUser user = AuthUtil.getUser(); |
||||||
|
//获取user参数
|
||||||
|
Map<String, Object> map = (Func.isEmpty(user)) ? Kv.newMap() : BeanUtil.toMap(user); |
||||||
|
//替换user占位符
|
||||||
|
String dynamicSql = PlaceholderUtil.getDefaultResolver().resolveByMap(sql, map); |
||||||
|
//执行自定义sql
|
||||||
|
return mapper.dynamicQuery(dynamicSql); |
||||||
|
} catch (Exception exception) { |
||||||
|
throw new ServiceException(exception.getMessage()); |
||||||
|
} finally { |
||||||
|
//切回主数据源
|
||||||
|
DynamicDataSourceContextHolder.poll(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,27 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualMapDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualMap; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.mapper.VisualMapMapper; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.service.IVisualMapService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化地图配置表 服务实现类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class VisualMapServiceImpl extends ServiceImpl<VisualMapMapper, VisualMap> implements IVisualMapService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<VisualMapDto> selectVisualMapPage(IPage<VisualMapDto> page, VisualMapDto visualMap) { |
||||||
|
return page.setRecords(baseMapper.selectVisualMapPage(page, visualMap)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualRecordDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualRecord; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.mapper.VisualRecordMapper; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.service.IVisualRecordService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化数据集表 服务实现类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class VisualRecordServiceImpl extends ServiceImpl<VisualRecordMapper, VisualRecord> implements IVisualRecordService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<VisualRecordDto> selectVisualRecordPage(IPage<VisualRecordDto> page, VisualRecordDto visualRecord) { |
||||||
|
return page.setRecords(baseMapper.selectVisualRecordPage(page, visualRecord)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,86 @@ |
|||||||
|
/* |
||||||
|
package com.cloud.kicc.commonbiz.bigscreen.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualDto; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.Visual; |
||||||
|
import com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualConfig; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.mapper.VisualMapper; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.service.IVisualConfigService; |
||||||
|
import com.cloud.kicc.commonbiz.bigscreen.service.IVisualService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
*/ |
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 可视化表 服务实现类 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/30 |
||||||
|
*//*
|
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class VisualServiceImpl extends ServiceImpl<VisualMapper, Visual> implements IVisualService { |
||||||
|
|
||||||
|
private final IVisualConfigService configService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public VisualDto detail(String id) { |
||||||
|
Visual visual = this.getById(id); |
||||||
|
VisualConfig visualConfig = configService.getOne(Wrappers.<VisualConfig>query().lambda().eq(VisualConfig::getVisualId, id)); |
||||||
|
VisualDto dto = new VisualDto(); |
||||||
|
dto.setVisual(visual); |
||||||
|
dto.setConfig(visualConfig); |
||||||
|
return dto; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean saveVisual(VisualDto dto) { |
||||||
|
Visual visual = dto.getVisual(); |
||||||
|
VisualConfig visualConfig = dto.getConfig(); |
||||||
|
boolean tempV = this.save(visual); |
||||||
|
visualConfig.setVisualId(visual.getId()); |
||||||
|
boolean tempVc = configService.save(visualConfig); |
||||||
|
return tempV && tempVc; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean updateVisual(VisualDto dto) { |
||||||
|
Visual visual = dto.getVisual(); |
||||||
|
VisualConfig visualConfig = dto.getConfig(); |
||||||
|
if (visual != null && visual.getId() != null) { |
||||||
|
this.updateById(visual); |
||||||
|
} |
||||||
|
if (visualConfig != null && visualConfig.getId() != null) { |
||||||
|
configService.updateById(visualConfig); |
||||||
|
} |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public String copyVisual(String id) { |
||||||
|
Visual visual = this.getById(id); |
||||||
|
VisualConfig visualConfig = configService.getOne(Wrappers.<VisualConfig>query().lambda().eq(VisualConfig::getVisualId, id)); |
||||||
|
if (visual != null && visualConfig != null) { |
||||||
|
visual.setId(null); |
||||||
|
visualConfig.setId(null); |
||||||
|
VisualDto dto = new VisualDto(); |
||||||
|
dto.setVisual(visual); |
||||||
|
dto.setConfig(visualConfig); |
||||||
|
boolean temp = this.saveVisual(dto); |
||||||
|
if (temp) { |
||||||
|
return String.valueOf(visual.getId()); |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
*/ |
@ -0,0 +1,13 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualCategoryMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualCategoryResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualCategory"> |
||||||
|
<id column="id" property="id"/> |
||||||
|
<result column="category_key" property="categoryKey"/> |
||||||
|
<result column="category_value" property="categoryValue"/> |
||||||
|
<result column="is_deleted" property="isDeleted"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualComponentMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualComponentResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualComponentDto"> |
||||||
|
<id column="id" property="id"/> |
||||||
|
<result column="name" property="name"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
|
||||||
|
<select id="selectVisualComponentPage" resultMap="visualComponentResultMap"> |
||||||
|
select id, name from common_visual_component |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,13 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualConfigMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualConfigResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualConfig"> |
||||||
|
<id column="id" property="id"/> |
||||||
|
<result column="visual_id" property="visualId"/> |
||||||
|
<result column="detail" property="detail"/> |
||||||
|
<result column="component" property="component"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,39 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualDbMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="datasourceResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualDb"> |
||||||
|
<result column="id" property="id"/> |
||||||
|
<result column="create_user" property="createUser"/> |
||||||
|
<result column="create_dept" property="createDept"/> |
||||||
|
<result column="create_time" property="createTime"/> |
||||||
|
<result column="update_user" property="updateUser"/> |
||||||
|
<result column="update_time" property="updateTime"/> |
||||||
|
<result column="status" property="status"/> |
||||||
|
<result column="is_deleted" property="isDeleted"/> |
||||||
|
<result column="driver_class" property="driverClass"/> |
||||||
|
<result column="url" property="url"/> |
||||||
|
<result column="username" property="username"/> |
||||||
|
<result column="password" property="password"/> |
||||||
|
<result column="remark" property="remark"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<!-- 数据源查询映射结果 --> |
||||||
|
<resultMap id="visualDbResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualDbDto"> |
||||||
|
<id column="id" property="id"/> |
||||||
|
<result column="name" property="name"/> |
||||||
|
<result column="driver_class" property="driverClass"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<!-- 数据源列表查询 --> |
||||||
|
<select id="dbList" resultMap="visualDbResultMap"> |
||||||
|
select id, name, driver_class from common_visual_db |
||||||
|
</select> |
||||||
|
|
||||||
|
<!-- 动态SQL查询 --> |
||||||
|
<select id="dynamicQuery" parameterType="String" resultType="java.util.LinkedHashMap"> |
||||||
|
${value} |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualMapMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualMapResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualMapDto"> |
||||||
|
<id column="id" property="id"/> |
||||||
|
<result column="name" property="name"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
|
||||||
|
<select id="selectVisualMapPage" resultMap="visualMapResultMap"> |
||||||
|
select id, name from common_visual_map |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,21 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.entity.Visual"> |
||||||
|
<result column="id" property="id"/> |
||||||
|
<result column="create_user" property="createUser"/> |
||||||
|
<result column="create_dept" property="createDept"/> |
||||||
|
<result column="create_time" property="createTime"/> |
||||||
|
<result column="update_user" property="updateUser"/> |
||||||
|
<result column="update_time" property="updateTime"/> |
||||||
|
<result column="status" property="status"/> |
||||||
|
<result column="is_deleted" property="isDeleted"/> |
||||||
|
<result column="title" property="title"/> |
||||||
|
<result column="img" property="img"/> |
||||||
|
<result column="category" property="category"/> |
||||||
|
<result column="password" property="password"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,46 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.cloud.kicc.commonbiz.bigscreen.mapper.VisualRecordMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualRecordResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.entity.VisualRecord"> |
||||||
|
<result column="id" property="id"/> |
||||||
|
<result column="name" property="name"/> |
||||||
|
<result column="url" property="url"/> |
||||||
|
<result column="data_type" property="dataType"/> |
||||||
|
<result column="data_method" property="dataMethod"/> |
||||||
|
<result column="data_header" property="dataHeader"/> |
||||||
|
<result column="data" property="data"/> |
||||||
|
<result column="data_query" property="dataQuery"/> |
||||||
|
<result column="data_query_type" property="dataQueryType"/> |
||||||
|
<result column="data_formatter" property="dataFormatter"/> |
||||||
|
<result column="ws_url" property="wsUrl"/> |
||||||
|
<result column="create_user" property="createUser"/> |
||||||
|
<result column="create_dept" property="createDept"/> |
||||||
|
<result column="create_time" property="createTime"/> |
||||||
|
<result column="update_user" property="updateUser"/> |
||||||
|
<result column="update_time" property="updateTime"/> |
||||||
|
<result column="status" property="status"/> |
||||||
|
<result column="is_deleted" property="isDeleted"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="visualRecordDTOResultMap" type="com.cloud.kicc.commonbiz.api.bigscreen.dto.VisualRecordDto"> |
||||||
|
<result column="id" property="id"/> |
||||||
|
<result column="name" property="name"/> |
||||||
|
<result column="data_type" property="dataType"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<select id="selectVisualRecordPage" resultMap="visualRecordDTOResultMap"> |
||||||
|
select id, name, data_type from common_visual_record where del_flag = 0 |
||||||
|
<where> |
||||||
|
<if test="visualRecord.name!=null"> |
||||||
|
and name like concat(concat('%', #{visualRecord.name}), '%') |
||||||
|
</if> |
||||||
|
<if test="visualRecord.dataType!=null"> |
||||||
|
and data_type = #{visualRecord.dataType} |
||||||
|
</if> |
||||||
|
</where> |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
Loading…
Reference in new issue