Quellcode durchsuchen

更改seat表和sim表数据。

tom vor 2 Monaten
Ursprung
Commit
3ccb629559

+ 52 - 6
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Seat.java

@@ -12,6 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * @date 2024-12-13
  */
 public class Seat extends BaseEntity {
+
     private static final long serialVersionUID = 1L;
 
     /**
@@ -23,20 +24,38 @@ public class Seat extends BaseEntity {
      * 座号
      */
     @Excel(name = "座号")
-    private Integer seatNum;
+    private Long seatNum;
 
     /**
-     * 绑定的IP地址
+     * 学员端座次上[电脑]绑定的[IP地址]
      */
-    @Excel(name = "绑定的IP地址")
+    // @Excel(name = "学员端座次上[电脑]绑定的[IP地址]")
     private String seatBindIp;
 
     /**
+     * 学员端座次上[RS485]绑定的[IP地址]
+     */
+    // @Excel(name = "学员端座次上[RS485]绑定的[IP地址]")
+    private String seatRs485Ip;
+
+    /**
+     * 学员端座次上[RS485]绑定的[端口]
+     */
+    // @Excel(name = "学员端座次上[RS485]绑定的[端口]")
+    private Long seatRs485Port;
+
+    /**
      * 当前座上学员/用户ID
      */
-    @Excel(name = "当前座上学员/用户ID")
+    // @Excel(name = "当前座上学员/用户ID")
     private Long currentUserId;
 
+    /**
+     * 学员端座次上模拟器的ID:[0]没有连接任何模拟器
+     */
+    // @Excel(name = "学员端座次上模拟器的ID:[0]没有连接任何模拟器")
+    private Long currentSimId;
+
     public void setSeatId(Long seatId) {
         this.seatId = seatId;
     }
@@ -45,11 +64,11 @@ public class Seat extends BaseEntity {
         return seatId;
     }
 
-    public void setSeatNum(Integer seatNum) {
+    public void setSeatNum(Long seatNum) {
         this.seatNum = seatNum;
     }
 
-    public Integer getSeatNum() {
+    public Long getSeatNum() {
         return seatNum;
     }
 
@@ -61,6 +80,22 @@ public class Seat extends BaseEntity {
         return seatBindIp;
     }
 
+    public void setSeatRs485Ip(String seatRs485Ip) {
+        this.seatRs485Ip = seatRs485Ip;
+    }
+
+    public String getSeatRs485Ip() {
+        return seatRs485Ip;
+    }
+
+    public void setSeatRs485Port(Long seatRs485Port) {
+        this.seatRs485Port = seatRs485Port;
+    }
+
+    public Long getSeatRs485Port() {
+        return seatRs485Port;
+    }
+
     public void setCurrentUserId(Long currentUserId) {
         this.currentUserId = currentUserId;
     }
@@ -69,13 +104,24 @@ public class Seat extends BaseEntity {
         return currentUserId;
     }
 
+    public void setCurrentSimId(Long currentSimId) {
+        this.currentSimId = currentSimId;
+    }
+
+    public Long getCurrentSimId() {
+        return currentSimId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("seatId", getSeatId())
                 .append("seatNum", getSeatNum())
                 .append("seatBindIp", getSeatBindIp())
+                .append("seatRs485Ip", getSeatRs485Ip())
+                .append("seatRs485Port", getSeatRs485Port())
                 .append("currentUserId", getCurrentUserId())
+                .append("currentSimId", getCurrentSimId())
                 .append("createBy", getCreateBy())
                 .append("createTime", getCreateTime())
                 .append("updateBy", getUpdateBy())

+ 8 - 9
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Sim.java

@@ -24,34 +24,33 @@ public class Sim extends BaseEntity {
     private Long simId;
 
     /**
-     * 座ID
+     * [废弃]座ID
      */
-    @Excel(name = "座ID")
+    // @Excel(name = "[废弃]座ID")
     private Long seatId;
 
     /**
      * 模拟器类型
      */
-    @Excel(name = "模拟器类型")
+    // @Excel(name = "模拟器类型")
     private String simType;
 
     /**
-     * 模拟器状态 0:可用初始化 1:在线 2:模拟器离线 3:网关离线 4:硬件故障异常 5:手动禁用
-     * todo: [0]:可用初始化,[1]:在线,[2]:模拟器离线,[3]:网关离线,[4]:硬件故障异常,[5]:手动禁用,[6]:某故障位置存在空值
+     * 模拟器状态:[0]:可用初始化,[1]:在线,[2]:模拟器离线,[3]:网关离线,[4]:硬件故障异常,[5]:手动禁用
      */
-    @Excel(name = "模拟器状态 0:可用初始化 1:在线 2:模拟器离线 3:网关离线 4:硬件故障异常 5:手动禁用")
+    // @Excel(name = "模拟器状态:[0]:可用初始化,[1]:在线,[2]:模拟器离线,[3]:网关离线,[4]:硬件故障异常,[5]:手动禁用")
     private String simState;
 
     /**
      * 模拟器序列号
      */
-    @Excel(name = "模拟器序列号")
+    // @Excel(name = "模拟器序列号")
     private String simSn;
 
     /**
-     * 模拟器设备编号1~30
+     * 模拟器设备通信编号-站ID
      */
-    @Excel(name = "模拟器设备编号1~30")
+    // @Excel(name = "模拟器设备通信编号-站ID")
     private String simNum;
 
     /**

+ 2 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SocketService.java

@@ -106,6 +106,8 @@ public class SocketService {
         return AjaxResult.success("openOneSocket Success!");
     }
 
+
+
     /**
      * todo:部分返回Aj结果。
      *

+ 18 - 0
ruoyi-sim/src/main/resources/mapper/sim/SeatMapper.xml

@@ -8,7 +8,10 @@
         <result property="seatId" column="seat_id"/>
         <result property="seatNum" column="seat_num"/>
         <result property="seatBindIp" column="seat_bind_ip"/>
+        <result property="seatRs485Ip" column="seat_rs485_ip"/>
+        <result property="seatRs485Port" column="seat_rs485_port"/>
         <result property="currentUserId" column="current_user_id"/>
+        <result property="currentSimId" column="current_sim_id"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
@@ -20,7 +23,10 @@
         select seat_id,
                seat_num,
                seat_bind_ip,
+               seat_rs485_ip,
+               seat_rs485_port,
                current_user_id,
+               current_sim_id,
                create_by,
                create_time,
                update_by,
@@ -34,7 +40,10 @@
         <where>
             <if test="seatNum != null ">and seat_num = #{seatNum}</if>
             <if test="seatBindIp != null  and seatBindIp != ''">and seat_bind_ip = #{seatBindIp}</if>
+            <if test="seatRs485Ip != null  and seatRs485Ip != ''">and seat_rs485_ip = #{seatRs485Ip}</if>
+            <if test="seatRs485Port != null ">and seat_rs485_port = #{seatRs485Port}</if>
             <if test="currentUserId != null ">and current_user_id = #{currentUserId}</if>
+            <if test="currentSimId != null ">and current_sim_id = #{currentSimId}</if>
         </where>
     </select>
 
@@ -51,7 +60,10 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="seatNum != null">seat_num,</if>
             <if test="seatBindIp != null and seatBindIp != ''">seat_bind_ip,</if>
+            <if test="seatRs485Ip != null and seatRs485Ip != ''">seat_rs485_ip,</if>
+            <if test="seatRs485Port != null">seat_rs485_port,</if>
             <if test="currentUserId != null">current_user_id,</if>
+            <if test="currentSimId != null">current_sim_id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -61,7 +73,10 @@
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="seatNum != null">#{seatNum},</if>
             <if test="seatBindIp != null and seatBindIp != ''">#{seatBindIp},</if>
+            <if test="seatRs485Ip != null and seatRs485Ip != ''">#{seatRs485Ip},</if>
+            <if test="seatRs485Port != null">#{seatRs485Port},</if>
             <if test="currentUserId != null">#{currentUserId},</if>
+            <if test="currentSimId != null">#{currentSimId},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -75,7 +90,10 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="seatNum != null">seat_num = #{seatNum},</if>
             <if test="seatBindIp != null and seatBindIp != ''">seat_bind_ip = #{seatBindIp},</if>
+            <if test="seatRs485Ip != null and seatRs485Ip != ''">seat_rs485_ip = #{seatRs485Ip},</if>
+            <if test="seatRs485Port != null">seat_rs485_port = #{seatRs485Port},</if>
             <if test="currentUserId != null">current_user_id = #{currentUserId},</if>
+            <if test="currentSimId != null">current_sim_id = #{currentSimId},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>