From b291d46184e69b11cd9fa045e6d06be084d4203b Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 18 十二月 2025 20:38:36 +0800
Subject: [PATCH] 大屏标语配置,及大屏推送
---
fzzy-igdss-web/src/main/resources/static/group/gis.js | 15
fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketPacket.java | 50 +++
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SloganService.java | 74 ++++
fzzy-igdss-web/src/main/resources/templates/group/index.html | 1
fzzy-igdss-view/src/main/java/com/fzzy/igds/SloganPR.java | 124 ++++++++
fzzy-igdss-view/src/main/java/models/core.model.xml | 82 +++++
fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/common/CommonManager.java | 25 +
fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/group/GroupController.java | 15
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Slogan.java | 59 +++
fzzy-igdss-web/src/main/resources/static/group/video.js | 15 +
fzzy-igdss-view/src/main/java/com/fzzy/igds/Slogan.view.xml | 198 +++++++++++++
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml | 8
fzzy-igdss-web/src/main/resources/static/group/index.js | 17
fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketServer.java | 169 +++++++++++
fzzy-igdss-web/src/main/resources/static/common/igds-common.js | 21 +
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/SloganMapper.java | 15 +
16 files changed, 872 insertions(+), 16 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Slogan.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Slogan.java
new file mode 100644
index 0000000..7b447a5
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Slogan.java
@@ -0,0 +1,59 @@
+package com.fzzy.igds.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.bstek.dorado.annotation.PropertyDef;
+import com.fzzy.igds.constant.Constant;
+import lombok.Data;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description 澶у睆鏍囪
+ * @Author CZT
+ * @Date 2025/12/18 11:41
+ */
+@Data
+@Entity
+@Table(name = "d_slogan")
+@TableName("d_slogan")
+public class Slogan extends BizBaseEntity implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "id", length = 50)
+ @PropertyDef(label = "id")
+ private String id;
+
+ @Column(name = "name", columnDefinition = "varchar(50) COMMENT '鍚嶇О'")
+ @TableField("name")
+ private String name;
+
+ @Column(name = "content", columnDefinition = "varchar(200) COMMENT '鏍囪鍐呭'")
+ @TableField("content")
+ private String content;
+
+ @Column(name = "status", columnDefinition = "varchar(50) COMMENT '鐘舵��(N-涓嶄娇鐢紱Y-浣跨敤)'")
+ @TableField("status")
+ private String status = Constant.YN_N;
+
+ @Column(name = "color", columnDefinition = "varchar(50) COMMENT '棰滆壊'")
+ @TableField("color")
+ private String color ;
+
+ @Column(name = "push_user", columnDefinition = "varchar(50) COMMENT '鎺ㄩ�佷汉'")
+ @TableField("push_user")
+ private String pushUser ;
+
+ @Column(name = "push_time", columnDefinition = "dateTime COMMENT '鍙戝竷鏃堕棿'")
+ @TableField("push_time")
+ private Date pushTime ;
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/SloganMapper.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/SloganMapper.java
new file mode 100644
index 0000000..d5f14e7
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/SloganMapper.java
@@ -0,0 +1,15 @@
+package com.fzzy.igds.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fzzy.igds.domain.Slogan;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Description
+ * @Author CZT
+ * @Date 2025/12/18 19:19
+ */
+@Mapper
+public interface SloganMapper extends BaseMapper<Slogan> {
+
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SloganService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SloganService.java
new file mode 100644
index 0000000..71dc3e0
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SloganService.java
@@ -0,0 +1,74 @@
+package com.fzzy.igds.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fzzy.igds.constant.Constant;
+import com.fzzy.igds.domain.Slogan;
+import com.fzzy.igds.mapper.SloganMapper;
+import com.fzzy.igds.utils.ContextUtil;
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description service灞�
+ * @Author CZT
+ * @Date 2025/12/18 19:19
+ */
+@Service
+public class SloganService {
+
+ @Resource
+ private SloganMapper sloganMapper;
+
+ /**
+ *
+ * @return
+ */
+ public List<Slogan> listData(String status) {
+
+ QueryWrapper<Slogan> queryWrapper = new QueryWrapper<>();
+
+ queryWrapper.eq("company_id", ContextUtil.getCompanyId());
+
+ if(StringUtils.isNotBlank(status)){
+ queryWrapper.eq("status", status);
+ }
+
+ return sloganMapper.selectList(queryWrapper);
+ }
+
+ /**
+ * 鏇存柊鎴栦繚瀛樹俊鎭�
+ * @param data
+ * @return
+ */
+ public void saveData(Slogan data) {
+ if(StringUtils.isBlank(data.getCompanyId())){
+ data.setCompanyId(ContextUtil.getCompanyId());
+ }
+ if(StringUtils.isBlank(data.getStatus())){
+ data.setStatus(Constant.YN_N);
+ }
+ data.setUpdateBy(ContextUtil.getLoginUserName());
+ data.setUpdateTime(new Date());
+ if(StringUtils.isBlank(data.getId())){
+ data.setId(ContextUtil.generateId());
+ data.setCreateBy(ContextUtil.getLoginUserName());
+ data.setCreateTime(new Date());
+ sloganMapper.insert( data);
+ }else {
+ sloganMapper.updateById( data);
+ }
+ }
+
+ /**
+ * 鍒犻櫎淇℃伅
+ * @param data
+ * @return
+ */
+ public void delData(Slogan data) {
+ sloganMapper.deleteById(data);
+ }
+}
\ No newline at end of file
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketPacket.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketPacket.java
new file mode 100644
index 0000000..e6ef456
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketPacket.java
@@ -0,0 +1,50 @@
+package com.fzzy.igds.websocket;
+
+import com.fzzy.igds.constant.OrderRespEnum;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @Description 鐢ㄤ簬WEbSocket鍓嶅悗绔暟鎹紶杈撳璞″皝瑁�
+ * @Author CZT
+ * @Date 2025/12/18 19:19
+ */
+@Data
+public class WebSocketPacket implements Serializable {
+
+ public static final String BIZ_TAG_COMMON = "common";
+
+ public static final String BIZ_TAG_SCREEN_CHECK = "check";
+
+ public static final String BIZ_TAG_SCREEN_INOUT = "inout";
+
+ public static final String BIZ_TAG_SCREEN_GROUP = "group";
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ // 缁勭粐缂栫爜锛屼笉鍙负绌�
+ private String companyId;
+
+ private String deptId;
+
+ // 涓氬姟绫诲瀷锛屼笉鍙负绌�
+ private String bizType;
+
+ //涓氬姟鑷畾涔夋爣绛�
+ private String bizTag = "common";//榛樿浠h〃閫氱敤
+
+ // 涓氬姟ID锛屾瘮濡備粨搴揑D锛岀被鍨婭d绛�
+ private String bizId;
+
+ //鐢ㄤ簬鍛戒护绫诲瀷鐨勮繑鍥炰唬鐮�
+ private String orderResp = OrderRespEnum.MSG_SUCCESS.getCode();
+
+ private String userId;
+
+ // 涓氬姟鏁版嵁锛屽彲浠ユ槸瀛楃涓叉垨鑰呬笟鍔℃暟鎹�
+ private Object data;
+
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketServer.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketServer.java
new file mode 100644
index 0000000..0fd2704
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/websocket/WebSocketServer.java
@@ -0,0 +1,169 @@
+package com.fzzy.igds.websocket;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import javax.websocket.*;
+import javax.websocket.server.PathParam;
+import javax.websocket.server.ServerEndpoint;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @Description WEB-Socket鏈嶅姟锛屽ぇ灞忎娇鐢細璇锋眰璺緞瀹氫箟锛�"/websocket/{缁勭粐缂栫爜}"
+ * @Author CZT
+ * @Date 2025/12/18 19:19
+ */
+@Slf4j
+@Component
+@ServerEndpoint(value = "/websocket/{deptId}/{bizType}/{bizTag}/{userId}")
+public class WebSocketServer {
+
+ private static Map<String, Session> sessionPool = new ConcurrentHashMap<>();
+ private static Map<String, String> sessionIds = new ConcurrentHashMap<>();
+
+ /**
+ * 閰嶇疆妯″潡鍦ㄧ嚎鐘舵��
+ */
+ public static Map<String,Boolean> contextOnLineMap = new HashMap<String, Boolean>();
+
+ // 涓庢煇涓鎴风鐨勮繛鎺ヤ細璇濓紝闇�瑕侀�氳繃瀹冩潵缁欏鎴风鍙戦�佹暟鎹�
+ private Session session;
+
+ @OnOpen
+ public void onOpen(Session session,
+ @PathParam("deptId") String deptId,
+ @PathParam("bizType") String bizType,
+ @PathParam("bizTag") String bizTag,
+ @PathParam("userId") String userId) throws Exception {
+
+ this.session = session;
+
+ String key = deptId + "-" + bizType + "-" + bizTag + "-" + userId;
+
+ sessionPool.put(key, session);
+ sessionIds.put(session.getId(), key);
+
+ log.info("new webSocket,key={}", key);
+ }
+
+ @OnClose
+ public void onClose() {
+ String key = sessionIds.get(session.getId());
+
+ sessionPool.remove(key);
+ sessionIds.remove(session.getId());
+
+ log.info("WebSocket杩炴帴鍏抽棴={}", key);
+
+ String bizType = key.split("-")[2];
+
+ contextOnLineMap.put(bizType, false);
+ }
+
+ /**
+ * 鏀跺埌鍓嶇鍙戦�佺殑淇℃伅
+ *
+ * @param message
+ * @param session
+ */
+ @OnMessage
+ public void onMessage(String message, Session session) {
+
+ contextOnLineMap.put(message,true);
+
+ log.info("鏉ヨ嚜瀹㈡埛绔俊鎭�:\n" + message);
+ }
+
+ @OnError
+ public void onError(Session session, Throwable error) {
+ log.error("鍙戠敓閿欒");
+
+ String key = sessionIds.get(session.getId());
+
+ sessionPool.remove(key);
+ sessionIds.remove(session.getId());
+ error.printStackTrace();
+ }
+
+ /**
+ * 鍚庣鍚戝墠绔帹閫佷俊鎭紝鎺ュ彈鑰呬负鍚屼竴涓笟鍔$被鍨嬫搷浣滄墍鏈変汉鍛�
+ *
+ * @param packet
+ */
+ public static void sendByPocket(WebSocketPacket packet) {
+ if (StringUtils.isEmpty(packet.getBizType())) {
+ log.error("WebSocket淇℃伅鎺ㄩ�佸け璐ワ紝涓氬姟绫诲瀷涓嶅彲涓虹┖銆�");
+ return;
+ }
+
+ String tag = packet.getDeptId() + "-" + packet.getBizType() + "-" + packet.getBizTag();
+
+ // 閬嶅巻鎺ㄩ�侊紝鍙鏄痓izType涓�鑷寸殑鍧囨帹閫�
+ Session session;
+ for (String key : sessionPool.keySet()) {
+ if (key.indexOf(tag) != -1) {
+ session = sessionPool.get(key);
+ session.getAsyncRemote().sendText(
+ JSONObject.toJSONString(packet));
+ }
+ }
+ }
+
+ /**
+ * 鍙戦�佺粰鎸囧畾浜哄憳
+ *
+ * @param packet
+ */
+ public static void sendByUser(WebSocketPacket packet) {
+ if (StringUtils.isEmpty(packet.getBizType())
+ || StringUtils.isEmpty(packet.getDeptId())
+ || StringUtils.isEmpty(packet.getUserId())) {
+ log.error("WebSocket淇℃伅鎺ㄩ�佸け璐ワ紝缁勭粐缂栫爜鍜屼笟鍔$被鍨嬫垨鑰呮寚瀹氫汉淇℃伅鍙傛暟娌℃湁鑾峰彇鍒帮紒");
+
+ return;
+ }
+
+ String tag = packet.getDeptId() + "-" + packet.getBizType() + "-"
+ + packet.getBizTag() + "-" + packet.getUserId();
+
+ Session session;
+ for (String key : sessionPool.keySet()) {
+ if (tag.equals(key)) {
+ session = sessionPool.get(key);
+ session.getAsyncRemote().sendText(
+ JSONObject.toJSONString(packet));
+ }
+ }
+ }
+
+ /**
+ * 鏍规嵁鎸囧畾鐨凚izId鏍囩鎺ㄩ��
+ *
+ * @param packet
+ */
+ public static void sendByBizTag(WebSocketPacket packet) {
+ if (StringUtils.isEmpty(packet.getBizType())
+ || StringUtils.isEmpty(packet.getDeptId())
+ || StringUtils.isEmpty(packet.getBizTag())) {
+ log.error("WebSocket淇℃伅鎺ㄩ�佸け璐ワ紝缁勭粐缂栫爜鍜屼笟鍔$被鍨嬫垨鑰呮寚瀹氫汉淇℃伅鍙傛暟娌℃湁鑾峰彇鍒帮紒");
+
+ return;
+ }
+
+ String tag = packet.getDeptId() + "-" + packet.getBizType() + "-" + packet.getBizTag();
+
+ // 閬嶅巻鎺ㄩ�侊紝鍙鏄痓izType涓�鑷寸殑鍧囨帹閫�
+ Session session;
+ for (String key : sessionPool.keySet()) {
+ if (key.indexOf(tag) != -1) {
+ session = sessionPool.get(key);
+ session.getAsyncRemote().sendText(
+ JSONObject.toJSONString(packet));
+ }
+ }
+
+ }
+}
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml
index 5afacbc..e7facd8 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml
@@ -391,16 +391,18 @@
$notify("鏁版嵁鎵ц瀹屾垚锛侊紒");
self.get("parent").hide();
});</ClientEvent>
- <Property name="caption">纭畾</Property>
- <Property name="iconClass">fa fa-check</Property>
+ <Property name="caption">淇濆瓨</Property>
+ <Property name="iconClass">fa fa-check-circle</Property>
<Property name="exClassName">btn1</Property>
+ <Property name="width">120</Property>
</Button>
<Button>
<ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
self.get("parent").hide();</ClientEvent>
<Property name="caption">鍙栨秷</Property>
- <Property name="iconClass">fa fa-times</Property>
<Property name="exClassName">btn3</Property>
+ <Property name="iconClass">fa fa-times-circle</Property>
+ <Property name="width">120</Property>
</Button>
</Buttons>
<Children>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/Slogan.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/Slogan.view.xml
new file mode 100644
index 0000000..4234705
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/Slogan.view.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ViewConfig>
+ <Arguments/>
+ <Context/>
+ <Model/>
+ <View layout="padding:10">
+ <ClientEvent name="onReady">
+ /**
+ * 鏌ヨ
+ */
+ query = function(){
+ view.get("#dsMain").flushAsync();
+ }
</ClientEvent>
+ <Property name="packages">font-awesome,css-common</Property>
+ <DataSet id="dsMain">
+ <Property name="dataProvider">sloganPR#loadData</Property>
+ <Property name="dataType">[dtSlogan]</Property>
+ </DataSet>
+ <Container>
+ <Property name="className">c-param</Property>
+ <ToolBar>
+ <ToolBarButton>
+ <ClientEvent name="onClick">view.get("#dsMain").insert();
+ view.get("#dialog1").show();
+ </ClientEvent>
+ <Property name="caption">鏂板</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-plus</Property>
+ </ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">var select = view.get("#dataGridMain").get("selection");
+ if(select){
+ view.get("#dialog1").show();
+ }else{
+ $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
+ }</ClientEvent>
+ <Property name="caption">淇敼</Property>
+ <Property name="exClassName">btn2</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-pencil-square-o</Property>
+ </ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">
+ var select = view.get("#dataGridMain").get("selection");
+ if(select){
+ view.get("#ajaxDel").set("parameter",select).execute(function(result){
+ select.remove();
+ });
+ }else{
+ $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑浠撳簱鈥︹��");
+ }
+ 
+ </ClientEvent>
+ <Property name="caption">鍒犻櫎</Property>
+ <Property name="exClassName">btn3</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-times</Property>
+ </ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
+ if(data){
+ $confirm("纭灏�" + data.get("name") + "鎺ㄩ�佽嚦澶у睆锛�",function(){
+ view.get("#ajaxAction1").set("parameter",data).execute(function(){
+ $notify("鎺ㄩ�佹垚鍔燂紒");
+ view.get("#dsMain").flushAsync ();
+ });
+ });
+ }else{
+ $notify("璇烽�夋嫨涓�鏉℃爣璇�");
+ }
+ 
+ </ClientEvent>
+ <Property name="caption">鎺ㄩ�佸ぇ灞�</Property>
+ <Property name="exClassName">btn4</Property>
+ <Property name="width">120</Property>
+ <Property name="iconClass">fa fa-upload</Property>
+ </ToolBarButton>
+ </ToolBar>
+ <DataGrid id="dataGridMain" layoutConstraint="padding:8">
+ <ClientEvent name="onDataRowClick">view.get("#dataGridMain").set("selection",arg.data);</ClientEvent>
+ <Property name="dataSet">dsMain</Property>
+ <Property name="readOnly">true</Property>
+ <Property name="selectionMode">singleRow</Property>
+ <Property name="readOnly">true</Property>
+ <RowSelectorColumn/>
+ <RowNumColumn/>
+ <DataColumn name="name">
+ <Property name="property">name</Property>
+ <Property name="align">center</Property>
+ <Property name="width">120</Property>
+ </DataColumn>
+ <DataColumn name="content">
+ <Property name="property">content</Property>
+ <Property name="align">center</Property>
+ </DataColumn>
+ <DataColumn name="color">
+ <Property name="property">color</Property>
+ <Property name="align">center</Property>
+ <Property name="width">100</Property>
+ </DataColumn>
+ <DataColumn name="status">
+ <Property name="property">status</Property>
+ <Property name="align">center</Property>
+ <Property name="width">100</Property>
+ </DataColumn>
+ <DataColumn name="pushUser">
+ <Property name="property">pushUser</Property>
+ <Property name="align">center</Property>
+ <Property name="width">120</Property>
+ </DataColumn>
+ <DataColumn name="pushTime">
+ <Property name="property">pushTime</Property>
+ <Property name="align">center</Property>
+ <Property name="width">160</Property>
+ </DataColumn>
+ <DataColumn name="updateTime">
+ <Property name="property">updateTime</Property>
+ <Property name="align">center</Property>
+ <Property name="width">160</Property>
+ </DataColumn>
+ </DataGrid>
+ </Container>
+ <Dialog id="dialog1" layout="regionPadding:8">
+ <Property name="iconClass">fa fa-tasks</Property>
+ <Property name="width">500</Property>
+ <Property name="height">300</Property>
+ <Property name="caption">鏍囪璇︾粏</Property>
+ <Buttons>
+ <Button>
+ <ClientEvent name="onClick">view.get("#uaMain").execute(function(result){
+ if(result){
+ $alert(result);
+ }else{
+ $notify("淇濆瓨鎴愬姛锛侊紒");
+ view.get("#dialog1").hide();
+ query();
+ }
+});
+
+</ClientEvent>
+ <Property name="caption">淇濆瓨</Property>
+ <Property name="iconClass">fa fa-check-circle</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="width">120</Property>
+ </Button>
+ <Button>
+ <ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
+view.get("#dialog1").hide();
+</ClientEvent>
+ <Property name="caption">鍙栨秷</Property>
+ <Property name="exClassName">btn3</Property>
+ <Property name="iconClass">fa fa-times-circle</Property>
+ <Property name="width">120</Property>
+ </Button>
+ </Buttons>
+ <Children>
+ <AutoForm>
+ <Property name="dataSet">dsMain</Property>
+ <Property name="cols">*</Property>
+ <Property name="labelAlign">right</Property>
+ <Property name="labelSeparator"> : </Property>
+ <Property name="labelWidth">120</Property>
+ <AutoFormElement>
+ <Property name="name">name</Property>
+ <Property name="property">name</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="property">color</Property>
+ <Property name="name">color</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement layoutConstraint="rowSpan:3">
+ <Property name="name">content</Property>
+ <Property name="property">content</Property>
+ <Property name="editorType">TextArea</Property>
+ <Editor/>
+ </AutoFormElement>
+ </AutoForm>
+ </Children>
+ <Tools/>
+ </Dialog>
+ <UpdateAction id="uaMain">
+ <Property name="dataResolver">sloganPR#saveAll</Property>
+ <UpdateItem>
+ <Property name="dataSet">dsMain</Property>
+ </UpdateItem>
+ </UpdateAction>
+ <AjaxAction id="ajaxAction1">
+ <Property name="service">sloganPR#push</Property>
+ </AjaxAction>
+ <AjaxAction id="ajaxDel">
+ <Property name="service">sloganPR#delData</Property>
+ <Property name="confirmMessage">纭畾瑕佹墽琛屽垹闄や箞锛�</Property>
+ </AjaxAction>
+ </View>
+</ViewConfig>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/SloganPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/SloganPR.java
new file mode 100644
index 0000000..c35dfd9
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/SloganPR.java
@@ -0,0 +1,124 @@
+package com.fzzy.igds;
+
+import com.bstek.dorado.annotation.DataProvider;
+import com.bstek.dorado.annotation.DataResolver;
+import com.bstek.dorado.annotation.Expose;
+import com.bstek.dorado.data.entity.EntityState;
+import com.bstek.dorado.data.entity.EntityUtils;
+import com.fzzy.igds.constant.Constant;
+import com.fzzy.igds.constant.OrderRespEnum;
+import com.fzzy.igds.domain.Slogan;
+import com.fzzy.igds.service.SloganService;
+import com.fzzy.igds.utils.ContextUtil;
+import com.fzzy.igds.websocket.WebSocketPacket;
+import com.fzzy.igds.websocket.WebSocketServer;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description 澶у睆鏍囪绠$悊
+ * @Author CZT
+ * @Date 2025/12/18 19:19
+ */
+@Component
+public class SloganPR {
+
+ @Resource
+ private SloganService sloganService;
+
+ /**
+ * 鏌ヨ
+ *
+ * sloganPR#loadData
+ *
+ * @param
+ * @return
+ */
+ @DataProvider
+ public List<Slogan> loadData() {
+ return sloganService.listData(null);
+ }
+
+ /**
+ * 淇濆瓨 sloganPR#saveAll
+ *
+ * @return
+ */
+ @DataResolver
+ @Transactional
+ public String saveAll(List<Slogan> items) {
+ EntityState state;
+ Slogan slogan;
+ for (Slogan item : items) {
+ slogan = new Slogan();
+ BeanUtils.copyProperties(item, slogan);
+ state = EntityUtils.getState(item);
+ if (state == EntityState.NEW) {
+ sloganService.saveData(slogan);
+ }
+ if (state == EntityState.DELETED) {
+ sloganService.delData(slogan);
+ }
+ if (state == EntityState.MODIFIED) {
+ sloganService.saveData(slogan);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 鍒犻櫎鏁版嵁
+ * sloganPR#delData
+ *
+ * @param data
+ * @return
+ */
+ @Expose
+ public void delData(Slogan data) {
+ Slogan slogan = new Slogan();
+ BeanUtils.copyProperties(data, slogan);
+ sloganService.delData(slogan);
+ }
+
+
+ /**
+ * sloganPR#push
+ * @return
+ */
+ @Expose
+ @Transactional
+ public void push(Slogan data) {
+
+ //璁剧疆鍏ㄩ儴鏍囪涓轰笉鍚敤
+ List<Slogan> slogans = sloganService.listData(null);
+ if(null != slogans && slogans.size() > 0){
+ for (Slogan slogan1 : slogans) {
+ slogan1.setStatus(Constant.YN_N);
+ sloganService.saveData(slogan1);
+ }
+ }
+
+ //璁剧疆褰撳墠鏍囪涓哄惎鐢�
+ Slogan slogan = new Slogan();
+ BeanUtils.copyProperties(data, slogan);
+ slogan.setStatus(Constant.YN_Y);
+ slogan.setPushTime(new Date());
+ slogan.setPushUser(ContextUtil.getLoginUserName());
+ sloganService.saveData(slogan);
+
+ // 閫氱煡鍓嶇
+ WebSocketPacket packet = new WebSocketPacket();
+ packet.setBizType("screen");
+ packet.setCompanyId(data.getCompanyId());
+ packet.setDeptId(data.getCompanyId());
+ packet.setBizId("slogan");
+ packet.setOrderResp(OrderRespEnum.ORDER_INPROGRESS.getCode());
+
+ packet.setData(slogan);
+ WebSocketServer.sendByPocket(packet);
+ }
+}
diff --git a/fzzy-igdss-view/src/main/java/models/core.model.xml b/fzzy-igdss-view/src/main/java/models/core.model.xml
index 6d366b6..1a389aa 100644
--- a/fzzy-igdss-view/src/main/java/models/core.model.xml
+++ b/fzzy-igdss-view/src/main/java/models/core.model.xml
@@ -1765,4 +1765,86 @@
<Property name="label">鏇存柊浜�</Property>
</PropertyDef>
</DataType>
+ <DataType name="dtSlogan">
+ <Property name="creationType">com.fzzy.igds.domain.Slogan</Property>
+ <PropertyDef name="id">
+ <Property></Property>
+ <Property name="label">缂栧彿</Property>
+ </PropertyDef>
+ <PropertyDef name="companyId">
+ <Property></Property>
+ <Property name="label">缁勭粐缂栫爜</Property>
+ </PropertyDef>
+ <PropertyDef name="name">
+ <Property></Property>
+ <Property name="label">鍚嶇О</Property>
+ </PropertyDef>
+ <PropertyDef name="content">
+ <Property></Property>
+ <Property name="label">鏍囪鍐呭</Property>
+ </PropertyDef>
+ <PropertyDef name="status">
+ <Property></Property>
+ <Property name="label">鐘舵��</Property>
+ <Property name="mapping">
+ <Property name="mapValues">
+ <Collection>
+ <Entity>
+ <Property name="key">N</Property>
+ <Property name="value">鏈娇鐢�</Property>
+ </Entity>
+ <Entity>
+ <Property name="key">Y</Property>
+ <Property name="value">姝e湪浣跨敤</Property>
+ </Entity>
+ </Collection>
+ </Property>
+ <Property name="keyProperty">key</Property>
+ <Property name="valueProperty">value</Property>
+ </Property>
+ </PropertyDef>
+ <PropertyDef name="color">
+ <Property name="mapping">
+ <Property name="mapValues">
+ <Collection>
+ <Entity>
+ <Property name="key">default</Property>
+ <Property name="value">榛樿</Property>
+ </Entity>
+ <Entity>
+ <Property name="key">red</Property>
+ <Property name="value">绾㈣壊</Property>
+ </Entity>
+ </Collection>
+ </Property>
+ <Property name="keyProperty">key</Property>
+ <Property name="valueProperty">value</Property>
+ </Property>
+ <Property name="label">棰滆壊</Property>
+ </PropertyDef>
+ <PropertyDef name="pushUser">
+ <Property></Property>
+ <Property name="label">鎺ㄩ�佷汉</Property>
+ </PropertyDef>
+ <PropertyDef name="pushTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">鍙戝竷鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="createTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">鍒涘缓鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="createBy">
+ <Property></Property>
+ <Property name="label">鍒涘缓浜�</Property>
+ </PropertyDef>
+ <PropertyDef name="updateTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">淇敼鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="updateBy">
+ <Property></Property>
+ <Property name="label">淇敼浜�</Property>
+ </PropertyDef>
+ </DataType>
</Model>
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/group/GroupController.java b/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/group/GroupController.java
index ca3100a..5d623d0 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/group/GroupController.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/group/GroupController.java
@@ -3,7 +3,9 @@
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.domain.Dept;
import com.fzzy.igds.domain.DicArea;
+import com.fzzy.igds.domain.Slogan;
import com.fzzy.igds.utils.ContextUtil;
+import com.fzzy.sys.manager.common.CommonManager;
import com.fzzy.sys.manager.gropu.GroupManager;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.stereotype.Controller;
@@ -24,6 +26,8 @@
@Resource
private GroupManager groupManager;
+ @Resource
+ private CommonManager commonManager;
private String prefix = "group";
@@ -38,9 +42,11 @@
view.put(Constant.MODEL_KEY_LOGIN_USER, user);
view.put("deptId", user.getDeptId());
-
view.put("sysName", "鏅烘収绮簱璐ㄦ娂鐩戠澶у睆");
+ // 鏍囪
+ Slogan dicSlogan = commonManager.getDicSlogan();
+ view.put("dicSlogan", dicSlogan);
//鏌ヨ搴撳尯淇℃伅
List<Dept> deptList = groupManager.getAllDept(user.getCompanyId());
@@ -61,7 +67,9 @@
view.put("deptId", user.getDeptId());
view.put("sysName", "鏅烘収绮簱璐ㄦ娂鐩戠澶у睆");
-
+ // 鏍囪
+ Slogan dicSlogan = commonManager.getDicSlogan();
+ view.put("dicSlogan", dicSlogan);
//鏌ヨ搴撳尯淇℃伅
List<Dept> deptList = groupManager.getAllDept(user.getCompanyId());
@@ -82,6 +90,9 @@
view.put("deptId", user.getDeptId());
view.put("sysName", "鏅烘収绮簱璐ㄦ娂鐩戠澶у睆");
+ // 鏍囪
+ Slogan dicSlogan = commonManager.getDicSlogan();
+ view.put("dicSlogan", dicSlogan);
view.put("defaultAreaCode", "650000");
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/common/CommonManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/common/CommonManager.java
index 08149d9..a975bc5 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/common/CommonManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/common/CommonManager.java
@@ -1,10 +1,8 @@
package com.fzzy.sys.manager.common;
+import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.constant.DepotType;
-import com.fzzy.igds.domain.Camera;
-import com.fzzy.igds.domain.Company;
-import com.fzzy.igds.domain.Depot;
-import com.fzzy.igds.domain.Dept;
+import com.fzzy.igds.domain.*;
import com.fzzy.igds.service.*;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysDept;
@@ -45,6 +43,9 @@
private FileService fileService;
@Resource
private CoreCompanyService coreCompanyService;
+ @Resource
+ private SloganService sloganService;
+
/**
* 鏍规嵁搴撳尯缂栫爜鑾峰彇搴撳尯涓嬫墍鏈変粨搴撳垪琛�
*
@@ -172,5 +173,19 @@
*/
public List<Company> listCompanyData() {
SysUser user = ContextUtil.getLoginUser();
- return coreCompanyService.listCompany(null, null, user.getDeptId() + ""); }
+ return coreCompanyService.listCompany(null, null, user.getDeptId() + "");
+ }
+
+
+ /**
+ * 鑾峰彇鍚敤鐨勫ぇ灞忔爣璇�
+ * @return
+ */
+ public Slogan getDicSlogan() {
+ List<Slogan> slogans = sloganService.listData(Constant.YN_Y);
+ if(null == slogans || slogans.isEmpty()){
+ return null;
+ }
+ return slogans.get(0);
+ }
}
diff --git a/fzzy-igdss-web/src/main/resources/static/common/igds-common.js b/fzzy-igdss-web/src/main/resources/static/common/igds-common.js
index 206f4d7..f899319 100644
--- a/fzzy-igdss-web/src/main/resources/static/common/igds-common.js
+++ b/fzzy-igdss-web/src/main/resources/static/common/igds-common.js
@@ -58,7 +58,8 @@
// 鍙戠敓浜嗛敊璇簨浠�
socket.onerror = function () {
- alert("Socket error鈥︹��");
+ // alert("Socket error鈥︹��");
+ console.log("Socket error鈥︹��");
};
$(window).unload(function () {
@@ -238,6 +239,24 @@
window.location.href = url;
}
+/**
+ * 鍒濆鏍囪鏁版嵁
+ */
+function initDicSlogan() {
+ if (dicSlogan) {
+ if (dicSlogan.color == "red") {
+ $("#sloganText").css({
+ color: "#DE2910"
+ });
+ } else {
+ $("#sloganText").css({
+ color: "#7ddfff"
+ });
+ }
+ $("#sloganText").text(dicSlogan.content);
+ }
+}
+
//娴忚鍣ㄥ叏灞�
var fullscreen = false;
diff --git a/fzzy-igdss-web/src/main/resources/static/group/gis.js b/fzzy-igdss-web/src/main/resources/static/group/gis.js
index 613f249..cd450bf 100644
--- a/fzzy-igdss-web/src/main/resources/static/group/gis.js
+++ b/fzzy-igdss-web/src/main/resources/static/group/gis.js
@@ -25,7 +25,7 @@
//鍒濆鍖栨椂闂�
initTime();
-
+ initDicSlogan();
//鍒濆鍖栧湴鍥�
initMap();
@@ -63,8 +63,21 @@
kai2.addClass('menu-h')
}
});
+
+ // 鍒濆鍖朩ebSocket
+ initWS(companyId,"screen",null,null);
});
+// socket淇℃伅杩斿洖铏曠悊
+function socketOnMessage(pocket) {
+ //console.log(pocket);
+ if (pocket.bizId == "slogan") {
+ var data = pocket.data;
+ dicSlogan = data;
+ initDicSlogan();
+ }
+}
+
// 鍒锋柊鏃堕棿
function initTime() {
setInterval(function () {
diff --git a/fzzy-igdss-web/src/main/resources/static/group/index.js b/fzzy-igdss-web/src/main/resources/static/group/index.js
index 1a5e2c1..9d2a528 100644
--- a/fzzy-igdss-web/src/main/resources/static/group/index.js
+++ b/fzzy-igdss-web/src/main/resources/static/group/index.js
@@ -25,10 +25,9 @@
// 鍒濆鍖栭〉闈�
init();
- //鎻愰啋
- // showTip("鍙屽嚮椤甸潰鏍囪锛屽垏鎹㈠叏灞�");
+ // 鍒濆鍖朩ebSocket
+ initWS(companyId,"screen",null,null);
});
-
// 鍒濆鍖栭〉闈�
function init() {
@@ -38,7 +37,7 @@
initTime();
// 鍒濆鍖栧浘琛�
initChart();
-
+ initDicSlogan();
//鍒濆鍖栧湴鍥�
initMap();
@@ -54,6 +53,16 @@
// ajaxMsg();
}
+// socket淇℃伅杩斿洖铏曠悊
+function socketOnMessage(pocket) {
+ //console.log(pocket);
+ if (pocket.bizId == "slogan") {
+ var data = pocket.data;
+ dicSlogan = data;
+ initDicSlogan();
+ }
+}
+
//鍔犺浇搴撳尯鍦板浘浣嶇疆
function renderMap() {
var myChart = mapChart;
diff --git a/fzzy-igdss-web/src/main/resources/static/group/video.js b/fzzy-igdss-web/src/main/resources/static/group/video.js
index 5b6a247..b909ec7 100644
--- a/fzzy-igdss-web/src/main/resources/static/group/video.js
+++ b/fzzy-igdss-web/src/main/resources/static/group/video.js
@@ -77,6 +77,9 @@
$(function () {
// 鍒濆鍖栭〉闈�
initHtml();
+
+ // 鍒濆鍖朩ebSocket
+ initWS(companyId,"screen",null,null);
});
// 鍒濆鍖栭〉闈�
@@ -84,6 +87,8 @@
// 鏃堕棿
initTime();
+ initDicSlogan();
+
//鐩戞帶鐐逛俊鎭�傚簲婊氬姩
initScrollbar(60);
//搴撳尯淇℃伅
@@ -92,6 +97,16 @@
// renderCamera();
}
+// socket淇℃伅杩斿洖铏曠悊
+function socketOnMessage(pocket) {
+ //console.log(pocket);
+ if (pocket.bizId == "slogan") {
+ var data = pocket.data;
+ dicSlogan = data;
+ initDicSlogan();
+ }
+}
+
// 娓叉煋搴撳尯淇℃伅
function renderDeptArea() {
diff --git a/fzzy-igdss-web/src/main/resources/templates/group/index.html b/fzzy-igdss-web/src/main/resources/templates/group/index.html
index 15d3014..94f3eec 100644
--- a/fzzy-igdss-web/src/main/resources/templates/group/index.html
+++ b/fzzy-igdss-web/src/main/resources/templates/group/index.html
@@ -271,6 +271,7 @@
var userId = [[${loginUser.loginName}]];
var companyId = [[${loginUser.companyId}]];
var deptId = [[${deptId}]];
+ var dicSlogan = [[${dicSlogan}]];
var deptList = [[${deptList}]];
</script>
</body>
--
Gitblit v1.9.3