Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1

This commit is contained in:
xzb 2022-09-29 17:36:33 +08:00
commit 9b94c39826
7 changed files with 76 additions and 71 deletions

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.entity.org;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class OrgProject {
private Long id;
private Long orgId;
private String projectCode;
private Long creatorId;
private LocalDateTime createTime;
}

View File

@ -140,7 +140,8 @@ public class AccountVO implements Serializable {
private List<String> projectCodes; private List<String> projectCodes;
public AccountVO() {} public AccountVO() {
}
public AccountVO(SysAccount account) { public AccountVO(SysAccount account) {
this.id = account.getId(); this.id = account.getId();
@ -262,6 +263,7 @@ public class AccountVO implements Serializable {
/** /**
* 是否管理员 * 是否管理员
*
* @return * @return
*/ */
@JsonIgnore @JsonIgnore
@ -272,6 +274,7 @@ public class AccountVO implements Serializable {
/** /**
* 是否超级管理员 * 是否超级管理员
*
* @return * @return
*/ */
@JsonIgnore @JsonIgnore

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.constants.Client;
import club.joylink.rtss.entity.SysAccountLogin; import club.joylink.rtss.entity.SysAccountLogin;
import club.joylink.rtss.entity.project.Project; import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.util.EncryptUtil; import club.joylink.rtss.util.EncryptUtil;
import club.joylink.rtss.vo.client.org.OrgProjectVO;
import club.joylink.rtss.vo.client.project.ProjectDeviceVO; import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
import club.joylink.rtss.vo.project.ProjectVO; import club.joylink.rtss.vo.project.ProjectVO;
import lombok.Getter; import lombok.Getter;
@ -49,6 +50,9 @@ public class LoginUserInfoVO {
private LocalDateTime preLogoutTime; private LocalDateTime preLogoutTime;
private LocalDateTime lastQueryTime; // 最后使用时间 private LocalDateTime lastQueryTime; // 最后使用时间
// 20220929 增加
private OrgProjectVO orgProjectVO;
public LoginUserInfoVO(AccountVO accountVO, Client client, String project, ProjectDeviceVO deviceVO) { public LoginUserInfoVO(AccountVO accountVO, Client client, String project, ProjectDeviceVO deviceVO) {
this.accountVO = accountVO; this.accountVO = accountVO;
this.client = client; this.client = client;
@ -139,4 +143,14 @@ public class LoginUserInfoVO {
public boolean isWechatLogin() { public boolean isWechatLogin() {
return Client.Assistant.equals(this.getClient()); return Client.Assistant.equals(this.getClient());
} }
/**
* 获取顶级组织Id
*/
public Long getTopOrgId() {
if (orgProjectVO == null) {
return null;
}
return orgProjectVO.getTopOrgId();
}
} }

View File

@ -15,26 +15,6 @@ public enum WebSocketMessageType {
* 订单支付结果 * 订单支付结果
*/ */
Order_Pay_Result, Order_Pay_Result,
/**
* 综合演练室-房间消息
*/
JointTraining_Room,
/**
* 综合演练室-房间邀请消息
*/
JointTraining_Room_Invite,
/**
* 综合演练室-用户消息
*/
JointTraining_User,
/**
* 综合演练-设备消息
*/
JointTraining_Device,
/**
* 综合演练室-群聊消息
*/
JointTraining_Chat,
/** /**
* 被登出消息 * 被登出消息
*/ */
@ -158,26 +138,14 @@ public enum WebSocketMessageType {
* 仿真-控制权转换申请回复 * 仿真-控制权转换申请回复
*/ */
Simulation_ControlTransfer_Reply, Simulation_ControlTransfer_Reply,
/**
* 仿真-回放会话消息
*/
Simulation_PlayBack_Conversation,
/** /**
* 仿真-结束消息 * 仿真-结束消息
*/ */
Simulation_Over, Simulation_Over,
/**
* 仿真-权限用完
*/
Simulation_Permission_Over,
/** /**
* 仿真-任务已加载 * 仿真-任务已加载
*/ */
Simulation_Quest_Loaded, Simulation_Quest_Loaded,
/**
* 仿真-任务完成
*/
Simulation_Quest_Finish,
/** /**
* 仿真-退出任务 * 仿真-退出任务
*/ */
@ -200,10 +168,6 @@ public enum WebSocketMessageType {
* 仿真-退出剧本 * 仿真-退出剧本
*/ */
Simulation_Script_Quit, Simulation_Script_Quit,
/**
* 仿真-剧本完成
*/
Simulation_Script_Finish,
/** /**
* 仿真-竞赛实操完成 * 仿真-竞赛实操完成
*/ */
@ -229,10 +193,6 @@ public enum WebSocketMessageType {
* 仿真-暂停/开始消息 * 仿真-暂停/开始消息
*/ */
Simulation_Control_Pause, Simulation_Control_Pause,
/**
* 仿真回放完成消息
*/
Simulation_PlayBack_Finish,
/** /**
* 仿真驾驶数据路由 * 仿真驾驶数据路由
*/ */

View File

@ -70,23 +70,11 @@ public class SocketMessageFactory {
} }
case BROADCAST: case BROADCAST:
case Order_Pay_Result: case Order_Pay_Result:
case JointTraining_Room_Invite:
case Be_Logged_Out: case Be_Logged_Out:
case Simulation_Invite: { case Simulation_Invite: {
topicList.add(WebSocketSubscribeTopic.Common); topicList.add(WebSocketSubscribeTopic.Common);
break; break;
} }
case JointTraining_Room:
case JointTraining_Device:
case JointTraining_Chat: {
topicList.add(SimulationSubscribeTopic.Room.buildDestination(group));
break;
}
case JointTraining_User: {
topicList.add(SimulationSubscribeTopic.Room.buildDestination(group));
topicList.add(SimulationSubscribeTopic.WeChatMini.buildDestination(group));
break;
}
case Simulation_Time_Sync: case Simulation_Time_Sync:
case Simulation_User: case Simulation_User:
case Simulation_Member: case Simulation_Member:
@ -98,14 +86,10 @@ public class SocketMessageFactory {
case Simulation_RunAsPlan_Start: case Simulation_RunAsPlan_Start:
case Simulation_RunFact: case Simulation_RunFact:
case Simulation_ApplyHandle: case Simulation_ApplyHandle:
case Simulation_PlayBack_Conversation:
case Simulation_Control_Pause: case Simulation_Control_Pause:
case Simulation_Permission_Over:
case Simulation_Run_Plan_Reload: case Simulation_Run_Plan_Reload:
case Simulation_Trip_Plan_Change: case Simulation_Trip_Plan_Change:
case Simulation_Scenes_Reload: case Simulation_Scenes_Reload:
case Simulation_Quest_Finish:
case Simulation_PlayBack_Finish:
case Competition_Practical: case Competition_Practical:
case SIMULATION_RAIL_TICKET: case SIMULATION_RAIL_TICKET:
case Simulation_Alarm: { case Simulation_Alarm: {
@ -139,7 +123,6 @@ public class SocketMessageFactory {
case Simulation_Script_Action_Tip: case Simulation_Script_Action_Tip:
case Simulation_Script_Action_Finish: case Simulation_Script_Action_Finish:
case Simulation_Script_Action_Error: case Simulation_Script_Action_Error:
case Simulation_Script_Finish:
case Simulation_Competition_Practice_Finish: case Simulation_Competition_Practice_Finish:
case Simulation_Script_Action: case Simulation_Script_Action:
case Simulation_Driver_Change: case Simulation_Driver_Change:

View File

@ -0,0 +1,19 @@
package club.joylink.rtss.vo.client.org;
import club.joylink.rtss.entity.org.OrgProject;
import lombok.Data;
@Data
public class OrgProjectVO {
private Long topOrgId;
private Long orgId;
private String projectCode;
public OrgProjectVO(OrgProject orgProject) {
this.orgId = orgProject.getOrgId();
this.projectCode = orgProject.getProjectCode();
}
}

View File

@ -246,4 +246,12 @@
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="countByExample" parameterType="club.joylink.rtss.entity.project.ProjectViewExample"
resultType="java.lang.Long">
select count(*) from project_view
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
</mapper> </mapper>