longList(Product product)
+ {
+ Boolean showSenior = product.getShowSenior();
+ if (Objects.isNull(showSenior)){
+ //默认展示上级产品
+ product.setShowSenior(true);
+ }
+ if(product.getDeptId()==null){
+ Long deptUserId = getLoginUser().getUser().getDept().getDeptUserId();
+ product.setDeptId(getLoginUser().getDeptId());
+ product.setTenantId(deptUserId);
+ }
+
+ return productService.selectProductList(product);
+ }
+
/**
* 查询产品简短列表
*/
diff --git a/xinda-open-api/src/main/java/com/xinda/data/controller/ThingsModelStandardController.java b/xinda-open-api/src/main/java/com/xinda/data/controller/ThingsModelStandardController.java
index 57c433a..6102206 100644
--- a/xinda-open-api/src/main/java/com/xinda/data/controller/ThingsModelStandardController.java
+++ b/xinda-open-api/src/main/java/com/xinda/data/controller/ThingsModelStandardController.java
@@ -35,7 +35,6 @@ public class ThingsModelStandardController extends BaseController {
/**
* 查询通用物模型列表
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:list')")
@GetMapping("/list")
@ApiOperation("通用物模型分页列表")
public TableDataInfo list(ThingsModelStandard thingsModelStandard) {
@@ -46,7 +45,7 @@ public class ThingsModelStandardController extends BaseController {
/**
* 导出通用物模型列表
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:export')")
+
@Log(title = "通用物模型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ApiOperation("导出通用物模型")
@@ -59,7 +58,7 @@ public class ThingsModelStandardController extends BaseController {
/**
* 获取通用物模型详细信息
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:query')")
+
@GetMapping(value = "/{templateId}")
@ApiOperation("获取通用物模型详情")
public AjaxResult getInfo(@PathVariable("templateId") Long templateId) {
@@ -69,7 +68,6 @@ public class ThingsModelStandardController extends BaseController {
/**
* 新增通用物模型
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:add')")
@Log(title = "通用物模型", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("添加通用物模型")
@@ -99,7 +97,7 @@ public class ThingsModelStandardController extends BaseController {
/**
* 删除通用物模型
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:remove')")
+
@Log(title = "通用物模型", businessType = BusinessType.DELETE)
@DeleteMapping("/{templateIds}")
@ApiOperation("批量删除通用物模型")
@@ -125,7 +123,7 @@ public class ThingsModelStandardController extends BaseController {
/**
* 导入采集点
*/
- @PreAuthorize("@ss.hasPermi('iot:standard:add')")
+
@ApiOperation(value = "采集点导入")
@PostMapping(value = "/importData")
public AjaxResult importData(MultipartFile file, String tempSlaveId) throws Exception {
diff --git a/xinda-plugs/xinda-mqtt-client/src/main/java/com/xinda/mqttclient/PubMqttCallBack.java b/xinda-plugs/xinda-mqtt-client/src/main/java/com/xinda/mqttclient/PubMqttCallBack.java
index 64059dd..655178b 100644
--- a/xinda-plugs/xinda-mqtt-client/src/main/java/com/xinda/mqttclient/PubMqttCallBack.java
+++ b/xinda-plugs/xinda-mqtt-client/src/main/java/com/xinda/mqttclient/PubMqttCallBack.java
@@ -97,13 +97,6 @@ public class PubMqttCallBack implements MqttCallbackExtended {
log.info("MQTT内部客户端已经连接!");
System.out.print("" +
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" +
- " * _⚲_⚲_ ______ _ ____ * \n" +
- " * | / \\ | | ____| | | | _ \\ * \n" +
- " * | | | ● | | | | |__ __ _ ___| |_ | |_) | ___ ___ * \n" +
- " * | \\ / | | __/ _` / __| __| | _ < / _ \\/ _ \\ * \n" +
- " * \\ / | | | (_| \\__ \\ |_ | |_) | __/ __/ * \n" +
- " * V |_| \\__,_|___/\\__| |____/ \\___|\\___| * \n" +
- " * * \n" +
" * * * * * * * * * * * * XinDa物联网平台[✔启动成功] * * * * * * * * * * * * \n");
//连接后订阅, enable为false表示使用emq
diff --git a/xinda-protocol/xinda-protocol-collect/src/main/java/com/xinda/gkb/IECF6113ProtocolService.java b/xinda-protocol/xinda-protocol-collect/src/main/java/com/xinda/gkb/IECF6113ProtocolService.java
index 33cd54e..cd77ba4 100644
--- a/xinda-protocol/xinda-protocol-collect/src/main/java/com/xinda/gkb/IECF6113ProtocolService.java
+++ b/xinda-protocol/xinda-protocol-collect/src/main/java/com/xinda/gkb/IECF6113ProtocolService.java
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Component
-@SysProtocol(name = "IECF6113-JSON协议",protocolCode = XinDaConstant.PROTOCOL.IECF6113,description = "IECF6113-JSON协议")
+@SysProtocol(name = "IECF6113-JSON协议", protocolCode = XinDaConstant.PROTOCOL.IECF6113, description = "IECF6113-JSON协议")
public class IECF6113ProtocolService implements IProtocol {
@@ -49,67 +49,67 @@ public class IECF6113ProtocolService implements IProtocol {
/**
* 上报数据格式:
- * {
- * "AD6": 0.27333333333333,
- * "AD15": 0.27333333333333,
- * "AD14": 0.27333333333333,
- * "AD7": 0.27333333333333,
- * "AD11": 0.26,
- * "AD1": 0.27333333333333,
- * "AD4": 0.26,
- * "AD3": 0.26,
- * "AD10": 0.27333333333333,
- * "AD8": 0.26,
- * "AD16": 0.27333333333333,
- * "AD12": 0.26,
- * "AD13": 0.27333333333333,
- * "AD9": 0.27333333333333,
- * "AD2": 0.27333333333333,
- * "AD5": 0.27333333333333
- * }
- *
* {
- * "I0.1": 0,
- * "I0.3": 0,
- * "I0.4": 0,
- * "I0.6": 0,
- * "I0.5": 0,
- * "I0.2": 0
+ * "AD6": 0.27333333333333,
+ * "AD15": 0.27333333333333,
+ * "AD14": 0.27333333333333,
+ * "AD7": 0.27333333333333,
+ * "AD11": 0.26,
+ * "AD1": 0.27333333333333,
+ * "AD4": 0.26,
+ * "AD3": 0.26,
+ * "AD10": 0.27333333333333,
+ * "AD8": 0.26,
+ * "AD16": 0.27333333333333,
+ * "AD12": 0.26,
+ * "AD13": 0.27333333333333,
+ * "AD9": 0.27333333333333,
+ * "AD2": 0.27333333333333,
+ * "AD5": 0.27333333333333
* }
- *
+ *
* {
- * "lng": "104.0902886",
- * "lat": "030.8176553"
+ * "I0.1": 0,
+ * "I0.3": 0,
+ * "I0.4": 0,
+ * "I0.6": 0,
+ * "I0.5": 0,
+ * "I0.2": 0
* }
- *
+ *
* {
- * "PAD": 3905
+ * "lng": "104.0902886",
+ * "lat": "030.8176553"
* }
- *
- *
- *
+ *
+ * {
+ * "PAD": 3905
+ * }
+ *
+ *
+ *
* 下发报文格式
* device 从机编号
* name 标识符
* value 值
* serNo 流水号
* {
- * "device": 1,
- * "name": "template",
- * "value": 111,
- * "serNo": "213245489543789"
+ * "device": 1,
+ * "name": "template",
+ * "value": 111,
+ * "serNo": "213245489543789"
* }
*
- *
+ *
* 下发指令回复格式
* serNo 平台的流水号,用于对应回复消息
* ack 下发指令状态 0是失败 1是成功
- * {
- * "serNo": "213245489543789",
- * "ack": 1
+ * {
+ * "serNo": "213245489543789",
+ * "ack": 1
* }
*
- *
+ *
* {"AD6":0.20666666666667,"AD15":0.22,"AD14":0.22,"AD7":0.20666666666667,"AD11":0.20666666666667,
* "AD1":18.886666666667,"AD4":0.22,"AD3":0.22,"AD10":0.22,"AD8":15.526666666667,"AD16":0.22,"AD12":0.22,
* "AD13":0.22,"AD9":0.20666666666667,"AD2":0.22,"AD5":0.22}
@@ -118,58 +118,103 @@ public class IECF6113ProtocolService implements IProtocol {
* {"lng":"104.1536100","lat":"030.8336398","PAD":4185,"CSQ":28}
*/
private static final Set EXCLUDE_KEYS = new HashSet<>(Arrays.asList(
- "AD1", "AD2", "AD3","AD4", "AD5", "AD6","AD7", "AD8", "AD9","AD10", "AD11", "AD12",
- "AD13", "AD14", "AD15","AD16", "I0.1", "I0.2","I0.3", "I0.4", "I0.5","I0.6","lng", "lat", "PAD", "CSQ",
- "K0", "K1", "温度","温度1", "标况流量", "工况流量", "压力"
+ "AD1", "AD2", "AD3", "AD4", "AD5", "AD6", "AD7", "AD8", "AD9", "AD10", "AD11", "AD12",
+ "AD13", "AD14", "AD15", "AD16", "I0.1", "I0.2", "I0.3", "I0.4", "I0.5", "I0.6", "lng", "lat", "PAD", "CSQ",
+ "K0", "K1", "温度", "温度1", "标况流量", "工况流量", "压力"
));
+
@Override
public DeviceReport decode(DeviceData deviceData, String clientId) {
try {
DeviceReport reportMessage = new DeviceReport();
- String data = new String(deviceData.getData(),StandardCharsets.UTF_8);
+ String data = new String(deviceData.getData(), StandardCharsets.UTF_8);
List result = new ArrayList<>();
- if(data.trim().equals("ok")||data.trim().equals("ERROR")){
+ if (data.trim().equals("ok") || data.trim().equals("ERROR")) {
log.info(data);
- }else{
- Map values = JSON.parseObject(data, Map.class);
+ } else {
+ Map values = JSON.parseObject(data, Map.class);
// if (values.containsKey("AD1") || values.containsKey("lng") || values.containsKey("I0.1")||values.containsKey("PAD")||values.containsKey("K1")){
- // 初始化纬度变量,使用BigDecimal来存储高精度值
- BigDecimal latitude = new BigDecimal("39.9042");
- // 初始化经度变量,同样使用BigDecimal
- BigDecimal longitude = new BigDecimal("116.4074");
- for (Map.Entry entry : values.entrySet()) {
+ // 初始化纬度变量,使用BigDecimal来存储高精度值
+ BigDecimal latitude = new BigDecimal("39.9042");
+ // 初始化经度变量,同样使用BigDecimal
+ BigDecimal longitude = new BigDecimal("116.4074");
+ String volt = "";
+ Integer rssi = 0;
+ String sd = "";
+ String pd = "";
+ String imei = "";
+ String iccid = "";
+ Device device = new Device();
+ for (Map.Entry entry : values.entrySet()) {
// if (EXCLUDE_KEYS.contains(entry.getKey())){
- ThingsModelSimpleItem simpleItem = new ThingsModelSimpleItem();
- simpleItem.setTs(DateUtils.getNowDate());
- simpleItem.setId(entry.getKey());
- simpleItem.setValue(entry.getValue()+"");
- result.add(simpleItem);
- if(values.containsKey("lng")) {
- if (entry.getKey().equals("lng")) {
- longitude = new BigDecimal(entry.getValue() + "");
+ ThingsModelSimpleItem simpleItem = new ThingsModelSimpleItem();
+ simpleItem.setTs(DateUtils.getNowDate());
+ simpleItem.setId(entry.getKey());
+ simpleItem.setValue(entry.getValue() + "");
+ result.add(simpleItem);
+ if (entry.getKey().equals("lng")) {
+ longitude = new BigDecimal(entry.getValue() + "");
+ device.setLongitude(longitude);
- }
- if (entry.getKey().equals("lat")) {
- latitude = new BigDecimal(entry.getValue() + "");
-
- }
- //更新设备经纬度信息
- Device device = new Device();
- device.setSerialNumber(deviceData.getSerialNumber());
- device.setLongitude(longitude);
- device.setLatitude(latitude);
- deviceService.updateDeviceStatus(device);
- }
-// }
}
-// }
+ if (entry.getKey().equals("lat")) {
+ latitude = new BigDecimal(entry.getValue() + "");
+ device.setLatitude(latitude);
+
+ }
+ if (entry.getKey().equals("PAD")) {
+// volt = entry.getValue() + "";
+ BigDecimal num = new BigDecimal( entry.getValue() + "");
+ volt = num.divide(new BigDecimal("1000"), 2, BigDecimal.ROUND_HALF_UP).toPlainString();
+ device.setVolt(volt);
+ }
+ if (entry.getKey().equals("CSQ")) {
+ rssi = Integer.parseInt(entry.getValue() + "");
+ device.setRssi(rssi);
+ }
+
+ if (entry.getKey().equals("SD")) {
+ BigDecimal num1 = new BigDecimal( entry.getValue() + "");
+ sd = num1.divide(new BigDecimal("1000"), 3, BigDecimal.ROUND_HALF_UP).toPlainString();
+ device.setSd(sd);
+
+ }
+ if (entry.getKey().equals("BD")) {
+ BigDecimal num2 = new BigDecimal( entry.getValue() + "");
+ pd = num2.divide(new BigDecimal("1000"), 3, BigDecimal.ROUND_HALF_UP).toPlainString();
+ device.setPd(pd);
+ }
+ if (entry.getKey().equals("ICCID")) {
+ iccid = entry.getValue() + "";
+ device.setIccid(iccid);
+ }
+ if (entry.getKey().equals("IMEI")) {
+ imei = entry.getValue() + "";
+ device.setImei(imei);
+ }
+// }
+ }
+ if (values.containsKey("lng")) {
+ //更新设备经纬度信息
+// Device device = new Device();
+ device.setSerialNumber(deviceData.getSerialNumber());
+// device.setLongitude(longitude);
+// device.setLatitude(latitude);
+// device.setVolt(volt);
+// device.setRssi(rssi);
+// device.setSd(sd);
+// device.setPd(pd);
+ deviceService.updateDeviceStatus(device);
+ }
+
+
}
reportMessage.setThingsModelSimpleItem(result);
reportMessage.setClientId(clientId);
reportMessage.setSerialNumber(clientId);
return reportMessage;
- }catch (Exception e){
- throw new ServiceException("数据解析异常"+e.getMessage());
+ } catch (Exception e) {
+ throw new ServiceException("数据解析异常" + e.getMessage());
}
}
@@ -180,7 +225,8 @@ public class IECF6113ProtocolService implements IProtocol {
* 4.更改上报时间 GKB29810,JCZ,{"TIME":20}
* 5.通 信 控制 GKB29810,MODBUS, {"KO":12}
* 6.开关量输出控制 GKB29810,OUT,{"Q0.1":0,"Q0.2":0,"Q0.3":0,"Q0.4":0,"Q0.5":0,"Q0.6":0}
- * GKB29810,0UT,{"Q0.1":1 ,"Q0.2":1,"Q0.3":1,"Q0.4":1,"Q0.5":1 "Q0.6":1)
+ * GKB29810,0UT,{"Q0.1":1 ,"Q0.2":1,"Q0.3":1,"Q0.4":1,"Q0.5":1 "Q0.6":1)
+ *
* @param message
* @return
*/
@@ -238,21 +284,21 @@ public class IECF6113ProtocolService implements IProtocol {
callBack.setMessage(msg.toString().getBytes());
}
- if(params.containsKey("select")) {
- String msg = params.get("select") + "";
- callBack.setSources(msg);
- callBack.setMessage(msg.getBytes());
- }
- if(params.containsKey("OUT")){
- String msg = params.get("OUT") + "";
- callBack.setSources(msg);
- callBack.setMessage(msg.getBytes());
- }
- if(params.containsKey("TIME")){
- String msg = "GKB29810,JCZ,{\"TIME\":" + params.get("TIME")+ "}";
- callBack.setSources(msg);
- callBack.setMessage(msg.getBytes());
- }
+ if (params.containsKey("select")) {
+ String msg = params.get("select") + "";
+ callBack.setSources(msg);
+ callBack.setMessage(msg.getBytes());
+ }
+ if (params.containsKey("OUT")) {
+ String msg = params.get("OUT") + "";
+ callBack.setSources(msg);
+ callBack.setMessage(msg.getBytes());
+ }
+ if (params.containsKey("TIME")) {
+ String msg = "GKB29810,JCZ,{\"TIME\":" + params.get("TIME") + "}";
+ callBack.setSources(msg);
+ callBack.setMessage(msg.getBytes());
+ }
// 调用方法检查并获取以前缀开头的键和值
Map result = getKeysAndValuesWithPrefix(params, "Q0.");
// 输出结果
diff --git a/xinda-scada/src/main/java/com/xinda/scada/controller/ScadaController.java b/xinda-scada/src/main/java/com/xinda/scada/controller/ScadaController.java
index a93016e..e324684 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/controller/ScadaController.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/controller/ScadaController.java
@@ -7,10 +7,12 @@ import com.xinda.common.config.RuoYiConfig;
import com.xinda.common.constant.HttpStatus;
import com.xinda.common.core.controller.BaseController;
import com.xinda.common.core.domain.AjaxResult;
+import com.xinda.common.core.domain.entity.SysUser;
import com.xinda.common.core.page.TableDataInfo;
import com.xinda.common.enums.BusinessType;
import com.xinda.common.exception.ServiceException;
import com.xinda.common.exception.file.InvalidExtensionException;
+import com.xinda.common.utils.MessageUtils;
import com.xinda.common.utils.StringUtils;
import com.xinda.common.utils.file.MimeTypeUtils;
import com.xinda.common.utils.poi.ExcelUtil;
@@ -23,15 +25,13 @@ import com.xinda.iot.service.IDeviceService;
import com.xinda.scada.domain.Scada;
import com.xinda.scada.domain.ScadaDeviceBind;
import com.xinda.scada.domain.ScadaGallery;
+import com.xinda.scada.enums.ScadaTypeEnum;
import com.xinda.scada.service.IScadaDeviceBindService;
import com.xinda.scada.service.IScadaService;
import com.xinda.scada.utils.ScadaCollectionUtils;
import com.xinda.scada.utils.ScadaFileUploadUtils;
import com.xinda.scada.utils.ScadaFileUtils;
-import com.xinda.scada.vo.DeviceRealDataVO;
-import com.xinda.scada.vo.FavoritesVO;
-import com.xinda.scada.vo.ScadaDeviceBindDTO;
-import com.xinda.scada.vo.ThingsModelHistoryParam;
+import com.xinda.scada.vo.*;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -115,9 +115,9 @@ public class ScadaController extends BaseController
@PreAuthorize("@ss.hasPermi('scada:center:add')")
@Log(title = "组态中心", businessType = BusinessType.INSERT)
@PostMapping
- public AjaxResult add(@RequestBody Scada scada)
+ public AjaxResult add(@RequestBody ScadaVO scadaVO)
{
- return scadaService.insertScada(scada);
+ return scadaService.insertScada(scadaVO);
}
/**
@@ -127,9 +127,9 @@ public class ScadaController extends BaseController
@PreAuthorize("@ss.hasPermi('scada:center:edit')")
@Log(title = "组态中心", businessType = BusinessType.UPDATE)
@PutMapping
- public AjaxResult edit(@RequestBody Scada scada)
+ public AjaxResult edit(@RequestBody ScadaVO scadaVO)
{
- return toAjax(scadaService.updateScada(scada));
+ return toAjax(scadaService.updateScada(scadaVO));
}
/**
@@ -164,32 +164,43 @@ public class ScadaController extends BaseController
@Log(title = "组态中心", businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('scada:center:edit')")
@PostMapping("/save")
- public AjaxResult save(@RequestBody Scada scada)
+ public AjaxResult save(@RequestBody ScadaVO scadaVO)
{
- if (StringUtils.isEmpty(scada.getGuid())) {
- return AjaxResult.error("guid不能为空");
+ if (StringUtils.isEmpty(scadaVO.getGuid())) {
+ return AjaxResult.error(MessageUtils.message("scada.guid.cannot.empty"));
+ }
+ if (null == scadaVO.getType()) {
+ scadaVO.setType(ScadaTypeEnum.PUBLIC.getType());
}
Scada scadaQuery = new Scada();
- scadaQuery.setGuid(scada.getGuid());
- List scadaList = scadaService.selectScadaList(scadaQuery);
- if (StringUtils.isNotEmpty(scada.getBase64())) {
- MultipartFile multipartFile = ScadaFileUtils.base64toMultipartFile(scada.getBase64());
+ scadaQuery.setGuid(scadaVO.getGuid());
+ List scadaVOList = scadaService.listScadaVO(scadaQuery);
+ if (StringUtils.isNotEmpty(scadaVO.getBase64())) {
+ MultipartFile multipartFile = ScadaFileUtils.base64toMultipartFile(scadaVO.getBase64());
String url;
try {
url = ScadaFileUploadUtils.upload(RuoYiConfig.getUploadPath(), multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
} catch (IOException | InvalidExtensionException e) {
- throw new ServiceException("修改组态base64转图片异常" + e.getMessage());
+ throw new ServiceException(StringUtils.format(MessageUtils.message("scada.base64.change.image.exception"), e.getMessage()));
}
- scada.setPageImage(url);
+ scadaVO.setPageImage(url);
}
- if (CollectionUtils.isNotEmpty(scadaList)) {
- Scada updateScada = scadaList.get(0);
- updateScada.setScadaData(scada.getScadaData());
- updateScada.setPageImage(scada.getPageImage());
- scadaService.updateScada(updateScada);
+ if (CollectionUtils.isNotEmpty(scadaVOList)) {
+ ScadaVO updateScadaVO = scadaVOList.get(0);
+ updateScadaVO.setScadaData(scadaVO.getScadaData());
+ updateScadaVO.setPageImage(scadaVO.getPageImage());
+ scadaService.updateScada(updateScadaVO);
} else {
- scadaService.insertScada(scada);
-// scadaDeviceBindService.insertScadaDeviceBind()
+ // 多租户版本使用
+ SysUser user = getLoginUser().getUser();
+ if (null != user.getDeptId()) {
+ scadaVO.setTenantId(user.getDept().getDeptUserId());
+ scadaVO.setTenantName(user.getDept().getDeptUserName());
+ } else {
+ scadaVO.setTenantId(user.getUserId());
+ scadaVO.setTenantName(user.getUserName());
+ }
+ scadaService.insertScada(scadaVO);
}
return AjaxResult.success();
}
@@ -374,39 +385,7 @@ public class ScadaController extends BaseController
// @PreAuthorize("@ss.hasPermi('scada:center:add')")
@PostMapping("/importJson")
public AjaxResult importJson(MultipartFile file, String guid) throws IOException {
- InputStream inputStream = file.getInputStream();
- if(file.isEmpty()){
- return AjaxResult.error("无效的配置文件");
- }
- if(file.getOriginalFilename().indexOf("json")==-1){
- return AjaxResult.error("无效的配置文件");
- }
- Scada scada = new Scada();
- try {
- scada = JSON.parseObject(inputStream, Scada.class);
- }catch (Exception e){
- return AjaxResult.error("无效的配置文件");
- }finally {
- inputStream.close();
- }
- Scada oldScada = new Scada();
- if (StringUtils.isNotEmpty(guid)) {
- Scada queryScada = new Scada();
- queryScada.setGuid(guid);
- List scadaList = scadaService.selectScadaList(queryScada);
- if (CollectionUtils.isNotEmpty(scadaList)) {
- oldScada = scadaList.get(0);
- }
- }
- if (oldScada == null) {
- guid= UUID.randomUUID().toString();
- scada.setGuid(guid);
- scadaService.insertScada(scada);
- } else {
- scada.setId(oldScada.getId());
- scadaService.updateScada(scada);
- }
- return AjaxResult.success("导入成功");
+ return scadaService.importJson(file, guid);
}
/**
diff --git a/xinda-scada/src/main/java/com/xinda/scada/convert/ScadaConvert.java b/xinda-scada/src/main/java/com/xinda/scada/convert/ScadaConvert.java
new file mode 100644
index 0000000..aad18f8
--- /dev/null
+++ b/xinda-scada/src/main/java/com/xinda/scada/convert/ScadaConvert.java
@@ -0,0 +1,70 @@
+package com.xinda.scada.convert;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xinda.scada.domain.Scada;
+import com.xinda.scada.vo.ScadaVO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+/**
+ * 组态页面Convert转换类
+ *
+ * @author zhuangpeng.li
+ * @date 2024-12-04
+ */
+@Mapper
+public interface ScadaConvert
+{
+
+ ScadaConvert INSTANCE = Mappers.getMapper(ScadaConvert.class);
+
+ /**
+ * 实体类转换为VO类
+ *
+ * @param scada
+ * @return 组态页面集合
+ */
+ ScadaVO convertScadaVO(Scada scada);
+
+ /**
+ * VO类转换为实体类集合
+ *
+ * @param scadaVO
+ * @return 组态页面集合
+ */
+ Scada convertScada(ScadaVO scadaVO);
+
+ /**
+ * 实体类转换为VO类集合
+ *
+ * @param scadaList
+ * @return 组态页面集合
+ */
+ List convertScadaVOList(List scadaList);
+
+ /**
+ * VO类转换为实体类
+ *
+ * @param scadaVOList
+ * @return 组态页面集合
+ */
+ List convertScadaList(List scadaVOList);
+
+ /**
+ * 实体类转换为VO类分页
+ *
+ * @param scadaPage
+ * @return 组态页面分页
+ */
+ Page convertScadaVOPage(Page scadaPage);
+
+ /**
+ * VO类转换为实体类
+ *
+ * @param scadaVOPage
+ * @return 组态页面分页
+ */
+ Page convertScadaPage(Page scadaVOPage);
+}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/domain/Scada.java b/xinda-scada/src/main/java/com/xinda/scada/domain/Scada.java
index 613f80f..7b79223 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/domain/Scada.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/domain/Scada.java
@@ -4,6 +4,7 @@ import com.xinda.common.annotation.Excel;
import com.xinda.common.core.domain.BaseEntity;
import com.xinda.scada.vo.ScadaBindDeviceSimVO;
import com.xinda.scada.vo.ScadaDeviceBindVO;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@@ -70,6 +71,8 @@ public class Scada extends BaseEntity
@Excel(name = "页面图片")
private String pageImage;
+ private Long deptId;
+
/** 租户id */
@Excel(name = "租户id")
private Long tenantId;
@@ -83,6 +86,10 @@ public class Scada extends BaseEntity
private String base64;
+ /** 组态类型 1- 模板组态 2- 场景组态 3-公共组态 */
+ @ApiModelProperty("组态类型 1- 模板组态 2- 场景组态 3-公共组态")
+ private Integer type;
+
private List bindDeviceList;
}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/enums/ScadaTypeEnum.java b/xinda-scada/src/main/java/com/xinda/scada/enums/ScadaTypeEnum.java
new file mode 100644
index 0000000..9013aad
--- /dev/null
+++ b/xinda-scada/src/main/java/com/xinda/scada/enums/ScadaTypeEnum.java
@@ -0,0 +1,38 @@
+package com.xinda.scada.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 组态类型枚举
+ * @author fastb
+ * @date 2024-05-22 10:01
+ * @version 1.0
+ */
+@Getter
+@AllArgsConstructor
+public enum ScadaTypeEnum {
+
+ PRODUCT_TEMPLATE(1, "模版组态"),
+ SCENE_MODEL(2, "场景组态"),
+ PUBLIC(3, "公共组态");
+
+
+
+ private final Integer type;
+
+ private final String name;
+
+ public static ScadaTypeEnum getByType(Integer type) {
+ for (ScadaTypeEnum scadaTypeEnum : ScadaTypeEnum.values()) {
+ if (scadaTypeEnum.getType().equals(type)) {
+ return scadaTypeEnum;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaDeviceBindMapper.java b/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaDeviceBindMapper.java
index 146c7a7..47fe9e6 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaDeviceBindMapper.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaDeviceBindMapper.java
@@ -69,4 +69,6 @@ public interface ScadaDeviceBindMapper
* @return java.util.List
*/
List listDeviceSimByGuid(String guid);
+
+ List selectScadaDeviceBindListByIds(List guidList);
}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaMapper.java b/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaMapper.java
index 9c2ea70..c6964c9 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaMapper.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/mapper/ScadaMapper.java
@@ -59,6 +59,7 @@ public interface ScadaMapper
*/
public int deleteScadaById(Long id);
+ public int deleteScadaByGuid(String guid);
/**
* 批量删除组态中心
*
@@ -96,4 +97,20 @@ public interface ScadaMapper
* @return java.util.List
*/
List listEventLogHistory(EventLog eventLog);
+
+ String selectGuidBySceneModelId(Long sceneModelId);
+
+ String selectGuidByProductId(Long productId);
+
+ void updateProductGuid(@Param("productId") Long productId, @Param("guid") String guid);
+
+ void updateSceneModelGuid( @Param("sceneModelId") Long sceneModelId, @Param("guid") String guid);
+
+ void deleteProductByGuids(List guids);
+
+ void deleteSceneModelByGuids(List guids);
+
+ Long selectProductByGuid(String guid);
+
+ Long selectSceneModelByGuid(String guid);
}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/service/IScadaService.java b/xinda-scada/src/main/java/com/xinda/scada/service/IScadaService.java
index 3d04620..256e658 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/service/IScadaService.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/service/IScadaService.java
@@ -3,19 +3,17 @@ package com.xinda.scada.service;
import com.xinda.common.core.domain.AjaxResult;
import com.xinda.scada.domain.Scada;
import com.xinda.scada.domain.ScadaGallery;
-import com.xinda.scada.vo.FavoritesVO;
-import com.xinda.scada.vo.ScadaHistoryModelVO;
-import com.xinda.scada.vo.ScadaStatisticVO;
-import com.xinda.scada.vo.ThingsModelHistoryParam;
+import com.xinda.scada.vo.*;
import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* 组态中心Service接口
*
- * @author kerwincui
+ * @author kerwincuiIScadaService
* @date 2023-11-10
*/
public interface IScadaService
@@ -26,7 +24,7 @@ public interface IScadaService
* @param id 组态中心主键
* @return 组态中心
*/
- public Scada selectScadaById(Long id);
+ public ScadaVO selectScadaById(Long id);
/**
* 查询组态中心列表
@@ -39,18 +37,20 @@ public interface IScadaService
/**
* 新增组态中心
*
- * @param scada 组态中心
+ * @param scadaVO 组态中心
* @return 结果
*/
+ public AjaxResult insertScada(ScadaVO scadaVO);
+
public AjaxResult insertScada(Scada scada);
/**
* 修改组态中心
*
- * @param scada 组态中心
+ * @param scadaVO 组态中心
* @return 结果
*/
- public int updateScada(Scada scada);
+ public int updateScada(ScadaVO scadaVO);
/**
* 批量删除组态中心
@@ -68,6 +68,8 @@ public interface IScadaService
*/
public int deleteScadaById(Long id);
+ public int deleteScadaByGuid(String guid);
+
/**
* 根据guid获取组态详情
* @param guid 组态id
@@ -120,4 +122,8 @@ public interface IScadaService
* @return com.xinda.common.core.domain.AjaxResult
*/
ScadaStatisticVO selectStatistic();
+
+ List listScadaVO(Scada scadaQuery);
+
+ AjaxResult importJson(MultipartFile file, String guid) throws IOException;
}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/service/impl/ScadaServiceImpl.java b/xinda-scada/src/main/java/com/xinda/scada/service/impl/ScadaServiceImpl.java
index cc20525..728c8a8 100644
--- a/xinda-scada/src/main/java/com/xinda/scada/service/impl/ScadaServiceImpl.java
+++ b/xinda-scada/src/main/java/com/xinda/scada/service/impl/ScadaServiceImpl.java
@@ -1,12 +1,17 @@
package com.xinda.scada.service.impl;
+import com.alibaba.fastjson2.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xinda.common.config.RuoYiConfig;
+import com.xinda.common.constant.HttpStatus;
import com.xinda.common.core.domain.AjaxResult;
import com.xinda.common.core.domain.entity.SysRole;
import com.xinda.common.core.domain.entity.SysUser;
import com.xinda.common.core.domain.model.LoginUser;
import com.xinda.common.core.redis.RedisCache;
+import com.xinda.common.exception.ServiceException;
import com.xinda.common.utils.DateUtils;
+import com.xinda.common.utils.MessageUtils;
import com.xinda.common.utils.StringUtils;
import com.xinda.common.utils.bean.BeanUtils;
import com.xinda.common.utils.file.FileUploadUtils;
@@ -15,8 +20,11 @@ import com.xinda.iot.domain.EventLog;
import com.xinda.iot.domain.FunctionLog;
import com.xinda.iot.model.HistoryModel;
import com.xinda.iot.service.IDeviceLogService;
+import com.xinda.scada.convert.ScadaConvert;
import com.xinda.scada.domain.Scada;
+import com.xinda.scada.domain.ScadaDeviceBind;
import com.xinda.scada.domain.ScadaGallery;
+import com.xinda.scada.enums.ScadaTypeEnum;
import com.xinda.scada.mapper.ScadaDeviceBindMapper;
import com.xinda.scada.mapper.ScadaGalleryMapper;
import com.xinda.scada.mapper.ScadaMapper;
@@ -27,6 +35,8 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
@@ -59,9 +69,21 @@ public class ScadaServiceImpl implements IScadaService
* @return 组态中心
*/
@Override
- public Scada selectScadaById(Long id)
+ public ScadaVO selectScadaById(Long id)
{
- return scadaMapper.selectScadaById(id);
+ Scada scada = scadaMapper.selectScadaById(id);
+ if (Objects.isNull(scada)) {
+ return null;
+ }
+ ScadaVO scadaVO = ScadaConvert.INSTANCE.convertScadaVO(scada);
+ if (ScadaTypeEnum.PRODUCT_TEMPLATE.getType().equals(scada.getType())) {
+ Long productId = scadaMapper.selectProductByGuid(scada.getGuid());
+ scadaVO.setProductId(productId);
+ } else if (ScadaTypeEnum.SCENE_MODEL.getType().equals(scada.getType())) {
+ Long sceneModelId = scadaMapper.selectSceneModelByGuid(scada.getGuid());
+ scadaVO.setSceneModelId(sceneModelId);
+ }
+ return scadaVO;
}
/**
@@ -79,32 +101,126 @@ public class ScadaServiceImpl implements IScadaService
/**
* 新增组态中心
*
- * @param scada 组态中心
+ * @param scadaVO 组态中心
* @return 结果
*/
@Override
- public AjaxResult insertScada(Scada scada)
+ public AjaxResult insertScada(ScadaVO scadaVO)
{
+// scadaVO.setPageName("综合测试GKB-29813组态");
+// scadaVO.setProductId(219L);
+// scadaVO.setType(1);
LoginUser loginUser = getLoginUser();
if (loginUser == null) {
- return AjaxResult.error("请登录后重试!");
+ return AjaxResult.error(MessageUtils.message("scada.please.login"));
+ }
+ if (ScadaTypeEnum.PRODUCT_TEMPLATE.getType().equals(scadaVO.getType())) {
+ String guid = scadaMapper.selectGuidByProductId(scadaVO.getProductId());
+ if (StringUtils.isNotEmpty(guid)){
+ return AjaxResult.warn(MessageUtils.message("scada.product.has.relate.please.select.again"));
+ }
+ }
+ if (ScadaTypeEnum.SCENE_MODEL.getType().equals(scadaVO.getType())) {
+ String guid = scadaMapper.selectGuidBySceneModelId(scadaVO.getSceneModelId());
+ if (StringUtils.isNotEmpty(guid)){
+ return AjaxResult.warn(MessageUtils.message("scada.scene.has.relate.please.select.again"));
+ }
+ }
+ // 多租户版本使用
+ SysUser user = getLoginUser().getUser();
+ if (null != user.getDeptId()) {
+ scadaVO.setTenantId(user.getDept().getDeptUserId());
+ scadaVO.setTenantName(user.getDept().getDeptUserName());
+ } else {
+ scadaVO.setTenantId(user.getUserId());
+ scadaVO.setTenantName(user.getUserName());
+ }
+ scadaVO.setCreateBy(loginUser.getUserId().toString());
+ UUID uuid = UUID.randomUUID();
+ scadaVO.setGuid(uuid.toString());
+ Scada scada = ScadaConvert.INSTANCE.convertScada(scadaVO);
+ int result = scadaMapper.insertScada(scada);
+ if (result >0){
+ if (ScadaTypeEnum.PRODUCT_TEMPLATE.getType().equals(scadaVO.getType())) {
+ scadaMapper.updateProductGuid(scadaVO.getProductId(), uuid.toString());
+ }
+ if (ScadaTypeEnum.SCENE_MODEL.getType().equals(scadaVO.getType())) {
+ scadaMapper.updateSceneModelGuid(scadaVO.getSceneModelId(), uuid.toString());
+ }
+ return AjaxResult.success(uuid.toString());
+ }else {
+ return AjaxResult.error();
+ }
+ }
+
+ @Override
+ public AjaxResult insertScada(Scada scada){
+
+ LoginUser loginUser = getLoginUser();
+ if (loginUser == null) {
+ return AjaxResult.error(MessageUtils.message("scada.please.login"));
+ }
+ // 多租户版本使用
+ SysUser user = getLoginUser().getUser();
+ if (null != user.getDeptId()) {
+ scada.setTenantId(user.getDept().getDeptUserId());
+ scada.setTenantName(user.getDept().getDeptUserName());
+ } else {
+ scada.setTenantId(user.getUserId());
+ scada.setTenantName(user.getUserName());
}
scada.setCreateBy(loginUser.getUserId().toString());
- UUID uuid = UUID.randomUUID();
- scada.setGuid(uuid.toString());
- return scadaMapper.insertScada(scada) > 0 ? AjaxResult.success() : AjaxResult.error();
+ int result = scadaMapper.insertScada(scada);
+ if (result >0){
+ return AjaxResult.success(scada.getGuid());
+ }else {
+ return AjaxResult.error();
+ }
}
+ /**
+ * 查询组态页面列表
+ *
+ * @param scada 组态页面
+ * @return 组态页面
+ */
+ @Override
+ public List listScadaVO(Scada scada) {
+ List scadaList = scadaMapper.selectScadaList(scada);
+ return ScadaConvert.INSTANCE.convertScadaVOList(scadaList);
+ }
+
+
/**
* 修改组态中心
*
- * @param scada 组态中心
+ * @param scadaVO 组态中心
* @return 结果
*/
@Override
- public int updateScada(Scada scada)
+ public int updateScada(ScadaVO scadaVO)
{
- scada.setUpdateTime(DateUtils.getNowDate());
+ if (ScadaTypeEnum.PRODUCT_TEMPLATE.getType().equals(scadaVO.getType()) && null != scadaVO.getProductId()) {
+ String guid = scadaMapper.selectGuidByProductId(scadaVO.getProductId());
+ if (StringUtils.isNotEmpty(guid) && !guid.equals(scadaVO.getGuid())){
+ throw new ServiceException(MessageUtils.message("scada.product.has.relate.please.select.again"), HttpStatus.WARN);
+ }
+ if (StringUtils.isEmpty(guid)) {
+ scadaMapper.deleteProductByGuids(Collections.singletonList(scadaVO.getGuid()));
+ scadaMapper.updateProductGuid(scadaVO.getProductId(), scadaVO.getGuid());
+ }
+ }
+ if (ScadaTypeEnum.SCENE_MODEL.getType().equals(scadaVO.getType()) && null != scadaVO.getSceneModelId()) {
+ String guid = scadaMapper.selectGuidBySceneModelId(scadaVO.getSceneModelId());
+ if (StringUtils.isNotEmpty(guid) && !guid.equals(scadaVO.getGuid())){
+ throw new ServiceException(MessageUtils.message("scada.scene.has.relate.please.select.again"), HttpStatus.WARN);
+ }
+ if (StringUtils.isEmpty(guid)) {
+ scadaMapper.deleteSceneModelByGuids(Collections.singletonList(scadaVO.getGuid()));
+ scadaMapper.updateSceneModelGuid(scadaVO.getSceneModelId(), scadaVO.getGuid());
+ }
+ }
+ Scada scada = ScadaConvert.INSTANCE.convertScada(scadaVO);
return scadaMapper.updateScada(scada);
}
@@ -132,6 +248,11 @@ public class ScadaServiceImpl implements IScadaService
return scadaMapper.deleteScadaById(id);
}
+ @Override
+ public int deleteScadaByGuid(String guid) {
+ return scadaMapper.deleteScadaByGuid(guid);
+ }
+
/**
* 根据guid获取组态详情
* @param guid 组态id
@@ -301,4 +422,60 @@ public class ScadaServiceImpl implements IScadaService
}
return statistic;
}
+
+ @Override
+ public AjaxResult importJson(MultipartFile file, String guid) throws IOException {
+ InputStream inputStream = file.getInputStream();
+ if(file.isEmpty()){
+ return AjaxResult.error(MessageUtils.message("scada.invalid.profile"));
+ }
+ if(file.getOriginalFilename().indexOf("json")==-1){
+ return AjaxResult.error(MessageUtils.message("scada.invalid.profile"));
+ }
+ Scada scada = new Scada();
+ try {
+ scada = JSON.parseObject(inputStream, Scada.class);
+ }catch (Exception e){
+ return AjaxResult.error(MessageUtils.message("scada.invalid.profile"));
+ }finally {
+ inputStream.close();
+ }
+ Scada oldScada = new Scada();
+ if (StringUtils.isNotEmpty(guid)) {
+ Scada queryScada = new Scada();
+ queryScada.setGuid(guid);
+ List scadaList = scadaMapper.selectScadaList(queryScada);
+ if (CollectionUtils.isNotEmpty(scadaList)) {
+ oldScada = scadaList.get(0);
+ }
+ }
+ String importGuid = scada.getGuid();
+ Long tenantId = scada.getTenantId();
+ oldScada.setScadaData(scada.getScadaData());
+ int i = scadaMapper.updateScada(oldScada);
+ if (i <= 0) {
+ return AjaxResult.error(MessageUtils.message("import.fail"));
+ }
+ if (!tenantId.equals(oldScada.getTenantId())) {
+ return AjaxResult.success(MessageUtils.message("scada.import.success.need.replace.variable"));
+ }
+ if (StringUtils.isNotEmpty(importGuid) && ScadaTypeEnum.PUBLIC.getType().equals(oldScada.getType())
+ && ScadaTypeEnum.PUBLIC.getType().equals(scada.getType())) {
+ List guidList = Arrays.asList(guid, importGuid);
+ List scadaDeviceBinds = scadaDeviceBindMapper.selectScadaDeviceBindListByIds(guidList);
+ if (CollectionUtils.isNotEmpty(scadaDeviceBinds)) {
+ List serialNumbers = scadaDeviceBinds.stream().filter(d -> guid.equals(d.getScadaGuid())).map(ScadaDeviceBind::getSerialNumber).collect(Collectors.toCollection(ArrayList::new));
+ List importSerialNumbers = scadaDeviceBinds.stream().filter(d -> importGuid.equals(d.getScadaGuid())).map(ScadaDeviceBind::getSerialNumber).collect(Collectors.toCollection(ArrayList::new));
+ importSerialNumbers.removeAll(serialNumbers);
+ for (String importSerialNumber : importSerialNumbers) {
+ ScadaDeviceBind scadaDeviceBind = new ScadaDeviceBind();
+ scadaDeviceBind.setScadaGuid(guid);
+ scadaDeviceBind.setSerialNumber(importSerialNumber);
+ scadaDeviceBindMapper.insertScadaDeviceBind(scadaDeviceBind);
+ }
+ }
+ return AjaxResult.success(MessageUtils.message("import.success"));
+ }
+ return AjaxResult.success(MessageUtils.message("scada.import.success.need.replace.variable"));
+ }
}
diff --git a/xinda-scada/src/main/java/com/xinda/scada/vo/ScadaVO.java b/xinda-scada/src/main/java/com/xinda/scada/vo/ScadaVO.java
new file mode 100644
index 0000000..bbc6e9c
--- /dev/null
+++ b/xinda-scada/src/main/java/com/xinda/scada/vo/ScadaVO.java
@@ -0,0 +1,162 @@
+package com.xinda.scada.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.xinda.common.annotation.Excel;
+import com.xinda.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.*;
+
+
+/**
+ * 组态页面对象 scada
+ *
+ * @author zhuangpeng.li
+ * @date 2024-12-04
+ */
+
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ScadaVO", description = "组态页面 scada")
+@Data
+public class ScadaVO extends BaseEntity {
+
+ /** id唯一标识 */
+ @Excel(name = "id唯一标识")
+ @ApiModelProperty("id唯一标识")
+ private Long id;
+
+ /** 组态id */
+ @Excel(name = "组态id")
+ @ApiModelProperty("组态id")
+ private String guid;
+
+ /** 组态信息 */
+ @Excel(name = "组态信息")
+ @ApiModelProperty("组态信息")
+ private String scadaData;
+
+ /** 设备编号 */
+ @Excel(name = "设备编号")
+ @ApiModelProperty("设备编号")
+ private String serialNumbers;
+
+ /** 设备名称 */
+ @Excel(name = "设备名称")
+ @ApiModelProperty("设备名称")
+ private String deviceName;
+
+ /** 是否主界面 */
+ @Excel(name = "是否主界面")
+ @ApiModelProperty("是否主界面")
+ private Integer isMainPage;
+
+ /** 页面名称 */
+ @Excel(name = "页面名称")
+ @ApiModelProperty("页面名称")
+ private String pageName;
+
+ /** 页面大小 */
+ @Excel(name = "页面大小")
+ @ApiModelProperty("页面大小")
+ private String pageResolution;
+
+ /** 是否分享 */
+ @Excel(name = "是否分享")
+ @ApiModelProperty("是否分享")
+ private Integer isShare;
+
+ /** 分享链接 */
+ @Excel(name = "分享链接")
+ @ApiModelProperty("分享链接")
+ private String shareUrl;
+
+ /** 分享密码 */
+ @Excel(name = "分享密码")
+ @ApiModelProperty("分享密码")
+ private String sharePass;
+
+ /** 页面图片 */
+ @Excel(name = "页面图片")
+ @ApiModelProperty("页面图片")
+ private String pageImage;
+
+ /** 租户id */
+ @Excel(name = "租户id")
+ @ApiModelProperty("租户id")
+ private Long tenantId;
+
+ /** 租户名称 */
+ @Excel(name = "租户名称")
+ @ApiModelProperty("租户名称")
+ private String tenantName;
+
+ /** 创建人 */
+ @Excel(name = "创建人")
+ @ApiModelProperty("创建人")
+ private String createBy;
+
+ /** 创建时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("创建时间")
+ @Excel(name = "创建时间")
+ private Date createTime;
+
+ /** 更新人 */
+ @Excel(name = "更新人")
+ @ApiModelProperty("更新人")
+ private String updateBy;
+
+ /** 更新时间 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("更新时间")
+ @Excel(name = "更新时间")
+ private Date updateTime;
+
+ /** 逻辑删除标识 */
+ @Excel(name = "逻辑删除标识")
+ @ApiModelProperty("逻辑删除标识")
+ private Integer delFlag;
+
+ /** 备注 */
+ @Excel(name = "备注")
+ @ApiModelProperty("备注")
+ private String remark;
+
+ /** 组态类型 1- 模板组态 2- 场景组态 3-公共组态 */
+ @Excel(name = "组态类型 1- 模板组态 2- 场景组态 3-公共组态")
+ @ApiModelProperty("组态类型 1- 模板组态 2- 场景组态 3-公共组态")
+ private Integer type;
+
+ /** 分享短链接 */
+ @Excel(name = "分享短链接")
+ @ApiModelProperty("分享短链接")
+ private String shareShortUrl;
+
+ /**
+ * 绑定的产品id
+ */
+ private Long productId;
+
+ /**
+ * 场景id
+ */
+ private Long sceneModelId;
+
+ private List bindDeviceList = new ArrayList<>();
+
+ private String base64;
+
+ /**
+ * 设备编号
+ */
+ private String serialNumber;
+
+}
diff --git a/xinda-scada/src/main/resources/mapper/ScadaDeviceBindMapper.xml b/xinda-scada/src/main/resources/mapper/ScadaDeviceBindMapper.xml
index 044bbae..0025e35 100644
--- a/xinda-scada/src/main/resources/mapper/ScadaDeviceBindMapper.xml
+++ b/xinda-scada/src/main/resources/mapper/ScadaDeviceBindMapper.xml
@@ -22,6 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+