Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
7c49859a93
15
das/pom.xml
15
das/pom.xml
@ -24,6 +24,7 @@
|
||||
|
||||
<postgresql.version>42.7.3</postgresql.version>
|
||||
<sa.version>1.38.0</sa.version>
|
||||
<easyexcel.version>4.0.1</easyexcel.version>
|
||||
<annotations.version>4.8.6</annotations.version>
|
||||
</properties>
|
||||
|
||||
@ -72,6 +73,20 @@
|
||||
<version>${sa.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- easyexcel导入导出 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${easyexcel.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 提供Redis连接池 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
|
55
das/src/main/java/com/das/common/utils/ExcelUtil.java
Normal file
55
das/src/main/java/com/das/common/utils/ExcelUtil.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.das.common.utils;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.das.modules.equipment.domain.excel.SheetInfoBean;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* EXCEL处理工具类
|
||||
* @author 王凯
|
||||
* @version 1.0.0
|
||||
* @since 2022-08-17
|
||||
*/
|
||||
public class ExcelUtil {
|
||||
|
||||
/**导出*/
|
||||
public static void exportMoreSheet(String fileName,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
List<SheetInfoBean> sheetInfoList){
|
||||
try {
|
||||
// response.reset();
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
if (request.getMethod().equals("OPTIONS")) {
|
||||
response.addHeader("Access-Control-Allow-Methods", "GET,HEAD,POST,PUT,DELETE,TRACE,OPTIONS,PATCH");
|
||||
response.addHeader("Access-Control-Allow-Headers", "dnt,Origin, X-Requested-With,Content-Type, Accept, Authorization");
|
||||
}
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
String encodedFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + encodedFileName);
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
WriteSheet writeSheet;
|
||||
for (SheetInfoBean bean : sheetInfoList) {
|
||||
// 构建sheet对象
|
||||
writeSheet = EasyExcel.writerSheet(bean.getSheetName()).head(bean.getHeadClass()).build();
|
||||
// 写出sheet数据
|
||||
excelWriter.write(bean.getDataList(), writeSheet);
|
||||
}
|
||||
// // 关流
|
||||
excelWriter.finish();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -4,13 +4,17 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.das.common.constant.SysAuthorityIds;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.result.R;
|
||||
import com.das.common.utils.ExcelUtil;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelDto;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelFieldDto;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelServiceDto;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelFieldVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelServiceVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelVo;
|
||||
import com.das.modules.equipment.entity.SysIotModel;
|
||||
import com.das.modules.equipment.service.SysIotModelService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -209,5 +213,16 @@ public class SysIotModelController {
|
||||
sysIotModelService.deleteSysIotModelService(sysIotModelServiceDto);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/** 物模型导出 */
|
||||
@PostMapping("/export")
|
||||
public void exportSysIotModel(@RequestBody SysIotModelDto sysIotModelDto, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
if (sysIotModelDto.getId() == null) {
|
||||
throw new ServiceException("请选择需要下载的物模型属性信息");
|
||||
}
|
||||
sysIotModelService.exportSysIotModel(sysIotModelDto,request, response);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,5 +32,5 @@ public class SysIotModelFieldDto implements Serializable {
|
||||
*/
|
||||
private Integer porder;
|
||||
|
||||
private Integer version;
|
||||
private Integer revision;
|
||||
}
|
||||
|
@ -35,5 +35,5 @@ public class SysIotModelServiceDto implements Serializable {
|
||||
*/
|
||||
private Integer porder;
|
||||
|
||||
private Integer version;
|
||||
private Integer revision;
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
package com.das.modules.equipment.domain.excel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SheetInfoBean {
|
||||
|
||||
/**
|
||||
* sheet页名称
|
||||
*/
|
||||
private String sheetName;
|
||||
|
||||
/**
|
||||
* sheet标题bean
|
||||
*/
|
||||
private Class<?> headClass;
|
||||
|
||||
/**
|
||||
* sheet页数据
|
||||
*/
|
||||
private List<?> dataList;
|
||||
|
||||
public SheetInfoBean() {
|
||||
}
|
||||
|
||||
public SheetInfoBean(String sheetName, Class<?> headClass, List<?> dataList) {
|
||||
this.sheetName = sheetName;
|
||||
this.headClass = headClass;
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
public String getSheetName() {
|
||||
return sheetName;
|
||||
}
|
||||
|
||||
public void setSheetName(String sheetName) {
|
||||
this.sheetName = sheetName;
|
||||
}
|
||||
|
||||
public Class<?> getHeadClass() {
|
||||
return headClass;
|
||||
}
|
||||
|
||||
public void setHeadClass(Class<?> headClass) {
|
||||
this.headClass = headClass;
|
||||
}
|
||||
|
||||
public List<?> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<?> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SheetInfoBean{" +
|
||||
"sheetName='" + sheetName + '\'' +
|
||||
", headClass=" + headClass +
|
||||
", dataList=" + dataList +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.das.modules.equipment.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型属性前端回显
|
||||
*
|
||||
* @author guchengwei
|
||||
*/
|
||||
@Data
|
||||
public class SysIotModelFieldExcel {
|
||||
|
||||
|
||||
/**
|
||||
* 所属物模型ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属物模型名称",index = 0)
|
||||
private String iotModelName;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型动作编码
|
||||
*/
|
||||
@ExcelProperty(value = "物模型属性编码",index = 1)
|
||||
private String attributeCode;
|
||||
|
||||
/**
|
||||
* 物模型动作名称
|
||||
*/
|
||||
@ExcelProperty(value = "物模型属性名称",index = 2)
|
||||
private String attributeName;
|
||||
|
||||
/**
|
||||
* 属性类型
|
||||
*/
|
||||
@ExcelProperty(value = "属性类型",index = 3)
|
||||
private Integer attributeType;
|
||||
|
||||
/**
|
||||
* 测点序号
|
||||
*/
|
||||
@ExcelProperty(value = "测点序号",index = 4)
|
||||
private Integer porder;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.das.modules.equipment.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型动作前端回显
|
||||
*
|
||||
* @author guchengwei
|
||||
*/
|
||||
@Data
|
||||
public class SysIotModelServiceExcel implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 所属物模型ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属物模型名称",index = 0)
|
||||
private String iotModelName;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型动作编码
|
||||
*/
|
||||
@ExcelProperty(value = "物模型动作编码",index = 1)
|
||||
private String serviceCode;
|
||||
|
||||
/**
|
||||
* 物模型动作名称
|
||||
*/
|
||||
@ExcelProperty(value = "物模型动作名称",index = 2)
|
||||
private String serviceName;
|
||||
|
||||
/**
|
||||
* 动作类型
|
||||
*/
|
||||
@ExcelProperty(value = "动作类型",index = 3)
|
||||
private Integer serviceType;
|
||||
|
||||
/**
|
||||
* 测点序号
|
||||
*/
|
||||
@ExcelProperty(value = "测点序号",index = 4)
|
||||
private Integer porder;
|
||||
|
||||
}
|
@ -43,6 +43,6 @@ public class SysIotModelFieldVo {
|
||||
*/
|
||||
private Integer porder;
|
||||
|
||||
private Integer version;
|
||||
private Integer revision;
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,6 @@ public class SysIotModelServiceVo {
|
||||
*/
|
||||
private Integer porder;
|
||||
|
||||
private Integer version;
|
||||
private Integer revision;
|
||||
|
||||
}
|
||||
|
@ -2,10 +2,20 @@ package com.das.modules.equipment.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.das.modules.equipment.domain.excel.SysIotModelFieldExcel;
|
||||
import com.das.modules.equipment.domain.excel.SysIotModelServiceExcel;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelFieldVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelServiceVo;
|
||||
import com.das.modules.equipment.entity.SysIotModel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysIotModelMapper extends BaseMapper<SysIotModel> {
|
||||
|
||||
List<SysIotModelFieldExcel> queryFieldByModelId(Long id);
|
||||
|
||||
List<SysIotModelServiceExcel> queryServiceByModelId(Long id);
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import com.das.modules.equipment.domain.dto.SysIotModelServiceDto;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelFieldVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelServiceVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelVo;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -34,4 +36,6 @@ public interface SysIotModelService {
|
||||
|
||||
void deleteSysIotModelService(SysIotModelServiceDto sysIotModelServiceDto);
|
||||
|
||||
void exportSysIotModel(SysIotModelDto sysIotModelDto, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
}
|
||||
|
@ -5,10 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.das.common.config.SessionUtil;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.BeanCopyUtils;
|
||||
import com.das.common.utils.ExcelUtil;
|
||||
import com.das.modules.auth.domain.vo.SysUserVo;
|
||||
import com.das.modules.equipment.domain.excel.SheetInfoBean;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelDto;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelFieldDto;
|
||||
import com.das.modules.equipment.domain.dto.SysIotModelServiceDto;
|
||||
import com.das.modules.equipment.domain.excel.SysIotModelFieldExcel;
|
||||
import com.das.modules.equipment.domain.excel.SysIotModelServiceExcel;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelFieldVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelServiceVo;
|
||||
import com.das.modules.equipment.domain.vo.SysIotModelVo;
|
||||
@ -19,6 +23,8 @@ import com.das.modules.equipment.mapper.SysIotModelFieldMapper;
|
||||
import com.das.modules.equipment.mapper.SysIotModelMapper;
|
||||
import com.das.modules.equipment.mapper.SysIotModelServiceMapper;
|
||||
import com.das.modules.equipment.service.SysIotModelService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -67,14 +73,6 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
public SysIotModelVo updateSysIotModel(SysIotModelDto sysIotModelDto) {
|
||||
SysIotModel sysIotModel = new SysIotModel();
|
||||
BeanCopyUtils.copy(sysIotModelDto,sysIotModel);
|
||||
|
||||
QueryWrapper<SysIotModel> sysIotModelQueryWrapper = new QueryWrapper<>();
|
||||
sysIotModelQueryWrapper.eq("iot_model_code", sysIotModelDto.getIotModelCode());
|
||||
sysIotModelQueryWrapper.eq("id", sysIotModelDto.getId());
|
||||
SysIotModel sysIotModelQuery = sysIotModelMapper.selectOne(sysIotModelQueryWrapper);
|
||||
if (!(sysIotModelQuery == null)){
|
||||
throw new ServiceException("更新的物模型编码code重复");
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysIotModel.setUpdatedTime(new Date());
|
||||
sysIotModel.setUpdatedBy(sysUserVo.getAccount());
|
||||
@ -116,7 +114,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
public List<SysIotModelFieldVo> querySysIotModelField(SysIotModelFieldDto sysIotModelFieldDto) {
|
||||
List<SysIotModelFieldVo> sysIotModelFieldVoList = new ArrayList<>();
|
||||
QueryWrapper<SysIotModelField> sysIotModelFieldQueryWrapper = new QueryWrapper<>();
|
||||
sysIotModelFieldQueryWrapper.like("iot_model_id",sysIotModelFieldDto.getIotModelId());
|
||||
sysIotModelFieldQueryWrapper.eq("iot_model_id",sysIotModelFieldDto.getIotModelId());
|
||||
List<SysIotModelField> sysIotModelFields = sysIotModelFieldMapper.selectList(sysIotModelFieldQueryWrapper);
|
||||
for (SysIotModelField item : sysIotModelFields){
|
||||
SysIotModelFieldVo sysIotModelVo = new SysIotModelFieldVo();
|
||||
@ -154,14 +152,6 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
public SysIotModelFieldVo updateSysIotModelField(SysIotModelFieldDto sysIotModelFieldDto) {
|
||||
SysIotModelField sysIotModelField = new SysIotModelField();
|
||||
BeanCopyUtils.copy(sysIotModelFieldDto,sysIotModelField);
|
||||
|
||||
QueryWrapper<SysIotModelField> sysIotModelFieldQueryWrapper = new QueryWrapper<>();
|
||||
sysIotModelFieldQueryWrapper.eq("attribute_code", sysIotModelFieldDto.getAttributeCode());
|
||||
sysIotModelFieldQueryWrapper.eq("id", sysIotModelFieldDto.getId());
|
||||
SysIotModelField sysIotModelFieldQuery = sysIotModelFieldMapper.selectOne(sysIotModelFieldQueryWrapper);
|
||||
if (!(sysIotModelFieldQuery == null)){
|
||||
throw new ServiceException("物模型属性修改的code已经存在");
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysIotModelField.setUpdatedTime(new Date());
|
||||
sysIotModelField.setUpdatedBy(sysUserVo.getAccount());
|
||||
@ -181,7 +171,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
public List<SysIotModelServiceVo> querySysIotModelService(SysIotModelServiceDto sysIotModelServiceDto) {
|
||||
List<SysIotModelServiceVo> sysIotModelServiceVoList = new ArrayList<>();
|
||||
QueryWrapper<SysIotModelServices> sysIotModelServicesQueryWrapper = new QueryWrapper<>();
|
||||
sysIotModelServicesQueryWrapper.like("iot_model_id",sysIotModelServiceDto.getIotModelId());
|
||||
sysIotModelServicesQueryWrapper.eq("iot_model_id",sysIotModelServiceDto.getIotModelId());
|
||||
List<SysIotModelServices> sysIotModelServices = sysIotModelServiceMapper.selectList(sysIotModelServicesQueryWrapper);
|
||||
for (SysIotModelServices item : sysIotModelServices){
|
||||
SysIotModelServiceVo sysIotServiceVo = new SysIotModelServiceVo();
|
||||
@ -219,14 +209,6 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
public SysIotModelServiceVo updateSysIotModelService(SysIotModelServiceDto sysIotModelServiceDto) {
|
||||
SysIotModelServices sysIotModelServices = new SysIotModelServices();
|
||||
BeanCopyUtils.copy(sysIotModelServiceDto,sysIotModelServices);
|
||||
|
||||
QueryWrapper<SysIotModelField> sysIotModelFieldQueryWrapper = new QueryWrapper<>();
|
||||
sysIotModelFieldQueryWrapper.eq("service_code", sysIotModelServiceDto.getServiceCode());
|
||||
sysIotModelFieldQueryWrapper.eq("id", sysIotModelServiceDto.getId());
|
||||
SysIotModelField sysIotModelFieldQuery = sysIotModelFieldMapper.selectOne(sysIotModelFieldQueryWrapper);
|
||||
if (!(sysIotModelFieldQuery == null)){
|
||||
throw new ServiceException("物模型动作更新code已经存在");
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysIotModelServices.setUpdatedTime(new Date());
|
||||
sysIotModelServices.setUpdatedBy(sysUserVo.getAccount());
|
||||
@ -242,4 +224,20 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
sysIotModelServiceMapper.deleteById(sysIotModelServiceDto.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportSysIotModel(SysIotModelDto sysIotModelDto, HttpServletRequest request, HttpServletResponse response) {
|
||||
// 查询物模型属性和动作
|
||||
List<SysIotModelFieldExcel> sysIotModelFieldVoList = sysIotModelMapper.queryFieldByModelId(sysIotModelDto.getId());
|
||||
List<SysIotModelServiceExcel> sysIotModelServiceVoList = sysIotModelMapper.queryServiceByModelId(sysIotModelDto.getId());
|
||||
SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelDto.getId());
|
||||
String fileName = sysIotModel.getIotModelName()+":物模型信息表";
|
||||
List<SheetInfoBean> sheetInfoBeanList = new ArrayList<>();
|
||||
SheetInfoBean sheetInfoBean1 = new SheetInfoBean("物模型属性", SysIotModelFieldExcel.class, sysIotModelFieldVoList);
|
||||
SheetInfoBean sheetInfoBean2 = new SheetInfoBean("物模型动作", SysIotModelServiceExcel.class, sysIotModelServiceVoList);
|
||||
sheetInfoBeanList.add(sheetInfoBean1);
|
||||
sheetInfoBeanList.add(sheetInfoBean2);
|
||||
ExcelUtil.exportMoreSheet(fileName,request,response,sheetInfoBeanList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
31
das/src/main/resources/mapper/SysIotModelMapper.xml
Normal file
31
das/src/main/resources/mapper/SysIotModelMapper.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?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.das.modules.equipment.mapper.SysIotModelMapper">
|
||||
|
||||
<resultMap type="com.das.modules.equipment.domain.excel.SysIotModelServiceExcel" id="SysIotModelServiceMap">
|
||||
<result property="iotModelName" column="iotModelName" jdbcType="VARCHAR"/>
|
||||
<result property="serviceCode" column="service_code" jdbcType="VARCHAR"/>
|
||||
<result property="serviceName" column="service_name" jdbcType="VARCHAR"/>
|
||||
<result property="serviceType" column="service_type" jdbcType="INTEGER"/>
|
||||
<result property="porder" column="porder" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="com.das.modules.equipment.domain.excel.SysIotModelFieldExcel" id="SysIotModelFieldMap">
|
||||
<result property="iotModelName" column="iotModelName" jdbcType="VARCHAR"/>
|
||||
<result property="attributeCode" column="attribute_code" jdbcType="VARCHAR"/>
|
||||
<result property="attributeName" column="attribute_name" jdbcType="VARCHAR"/>
|
||||
<result property="attributeType" column="attribute_type" jdbcType="INTEGER"/>
|
||||
<result property="porder" column="porder" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryFieldByModelId" resultMap="SysIotModelFieldMap">
|
||||
select simf.*,sim.iot_model_name as iotModelName from sys_iot_model_field simf left join sys_iot_model sim on simf.iot_model_id = sim.id
|
||||
where simf.iot_model_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryServiceByModelId" resultMap="SysIotModelServiceMap">
|
||||
select sims.*,sim.iot_model_name as iotModelName from sys_iot_model_service sims left join sys_iot_model sim on sims.iot_model_id = sim.id
|
||||
where sims.iot_model_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -94,19 +94,69 @@
|
||||
|
||||
`ws://127.0.0.1:7790/gate/{nodeId}`
|
||||
|
||||
PS: 同一节点只允许建立一条连接。
|
||||
|
||||
## 通讯报文
|
||||
|
||||
### 节点上线请求
|
||||
|
||||
?> 方向: `采集程序` -> `系统`
|
||||
### 报文格式
|
||||
|
||||
```json
|
||||
{
|
||||
//节点ID
|
||||
"nodeId" : "nx10928234",
|
||||
//消息ID
|
||||
"messageId": "123512351235123",
|
||||
//命令
|
||||
"action" : "online"
|
||||
"cmd": "heartbeat",
|
||||
//命令ID
|
||||
"cmdId": "123123",
|
||||
//发送时间(毫秒)
|
||||
"time": 123123123123,
|
||||
//数据体
|
||||
"data": {}
|
||||
}
|
||||
```
|
||||
|
||||
### 节点心跳报文
|
||||
|
||||
?> 方向: `采集程序` -> `系统`
|
||||
|
||||
**命令:** `heartbeat`
|
||||
|
||||
**数据体:**
|
||||
```json
|
||||
{
|
||||
//心跳生存时间(毫秒)
|
||||
"ttl": 30000,
|
||||
//终端状态, 0 - 离线, 1 - 在线
|
||||
"status": 0,
|
||||
//通讯链路监控信息
|
||||
"links": [
|
||||
{
|
||||
//通讯链路IRN
|
||||
"linkId": 3444,
|
||||
//通讯链路状态
|
||||
"online": true
|
||||
},
|
||||
{
|
||||
"linkId": 123,
|
||||
"online": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
### 实时数据上报
|
||||
|
||||
?> 方向: `采集程序` -> `系统`
|
||||
|
||||
**命令:** `realdata`
|
||||
|
||||
**数据体:**
|
||||
```json
|
||||
{
|
||||
//key为设备ID
|
||||
"1123451235": {
|
||||
//key为属性名
|
||||
"Ia": 123.1,
|
||||
"Ib": 122.1,
|
||||
"Ic": 123.1,
|
||||
"Switch01": 1
|
||||
}
|
||||
}
|
||||
```
|
@ -1,14 +1,40 @@
|
||||
@use 'sass:math';
|
||||
@use 'sass:map';
|
||||
|
||||
@mixin set-css-var-value($name, $value) {
|
||||
#{joinVarName($name)}: #{$value};
|
||||
}
|
||||
|
||||
@function joinVarName($list) {
|
||||
$name: '--ba';
|
||||
|
||||
@each $item in $list {
|
||||
@if $item != '' {
|
||||
$name: $name + '-' + $item;
|
||||
@if $item !='' {
|
||||
$name: '#{$name}-#{$item}';
|
||||
}
|
||||
}
|
||||
|
||||
@return $name;
|
||||
}
|
||||
|
||||
@mixin set-css-var-value2($name, $value) {
|
||||
@if $value=='' {}
|
||||
|
||||
@else {
|
||||
#{joinVarName2($name)}: #{$value};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@function joinVarName2($list) {
|
||||
$name: '--el';
|
||||
|
||||
@each $item in $list {
|
||||
@if $item !='' {
|
||||
$name: #{$name}+'-'+#{$item};
|
||||
}
|
||||
}
|
||||
|
||||
@return $name;
|
||||
}
|
||||
|
||||
@ -20,11 +46,27 @@
|
||||
* 通过映射设置所有的CSS变量
|
||||
*/
|
||||
@mixin set-component-css-var($name, $variables) {
|
||||
@each $attribute, $value in $variables {
|
||||
@if $attribute == 'default' {
|
||||
|
||||
@each $attribute,
|
||||
$value in $variables {
|
||||
@if $attribute =='default' {
|
||||
#{getCssVarName($name)}: #{$value};
|
||||
} @else {
|
||||
}
|
||||
|
||||
@else {
|
||||
#{getCssVarName($name, $attribute)}: #{$value};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin set-css-color-type($colors, $type) {
|
||||
@include set-css-var-value2(('color', $type), map.get($colors, $type, 'base'));
|
||||
|
||||
@each $i in (3, 5, 7, 8, 9) {
|
||||
@include set-css-var-value2(('color', $type, 'light', $i),
|
||||
map.get($colors, $type, 'light-#{$i}'));
|
||||
}
|
||||
|
||||
@include set-css-var-value2(('color', $type, 'dark-2'),
|
||||
map.get($colors, $type, 'dark-2'));
|
||||
}
|
@ -17,6 +17,8 @@ $colors: map.deep-merge(( // 白色和黑色作为基本颜色选项
|
||||
),
|
||||
'warning': ('base': #e6a23c,
|
||||
),
|
||||
'danger': ('base': #f56c6c,
|
||||
),
|
||||
'error': ('base': #f56c6c,
|
||||
),
|
||||
'info': ('base': #909399,
|
||||
@ -33,38 +35,45 @@ $color-black: map.get($colors, 'black') !default; // 黑色
|
||||
$color-primary: map.get($colors, 'primary', 'base') !default; // 主要颜色,默认使用'base'色调
|
||||
$color-success: map.get($colors, 'success', 'base') !default; // 成功状态颜色,默认使用'base'色调
|
||||
$color-warning: map.get($colors, 'warning', 'base') !default; // 警告状态颜色,默认使用'base'色调
|
||||
$color-danger: map.get($colors, 'danger', 'base') !default;
|
||||
$color-error: map.get($colors, 'error', 'base') !default; // 错误状态颜色,默认使用'base'色调
|
||||
$color-info: map.get($colors, 'info', 'base') !default; // 信息状态颜色,默认使用'base'色调
|
||||
|
||||
// @mixin set-color-mix-level($type,
|
||||
// $number,
|
||||
// $mode: 'light',
|
||||
// $mix-color: $color-white) {
|
||||
// $colors: map.deep-merge(($type: ('#{$mode}-#{$number}': mix($mix-color,
|
||||
// map.get($colors, $type, 'base'),
|
||||
// math.percentage(math.div($number, 10))),
|
||||
// ),
|
||||
// ),
|
||||
// $colors ) !global;
|
||||
// }
|
||||
|
||||
// @mixin set-css-color-type($colors, $type) {
|
||||
// @include set-css-var-value(('color', $type), map.get($colors, $type, 'base'));
|
||||
@mixin set-color-mix-level($type,
|
||||
$number,
|
||||
$mode: 'light',
|
||||
$mix-color: $color-white) {
|
||||
$colors: map.deep-merge(($type: ('#{$mode}-#{$number}': mix($mix-color,
|
||||
map.get($colors, $type, 'base'),
|
||||
math.percentage(math.div($number, 10))),
|
||||
),
|
||||
),
|
||||
$colors ) !global;
|
||||
}
|
||||
|
||||
// @each $i in (3, 5, 7, 8, 9) {
|
||||
// @include set-css-var-value(('color', $type, 'light', $i),
|
||||
// map.get($colors, $type, 'light-#{$i}'));
|
||||
// }
|
||||
// $colors.primary.light-i
|
||||
// --el-color-primary-light-i
|
||||
// 10% 53a8ff
|
||||
// 20% 66b1ff
|
||||
// 30% 79bbff
|
||||
// 40% 8cc5ff
|
||||
// 50% a0cfff
|
||||
// 60% b3d8ff
|
||||
// 70% c6e2ff
|
||||
// 80% d9ecff
|
||||
// 90% ecf5ff
|
||||
@each $type in $types {
|
||||
@for $i from 1 through 9 {
|
||||
@include set-color-mix-level($type, $i, 'light', $color-white);
|
||||
}
|
||||
}
|
||||
|
||||
// @include set-css-var-value(('color', $type, 'dark-2'),
|
||||
// map.get($colors, $type, 'dark-2'));
|
||||
// }
|
||||
// --el-color-primary-dark-2
|
||||
@each $type in $types {
|
||||
@include set-color-mix-level($type, 2, 'dark', $color-black);
|
||||
}
|
||||
|
||||
// @each $type in $types {
|
||||
// @for $i from 1 through 9 {
|
||||
// @include set-color-mix-level($type, $i, 'light', $color-white);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // --el-color-primary-dark-2
|
||||
// @each $type in $types {
|
||||
@ -95,11 +104,11 @@ $border-color: map.merge(('': #f6f6f6,
|
||||
|
||||
|
||||
:root {
|
||||
--el-color-primary: #0064AA !important;
|
||||
// --el-color-primary: #0064AA !important;
|
||||
|
||||
// @each $type in $types {
|
||||
// @include set-css-color-type($colors, $type);
|
||||
// }
|
||||
@each $type in $types {
|
||||
@include set-css-color-type($colors, $type);
|
||||
}
|
||||
|
||||
@include set-css-var-value('main-space', $main-space);
|
||||
@include set-css-var-value('color-primary-light', $primary-light);
|
||||
|
@ -12,7 +12,7 @@ export function mainHeight(extra = 0): CSSProperties {
|
||||
let height = extra
|
||||
const adminLayoutMainExtraHeight: anyObj = {
|
||||
Default: 70,
|
||||
Classic: 148,
|
||||
Classic: 150,
|
||||
Streamline: 60,
|
||||
}
|
||||
if (isAdminApp()) {
|
||||
|
Loading…
Reference in New Issue
Block a user