yang_shj
1 year ago
57 changed files with 1453 additions and 268 deletions
@ -0,0 +1,47 @@ |
|||||||
|
package com.hnac.hzims.fdp.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 模型VO |
||||||
|
* |
||||||
|
* @author tangyu |
||||||
|
* @created 2023-07-03 17:38 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@NoArgsConstructor |
||||||
|
@AllArgsConstructor |
||||||
|
public class FdpFaultRealDataVO { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 监测点ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty("监测点ID") |
||||||
|
private String monitorId; |
||||||
|
|
||||||
|
@ApiModelProperty("监测点名称") |
||||||
|
private String name; |
||||||
|
@ApiModelProperty("位置") |
||||||
|
private String ord; |
||||||
|
@ApiModelProperty("单代表对应一个实时数据,多代表对应一组实时数据") |
||||||
|
private String multi; |
||||||
|
@ApiModelProperty("数据的物模型id") |
||||||
|
private String instance; |
||||||
|
@ApiModelProperty("数据的物模型属性:如果multi是“多”,则包含该字符串起始的所有属性") |
||||||
|
private String identifier; |
||||||
|
@ApiModelProperty("物模型是否开机:无法获取当作开机处理") |
||||||
|
private Boolean powerOn; |
||||||
|
|
||||||
|
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组") |
||||||
|
private List<String> real; |
||||||
|
@ApiModelProperty("实时数据时间,如果MULTI是“单”则为数值,MULTI是“多”则为数组") |
||||||
|
private List<Date> realTime; |
||||||
|
} |
@ -1,8 +1,28 @@ |
|||||||
package com.hnac.hzinfo.inspect; |
package com.hnac.hzinfo.inspect; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
/** |
/** |
||||||
* @Author: py |
* @Author: py |
||||||
*/ |
*/ |
||||||
public class Constants { |
public class Constants { |
||||||
public final static String APP_NAME = "hzinfo-inspect"; |
public final static String APP_NAME = "hzinfo-inspect"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型, 0普通巡检,1视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
public enum InspectTypeEnum{ |
||||||
|
/**0普通巡检**/ |
||||||
|
COMMON("0"), |
||||||
|
/**1视频自动巡检**/ |
||||||
|
VIDEO("1"), |
||||||
|
/**2机器人巡检**/ |
||||||
|
ROBOT("2"); |
||||||
|
private final String val; |
||||||
|
InspectTypeEnum(String val){ |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,49 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author huangxing |
||||||
|
* 巡检配置常量 |
||||||
|
*/ |
||||||
|
public interface ObjectConstants { |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检模板重复记录类型 |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@Getter |
||||||
|
enum TemplateRecordEnum { |
||||||
|
/**允许**/ |
||||||
|
ALLOW("1","允许"), |
||||||
|
/**禁止**/ |
||||||
|
FORBIDDEN("0","禁止") |
||||||
|
; |
||||||
|
|
||||||
|
private final String recordType; |
||||||
|
private final String describe; |
||||||
|
} |
||||||
|
|
||||||
|
@Getter |
||||||
|
@AllArgsConstructor |
||||||
|
enum TemplateEnableEnum { |
||||||
|
/**启用**/ |
||||||
|
YES(0), |
||||||
|
/**弃用**/ |
||||||
|
no(1) |
||||||
|
; |
||||||
|
private final Integer enableType; |
||||||
|
} |
||||||
|
|
||||||
|
@Getter |
||||||
|
@AllArgsConstructor |
||||||
|
enum ProjectEnableEnum { |
||||||
|
/**启用**/ |
||||||
|
YES(0), |
||||||
|
/**弃用**/ |
||||||
|
no(1) |
||||||
|
; |
||||||
|
private final Integer enableType; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.dto; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDTO |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 19:22 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
|
||||||
|
public class ContentDTO extends ContentEntity implements Serializable { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.dto; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionDTO |
||||||
|
* @description: 巡检定义VO对象 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 19:00 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@ApiModel("巡检定义DTO对象") |
||||||
|
@EqualsAndHashCode |
||||||
|
public class ContentDefinitionDTO extends ContentDefinitionEntity implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty("id,按逗号分隔") |
||||||
|
private String ids; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.dto; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ProjectDTO |
||||||
|
* @description: 设备巡检项目DTO对象 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-29 16:06 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@ApiModel("设备巡检项目DTO对象") |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
public class ProjectDTO extends ProjectEntity implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty("巡检内容DTO对象") |
||||||
|
private List<ContentDTO> contentDTOList; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,92 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.entity; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.support.QueryField; |
||||||
|
import org.springblade.core.mp.support.SqlCondition; |
||||||
|
import org.springblade.core.tenant.mp.TenantEntity; |
||||||
|
|
||||||
|
import javax.validation.constraints.Size; |
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionEntity |
||||||
|
* @description: 巡检内容定义 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 18:27 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
public class ContentDefinitionEntity extends TenantEntity implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容编码") |
||||||
|
private String code; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容名称,长度必须为1到128") |
||||||
|
@Size(min=1,max = 128,message ="内容名称长度必须为1到128") |
||||||
|
private String name; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容描述,长度必须为0到512") |
||||||
|
@Size(min=0,max = 512,message ="内容描述长度必须为0到512") |
||||||
|
private String description; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "记录类型 0不记录 1仅选择 2仅记值 3选择并记值") |
||||||
|
private String recordType; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "检测类型") |
||||||
|
private String checkType; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "检测类型子类") |
||||||
|
private String checkTypeSon; |
||||||
|
|
||||||
|
// @JsonSerialize(nullsUsing = NullSerializer.class)
|
||||||
|
// @ApiModelProperty(value = "表针识别,表盘ID")
|
||||||
|
// private Long clockId;
|
||||||
|
|
||||||
|
// @JsonSerialize(nullsUsing = NullSerializer.class)
|
||||||
|
// @ApiModelProperty(value = "视频巡检摄像机ID")
|
||||||
|
// private Long cameraId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "记值方式为选择时选择值") |
||||||
|
private String dictType; |
||||||
|
|
||||||
|
// @ApiModelProperty(value = "上限值")
|
||||||
|
// private Double upLimit;
|
||||||
|
//
|
||||||
|
// @ApiModelProperty(value = "下限值")
|
||||||
|
// private Double downLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "问题排除建议") |
||||||
|
private String suggestion; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序") |
||||||
|
private Integer sort; |
||||||
|
|
||||||
|
@ApiModelProperty(value = " inspectType 支持的巡检类型 0普通巡检,1视频自动巡检,2机器人巡检") |
||||||
|
private String supportAutoVideo; |
||||||
|
|
||||||
|
// @ApiModelProperty(value = "开关/灯/表盘在摄像机可视面二维坐标位置,例如:2,1 表示第三行第二列,行列均从0开始记录,默认 0,0,如果有多张图则:0,0,1( 最后一位表示所在图片,最后一位1表示第二张图),默认0,0,0")
|
||||||
|
// private String cameraAddr;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "其他参数,例如多联断路器内断路器的个数") |
||||||
|
private String otherParam; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "校验值,用来判断当前值是否正确:枚举数据通过 “ , ”隔开, 区间通过~隔开") |
||||||
|
private String checkVal; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定物模型标识") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String modelSignage; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定物模型属性标识") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String attrSignage; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定物模型属性标识") |
||||||
|
@QueryField(condition = SqlCondition.LIKE) |
||||||
|
private String attrName; |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.Constants; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentVO; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
|
||||||
|
@FeignClient(value = Constants.APP_NAME) |
||||||
|
public interface IContentClient { |
||||||
|
String API_PREFIX = "/feign/content"; |
||||||
|
String DETAIL = API_PREFIX + "/detail"; |
||||||
|
String SAVE_BATCH = API_PREFIX + "/saveBatch"; |
||||||
|
String LIST = API_PREFIX + "/list"; |
||||||
|
String SAVE_OR_UPDATE_BATCH = API_PREFIX + "/saveOrUpdateBatch"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据ID查询设备巡检内容详情 |
||||||
|
* @param id 主键ID |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(DETAIL) |
||||||
|
R<ContentVO> detail(Long id); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.Constants; |
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName IContentDefinitionClient |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 14:15 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@FeignClient(value = Constants.APP_NAME) |
||||||
|
public interface IContentDefinitionClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/feign/content/definition"; |
||||||
|
String DETAIL = API_PREFIX + "/detail"; |
||||||
|
String SAVE_BATCH = API_PREFIX + "/saveBatch"; |
||||||
|
String LIST = API_PREFIX + "/list"; |
||||||
|
String SAVE_OR_UPDATE_BATCH = API_PREFIX + "/saveOrUpdateBatch"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 查看巡检内容定义详情 |
||||||
|
* @param id 主键 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(DETAIL) |
||||||
|
R<ContentDefinitionVO> detail(@RequestParam Long id); |
||||||
|
|
||||||
|
/** |
||||||
|
* 批量保存巡检内容定义 |
||||||
|
* @param request ContentDefinitionDTO列表 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@PostMapping(SAVE_BATCH) |
||||||
|
R<Boolean> saveBatch(@RequestBody List<ContentDefinitionDTO> request); |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询列表 |
||||||
|
* @param request 筛选条件 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(LIST) |
||||||
|
R<List<ContentDefinitionVO>> list(ContentDefinitionDTO request); |
||||||
|
|
||||||
|
/** |
||||||
|
* 批量更新 |
||||||
|
* @param request |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(SAVE_OR_UPDATE_BATCH) |
||||||
|
R<Boolean> saveOrUpdateBatch(List<ContentDefinitionDTO> request); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.Constants; |
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ProjectEntity; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@FeignClient(value = Constants.APP_NAME) |
||||||
|
public interface IProjectClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/feign/project"; |
||||||
|
String ADD_PROJECT_AND_CONTENT = API_PREFIX + "/addProjectAndContent"; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 批量新增/更新项目 |
||||||
|
* @param request ProjectEntity 列表 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@PostMapping(ADD_PROJECT_AND_CONTENT) |
||||||
|
R<Boolean> addProjectAndContent(@RequestBody @Valid List<ProjectDTO> request); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.vo; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionVO |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 19:00 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
@ApiModel("巡检内容定义VO对象") |
||||||
|
public class ContentDefinitionVO extends ContentDefinitionEntity implements Serializable { |
||||||
|
|
||||||
|
@ApiModelProperty("创建人名称") |
||||||
|
private String creatorName; |
||||||
|
|
||||||
|
@ApiModelProperty("更新人名称") |
||||||
|
private String updateUserName; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.vo; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentVO |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 19:20 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@EqualsAndHashCode |
||||||
|
@Data |
||||||
|
@ApiModel(value = "设备巡检内容VO对象",description = "设备巡检内容VO对象") |
||||||
|
public class ContentVO extends ContentEntity implements Serializable { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.wrapper; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
|
||||||
|
import java.util.Optional; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionWrapper |
||||||
|
* @description: 巡检内容定义 entity -> VO 转换类 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 19:04 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
|
||||||
|
public class ContentDefinitionWrapper extends BaseEntityWrapper<ContentDefinitionEntity, ContentDefinitionVO> { |
||||||
|
|
||||||
|
public static ContentDefinitionWrapper build() { |
||||||
|
return new ContentDefinitionWrapper(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ContentDefinitionVO entityVO(ContentDefinitionEntity entity) { |
||||||
|
ContentDefinitionVO definitionVO = BeanUtil.copy(entity, ContentDefinitionVO.class); |
||||||
|
return definitionVO; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.wrapper; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentVO; |
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentWrapper |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 19:28 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
public class ContentWrapper extends BaseEntityWrapper<ContentEntity, ContentVO> { |
||||||
|
|
||||||
|
public static ContentWrapper build() { |
||||||
|
return new ContentWrapper(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ContentVO entityVO(ContentEntity entity) { |
||||||
|
ContentVO contentVO = BeanUtil.copy(entity, ContentVO.class); |
||||||
|
return contentVO; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.dao; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
@Mapper |
||||||
|
public interface ContentDefinitionMapper extends BaseMapper<ContentDefinitionEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.services.ContentService; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentVO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.wrapper.ContentWrapper; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.util.Optional; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentClient |
||||||
|
* @description: 设备巡检内容 feign 接口实现类 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 19:49 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
@RestController |
||||||
|
public class ContentClient extends BladeController implements IContentClient { |
||||||
|
|
||||||
|
private final ContentService contentService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public R<ContentVO> detail(Long id) { |
||||||
|
ContentEntity entity = contentService.getById(id); |
||||||
|
return R.data(Optional.ofNullable(entity).map(content -> ContentWrapper.build().entityVO(content)).orElse(null)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON; |
||||||
|
import com.alibaba.fastjson.JSONArray; |
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import oracle.jdbc.proxy.annotation.Post; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Optional; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionClient |
||||||
|
* @description: 巡检内容定义feign接口 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-26 14:20 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
public class ContentDefinitionClient implements IContentDefinitionClient { |
||||||
|
|
||||||
|
private final IContentDefinitionService contentDefinitionService; |
||||||
|
|
||||||
|
@Override |
||||||
|
@GetMapping(DETAIL) |
||||||
|
public R<ContentDefinitionVO> detail(@RequestParam Long id) { |
||||||
|
ContentDefinitionEntity entity = contentDefinitionService.getById(id); |
||||||
|
return R.data(Optional.ofNullable(entity).map(content -> ContentDefinitionWrapper.build().entityVO(content)).orElse(null)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping(SAVE_BATCH) |
||||||
|
public R<Boolean> saveBatch(@RequestBody List<ContentDefinitionDTO> request) { |
||||||
|
List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); |
||||||
|
return R.data(contentDefinitionService.saveBatch(list)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@GetMapping(LIST) |
||||||
|
public R<List<ContentDefinitionVO>> list(ContentDefinitionDTO request) { |
||||||
|
return R.data(contentDefinitionService.list(request)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping(SAVE_OR_UPDATE_BATCH) |
||||||
|
public R<Boolean> saveOrUpdateBatch(List<ContentDefinitionDTO> request) { |
||||||
|
List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); |
||||||
|
return R.data(contentDefinitionService.saveOrUpdateBatch(list)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.feign; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.services.ProjectService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ProjectClient |
||||||
|
* @description: |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-29 16:10 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
public class ProjectClient extends BladeController implements IProjectClient { |
||||||
|
|
||||||
|
private final ProjectService projectService; |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping(ADD_PROJECT_AND_CONTENT) |
||||||
|
public R<Boolean> addProjectAndContent(@RequestBody @Valid List<ProjectDTO> request) { |
||||||
|
return R.data(projectService.addProjectAndContent(request)); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
@Mapper |
||||||
|
public interface ContentDefinitionMapper extends BaseMapper<ContentDefinitionEntity> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.services; |
||||||
|
|
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface IContentDefinitionService extends BaseService<ContentDefinitionEntity> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据筛选条件获取列表 |
||||||
|
* @param request 筛选条件 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<ContentDefinitionVO> list(ContentDefinitionDTO request); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.services.impl; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.mapper.ContentDefinitionMapper; |
||||||
|
import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionServiceImpl |
||||||
|
* @description: 巡检内容定义service类 |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 18:48 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
@Slf4j |
||||||
|
public class ContentDefinitionServiceImpl extends BaseServiceImpl<ContentDefinitionMapper, ContentDefinitionEntity> |
||||||
|
implements IContentDefinitionService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<ContentDefinitionVO> list(ContentDefinitionDTO request) { |
||||||
|
QueryWrapper<ContentDefinitionEntity> queryWrapper = Condition.getQueryWrapper(BeanUtil.copy(request, ContentDefinitionEntity.class)); |
||||||
|
LambdaQueryWrapper<ContentDefinitionEntity> lambda = queryWrapper.lambda(); |
||||||
|
lambda.in(StringUtil.isNotBlank(request.getIds()),ContentDefinitionEntity::getId,Func.toLongList(",",request.getIds())); |
||||||
|
return ContentDefinitionWrapper.build().listVO(this.list(lambda)); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package com.hnac.hzinfo.inspect.obj.web; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; |
||||||
|
import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService; |
||||||
|
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; |
||||||
|
import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
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.BeanUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ContentDefinitionController |
||||||
|
* @description: 巡检内容定义controller |
||||||
|
* @author: hx |
||||||
|
* @create: 2023-06-20 19:13 |
||||||
|
* @Version 4.0 |
||||||
|
**/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/content/definition") |
||||||
|
@Api(value = "巡检内容定义管理",tags = "巡检内容定义管理") |
||||||
|
@AllArgsConstructor |
||||||
|
public class ContentDefinitionController extends BladeController { |
||||||
|
|
||||||
|
private final IContentDefinitionService contentDefinitionService; |
||||||
|
|
||||||
|
@GetMapping("/page") |
||||||
|
@ApiOperation("分页查询") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
public R<IPage<ContentDefinitionVO>> page(ContentDefinitionDTO content, Query query) { |
||||||
|
QueryWrapper<ContentDefinitionEntity> queryWrapper = Condition.getQueryWrapper(BeanUtil.copy(content, ContentDefinitionEntity.class)); |
||||||
|
queryWrapper.lambda().eq(Func.isEmpty(content.getCreateDept()),ContentDefinitionEntity::getCreateDept,content.getCreateDept()) |
||||||
|
.eq(Func.isEmpty(content.getCreateUser()),ContentDefinitionEntity::getCreateUser,content.getCreateUser()); |
||||||
|
IPage page = contentDefinitionService.page(Condition.getPage(query), queryWrapper); |
||||||
|
page.setRecords(ContentDefinitionWrapper.build().listVO(page.getRecords())); |
||||||
|
return R.data(page); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
-- 创建巡检内容定义表结构 |
||||||
|
CREATE TABLE IF NOT EXISTS `hz_st_re_content_definition` ( |
||||||
|
`ID` bigint(64) NOT NULL COMMENT 'ID', |
||||||
|
`CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容编码:由系统自动生成自动生成', |
||||||
|
`NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容名称', |
||||||
|
`DESCRIPTION` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容描述', |
||||||
|
`RECORD_TYPE` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '记录类型 0不记录 1仅选择 2仅记值 3选择并记值', |
||||||
|
`CHECK_TYPE` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检测类型 原来数据字典 暂时设计只支持99个类型', |
||||||
|
`CREATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||||
|
`CREATE_DEPT` bigint(64) NULL DEFAULT NULL COMMENT '创建部门', |
||||||
|
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', |
||||||
|
`UPDATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||||
|
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '修改时间', |
||||||
|
`STATUS` int(2) NULL DEFAULT 0 COMMENT '状态', |
||||||
|
`IS_DELETED` int(2) NOT NULL DEFAULT 0 COMMENT '是否已删除', |
||||||
|
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户', |
||||||
|
`CLOCK_ID` bigint(20) NULL DEFAULT NULL COMMENT '表针识别,表盘ID', |
||||||
|
`CAMERA_ID` bigint(20) NULL DEFAULT NULL COMMENT '视频巡检摄像机ID', |
||||||
|
`DICT_TYPE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '记值方式为选择时选择值', |
||||||
|
`UP_LIMIT` double NULL DEFAULT NULL COMMENT '上限值', |
||||||
|
`DOWN_LIMIT` double NULL DEFAULT NULL COMMENT '下限值', |
||||||
|
`SUGGESTION` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '问题排除建议', |
||||||
|
`SORT` int(11) NULL DEFAULT 0 COMMENT '排序', |
||||||
|
`SUPPORT_AUTO_VIDEO` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是支持的巡检类型 0普通巡检 1视频自动巡检 2机器人巡检', |
||||||
|
`CHECK_TYPE_SON` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '存字典表key 检测类型子类 子类的子类通过-隔开例如:1-12', |
||||||
|
`CAMERA_ADDR` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '开关/灯/表盘在摄像机可视面二维坐标位置 例如:2 1 表示第三行第二列 行列均从0开始记录 默认 0 0 如果有多张图则:0 0 1( 最后一位表示所在图片 最后一位1表示第二张图) 默认0 0 0', |
||||||
|
`OTHER_PARAM` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他参数 例如多联断路器内断路器的个数', |
||||||
|
`CHECK_VAL` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '校验值 用来判断当前值是否正确:枚举数据通过 “ ”隔开 区间通过~隔开', |
||||||
|
PRIMARY KEY (`ID`) USING BTREE, |
||||||
|
UNIQUE INDEX `UK_OBJECT_CONTENT_CODE`(`CODE`) USING BTREE, |
||||||
|
INDEX `idx_is_deleted_tenant_id`(`IS_DELETED`, `TENANT_ID`) USING BTREE |
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '巡检对象内容' ROW_FORMAT = Dynamic; |
||||||
|
SET FOREIGN_KEY_CHECKS = 1; |
||||||
|
|
||||||
|
-- 巡检内容定义添加物模型标识字段 |
||||||
|
alter table hz_st_re_content add COLUMN `model_signage` VARCHAR(64) comment '模型标识'; |
||||||
|
-- 巡检内容定义添加物模型属性标识字段 |
||||||
|
alter table hz_st_re_content add COLUMN `attr_signage` VARCHAR(50) comment '属性标识'; |
||||||
|
-- 巡检内容定义添加物模型属性名称字段 |
||||||
|
alter table hz_st_re_content add COLUMN `attr_name` VARCHAR(64) comment '属性名称'; |
||||||
|
|
||||||
|
-- 设备巡检内容添加物模型标识字段 |
||||||
|
alter table hz_st_re_content add COLUMN `model_signage` VARCHAR(64) comment '模型标识'; |
||||||
|
-- 设备巡检内容添加物模型属性标识字段 |
||||||
|
alter table hz_st_re_content add COLUMN `attr_signage` VARCHAR(50) comment '属性标识'; |
||||||
|
-- 设备巡检内容添加物模型属性名称字段 |
||||||
|
alter table hz_st_re_content add COLUMN `attr_name` VARCHAR(64) comment '属性名称'; |
||||||
|
-- 设备巡检内容添加采集点ID字段 |
||||||
|
alter table hz_st_re_content add COLUMN `fac_device_id` VARCHAR(64) comment '关联的hz3000设备id'; |
||||||
|
-- 设备巡检内容添加采集点名称字段 |
||||||
|
alter table hz_st_re_content add COLUMN `fac_device_name` VARCHAR(64) comment '关联的hz3000设备名称'; |
||||||
|
|
||||||
|
-- 设备巡检项目添加设备编号字段 |
||||||
|
alter table hz_st_re_project add COLUMN `em_code` VARCHAR(50) comment '设备编号'; |
||||||
|
|
||||||
|
-- 设备巡检对象添加设备字段 |
||||||
|
alter table hz_st_re_object add COLUMN `em_codes` VARCHAR(255) comment '设备编号,按逗号分隔'; |
||||||
|
|
Loading…
Reference in new issue