更换git仓库后的提交
This commit is contained in:
33
cn-zutai/.gitignore
vendored
Normal file
33
cn-zutai/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
60
cn-zutai/pom.xml
Normal file
60
cn-zutai/pom.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.njcn.product</groupId>
|
||||
<artifactId>CN_Product</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cn-zutai</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>cn-zutai</name>
|
||||
<description>cn-zutai</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>njcn-common</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>spingboot2.3.12</artifactId>
|
||||
<version>2.3.12</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-web</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.njcn.product.cnzutai.zutai.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
|
||||
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsConfigurationParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsConfigurationVO;
|
||||
import com.njcn.product.cnzutai.zutai.service.CsConfigurationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* (cs_configuration)表控制层
|
||||
*
|
||||
* @author xxxxx
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/cs-harmonic-boot/csconfiguration")
|
||||
@Api(tags = "组态项目")
|
||||
@AllArgsConstructor
|
||||
public class CsConfigurationController extends BaseController {
|
||||
|
||||
private final CsConfigurationService csConfigurationService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增组态项目")
|
||||
@ApiImplicitParam(name = "csConfigurationParm", value = "新增组态项目参数", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated CsConfigurationParm csConfigurationParm){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
|
||||
boolean save = csConfigurationService.add(csConfigurationParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/audit")
|
||||
@ApiOperation("修改组态项目")
|
||||
@ApiImplicitParam(name = "auditParm", value = "修改组态项目参数", required = true)
|
||||
public HttpResult<Boolean> audit(@RequestBody @Validated CsConfigurationParm.CsConfigurationAuditParam auditParm){
|
||||
String methodDescribe = getMethodDescribe("audit");
|
||||
|
||||
boolean save = csConfigurationService.audit (auditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/active")
|
||||
@ApiOperation("激活组态项目")
|
||||
public HttpResult<Boolean> active(@RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("active");
|
||||
boolean active = csConfigurationService.active(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, active, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getActive")
|
||||
@ApiOperation("获取激活组态项目")
|
||||
public HttpResult<CsConfigurationPO> getActive(){
|
||||
String methodDescribe = getMethodDescribe("active");
|
||||
CsConfigurationPO active = csConfigurationService.getActive();
|
||||
if(Objects.nonNull(active)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, active, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("组态项目分页查询")
|
||||
@ApiImplicitParam(name = "csConfigurationQueryParam", value = "组态项目查询参数", required = true)
|
||||
public HttpResult<IPage<CsConfigurationVO>> queryPage(@RequestBody @Validated CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam ){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
|
||||
IPage<CsConfigurationVO> page = csConfigurationService.queryPage (csConfigurationQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||
@PostMapping("/uploadImage")
|
||||
@ApiOperation("上传底图")
|
||||
@ApiImplicitParam(name = "file", value = "底图文件", required = true)
|
||||
public HttpResult<MinIoUploadResDTO> uploadImage(@RequestParam("file") MultipartFile issuesFile){
|
||||
String methodDescribe = getMethodDescribe("uploadImage");
|
||||
String filePath = csConfigurationService.uploadImage(issuesFile);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,new MinIoUploadResDTO(issuesFile.getOriginalFilename(),filePath), methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.njcn.product.cnzutai.zutai.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsPageParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsPageVO;
|
||||
import com.njcn.product.cnzutai.zutai.service.CsPagePOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* (cs_page)表控制层
|
||||
*
|
||||
* @author xxxxx
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cs-harmonic-boot/cspage")
|
||||
@Api(tags = "组态项目页面")
|
||||
@AllArgsConstructor
|
||||
public class CsPagePOController extends BaseController {
|
||||
private final CsPagePOService csPagePOService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增组态页面")
|
||||
// @ApiImplicitParam(name = "csPageParm", value = "新增组态项目参数", required = true)
|
||||
public HttpResult<Boolean> add( @Validated CsPageParm csPageParm){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
|
||||
boolean flag = csPagePOService.add (csPageParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/audit")
|
||||
@ApiOperation("修改组态页面")
|
||||
public HttpResult<Boolean> audit( @Validated CsPageParm.CsPageParmAuditParam auditParm){
|
||||
String methodDescribe = getMethodDescribe("audit");
|
||||
|
||||
boolean save = csPagePOService.audit (auditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("组态页面分页查询")
|
||||
@ApiImplicitParam(name = "csPageParam", value = "组态项目查询参数", required = true)
|
||||
public HttpResult<IPage<CsPageVO>> queryPage(@RequestBody @Validated CsPageParm.CsPageParmQueryParam csPageParam ){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
|
||||
IPage<CsPageVO> page = csPagePOService.queryPage (csPageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.njcn.product.cnzutai.zutai.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.ElementParam;
|
||||
import com.njcn.product.cnzutai.zutai.service.IElementService;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsElement;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/7/12 16:07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("cs-system-boot/csElement")
|
||||
@Api(tags = "组态图元")
|
||||
@AllArgsConstructor
|
||||
public class ElementController extends BaseController {
|
||||
|
||||
private final IElementService csElementService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增图元")
|
||||
public HttpResult<CsElement> add(@Validated ElementParam param){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
CsElement csElement = csElementService.addElement(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csElement, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/find")
|
||||
@ApiOperation("查询图元")
|
||||
public HttpResult<List<CsElement>> find(){
|
||||
String methodDescribe = getMethodDescribe("find");
|
||||
List<CsElement> list = csElementService.findElement();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除图元")
|
||||
@ApiImplicitParam(name = "id", value = "图元Id", required = true)
|
||||
public HttpResult<String> deleteById(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("deleteById");
|
||||
csElementService.deleteById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.product.cnzutai.zutai.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsRtDataVO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.RealTimeDataVo;
|
||||
import com.njcn.product.cnzutai.zutai.service.ILineTargetService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/09/10 下午 7:46【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/data")
|
||||
@Api(tags = "装置数据")
|
||||
@AllArgsConstructor
|
||||
public class RealTimeDataController extends BaseController {
|
||||
private final ILineTargetService lineTargetService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/realTimeData")
|
||||
@ApiOperation("设备监控-》准实时数据")
|
||||
public HttpResult<List<CsRtDataVO>> realTimeData(@RequestParam String pageId) {
|
||||
String methodDescribe = getMethodDescribe("realTimeData");
|
||||
List<CsRtDataVO> lineData = lineTargetService.getLineData(pageId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineData, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.product.cnzutai.zutai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsConfigurationParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsConfigurationMapper extends BaseMapper<CsConfigurationPO> {
|
||||
Page<CsConfigurationPO> queryPage(Page<CsConfigurationPO> temppage, @Param("temp") CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.product.cnzutai.zutai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsElement;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组态图元库 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-06-14
|
||||
*/
|
||||
public interface CsElementMapper extends BaseMapper<CsElement> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.product.cnzutai.zutai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsPagePO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsPagePOMapper extends BaseMapper<CsPagePO> {
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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.njcn.product.cnzutai.zutai.mapper.CsConfigurationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cs_configuration-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, `name`, `status`, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
<select id="queryPage" resultMap="BaseResultMap">
|
||||
select * from cs_configuration a where a.status="1"
|
||||
<!-- and
|
||||
SUBSTRING_INDEX(a.project_ids,',',1) in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>-->
|
||||
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
|
||||
AND a.name like concat(concat("%",#{temp.searchValue}),"%")
|
||||
</if>
|
||||
<if test="temp!=null and temp.searchEndTime != null and temp.searchEndTime !=''">
|
||||
AND a.create_time <= #{temp.searchEndTime}
|
||||
</if>
|
||||
<if test="temp!=null and temp.searchBeginTime != null and temp.searchBeginTime !=''">
|
||||
AND a.create_time >= #{temp.searchBeginTime}
|
||||
</if>
|
||||
<if test="temp!=null and temp.id != null and temp.id !=''">
|
||||
AND a.id = #{temp.id}
|
||||
</if>
|
||||
order by a.order_by asc,create_time desc
|
||||
|
||||
</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.njcn.product.cnzutai.zutai.mapper.CsPagePOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.product.cnzutai.zutai.pojo.po.CsPagePO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cs_page-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="path" jdbcType="VARCHAR" property="path" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pid, `name`, `path`, `status`, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/09/18 下午 1:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class AskRealTimeDataDTO {
|
||||
private String pageId;
|
||||
private List<String> lineIdList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.dto;
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.RealTimeDataVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/09/18 下午 2:00【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RealTimeDataDTO {
|
||||
private Integer code;
|
||||
private String message;
|
||||
private Integer type =1;
|
||||
// private List<RealTimeDataVo> realTimeDataVoList;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/14 20:07
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ZuTaiDTO {
|
||||
|
||||
private List<DiagramElement> json;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class DiagramElement{
|
||||
|
||||
private String id;
|
||||
private String title;
|
||||
private String keyId;
|
||||
private String type;
|
||||
private boolean resize;
|
||||
private boolean rotate;
|
||||
private boolean lock;
|
||||
private boolean active;
|
||||
private boolean hide;
|
||||
private String tag;
|
||||
private boolean use_proportional_scaling;
|
||||
private String lineId;
|
||||
private List<String> lineList;
|
||||
private String lineName;
|
||||
@JsonProperty("UID")
|
||||
private List<List<String>> uid;
|
||||
@JsonProperty("UIDNames")
|
||||
|
||||
private List<String> uidNames;
|
||||
private List<String> unit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @date 2023年04月17日 10:50
|
||||
*/
|
||||
@Getter
|
||||
public enum CsSystemResponseEnum {
|
||||
|
||||
/**
|
||||
* A0301 ~ A0399 用于治理系统模块的枚举
|
||||
* <p>
|
||||
*/
|
||||
DICT_REPEAT("A0301","字典数据重复!"),
|
||||
SAME_DATA_ERROR("A0301","数据重复"),
|
||||
|
||||
CS_SYSTEM_COMMON_ERROR("A00302","治理系统模块异常"),
|
||||
BIND_TARGET_ERROR("A00601","指标参数绑定异常"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
CsSystemResponseEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:35【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CsConfigurationParm {
|
||||
|
||||
|
||||
/**
|
||||
* 组态项目名称
|
||||
*/
|
||||
@ApiModelProperty(value = "组态项目名称")
|
||||
@NotBlank(message="组态项目名称不能为空")
|
||||
private String name;
|
||||
|
||||
private String remark;
|
||||
|
||||
private List<String> projectIds;
|
||||
|
||||
|
||||
private Integer orderBy;
|
||||
|
||||
private String fileContent;
|
||||
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsConfigurationAuditParam extends CsConfigurationParm {
|
||||
@ApiModelProperty("Id")
|
||||
@NotBlank(message = "id不为空")
|
||||
private String id;
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsConfigurationQueryParam extends BaseParam {
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CsPageParm {
|
||||
|
||||
/**
|
||||
* 组态项目id
|
||||
*/
|
||||
@ApiModelProperty(value="组态项目id")
|
||||
private String pid;
|
||||
|
||||
private MultipartFile multipartFile;
|
||||
|
||||
/**
|
||||
* 组态页面文件路径
|
||||
*/
|
||||
@ApiModelProperty(value = "组态页面json文件")
|
||||
private String jsonFile;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsPageParmAuditParam extends CsPageParm {
|
||||
@ApiModelProperty("Id")
|
||||
@NotBlank(message = "id不为空")
|
||||
private String id;
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
}
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsPageParmQueryParam extends BaseParam {
|
||||
@ApiModelProperty("pid")
|
||||
private String pid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/7/12 16:23
|
||||
*/
|
||||
@Data
|
||||
public class ElementParam {
|
||||
|
||||
@ApiModelProperty(value = "组件分类")
|
||||
@NotBlank(message="组件分类不能为空!")
|
||||
private String elementType;
|
||||
|
||||
@ApiModelProperty(value = "组件子类型")
|
||||
@NotBlank(message="组件子类型不能为空!")
|
||||
private String elementSonType;
|
||||
|
||||
@ApiModelProperty(value = "组件编码")
|
||||
private String elementCode;
|
||||
|
||||
@ApiModelProperty(value = "组件名称")
|
||||
private String elementName;
|
||||
|
||||
@ApiModelProperty(value = "组件标识")
|
||||
private String elementMark;
|
||||
|
||||
@ApiModelProperty(value = "图元文件")
|
||||
@NotNull(message="图元文件不能为空!")
|
||||
private MultipartFile multipartFile;
|
||||
|
||||
@ApiModelProperty(value = "图元类型")
|
||||
@NotBlank(message="图元类型不能为空!")
|
||||
private String elementForm;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:35【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "cs_configuration")
|
||||
public class CsConfigurationPO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 组态项目名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
@TableField(value = "image_path")
|
||||
private String imagePath;
|
||||
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
@TableField(value = "project_ids")
|
||||
private String projectIds;
|
||||
|
||||
@TableField(value = "order_By")
|
||||
private Integer orderBy;
|
||||
|
||||
/**
|
||||
* 是否激活 0.否 1.是
|
||||
*/
|
||||
private Integer active;
|
||||
|
||||
|
||||
/**
|
||||
* 状态 0:删除 1:正常
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_NAME = "name";
|
||||
|
||||
public static final String COL_STATUS = "status";
|
||||
|
||||
public static final String COL_CREATE_BY = "create_by";
|
||||
|
||||
public static final String COL_CREATE_TIME = "create_time";
|
||||
|
||||
public static final String COL_UPDATE_BY = "update_by";
|
||||
|
||||
public static final String COL_UPDATE_TIME = "update_time";
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组态图元库
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-06-14
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_element")
|
||||
public class CsElement extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 图元文件路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 组件分类
|
||||
*/
|
||||
private String elementType;
|
||||
|
||||
/**
|
||||
* 组件子类型
|
||||
*/
|
||||
private String elementSonType;
|
||||
|
||||
/**
|
||||
* 组件编码
|
||||
*/
|
||||
private String elementCode;
|
||||
|
||||
/**
|
||||
* 组件名称
|
||||
*/
|
||||
private String elementName;
|
||||
|
||||
/**
|
||||
* 组件标识
|
||||
*/
|
||||
private String elementMark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 图元类型
|
||||
*/
|
||||
private String elementForm;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "cs_page")
|
||||
public class CsPagePO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 组态项目id
|
||||
*/
|
||||
@TableField(value = "pid")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 组态页面名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
/*排序id
|
||||
* */
|
||||
@TableField(value = "k_id")
|
||||
private String kId;
|
||||
|
||||
/**
|
||||
* 组态页面文件路径
|
||||
*/
|
||||
@TableField(value = "`path`")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 组态页面状态
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_PID = "pid";
|
||||
|
||||
public static final String COL_NAME = "name";
|
||||
public static final String COL_KID = "k_id";
|
||||
|
||||
public static final String COL_PATH = "path";
|
||||
|
||||
public static final String COL_STATUS = "status";
|
||||
|
||||
public static final String COL_CREATE_BY = "create_by";
|
||||
|
||||
public static final String COL_CREATE_TIME = "create_time";
|
||||
|
||||
public static final String COL_UPDATE_BY = "update_by";
|
||||
|
||||
public static final String COL_UPDATE_TIME = "update_time";
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:35【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class CsConfigurationVO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 组态项目名称
|
||||
*/
|
||||
@ApiModelProperty(value = "组态项目名称")
|
||||
private String name;
|
||||
|
||||
private String fileContent;
|
||||
|
||||
private Integer orderBy;
|
||||
|
||||
private Integer active;
|
||||
|
||||
|
||||
private List<String> projectIds;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operater;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态 0:删除 1:正常
|
||||
*/
|
||||
@ApiModelProperty(value = "组态项目状态")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CsPageVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value="id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 组态项目id
|
||||
*/
|
||||
@ApiModelProperty(value="组态项目id")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty(value="前端使用")
|
||||
@JsonProperty("kId") // 强制前端使用 kId
|
||||
private String kId;
|
||||
|
||||
@ApiModelProperty(value="组态项目名称")
|
||||
private String configurationName;
|
||||
|
||||
|
||||
/**
|
||||
* 组态页面名称
|
||||
*/
|
||||
@ApiModelProperty(value="组态页面名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operater;
|
||||
|
||||
/**
|
||||
* 组态页面文件路径
|
||||
*/
|
||||
@ApiModelProperty(value="组态页面文件路径")
|
||||
private String path;
|
||||
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||
)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||
)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/25 13:31
|
||||
*/
|
||||
@Data
|
||||
public class CsRtDataVO {
|
||||
|
||||
@ApiModelProperty("图元id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
// @JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("相别")
|
||||
private String phaseType;
|
||||
|
||||
@ApiModelProperty("数据类型")
|
||||
private String valueType;
|
||||
|
||||
@ApiModelProperty("实时数据值,3.1415926则显示暂无数据")
|
||||
private Double value;
|
||||
|
||||
@ApiModelProperty("指标显示名称")
|
||||
private String statisticalName;
|
||||
|
||||
@ApiModelProperty("指标单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("指标名称")
|
||||
private String target;
|
||||
|
||||
@ApiModelProperty("指标最大值")
|
||||
private Double maxValue;
|
||||
|
||||
@ApiModelProperty("指标最小值")
|
||||
private Double minValue;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/14 13:36
|
||||
*/
|
||||
@Data
|
||||
public class DataArrayTreeVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String showName;
|
||||
|
||||
private List<DataArrayTreeVO> children = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/2 15:26
|
||||
*/
|
||||
@Data
|
||||
public class ElementsVO implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String json;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.product.cnzutai.zutai.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class RealTimeDataVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("数据时间")
|
||||
// @JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@ApiModelProperty("指标id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("指标名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("指标别名")
|
||||
private String otherName;
|
||||
|
||||
@ApiModelProperty("相别")
|
||||
private String phase;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("平均值")
|
||||
private Double avgValue;
|
||||
|
||||
@ApiModelProperty("A相值")
|
||||
private Double valueA;
|
||||
|
||||
@ApiModelProperty("B相值")
|
||||
private Double valueB;
|
||||
|
||||
@ApiModelProperty("C相值")
|
||||
private Double valueC;
|
||||
|
||||
@ApiModelProperty("无相值")
|
||||
private Double valueM;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.product.cnzutai.zutai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsConfigurationParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsConfigurationVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsConfigurationService extends IService<CsConfigurationPO>{
|
||||
|
||||
|
||||
boolean add(CsConfigurationParm csConfigurationParm);
|
||||
|
||||
boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm);
|
||||
|
||||
boolean active(String id);
|
||||
|
||||
CsConfigurationPO getActive();
|
||||
|
||||
IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam);
|
||||
|
||||
String uploadImage(MultipartFile issuesFile);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.product.cnzutai.zutai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsPageParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsPagePO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsPageVO;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsPagePOService extends IService<CsPagePO>{
|
||||
|
||||
|
||||
boolean add(CsPageParm csPageParm);
|
||||
|
||||
boolean audit(CsPageParm.CsPageParmAuditParam auditParm);
|
||||
|
||||
IPage<CsPageVO> queryPage(CsPageParm.CsPageParmQueryParam csPageParam);
|
||||
|
||||
/**
|
||||
* 根据id获取组态页面数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CsPagePO queryById(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.product.cnzutai.zutai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.ElementParam;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsElement;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组态图元库 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-06-14
|
||||
*/
|
||||
public interface IElementService extends IService<CsElement> {
|
||||
|
||||
/**
|
||||
* 新增组态图元
|
||||
* @param param 图元参数
|
||||
*/
|
||||
CsElement addElement(ElementParam param);
|
||||
|
||||
/**
|
||||
* 组态图元数据查询
|
||||
*/
|
||||
List<CsElement> findElement();
|
||||
|
||||
/**
|
||||
* 组态图元数据查询
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.product.cnzutai.zutai.service;
|
||||
|
||||
|
||||
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsRtDataVO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.DataArrayTreeVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
*/
|
||||
public interface ILineTargetService {
|
||||
|
||||
/**
|
||||
* 根据监测点Id获取对应指标
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
List<DataArrayTreeVO> getLineTarget(String lineId);
|
||||
|
||||
/**
|
||||
* 获取绑定指标的数据
|
||||
* @param id
|
||||
*/
|
||||
List<CsRtDataVO> getLineData(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
package com.njcn.product.cnzutai.zutai.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.product.cnzutai.zutai.mapper.CsPagePOMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsPagePO;
|
||||
import com.njcn.product.cnzutai.zutai.service.CsConfigurationService;
|
||||
import com.njcn.product.cnzutai.zutai.mapper.CsConfigurationMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsConfigurationParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsConfigurationVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMapper, CsConfigurationPO> implements CsConfigurationService {
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final CsPagePOMapper csPagePOMapper;
|
||||
|
||||
//private final UserFeignClient userFeignClient;
|
||||
|
||||
//private final RoleEngineerDevFeignClient roleEngineerDevFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean add(CsConfigurationParm csConfigurationParm) {
|
||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||
|
||||
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
||||
|
||||
List<String> projectIds = csConfigurationParm.getProjectIds();
|
||||
if(CollectionUtils.isEmpty(projectIds)){
|
||||
throw new BusinessException("请选择项目");
|
||||
}
|
||||
String projects = String.join(",", projectIds);
|
||||
|
||||
csConfigurationPO.setProjectIds(projects);
|
||||
//排序不填给个100往后排
|
||||
csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy())?100:csConfigurationParm.getOrderBy());
|
||||
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
||||
csConfigurationPO.setActive(0);
|
||||
csConfigurationPO.setStatus("1");
|
||||
boolean save = this.save(csConfigurationPO);
|
||||
|
||||
String name = csConfigurationPO.getName();
|
||||
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
||||
if(count>1){
|
||||
throw new BusinessException("存在相同的组态项目名称");
|
||||
}
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
|
||||
CsConfigurationPO tem = this.getById(auditParm.getId());
|
||||
if(Objects.isNull(tem)){
|
||||
throw new BusinessException(CommonResponseEnum.FAIL,"未查询到项目信息,无法操作!");
|
||||
}
|
||||
|
||||
|
||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||
if(Objects.equals(auditParm.getStatus(),"0")){
|
||||
csConfigurationPO.setId(auditParm.getId());
|
||||
csConfigurationPO.setStatus("0");
|
||||
boolean b = this.updateById(csConfigurationPO);
|
||||
|
||||
if(StrUtil.isNotBlank(tem.getImagePath())){
|
||||
fileStorageUtil.deleteFile(tem.getImagePath());
|
||||
}
|
||||
|
||||
CsPagePO csPagePO = new CsPagePO();
|
||||
csPagePO.setStatus("0");
|
||||
csPagePOMapper.update(csPagePO,new LambdaUpdateWrapper<CsPagePO>().eq(CsPagePO::getPid,csConfigurationPO.getId()));
|
||||
return b;
|
||||
}
|
||||
|
||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
||||
List<String> projectIds = auditParm.getProjectIds();
|
||||
if(!CollectionUtils.isEmpty(projectIds)){
|
||||
String projects = String.join(",", projectIds);
|
||||
csConfigurationPO.setProjectIds(projects);
|
||||
|
||||
}
|
||||
if(!Objects.isNull(auditParm.getOrderBy())){
|
||||
csConfigurationPO.setOrderBy(auditParm.getOrderBy()==0?100:auditParm.getOrderBy());
|
||||
}
|
||||
|
||||
if(!Objects.isNull(auditParm.getFileContent())){
|
||||
if(StrUtil.isNotBlank(tem.getImagePath())){
|
||||
fileStorageUtil.deleteFile(tem.getImagePath());
|
||||
}
|
||||
|
||||
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), OssPath.CONFIGURATIONPATH, OssPath.CONFIGURATIONNAME);
|
||||
csConfigurationPO.setImagePath(s);
|
||||
}
|
||||
|
||||
boolean b = this.updateById(csConfigurationPO);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean active(String id) {
|
||||
CsConfigurationPO csConfigurationPO = this.lambdaQuery().eq(CsConfigurationPO::getId,id).one();
|
||||
if(Objects.isNull(csConfigurationPO)){
|
||||
throw new BusinessException("未查询到项目组态图");
|
||||
}
|
||||
this.lambdaUpdate().set(CsConfigurationPO::getActive,0).update();
|
||||
this.lambdaUpdate().set(CsConfigurationPO::getActive,1).eq(CsConfigurationPO::getId, id).update();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsConfigurationPO getActive() {
|
||||
CsConfigurationPO csConfigurationPO = this.lambdaQuery().eq(CsConfigurationPO::getActive,1).one();
|
||||
return csConfigurationPO;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
|
||||
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||
|
||||
List<String> data1 = new ArrayList<>(); //roleEngineerDevFeignClient.getRoleProject().getData();
|
||||
/* if(CollectionUtils.isEmpty(data1)){
|
||||
return returnpage;
|
||||
}*/
|
||||
//+无线项目id
|
||||
//data1.add(DataParam.WIRELESS_PROJECT_ID);
|
||||
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage,csConfigurationQueryParam);
|
||||
|
||||
List<String> collect1 = csConfigurationPOPage.getRecords().stream().map(CsConfigurationPO::getCreateBy).collect(Collectors.toList());
|
||||
Map<String, String> collect2 = new HashMap<>();
|
||||
/* if(!CollectionUtils.isEmpty(collect1)){
|
||||
List<User> data = userFeignClient.appuserByIdList(collect1).getData();
|
||||
collect2 = data.stream().collect(Collectors.toMap(User::getId, User::getName, (e1, e2) -> e1 + "," + e2));
|
||||
|
||||
} else {
|
||||
collect2 = new HashMap<>();
|
||||
}*/
|
||||
|
||||
List<CsConfigurationVO> collect = csConfigurationPOPage.getRecords().stream().map(page -> {
|
||||
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
||||
BeanUtils.copyProperties(page, csDevModelPageVO);
|
||||
|
||||
if(StringUtils.isEmpty(page.getProjectIds())){
|
||||
csDevModelPageVO.setProjectIds(new ArrayList<>());
|
||||
}else {
|
||||
csDevModelPageVO.setProjectIds( Arrays.asList(page.getProjectIds().split(",")));
|
||||
|
||||
}
|
||||
if(Objects.isNull(page.getImagePath())){
|
||||
csDevModelPageVO.setFileContent(null);
|
||||
|
||||
}else {
|
||||
|
||||
try {
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(page.getImagePath());
|
||||
String text = new BufferedReader(
|
||||
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
csDevModelPageVO.setFileContent(text);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
csDevModelPageVO.setOperater(collect2.get(csDevModelPageVO.getCreateBy()));
|
||||
return csDevModelPageVO;
|
||||
}).collect(Collectors.toList());
|
||||
returnpage.setRecords(collect);
|
||||
returnpage.setTotal(csConfigurationPOPage.getTotal());
|
||||
|
||||
|
||||
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadImage(MultipartFile issuesFile) {
|
||||
return fileStorageUtil.getFileUrl( fileStorageUtil.uploadMultipart(issuesFile, OssPath.CONFIGURATIONPATH));
|
||||
}
|
||||
|
||||
/*将strin写入Json文件,返回一个InputStream*/
|
||||
public InputStream writeJsonStringToInputStream(String jsonString) {
|
||||
// 转换为输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(jsonString.getBytes(StandardCharsets.UTF_8));
|
||||
return inputStream;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.njcn.product.cnzutai.zutai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.ElementParam;
|
||||
import com.njcn.product.cnzutai.zutai.mapper.CsElementMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.enums.CsSystemResponseEnum;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsElement;
|
||||
import com.njcn.product.cnzutai.zutai.service.IElementService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组态图元库 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-07-12
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CsElementServiceImpl extends ServiceImpl<CsElementMapper, CsElement> implements IElementService {
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
@Override
|
||||
public CsElement addElement(ElementParam param) {
|
||||
CsElement po = this.lambdaQuery().eq(CsElement::getStatus,1)
|
||||
.eq(CsElement::getElementCode,param.getElementCode())
|
||||
.eq(CsElement::getElementName,param.getElementName())
|
||||
.eq(CsElement::getElementMark,param.getElementMark()).one();
|
||||
if (!Objects.isNull(po)){
|
||||
throw new BusinessException(CsSystemResponseEnum.SAME_DATA_ERROR);
|
||||
}
|
||||
CsElement csElement = new CsElement();
|
||||
BeanUtils.copyProperties(param,csElement);
|
||||
String path = fileStorageUtil.uploadMultipart(param.getMultipartFile(), OssPath.ELEMENT);
|
||||
csElement.setPath(path);
|
||||
csElement.setStatus(1);
|
||||
this.saveOrUpdate(csElement);
|
||||
csElement.setPath(path);
|
||||
return csElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsElement> findElement() {
|
||||
List<CsElement> list = this.lambdaQuery().eq(CsElement::getStatus,1).list();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
CsElement csElement = this.lambdaQuery().eq(CsElement::getId,id).one();
|
||||
csElement.setStatus(0);
|
||||
this.updateById(csElement);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.njcn.product.cnzutai.zutai.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.product.cnzutai.zutai.service.CsPagePOService;
|
||||
import com.njcn.product.cnzutai.zutai.mapper.CsConfigurationMapper;
|
||||
import com.njcn.product.cnzutai.zutai.mapper.CsPagePOMapper;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.param.CsPageParm;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsConfigurationPO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.po.CsPagePO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsPageVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/31 14:31【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> implements CsPagePOService {
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final CsConfigurationMapper csConfigurationMapper;
|
||||
// private final UserFeignClient userFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean add(CsPageParm csPageParm) {
|
||||
QueryWrapper<CsPagePO> csPagePOQueryWrapper = new QueryWrapper<>();
|
||||
String pid = csPageParm.getPid();
|
||||
csPagePOQueryWrapper.eq("pid",pid);
|
||||
List<CsPagePO> csPagePOList = this.baseMapper.selectList(csPagePOQueryWrapper);
|
||||
if(CollUtil.isNotEmpty(csPagePOList)){
|
||||
//先删除旧的json文件
|
||||
for(CsPagePO csPagePO : csPagePOList){
|
||||
if(StrUtil.isNotBlank(csPagePO.getPath())){
|
||||
fileStorageUtil.deleteFile(csPagePO.getPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getBaseMapper().delete(csPagePOQueryWrapper);
|
||||
InputStream inputStream = null;
|
||||
MultipartFile multipartFile = csPageParm.getMultipartFile();
|
||||
try {
|
||||
inputStream = multipartFile.getInputStream(); // 获取文件的输入流
|
||||
String text = new BufferedReader(
|
||||
new InputStreamReader(inputStream, StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
List<CsPagePO> csPagePOS = JSONUtil.toList(text, CsPagePO.class);
|
||||
csPagePOS.forEach(temp->{
|
||||
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(temp.getPath()), OssPath.CONFIGURATIONPATH, OssPath.CONFIGURATIONNAME);
|
||||
temp.setPid(pid);
|
||||
temp.setStatus("1");
|
||||
temp.setPath(s);
|
||||
this.save(temp);
|
||||
});
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean audit(CsPageParm.CsPageParmAuditParam auditParm) {
|
||||
// CsPagePO csPagePO = new CsPagePO();
|
||||
// CsPagePO byId = this.getById(auditParm.getId());
|
||||
// fileStorageUtil.deleteFile(byId.getPath());
|
||||
// BeanUtils.copyProperties(auditParm, csPagePO);
|
||||
// String s = fileStorageUtil.uploadMultipart(auditParm.getMultipartFile(), HarmonicConstant.CONFIGURATIONPATH);
|
||||
//
|
||||
// csPagePO.setPath(s);
|
||||
//
|
||||
// return this.updateById(csPagePO);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<CsPageVO> queryPage(CsPageParm.CsPageParmQueryParam csPageParam) {
|
||||
Page<CsPageVO> returnpage = new Page<> (csPageParam.getPageNum(), csPageParam.getPageSize ( ));
|
||||
QueryWrapper<CsPagePO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
||||
like(StrUtil.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
||||
eq ("status",1);
|
||||
// orderByAsc(CsPagePO.COL_KID)
|
||||
|
||||
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
||||
|
||||
List<CsPageVO> collect = pageData.getRecords().stream().map(temp -> {
|
||||
CsPageVO csPageVO = new CsPageVO();
|
||||
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
||||
BeanUtils.copyProperties(temp, csPageVO);
|
||||
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
||||
String text = new BufferedReader(
|
||||
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
csPageVO.setPath(text);
|
||||
// csPageVO.setOperater(collect2.get(csPageVO.getCreateBy()));
|
||||
return csPageVO;
|
||||
}).collect(Collectors.toList());
|
||||
returnpage.setRecords(collect);
|
||||
returnpage.setTotal(pageData.getTotal());
|
||||
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsPagePO queryById(String id) {
|
||||
return this.lambdaQuery().eq(CsPagePO::getId,id).one();
|
||||
}
|
||||
|
||||
|
||||
/*将strin写入Json文件,返回一个InputStream*/
|
||||
public InputStream writeJsonStringToInputStream(String jsonString) {
|
||||
// 转换为输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(jsonString.getBytes(StandardCharsets.UTF_8));
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,471 @@
|
||||
package com.njcn.product.cnzutai.zutai.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.dto.ZuTaiDTO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.enums.CsSystemResponseEnum;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.CsRtDataVO;
|
||||
import com.njcn.product.cnzutai.zutai.pojo.vo.DataArrayTreeVO;
|
||||
import com.njcn.product.cnzutai.zutai.service.CsPagePOService;
|
||||
import com.njcn.product.cnzutai.zutai.service.ILineTargetService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/1 10:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class LineTargetServiceImpl implements ILineTargetService {
|
||||
|
||||
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
private final CsPagePOService csPagePOService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<DataArrayTreeVO> getLineTarget(String lineId) {
|
||||
// List<String> setList = new ArrayList<>();
|
||||
// String devId = csLedgerFeignClient.findDevByLineId(lineId).getData();
|
||||
// //1.获取监测点的安装位置
|
||||
// List<CsLinePO> lineList = csLineFeignClient.queryLineById(Collections.singletonList(lineId)).getData();
|
||||
// if (CollectionUtils.isEmpty(lineList)){
|
||||
// return new ArrayList<DataArrayTreeVO>();
|
||||
// }
|
||||
// CsLinePO line = csLineFeignClient.queryLineById(Collections.singletonList(lineId)).getData().get(0);
|
||||
// String code = dicDataFeignClient.getDicDataById(line.getPosition()).getData().getCode();
|
||||
// String modelId = null;
|
||||
// List<LineTargetVO> dataSetList = new ArrayList<>();
|
||||
// //治理监测点
|
||||
// if (Objects.equals(code, DicDataEnum.OUTPUT_SIDE.getCode())){
|
||||
// modelId = devModelRelationFeignClient.getModelByType(devId,0).getData();
|
||||
// dataSetList = dataSetFeignClient.getDataSet(modelId,0).getData();
|
||||
// }
|
||||
// //电网侧监测点
|
||||
// else if (Objects.equals(code, DicDataEnum.GRID_SIDE.getCode())){
|
||||
// modelId = devModelRelationFeignClient.getModelByType(devId,1).getData();
|
||||
// dataSetList = dataSetFeignClient.getDataSet(modelId,1).getData();
|
||||
// }
|
||||
// //负载侧监测点
|
||||
// else if (Objects.equals(code, DicDataEnum.LOAD_SIDE.getCode())){
|
||||
// modelId = devModelRelationFeignClient.getModelByType(devId,1).getData();
|
||||
// dataSetList = dataSetFeignClient.getDataSet(modelId,2).getData();
|
||||
// }
|
||||
// setList = dataSetList.stream().map(LineTargetVO::getId).collect(Collectors.toList());
|
||||
// return dataArrayFeignClient.getDataArray(setList).getData();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsRtDataVO> getLineData(String id) {
|
||||
List<CsRtDataVO> result = new ArrayList<>();
|
||||
String path = csPagePOService.queryById(id).getPath();
|
||||
InputStream inputStream = fileStorageUtil.getFileStream(path);
|
||||
ZuTaiDTO zuTaiDto = analysisJson(inputStream);
|
||||
|
||||
zuTaiDto.getJson().forEach(item->{
|
||||
if (!CollectionUtils.isEmpty(item.getUidNames())){
|
||||
for (int i = 0; i < item.getUidNames().size(); i++) {
|
||||
String temp = item.getUidNames().get(i);
|
||||
String targetTag = null;
|
||||
String phasic = null;
|
||||
String dataType = null;
|
||||
// String[] tmepUidName = temp.split(" / ");
|
||||
// if(tmepUidName.length==2){
|
||||
// targetTag = tmepUidName[0];
|
||||
// phasic = "T";
|
||||
// dataType = tmepUidName[1];
|
||||
// }else if (tmepUidName.length==3){
|
||||
// targetTag = tmepUidName[0];
|
||||
// phasic = tmepUidName[1];
|
||||
// dataType = tmepUidName[2];
|
||||
// }
|
||||
|
||||
if (CollectionUtils.isEmpty(item.getUid()) || StringUtils.isEmpty(item.getLineId())){
|
||||
throw new BusinessException(CsSystemResponseEnum.BIND_TARGET_ERROR);
|
||||
}
|
||||
List<String> tempUid = item.getUid().get(i);
|
||||
String s = tempUid.get(tempUid.size() - 1);
|
||||
String[] tempTable = s.replace("$", "").split("#");
|
||||
result.add(getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],tempTable[1],tempTable[2].toUpperCase(),temp,item.getUnit().get(i)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析json文件
|
||||
*/
|
||||
public ZuTaiDTO analysisJson(InputStream inputStream) {
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
String text = new BufferedReader(
|
||||
new InputStreamReader(inputStream, StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
|
||||
ZuTaiDTO config = null;
|
||||
try {
|
||||
config = mapper.readValue(text, ZuTaiDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过orm框架获取数据
|
||||
* @param id 图元Id
|
||||
* @param lineId 监测点Id
|
||||
* @param tableName 表名称
|
||||
* @param columnName 字段名称
|
||||
* @param phasic 相别
|
||||
* @param dataType 数据类型
|
||||
* @param target 数据名称
|
||||
* @return
|
||||
*/
|
||||
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
|
||||
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
||||
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType);
|
||||
if(Objects.isNull(statisticalDataDTO)){
|
||||
statisticalDataDTO = new StatisticalDataDTO();
|
||||
statisticalDataDTO.setLineId(lineId);
|
||||
statisticalDataDTO.setPhaseType(phasic);
|
||||
statisticalDataDTO.setValueType(dataType);
|
||||
statisticalDataDTO.setValue(3.1415926);
|
||||
} else {
|
||||
statisticalDataDTO.setValue(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
String targetTag = null;
|
||||
String targetPhasic = null;
|
||||
String targetDataType = null;
|
||||
|
||||
String[] tmepUidName = target.split(" / ");
|
||||
if(tmepUidName.length==2){
|
||||
targetTag = tmepUidName[0];
|
||||
targetDataType = getDataType(tmepUidName[1]) ;
|
||||
}else if (tmepUidName.length==3){
|
||||
targetTag = tmepUidName[0];
|
||||
targetPhasic = tmepUidName[1];
|
||||
targetDataType =getDataType(tmepUidName[2]) ;
|
||||
} else if (tmepUidName.length==4) {
|
||||
targetTag = tmepUidName[1];
|
||||
targetPhasic = tmepUidName[2];
|
||||
targetDataType =getDataType(tmepUidName[3]) ;
|
||||
}
|
||||
statisticalDataDTO.setStatisticalName((Objects.isNull(targetPhasic)?"":targetPhasic+"相_")+targetTag+"_"+targetDataType);
|
||||
statisticalDataDTO.setTarget(columnName + "$" + phasic + "$" + dataType);
|
||||
BeanUtils.copyProperties(statisticalDataDTO,csRtDataVO);
|
||||
csRtDataVO.setId(id);
|
||||
csRtDataVO.setUnit(uint);
|
||||
return csRtDataVO;
|
||||
}
|
||||
|
||||
public String getDataType(String statItem){
|
||||
String valueTypeName = "";
|
||||
switch (statItem) {
|
||||
case "max":
|
||||
valueTypeName = "最大值";
|
||||
break;
|
||||
case "min":
|
||||
valueTypeName = "最小值";
|
||||
break;
|
||||
case "avg":
|
||||
valueTypeName = "平均值";
|
||||
break;
|
||||
case "cp95":
|
||||
valueTypeName = "cp95值";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return valueTypeName;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String temp ="{\n" +
|
||||
" \"canvasCfg\": {\n" +
|
||||
" \"width\": 1920,\n" +
|
||||
" \"height\": 1080,\n" +
|
||||
" \"scale\": 1,\n" +
|
||||
" \"color\": \"\",\n" +
|
||||
" \"img\": \"\",\n" +
|
||||
" \"guide\": true,\n" +
|
||||
" \"adsorp\": true,\n" +
|
||||
" \"adsorp_diff\": 5,\n" +
|
||||
" \"transform_origin\": {\n" +
|
||||
" \"x\": 0,\n" +
|
||||
" \"y\": 0\n" +
|
||||
" },\n" +
|
||||
" \"drag_offset\": {\n" +
|
||||
" \"x\": 0,\n" +
|
||||
" \"y\": 0\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"gridCfg\": {\n" +
|
||||
" \"enabled\": true,\n" +
|
||||
" \"align\": true,\n" +
|
||||
" \"size\": 10\n" +
|
||||
" },\n" +
|
||||
" \"json\": [\n" +
|
||||
" {\n" +
|
||||
" \"id\": \"c53cccb8c65201c192d8c57fbdb4d993-fGe6GgykpF\",\n" +
|
||||
" \"title\": \"传输设备\",\n" +
|
||||
" \"keyId\": \"\",\n" +
|
||||
" \"type\": \"svg\",\n" +
|
||||
" \"binfo\": {\n" +
|
||||
" \"left\": 380,\n" +
|
||||
" \"top\": 120,\n" +
|
||||
" \"width\": 50,\n" +
|
||||
" \"height\": 50,\n" +
|
||||
" \"angle\": 0\n" +
|
||||
" },\n" +
|
||||
" \"resize\": true,\n" +
|
||||
" \"rotate\": true,\n" +
|
||||
" \"lock\": false,\n" +
|
||||
" \"active\": false,\n" +
|
||||
" \"hide\": false,\n" +
|
||||
" \"props\": {\n" +
|
||||
" \"fill\": \"#FF0000\"\n" +
|
||||
" },\n" +
|
||||
" \"tag\": \"c53cccb8c65201c192d8c57fbdb4d993\",\n" +
|
||||
" \"common_animations\": {\n" +
|
||||
" \"val\": \"\",\n" +
|
||||
" \"delay\": \"delay-0s\",\n" +
|
||||
" \"speed\": \"slow\",\n" +
|
||||
" \"repeat\": \"infinite\"\n" +
|
||||
" },\n" +
|
||||
" \"use_proportional_scaling\": true,\n" +
|
||||
" \"events\": [],\n" +
|
||||
" \"lineId\": \"782d0aa0bfbe47b83f54f9b31b2d6c9a\",\n" +
|
||||
" \"lineList\": [\n" +
|
||||
" \"52e34eb68eeb13fa515737048772d204\",\n" +
|
||||
" \"d02b5cc062e6a0e0bcb784c2df6b2e98\",\n" +
|
||||
" \"158445294c3f9b4507b6b19df403e467\",\n" +
|
||||
" \"782d0aa0bfbe47b83f54f9b31b2d6c9a\"\n" +
|
||||
" ],\n" +
|
||||
" \"lineName\": \"无锡供电公司 / 110kV下甸桥变 / PQ-COM_7 / 10kV母线_胜境11C线\",\n" +
|
||||
" \"UID\": [\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"B\",\n" +
|
||||
" \"$rms#B#max#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"B\",\n" +
|
||||
" \"$rms#B#min#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"B\",\n" +
|
||||
" \"$rms#B#avg#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"C\",\n" +
|
||||
" \"$rms#C#max#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"C\",\n" +
|
||||
" \"$rms#C#min#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"C\",\n" +
|
||||
" \"$rms#C#avg#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"rms\",\n" +
|
||||
" \"C\",\n" +
|
||||
" \"$rms#C#cp95#data_v#NO$\"\n" +
|
||||
" ]\n" +
|
||||
" ],\n" +
|
||||
" \"UIDName\": [\n" +
|
||||
" \"相电压总有效值 / B / max\",\n" +
|
||||
" \"相电压总有效值 / B / min\",\n" +
|
||||
" \"相电压总有效值 / B / avg\",\n" +
|
||||
" \"相电压总有效值 / C / max\",\n" +
|
||||
" \"相电压总有效值 / C / min\",\n" +
|
||||
" \"相电压总有效值 / C / avg\",\n" +
|
||||
" \"相电压总有效值 / C / cp95\"\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"id\": \"d09fd211e9908c5fea5cc38c9447e268-mVLhsvkxPK\",\n" +
|
||||
" \"title\": \"断路器\",\n" +
|
||||
" \"keyId\": \"\",\n" +
|
||||
" \"type\": \"svg\",\n" +
|
||||
" \"binfo\": {\n" +
|
||||
" \"left\": 610,\n" +
|
||||
" \"top\": 270,\n" +
|
||||
" \"width\": 50,\n" +
|
||||
" \"height\": 50,\n" +
|
||||
" \"angle\": 0\n" +
|
||||
" },\n" +
|
||||
" \"resize\": true,\n" +
|
||||
" \"rotate\": true,\n" +
|
||||
" \"lock\": false,\n" +
|
||||
" \"active\": false,\n" +
|
||||
" \"hide\": false,\n" +
|
||||
" \"props\": {\n" +
|
||||
" \"fill\": \"#FF0000\"\n" +
|
||||
" },\n" +
|
||||
" \"tag\": \"d09fd211e9908c5fea5cc38c9447e268\",\n" +
|
||||
" \"common_animations\": {\n" +
|
||||
" \"val\": \"\",\n" +
|
||||
" \"delay\": \"delay-0s\",\n" +
|
||||
" \"speed\": \"slow\",\n" +
|
||||
" \"repeat\": \"infinite\"\n" +
|
||||
" },\n" +
|
||||
" \"use_proportional_scaling\": true,\n" +
|
||||
" \"events\": [],\n" +
|
||||
" \"lineId\": \"14a81218e58fa62465d232ff22eba30e\",\n" +
|
||||
" \"lineList\": [\n" +
|
||||
" \"52e34eb68eeb13fa515737048772d204\",\n" +
|
||||
" \"d02b5cc062e6a0e0bcb784c2df6b2e98\",\n" +
|
||||
" \"591f9f6ad50db9e2dfb3f467682f7789\",\n" +
|
||||
" \"14a81218e58fa62465d232ff22eba30e\"\n" +
|
||||
" ],\n" +
|
||||
" \"lineName\": \"无锡供电公司 / 110kV下甸桥变 / PQCOM_3 / 10kV母线_东方12E线\",\n" +
|
||||
" \"UID\": [\n" +
|
||||
" [\n" +
|
||||
" \"p\",\n" +
|
||||
" \"p_2\",\n" +
|
||||
" \"A\",\n" +
|
||||
" \"$p_2#A#max#data_harmpower_p#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"p\",\n" +
|
||||
" \"p_2\",\n" +
|
||||
" \"A\",\n" +
|
||||
" \"$p_2#A#min#data_harmpower_p#NO$\"\n" +
|
||||
" ]\n" +
|
||||
" \n" +
|
||||
" ],\n" +
|
||||
" \"UIDName\": [\n" +
|
||||
" \"有功功率 / 2次有功功率 / A / max\",\n" +
|
||||
" \"有功功率 / 2次有功功率 / A / min\"\n" +
|
||||
" \n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"id\": \"ea37cb9e81e7dfd44babc986c3547a04-oJTFPUPGC3\",\n" +
|
||||
" \"title\": \"电灯\",\n" +
|
||||
" \"keyId\": \"\",\n" +
|
||||
" \"type\": \"svg\",\n" +
|
||||
" \"binfo\": {\n" +
|
||||
" \"left\": 270,\n" +
|
||||
" \"top\": 460,\n" +
|
||||
" \"width\": 50,\n" +
|
||||
" \"height\": 50,\n" +
|
||||
" \"angle\": 0\n" +
|
||||
" },\n" +
|
||||
" \"resize\": true,\n" +
|
||||
" \"rotate\": true,\n" +
|
||||
" \"lock\": false,\n" +
|
||||
" \"active\": false,\n" +
|
||||
" \"hide\": false,\n" +
|
||||
" \"props\": {\n" +
|
||||
" \"fill\": \"#FF0000\"\n" +
|
||||
" },\n" +
|
||||
" \"tag\": \"ea37cb9e81e7dfd44babc986c3547a04\",\n" +
|
||||
" \"common_animations\": {\n" +
|
||||
" \"val\": \"\",\n" +
|
||||
" \"delay\": \"delay-0s\",\n" +
|
||||
" \"speed\": \"slow\",\n" +
|
||||
" \"repeat\": \"infinite\"\n" +
|
||||
" },\n" +
|
||||
" \"use_proportional_scaling\": true,\n" +
|
||||
" \"events\": [],\n" +
|
||||
" \"lineId\": \"14a81218e58fa62465d232ff22eba30e\",\n" +
|
||||
" \"lineList\": [\n" +
|
||||
" \"52e34eb68eeb13fa515737048772d204\",\n" +
|
||||
" \"d02b5cc062e6a0e0bcb784c2df6b2e98\",\n" +
|
||||
" \"591f9f6ad50db9e2dfb3f467682f7789\",\n" +
|
||||
" \"14a81218e58fa62465d232ff22eba30e\"\n" +
|
||||
" ],\n" +
|
||||
" \"lineName\": \"无锡供电公司 / 110kV下甸桥变 / PQCOM_3 / 10kV母线_东方12E线\",\n" +
|
||||
" \"UID\": [\n" +
|
||||
" [\n" +
|
||||
" \"v_neg\",\n" +
|
||||
" \"$v_neg#max#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"v_neg\",\n" +
|
||||
" \"$v_neg#min#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"v_neg\",\n" +
|
||||
" \"$v_neg#cp95#data_v#NO$\"\n" +
|
||||
" ],\n" +
|
||||
" [\n" +
|
||||
" \"v_neg\",\n" +
|
||||
" \"$v_neg#avg#data_v#NO$\"\n" +
|
||||
" ]\n" +
|
||||
" ],\n" +
|
||||
" \"UIDName\": [\n" +
|
||||
" \"电压负序分量 / max\",\n" +
|
||||
" \"电压负序分量 / min\",\n" +
|
||||
" \"电压负序分量 / avg\",\n" +
|
||||
" \"电压负序分量 / cp95\"\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
ZuTaiDTO config = null;
|
||||
try {
|
||||
config = mapper.readValue(temp, ZuTaiDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user