Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1
This commit is contained in:
commit
ac5c1ed33d
4
sql/20220928-wei-project.sql
Normal file
4
sql/20220928-wei-project.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
alter table `joylink`.`project`
|
||||||
|
drop COLUMN `name_en`,
|
||||||
|
CHANGE COLUMN `simple_name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL comment '项目简称' AFTER `code`,
|
||||||
|
CHANGE COLUMN `name` `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL comment '项目描述' AFTER `name`;
|
@ -5,6 +5,8 @@ import club.joylink.rtss.entity.project.ProjectView;
|
|||||||
import club.joylink.rtss.services.project.ProjectService;
|
import club.joylink.rtss.services.project.ProjectService;
|
||||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectViewVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -50,9 +52,9 @@ public class ProjectInfoController {
|
|||||||
projectService.save(project);
|
projectService.save(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/simple")
|
@GetMapping("/check/code")
|
||||||
public List<Project.SimpleProject> queryProjectSimpleInfo() {
|
public boolean checkProjectCode(String code) {
|
||||||
return projectService.getSimpleProjectList();
|
return projectService.checkProjectCode(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/viewSetting/page")
|
@GetMapping("/viewSetting/page")
|
||||||
@ -85,14 +87,23 @@ public class ProjectInfoController {
|
|||||||
projectService.saveProjectView(projectView);
|
projectService.saveProjectView(projectView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/check/markKey")
|
||||||
|
public boolean checkProjectViewMarkKey(String markKey) {
|
||||||
|
return projectService.checkProjectViewMarkKey(markKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/simple")
|
||||||
|
public List<ProjectVO> queryProjectSimpleInfo() {
|
||||||
|
return projectService.getSimpleProjectList();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/viewSetting/project/{project}")
|
@GetMapping("/viewSetting/project/{project}")
|
||||||
public ProjectView.SimpleProjectView queryProjectViewSetting(@PathVariable String project) {
|
public ProjectViewVO queryProjectViewSetting(@PathVariable String project) {
|
||||||
return projectService.getProjectViewSetting(project);
|
return projectService.getProjectViewSetting(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/viewSetting/simple/all")
|
@GetMapping("/viewSetting/simple/all")
|
||||||
public List<ProjectView.SimpleProjectView> queryViewAll() {
|
public List<ProjectViewVO> queryViewAll() {
|
||||||
return projectService.queryViewAll();
|
return projectService.queryViewAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package club.joylink.rtss.entity.project;
|
package club.joylink.rtss.entity.project;
|
||||||
|
|
||||||
import club.joylink.rtss.util.JsonUtils;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@ -17,16 +15,6 @@ import java.util.List;
|
|||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class Project {
|
public class Project {
|
||||||
/**
|
|
||||||
* 有效信息标识
|
|
||||||
*/
|
|
||||||
public final static Integer EFFECT_PROJECT_STATUS = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认项目的markKey
|
|
||||||
*/
|
|
||||||
public final static String DEFAULT_PROJECT_MARK_KEY = "login";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认项目的Code
|
* 默认项目的Code
|
||||||
*/
|
*/
|
||||||
@ -53,15 +41,10 @@ public class Project {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目英文名称
|
* 描述
|
||||||
*/
|
*/
|
||||||
private String nameEn;
|
private String description;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目简称
|
|
||||||
*/
|
|
||||||
private String simpleName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@ -87,185 +70,8 @@ public class Project {
|
|||||||
*/
|
*/
|
||||||
private String serverSetting;
|
private String serverSetting;
|
||||||
|
|
||||||
/**
|
|
||||||
* 反序列化设置信息
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
private ProjectServerConfig projectServerConfig;
|
|
||||||
|
|
||||||
public void setServerSetting(String serverSetting) {
|
|
||||||
this.serverSetting = serverSetting;
|
|
||||||
if (StringUtils.isEmpty(this.serverSetting)) {
|
|
||||||
this.projectServerConfig = null;
|
|
||||||
} else {
|
|
||||||
this.projectServerConfig = JsonUtils.read(this.serverSetting, ProjectServerConfig.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否默认项目
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isDefault() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getDefaultProject() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public static boolean isDefault(String code) {
|
public static boolean isDefault(String code) {
|
||||||
return StringUtils.isEmpty(code) || DEFAULT_PROJECT_LABEL.contains(code);
|
return StringUtils.isEmpty(code) || DEFAULT_PROJECT_LABEL.contains(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否登录就创建仿真
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isLoginWithCreateSimulation() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getLoginCreateSimulation() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isPermissionVail() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getCreateSimulationPermission() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isCreateLocalSimulation() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getCreateLocalSimulation() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isMapNeedCharge() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getMapNeedCharge() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否资源免费
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isFreeSource() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getFreeSource() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isControlDevice() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getControlDevice() == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public int getDefaultLoadTrain() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getDefaultLoadTrain();
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getDefaultMemberId() {
|
|
||||||
if (this.projectServerConfig == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.projectServerConfig.getDefaultMemberId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回项目编码
|
|
||||||
*/
|
|
||||||
public String name() {
|
|
||||||
return this.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成项目简单信息
|
|
||||||
*/
|
|
||||||
public SimpleProject generateSimpleProject() {
|
|
||||||
return new SimpleProject(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class SimpleProject {
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
public SimpleProject() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public SimpleProject(Project project) {
|
|
||||||
this.label = project.getSimpleName();
|
|
||||||
this.value = project.getCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String name() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class ProjectServerConfig {
|
|
||||||
/**
|
|
||||||
* 默认项目
|
|
||||||
*/
|
|
||||||
private int defaultProject;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录后创建仿真
|
|
||||||
*/
|
|
||||||
private int loginCreateSimulation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录时创建仿真的权限判断,原BJD使用
|
|
||||||
*/
|
|
||||||
private int createSimulationPermission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录时创建仿真判断,WJLS创建现地类型
|
|
||||||
*/
|
|
||||||
private int createLocalSimulation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地图需要收费:DRTS
|
|
||||||
*/
|
|
||||||
private int mapNeedCharge;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 资源免费:CGY、ZZWW
|
|
||||||
*/
|
|
||||||
private int freeSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 需要控制装备:HEB
|
|
||||||
*/
|
|
||||||
private int controlDevice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认加载列车数
|
|
||||||
*/
|
|
||||||
private int defaultLoadTrain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认加载角色:WJLS默认加载2
|
|
||||||
*/
|
|
||||||
private String defaultMemberId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
package club.joylink.rtss.entity.project;
|
package club.joylink.rtss.entity.project;
|
||||||
|
|
||||||
import club.joylink.rtss.util.JsonUtils;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class ProjectView {
|
public class ProjectView {
|
||||||
|
/**
|
||||||
|
* 默认项目的markKey
|
||||||
|
*/
|
||||||
|
public final static String DEFAULT_PROJECT_MARK_KEY = "login";
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String markKey;
|
private String markKey;
|
||||||
@ -25,30 +26,4 @@ public class ProjectView {
|
|||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
private String viewSetting;
|
private String viewSetting;
|
||||||
|
|
||||||
public SimpleProjectView simplifyProjectView() {
|
|
||||||
return new SimpleProjectView(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Setter
|
|
||||||
@Getter
|
|
||||||
|
|
||||||
public static class SimpleProjectView {
|
|
||||||
private String markKey;
|
|
||||||
|
|
||||||
private String project;
|
|
||||||
|
|
||||||
private Map<String, Object> viewSetting;
|
|
||||||
|
|
||||||
public SimpleProjectView(ProjectView projectView) {
|
|
||||||
this.markKey = projectView.getMarkKey();
|
|
||||||
this.project = projectView.getProject();
|
|
||||||
if (StringUtils.isEmpty(projectView.getViewSetting())) {
|
|
||||||
this.viewSetting = new HashMap<>();
|
|
||||||
} else {
|
|
||||||
this.viewSetting = JsonUtils.read(projectView.getViewSetting(), Map.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
10
src/main/java/club/joylink/rtss/services/MinioService.java
Normal file
10
src/main/java/club/joylink/rtss/services/MinioService.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package club.joylink.rtss.services;
|
||||||
|
|
||||||
|
import club.joylink.rtss.util.MinioClientUtil;
|
||||||
|
|
||||||
|
public interface MinioService {
|
||||||
|
/**
|
||||||
|
* 根据目录获取MINIO客户端
|
||||||
|
*/
|
||||||
|
MinioClientUtil createMinioClientUtil(String directory);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package club.joylink.rtss.services;
|
||||||
|
|
||||||
|
import club.joylink.rtss.configuration.MinioClientConfig;
|
||||||
|
import club.joylink.rtss.util.MinioClientUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MinioServiceImpl implements MinioService {
|
||||||
|
private Map<String, MinioClientUtil> minioClientMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MinioClientConfig minioClientConfig;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MinioClientUtil createMinioClientUtil(String directory) {
|
||||||
|
if (minioClientMap.containsKey(directory)) {
|
||||||
|
return minioClientMap.get(directory);
|
||||||
|
}
|
||||||
|
MinioClientUtil minioClientUtil = MinioClientUtil.getInstance(minioClientConfig, directory);
|
||||||
|
minioClientMap.put(directory, minioClientUtil);
|
||||||
|
return minioClientUtil;
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,7 @@ import club.joylink.rtss.vo.client.SocketMessageVO;
|
|||||||
import club.joylink.rtss.vo.client.factory.SocketMessageFactory;
|
import club.joylink.rtss.vo.client.factory.SocketMessageFactory;
|
||||||
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
||||||
import club.joylink.rtss.vo.client.project.RelationLoginConfigVO;
|
import club.joylink.rtss.vo.client.project.RelationLoginConfigVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import club.joylink.rtss.vo.wx.WmUserSession;
|
import club.joylink.rtss.vo.wx.WmUserSession;
|
||||||
import club.joylink.rtss.websocket.StompMessageService;
|
import club.joylink.rtss.websocket.StompMessageService;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -120,25 +121,22 @@ public class AuthenticateService implements IAuthenticateService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO 20220922 用于替换上方方法 占位
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public LoginStatusVO getWmLoginUrl(String clientId, String secret, String projectCode, String deviceCode) {
|
public LoginStatusVO getWmLoginUrl(String clientId, String secret, String projectCode, String deviceCode) {
|
||||||
Client client = Client.getByIdAndSecret(clientId, secret);
|
Client client = Client.getByIdAndSecret(clientId, secret);
|
||||||
Project project = projectService.queryLoginProjectByCode(projectCode);
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(projectCode);
|
||||||
ProjectDeviceVO deviceVO = null;
|
ProjectDeviceVO deviceVO = null;
|
||||||
if (!StringUtils.isEmpty(deviceCode)) {
|
if (!StringUtils.isEmpty(deviceCode)) {
|
||||||
deviceVO = this.deviceService.getDeviceDetailInfoOf(project.getCode(), deviceCode);
|
deviceVO = this.deviceService.getDeviceDetailInfoOf(projectVO.name(), deviceCode);
|
||||||
}
|
}
|
||||||
String sessionId = RandomGenerator.uuid();
|
String sessionId = RandomGenerator.uuid();
|
||||||
String url = qrCodeManager.getLoginCode(clientId, project.name(), sessionId);
|
String url = qrCodeManager.getLoginCode(clientId, projectVO.name(), sessionId);
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LoginStatusVO loginStatusVO = LoginStatusVO.builder()
|
LoginStatusVO loginStatusVO = LoginStatusVO.builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.sessionId(sessionId)
|
.sessionId(sessionId)
|
||||||
.client(client)
|
.client(client)
|
||||||
.projectInfo(project)
|
.projectVO(projectVO)
|
||||||
.deviceVO(deviceVO)
|
.deviceVO(deviceVO)
|
||||||
.time(now)
|
.time(now)
|
||||||
.lastQueryTime(now)
|
.lastQueryTime(now)
|
||||||
@ -249,7 +247,7 @@ public class AuthenticateService implements IAuthenticateService {
|
|||||||
if (StringUtils.isEmpty(loginStatusVo.getToken())) { //正常扫码登陆
|
if (StringUtils.isEmpty(loginStatusVo.getToken())) { //正常扫码登陆
|
||||||
// 构造登陆用户信息
|
// 构造登陆用户信息
|
||||||
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(user, loginStatusVo.getClient(),
|
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(user, loginStatusVo.getClient(),
|
||||||
loginStatusVo.getProjectInfo().name(), loginStatusVo.getDeviceVO());
|
loginStatusVo.getProjectVO().name(), loginStatusVo.getDeviceVO());
|
||||||
// 设置组织信息
|
// 设置组织信息
|
||||||
iSysUserService.setOrgInfoOfOrgRelWithTheProject(loginUserInfo.getProjectInfo().name(), user);
|
iSysUserService.setOrgInfoOfOrgRelWithTheProject(loginUserInfo.getProjectInfo().name(), user);
|
||||||
// 登陆
|
// 登陆
|
||||||
@ -354,8 +352,8 @@ public class AuthenticateService implements IAuthenticateService {
|
|||||||
@Override
|
@Override
|
||||||
public String loginWithPwd(LoginUserVO loginUser) {
|
public String loginWithPwd(LoginUserVO loginUser) {
|
||||||
// TODO 20220922
|
// TODO 20220922
|
||||||
Project project = projectService.queryLoginProjectByCode(loginUser.getProject());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(loginUser.getProject());
|
||||||
AccountVO user = this.iSysUserService.findUserByAccountAndPassword(loginUser.getAccount(), loginUser.getPassword(), project.name());
|
AccountVO user = this.iSysUserService.findUserByAccountAndPassword(loginUser.getAccount(), loginUser.getPassword(), projectVO.name());
|
||||||
BusinessExceptionAssertEnum.LOGIN_INFO_ERROR.assertNotNull(user, "账号或密码不正确!");
|
BusinessExceptionAssertEnum.LOGIN_INFO_ERROR.assertNotNull(user, "账号或密码不正确!");
|
||||||
if (loginUser.isTeacherLogin()) {
|
if (loginUser.isTeacherLogin()) {
|
||||||
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertEquals(true, user.getCompanyAdmin(), "账号无教师权限");
|
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertEquals(true, user.getCompanyAdmin(), "账号无教师权限");
|
||||||
@ -363,10 +361,10 @@ public class AuthenticateService implements IAuthenticateService {
|
|||||||
Client client = Client.getByIdAndSecret(loginUser.getClientId(), loginUser.getSecret());
|
Client client = Client.getByIdAndSecret(loginUser.getClientId(), loginUser.getSecret());
|
||||||
ProjectDeviceVO deviceVO = null;
|
ProjectDeviceVO deviceVO = null;
|
||||||
if (!StringUtils.isEmpty(loginUser.getDeviceCode())) {
|
if (!StringUtils.isEmpty(loginUser.getDeviceCode())) {
|
||||||
deviceVO = this.deviceService.getDeviceDetailInfoOf(project.name(), loginUser.getDeviceCode());
|
deviceVO = this.deviceService.getDeviceDetailInfoOf(projectVO.name(), loginUser.getDeviceCode());
|
||||||
}
|
}
|
||||||
// 构造登陆用户信息
|
// 构造登陆用户信息
|
||||||
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(user, client, project, deviceVO);
|
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(user, client, projectVO, deviceVO);
|
||||||
// 执行登录
|
// 执行登录
|
||||||
login(loginUserInfo, true);
|
login(loginUserInfo, true);
|
||||||
return loginUserInfo.getToken();
|
return loginUserInfo.getToken();
|
||||||
@ -381,9 +379,9 @@ public class AuthenticateService implements IAuthenticateService {
|
|||||||
loginInfo.getAccount());
|
loginInfo.getAccount());
|
||||||
Client client = Client.getByIdAndSecret(loginInfo.getClientId(), loginInfo.getSecret());
|
Client client = Client.getByIdAndSecret(loginInfo.getClientId(), loginInfo.getSecret());
|
||||||
// TODO 20220922
|
// TODO 20220922
|
||||||
club.joylink.rtss.entity.project.Project project = projectService.queryLoginProjectByCode(loginInfo.getProject());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(loginInfo.getProject());
|
||||||
// 构造登陆用户信息
|
// 构造登陆用户信息
|
||||||
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(accountVO, client, project, null);
|
LoginUserInfoVO loginUserInfo = new LoginUserInfoVO(accountVO, client, projectVO, null);
|
||||||
// 执行登录
|
// 执行登录
|
||||||
login(loginUserInfo, true);
|
login(loginUserInfo, true);
|
||||||
return loginUserInfo.getToken();
|
return loginUserInfo.getToken();
|
||||||
|
@ -8,7 +8,6 @@ import club.joylink.rtss.dao.CompetitionDAO;
|
|||||||
import club.joylink.rtss.dao.CompetitionRecordDAO;
|
import club.joylink.rtss.dao.CompetitionRecordDAO;
|
||||||
import club.joylink.rtss.dao.CompetitionVoiceRecordDAO;
|
import club.joylink.rtss.dao.CompetitionVoiceRecordDAO;
|
||||||
import club.joylink.rtss.entity.*;
|
import club.joylink.rtss.entity.*;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.*;
|
import club.joylink.rtss.services.*;
|
||||||
import club.joylink.rtss.services.project.ProjectService;
|
import club.joylink.rtss.services.project.ProjectService;
|
||||||
@ -43,6 +42,7 @@ import club.joylink.rtss.vo.client.script.ScriptActionVO;
|
|||||||
import club.joylink.rtss.vo.client.script.ScriptVO;
|
import club.joylink.rtss.vo.client.script.ScriptVO;
|
||||||
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -386,8 +386,8 @@ public class CompetitionPracticalService implements ICompetitionPracticalService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createSimulationAndLoadCompetition(Long id, LoginUserInfoVO userInfo) {
|
public String createSimulationAndLoadCompetition(Long id, LoginUserInfoVO userInfo) {
|
||||||
Project project = projectService.queryLoginProjectByCode("DRTS");
|
ProjectVO projectVO = projectService.queryLoginProjectByCode("DRTS");
|
||||||
String group = projectSimulationService.createCenterSimulation(userInfo, project);
|
String group = projectSimulationService.createCenterSimulation(userInfo, projectVO);
|
||||||
loadCompetition(group, id, userInfo);
|
loadCompetition(group, id, userInfo);
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
@ -448,8 +448,8 @@ public class CompetitionPracticalService implements ICompetitionPracticalService
|
|||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(monthAmount > 0,
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(monthAmount > 0,
|
||||||
"购买月数需大于0");
|
"购买月数需大于0");
|
||||||
MapVO mapInfo = iMapService.getMapInfoById(mapId);
|
MapVO mapInfo = iMapService.getMapInfoById(mapId);
|
||||||
Project project = projectService.queryLoginProjectByCode(mapInfo.getProjectCode());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapInfo.getProjectCode());
|
||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(project.isMapNeedCharge(), "非国赛地图无需购买权限");
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(projectVO.isMapNeedCharge(), "非国赛地图无需购买权限");
|
||||||
List<UserPermissionVO> ups = iUserPermissionService.getSimulationUserPermission(user, mapId, MapPrdTypeEnum.JOINT.getCode());
|
List<UserPermissionVO> ups = iUserPermissionService.getSimulationUserPermission(user, mapId, MapPrdTypeEnum.JOINT.getCode());
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(ups.size() > 1,
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(ups.size() > 1,
|
||||||
"地图权限数量大于1,暂不能购买");
|
"地图权限数量大于1,暂不能购买");
|
||||||
|
@ -2,7 +2,6 @@ package club.joylink.rtss.services.pay.wechat;
|
|||||||
|
|
||||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||||
import club.joylink.rtss.constants.ServicePath;
|
import club.joylink.rtss.constants.ServicePath;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.event.OrderPaySuccessEvent;
|
import club.joylink.rtss.event.OrderPaySuccessEvent;
|
||||||
import club.joylink.rtss.exception.BusinessException;
|
import club.joylink.rtss.exception.BusinessException;
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
@ -24,6 +23,7 @@ import club.joylink.rtss.vo.client.permission.PermissionVO;
|
|||||||
import club.joylink.rtss.vo.client.permissionDistribute.DistributeVO;
|
import club.joylink.rtss.vo.client.permissionDistribute.DistributeVO;
|
||||||
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
||||||
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
|
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
|
||||||
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
|
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
|
||||||
@ -310,8 +310,8 @@ public class WechatPayService {
|
|||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(permission.getName().contains("综合演练"),
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(permission.getName().contains("综合演练"),
|
||||||
String.format("支付的[%s]中的商品不是综合演练权限", orderVO.logStr()));
|
String.format("支付的[%s]中的商品不是综合演练权限", orderVO.logStr()));
|
||||||
MapVO mapInfo = iMapService.getMapInfoById(permission.getMapId());
|
MapVO mapInfo = iMapService.getMapInfoById(permission.getMapId());
|
||||||
Project project = projectService.queryLoginProjectByCode(mapInfo.getProjectCode());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapInfo.getProjectCode());
|
||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(project.isMapNeedCharge(),
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(projectVO.isMapNeedCharge(),
|
||||||
String.format("支付的[%s]中的商品不是国赛的权限", orderVO.logStr()));
|
String.format("支付的[%s]中的商品不是国赛的权限", orderVO.logStr()));
|
||||||
|
|
||||||
AccountVO user = iSysUserService.getUserById(orderVO.getCreatorId());
|
AccountVO user = iSysUserService.getUserById(orderVO.getCreatorId());
|
||||||
|
@ -32,6 +32,7 @@ import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
|||||||
import club.joylink.rtss.vo.map.graph.MapSignalNewVO;
|
import club.joylink.rtss.vo.map.graph.MapSignalNewVO;
|
||||||
import club.joylink.rtss.vo.map.graph.MapSwitchVO;
|
import club.joylink.rtss.vo.map.graph.MapSwitchVO;
|
||||||
import club.joylink.rtss.vo.map.graph.MapTrainVO;
|
import club.joylink.rtss.vo.map.graph.MapTrainVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -722,10 +723,10 @@ public class DeviceServiceImpl implements DeviceService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProjectDevice buildIm(Project project, Long creatorId) {
|
private ProjectDevice buildIm(ProjectVO projectVO, Long creatorId) {
|
||||||
ProjectDevice im = new ProjectDevice();
|
ProjectDevice im = new ProjectDevice();
|
||||||
im.setProjectCode(project.name());
|
im.setProjectCode(projectVO.name());
|
||||||
im.setCode(project.name().toLowerCase() + "-" + "im");
|
im.setCode(projectVO.name().toLowerCase() + "-" + "im");
|
||||||
im.setType(ProjectDeviceType.IM.name());
|
im.setType(ProjectDeviceType.IM.name());
|
||||||
im.setCreator(creatorId);
|
im.setCreator(creatorId);
|
||||||
im.setCreateTime(LocalDateTime.now());
|
im.setCreateTime(LocalDateTime.now());
|
||||||
|
@ -4,6 +4,8 @@ import club.joylink.rtss.entity.project.Project;
|
|||||||
import club.joylink.rtss.entity.project.ProjectView;
|
import club.joylink.rtss.entity.project.ProjectView;
|
||||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectViewVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -17,83 +19,94 @@ public interface ProjectService {
|
|||||||
*/
|
*/
|
||||||
PageVO<Project> pagingQuery(PageQueryVO queryVO);
|
PageVO<Project> pagingQuery(PageQueryVO queryVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 前端设置信息分页
|
|
||||||
*/
|
|
||||||
PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
List<Project> getAllProject();
|
List<Project> getAllProject();
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有的前端配置
|
|
||||||
*/
|
|
||||||
List<ProjectView> getAllProjectView();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 前端通过项目编码(前端)请求项目信息
|
|
||||||
*/
|
|
||||||
Project queryLoginProjectByCode(String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 前端通过项目编码(前端)请求项目信息
|
|
||||||
*/
|
|
||||||
ProjectView queryLoginProjectByMarkKey(String project);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目Id请求项目信息
|
* 项目Id请求项目信息
|
||||||
*/
|
*/
|
||||||
Project queryProjectById(Long id);
|
Project queryProjectById(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置ID获取前端配置信息
|
|
||||||
*/
|
|
||||||
ProjectView queryProjectViewById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目信息
|
* 修改项目信息
|
||||||
*/
|
*/
|
||||||
void updateProject(Project project);
|
void updateProject(Project project);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改项目前端配置信息
|
|
||||||
*/
|
|
||||||
void updateProjectView(ProjectView projectView);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除项目信息
|
* 删除项目信息
|
||||||
*/
|
*/
|
||||||
void deleteProject(Long id);
|
void deleteProject(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除项目前端配置信息
|
|
||||||
*/
|
|
||||||
void deleteProjectView(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目信息
|
* 保存项目信息
|
||||||
*/
|
*/
|
||||||
void save(Project project);
|
void save(Project project);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查项目编码是否存在
|
||||||
|
*/
|
||||||
|
boolean checkProjectCode(String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端设置信息分页
|
||||||
|
*/
|
||||||
|
PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的前端配置
|
||||||
|
*/
|
||||||
|
List<ProjectView> getAllProjectView();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置ID获取前端配置信息
|
||||||
|
*/
|
||||||
|
ProjectView queryProjectViewById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目前端配置信息
|
||||||
|
*/
|
||||||
|
void updateProjectView(ProjectView projectView);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目前端配置信息
|
||||||
|
*/
|
||||||
|
void deleteProjectView(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存前端配置信息
|
* 保存前端配置信息
|
||||||
*/
|
*/
|
||||||
void saveProjectView(ProjectView projectView);
|
void saveProjectView(ProjectView projectView);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新项目的前端设置信息
|
* 检查项目编码是否存在
|
||||||
*/
|
*/
|
||||||
ProjectView.SimpleProjectView getProjectViewSetting(String project);
|
boolean checkProjectViewMarkKey(String markKey);
|
||||||
|
|
||||||
|
/************************** runtime ***************************/
|
||||||
|
/**
|
||||||
|
* 前端通过项目编码(前端)请求项目信息
|
||||||
|
*/
|
||||||
|
ProjectVO queryLoginProjectByCode(String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目的简要信息,前端关联时使用
|
* 获取项目的简要信息,前端关联时使用
|
||||||
*/
|
*/
|
||||||
List<Project.SimpleProject> getSimpleProjectList();
|
List<ProjectVO> getSimpleProjectList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端通过项目编码(前端)请求项目信息
|
||||||
|
*/
|
||||||
|
ProjectViewVO queryLoginProjectByMarkKey(String project);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新项目的前端设置信息
|
||||||
|
*/
|
||||||
|
ProjectViewVO getProjectViewSetting(String project);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前端请求所有设置信息
|
* 前端请求所有设置信息
|
||||||
*/
|
*/
|
||||||
List<ProjectView.SimpleProjectView> queryViewAll();
|
List<ProjectViewVO> queryViewAll();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
|||||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectViewVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -26,6 +28,10 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ProjectServiceImpl implements ProjectService {
|
public class ProjectServiceImpl implements ProjectService {
|
||||||
|
/**
|
||||||
|
* 有效信息标识
|
||||||
|
*/
|
||||||
|
public final static Integer EFFECT_PROJECT_STATUS = 1;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectDAO projectDAO;
|
private ProjectDAO projectDAO;
|
||||||
@ -37,63 +43,22 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
public PageVO<Project> pagingQuery(PageQueryVO queryVO) {
|
public PageVO<Project> pagingQuery(PageQueryVO queryVO) {
|
||||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS);
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
|
||||||
Page<Project> page = (Page<Project>) projectDAO.selectByExample(projectExample);
|
Page<Project> page = (Page<Project>) projectDAO.selectByExample(projectExample);
|
||||||
return PageVO.convert(page, page.getResult());
|
return PageVO.convert(page, page.getResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO) {
|
|
||||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS);
|
|
||||||
Page<ProjectView> page = (Page<ProjectView>) projectViewDAO.selectByExample(projectViewExample);
|
|
||||||
return PageVO.convert(page, page.getResult());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Project> getAllProject() {
|
public List<Project> getAllProject() {
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS);
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
|
||||||
return projectDAO.selectByExample(projectExample);
|
return projectDAO.selectByExample(projectExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ProjectView> getAllProjectView() {
|
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS);
|
|
||||||
return projectViewDAO.selectByExample(projectViewExample);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Cacheable(cacheNames = "project", keyGenerator = "projectKeyGenerator", unless = "#result == null")
|
|
||||||
public Project queryLoginProjectByCode(String code) {
|
|
||||||
String codeKey = Project.isDefault(code) ? Project.DEFAULT_PROJECT_CODE : code;
|
|
||||||
ProjectExample projectExample = new ProjectExample();
|
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andCodeEqualTo(codeKey);
|
|
||||||
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
|
||||||
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
|
||||||
}
|
|
||||||
return projectList.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ProjectView queryLoginProjectByMarkKey(String project) {
|
|
||||||
String markKey = StringUtils.isEmpty(project) ? Project.DEFAULT_PROJECT_MARK_KEY : project;
|
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andMarkKeyEqualTo(markKey);
|
|
||||||
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
|
||||||
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
|
||||||
}
|
|
||||||
return projectList.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Project queryProjectById(Long id) {
|
public Project queryProjectById(Long id) {
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andIdEqualTo(id);
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andIdEqualTo(id);
|
||||||
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
||||||
if (CollectionUtils.isEmpty(projectList)) {
|
if (CollectionUtils.isEmpty(projectList)) {
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
@ -101,23 +66,12 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
return projectList.get(0);
|
return projectList.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ProjectView queryProjectViewById(Long id) {
|
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andIdEqualTo(id);
|
|
||||||
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
|
||||||
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
|
||||||
}
|
|
||||||
return projectList.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@CacheEvict(cacheNames = "project", allEntries = true)
|
@CacheEvict(cacheNames = "project", allEntries = true)
|
||||||
public void updateProject(Project project) {
|
public void updateProject(Project project) {
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andIdEqualTo(project.getId());
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andIdEqualTo(project.getId());
|
||||||
List<Project> projectList = projectDAO.selectByExample(projectExample);
|
List<Project> projectList = projectDAO.selectByExample(projectExample);
|
||||||
if (CollectionUtils.isEmpty(projectList)) {
|
if (CollectionUtils.isEmpty(projectList)) {
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
@ -126,11 +80,70 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
projectDAO.updateByPrimaryKeySelective(project);
|
projectDAO.updateByPrimaryKeySelective(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames = "project", allEntries = true)
|
||||||
|
public void deleteProject(Long id) {
|
||||||
|
Project project = new Project();
|
||||||
|
project.setId(id);
|
||||||
|
project.setStatus(0);
|
||||||
|
projectDAO.updateByPrimaryKeySelective(project);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames = "project", allEntries = true)
|
||||||
|
public void save(Project project) {
|
||||||
|
if (checkProjectCode(project.getCode())) {
|
||||||
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "项目已存在");
|
||||||
|
}
|
||||||
|
project.setCreateTime(LocalDateTime.now());
|
||||||
|
project.setUpdateTime(LocalDateTime.now());
|
||||||
|
project.setStatus(EFFECT_PROJECT_STATUS);
|
||||||
|
projectDAO.insert(project);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkProjectCode(String code) {
|
||||||
|
if (Project.isDefault(code)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ProjectExample projectExample = new ProjectExample();
|
||||||
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andCodeEqualTo(code);
|
||||||
|
long num = projectDAO.countByExample(projectExample);
|
||||||
|
return num > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageVO<ProjectView> projectViewPagingQuery(PageQueryVO queryVO) {
|
||||||
|
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||||
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
|
||||||
|
Page<ProjectView> page = (Page<ProjectView>) projectViewDAO.selectByExample(projectViewExample);
|
||||||
|
return PageVO.convert(page, page.getResult());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectView> getAllProjectView() {
|
||||||
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS);
|
||||||
|
return projectViewDAO.selectByExample(projectViewExample);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectView queryProjectViewById(Long id) {
|
||||||
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andIdEqualTo(id);
|
||||||
|
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
||||||
|
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
||||||
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
|
}
|
||||||
|
return projectList.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateProjectView(ProjectView projectView) {
|
public void updateProjectView(ProjectView projectView) {
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andIdEqualTo(projectView.getId());
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andIdEqualTo(projectView.getId());
|
||||||
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
||||||
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
@ -139,59 +152,81 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
projectViewDAO.updateByPrimaryKeySelective(projectView);
|
projectViewDAO.updateByPrimaryKeySelective(projectView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@CacheEvict(cacheNames = "project", allEntries = true)
|
|
||||||
public void deleteProject(Long id) {
|
|
||||||
projectDAO.deleteByPrimaryKey(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteProjectView(Long id) {
|
public void deleteProjectView(Long id) {
|
||||||
projectViewDAO.deleteByPrimaryKey(id);
|
ProjectView projectView = new ProjectView();
|
||||||
}
|
projectView.setId(id);
|
||||||
|
projectView.setStatus(0);
|
||||||
@Override
|
projectViewDAO.updateByPrimaryKeySelective(projectView);
|
||||||
@CacheEvict(cacheNames = "project", allEntries = true)
|
|
||||||
public void save(Project project) {
|
|
||||||
project.setCreateTime(LocalDateTime.now());
|
|
||||||
project.setUpdateTime(LocalDateTime.now());
|
|
||||||
project.setStatus(Project.EFFECT_PROJECT_STATUS);
|
|
||||||
projectDAO.insert(project);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveProjectView(ProjectView projectView) {
|
public void saveProjectView(ProjectView projectView) {
|
||||||
|
if (checkProjectViewMarkKey(projectView.getMarkKey())) {
|
||||||
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "项目已存在");
|
||||||
|
}
|
||||||
projectView.setCreateTime(LocalDateTime.now());
|
projectView.setCreateTime(LocalDateTime.now());
|
||||||
projectView.setUpdateTime(LocalDateTime.now());
|
projectView.setUpdateTime(LocalDateTime.now());
|
||||||
projectView.setStatus(Project.EFFECT_PROJECT_STATUS);
|
projectView.setStatus(EFFECT_PROJECT_STATUS);
|
||||||
projectViewDAO.insert(projectView);
|
projectViewDAO.insert(projectView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectView.SimpleProjectView getProjectViewSetting(String project) {
|
public boolean checkProjectViewMarkKey(String markKey) {
|
||||||
String markKey = Project.isDefault(project) ? Project.DEFAULT_PROJECT_MARK_KEY : project;
|
ProjectViewExample projectExample = new ProjectViewExample();
|
||||||
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andMarkKeyEqualTo(markKey);
|
||||||
|
long num = projectViewDAO.countByExample(projectExample);
|
||||||
|
return num > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Cacheable(cacheNames = "project", keyGenerator = "projectKeyGenerator", unless = "#result == null")
|
||||||
|
public ProjectVO queryLoginProjectByCode(String code) {
|
||||||
|
String codeKey = ProjectVO.isDefault(code) ? Project.DEFAULT_PROJECT_CODE : code;
|
||||||
|
ProjectExample projectExample = new ProjectExample();
|
||||||
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andCodeEqualTo(codeKey);
|
||||||
|
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
||||||
|
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
||||||
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
|
}
|
||||||
|
return new ProjectVO(projectList.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectVO> getSimpleProjectList() {
|
||||||
|
ProjectExample projectExample = new ProjectExample();
|
||||||
|
projectExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andViewShowEqualTo(1);
|
||||||
|
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
||||||
|
return projectList.stream().map(project -> new ProjectVO(project)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectViewVO queryLoginProjectByMarkKey(String project) {
|
||||||
|
String markKey = StringUtils.isEmpty(project) ? ProjectView.DEFAULT_PROJECT_MARK_KEY : project;
|
||||||
ProjectViewExample projectViewExample = new ProjectViewExample();
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
projectViewExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andMarkKeyEqualTo(markKey);
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andMarkKeyEqualTo(markKey);
|
||||||
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
||||||
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
}
|
}
|
||||||
ProjectView projectInfo = projectList.get(0);
|
return new ProjectViewVO(projectList.get(0));
|
||||||
return projectInfo.simplifyProjectView();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Project.SimpleProject> getSimpleProjectList() {
|
|
||||||
ProjectExample projectExample = new ProjectExample();
|
|
||||||
projectExample.createCriteria().andStatusEqualTo(Project.EFFECT_PROJECT_STATUS).andViewShowEqualTo(1);
|
|
||||||
List<Project> projectList = projectDAO.selectWithBLOBsByExample(projectExample);
|
|
||||||
return projectList.stream().map(Project::generateSimpleProject).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProjectView.SimpleProjectView> queryViewAll() {
|
public ProjectViewVO getProjectViewSetting(String project) {
|
||||||
|
String markKey = Project.isDefault(project) ? ProjectView.DEFAULT_PROJECT_MARK_KEY : project;
|
||||||
|
ProjectViewExample projectViewExample = new ProjectViewExample();
|
||||||
|
projectViewExample.createCriteria().andStatusEqualTo(EFFECT_PROJECT_STATUS).andMarkKeyEqualTo(markKey);
|
||||||
|
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(projectViewExample);
|
||||||
|
if (CollectionUtils.isEmpty(projectList)) { // 未找到项目则获取默认信息
|
||||||
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
|
}
|
||||||
|
return new ProjectViewVO(projectList.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectViewVO> queryViewAll() {
|
||||||
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(new ProjectViewExample());
|
List<ProjectView> projectList = projectViewDAO.selectWithBLOBsByExample(new ProjectViewExample());
|
||||||
return projectList.stream().map(ProjectView::simplifyProjectView).collect(Collectors.toList());
|
return projectList.stream().map(projectView -> new ProjectViewVO(projectView)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.rtss.services.simulation;
|
package club.joylink.rtss.services.simulation;
|
||||||
|
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目综合演练仿真服务
|
* 项目综合演练仿真服务
|
||||||
@ -14,5 +14,5 @@ public interface ProjectSimulationService {
|
|||||||
* @param project
|
* @param project
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project);
|
String createCenterSimulation(LoginUserInfoVO loginUserInfo, ProjectVO project);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package club.joylink.rtss.services.simulation;
|
package club.joylink.rtss.services.simulation;
|
||||||
|
|
||||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.IMapService;
|
import club.joylink.rtss.services.IMapService;
|
||||||
import club.joylink.rtss.services.IUserPermissionService;
|
import club.joylink.rtss.services.IUserPermissionService;
|
||||||
@ -13,6 +12,7 @@ import club.joylink.rtss.vo.LoginUserInfoVO;
|
|||||||
import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
|
import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
|
||||||
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -41,17 +41,17 @@ public class ProjectSimulationServiceImpl implements ProjectSimulationService {
|
|||||||
private RtSimulationService rtSimulationService;
|
private RtSimulationService rtSimulationService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createCenterSimulation(LoginUserInfoVO loginUserInfo, Project project) {
|
public String createCenterSimulation(LoginUserInfoVO loginUserInfo, ProjectVO projectVO) {
|
||||||
AccountVO accountVO = loginUserInfo.getAccountVO();
|
AccountVO accountVO = loginUserInfo.getAccountVO();
|
||||||
// 查询用户综合演练配置
|
// 查询用户综合演练配置
|
||||||
|
|
||||||
// 查询项目地图,默认取第一个(暂时这样处理,后面考虑配置实训室-地图对应?)
|
// 查询项目地图,默认取第一个(暂时这样处理,后面考虑配置实训室-地图对应?)
|
||||||
List<MapVO> mapList = this.iMapService.findOnlineMapByProjectCode(project.name());
|
List<MapVO> mapList = this.iMapService.findOnlineMapByProjectCode(projectVO.name());
|
||||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertCollectionNotEmpty(mapList, String.format("项目[%s]无地图", project.name()));
|
BusinessExceptionAssertEnum.INVALID_OPERATION.assertCollectionNotEmpty(mapList, String.format("项目[%s]无地图", projectVO.name()));
|
||||||
Long mapId = mapList.get(0).getId();
|
Long mapId = mapList.get(0).getId();
|
||||||
|
|
||||||
// 权限判断 : Project.BJD.equals(project)
|
// 权限判断 : Project.BJD.equals(project)
|
||||||
if (project.isPermissionVail()) {
|
if (projectVO.isPermissionVail()) {
|
||||||
List<UserPermissionVO> userPermissionList = this.iUserPermissionService
|
List<UserPermissionVO> userPermissionList = this.iUserPermissionService
|
||||||
.getSimulationUserPermission(accountVO, mapId, MapPrdTypeEnum.CENTER.getCode());
|
.getSimulationUserPermission(accountVO, mapId, MapPrdTypeEnum.CENTER.getCode());
|
||||||
BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_EXIST
|
BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_EXIST
|
||||||
@ -66,7 +66,7 @@ public class ProjectSimulationServiceImpl implements ProjectSimulationService {
|
|||||||
.assertNotTrue(CollectionUtils.isEmpty(collect), "用户仿真权限当前时间不可用");
|
.assertNotTrue(CollectionUtils.isEmpty(collect), "用户仿真权限当前时间不可用");
|
||||||
}
|
}
|
||||||
// Project.WJLS.equals(project)
|
// Project.WJLS.equals(project)
|
||||||
if (project.isCreateLocalSimulation()) {
|
if (projectVO.isCreateLocalSimulation()) {
|
||||||
return rtSimulationService.create(loginUserInfo.getAccountVO(), mapId, MapPrdTypeEnum.LOCAL).getId();
|
return rtSimulationService.create(loginUserInfo.getAccountVO(), mapId, MapPrdTypeEnum.LOCAL).getId();
|
||||||
}
|
}
|
||||||
// 构建仿真
|
// 构建仿真
|
||||||
|
@ -4,7 +4,6 @@ import club.joylink.rtss.configuration.configProp.OtherConfig;
|
|||||||
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
||||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||||
import club.joylink.rtss.constants.ProjectDeviceType;
|
import club.joylink.rtss.constants.ProjectDeviceType;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.*;
|
import club.joylink.rtss.services.*;
|
||||||
import club.joylink.rtss.services.org.IOrgService;
|
import club.joylink.rtss.services.org.IOrgService;
|
||||||
@ -71,6 +70,7 @@ import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
|||||||
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import club.joylink.rtss.websocket.StompMessageService;
|
import club.joylink.rtss.websocket.StompMessageService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -1066,8 +1066,8 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(AccountVO accountVO, Long mapId, String prdType) {
|
public boolean hasPermission(AccountVO accountVO, Long mapId, String prdType) {
|
||||||
MapVO mapDetail = iMapService.getMapDetail(mapId);
|
MapVO mapDetail = iMapService.getMapDetail(mapId);
|
||||||
Project project = projectService.queryLoginProjectByCode(mapDetail.getProjectCode());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapDetail.getProjectCode());
|
||||||
if (project.isFreeSource()) { //成都工业,郑州共赢所有资源免费
|
if (projectVO.isFreeSource()) { //成都工业,郑州共赢所有资源免费
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
List<UserPermissionVO> ups = iUserPermissionService.getSimulationUserPermission(accountVO, mapId, prdType);
|
List<UserPermissionVO> ups = iUserPermissionService.getSimulationUserPermission(accountVO, mapId, prdType);
|
||||||
|
@ -2,7 +2,6 @@ package club.joylink.rtss.simulation.cbtc;
|
|||||||
|
|
||||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||||
import club.joylink.rtss.constants.ProjectDeviceType;
|
import club.joylink.rtss.constants.ProjectDeviceType;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
|
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
|
||||||
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
|
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
|
||||||
@ -31,6 +30,7 @@ import club.joylink.rtss.simulation.cbtc.training2.Training2;
|
|||||||
import club.joylink.rtss.simulation.vo.SimulationInfoVO;
|
import club.joylink.rtss.simulation.vo.SimulationInfoVO;
|
||||||
import club.joylink.rtss.vo.AccountVO;
|
import club.joylink.rtss.vo.AccountVO;
|
||||||
import club.joylink.rtss.vo.client.fault.FaultRuleVO;
|
import club.joylink.rtss.vo.client.fault.FaultRuleVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -68,7 +68,7 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
|
|||||||
*/
|
*/
|
||||||
private String project;
|
private String project;
|
||||||
|
|
||||||
private Project projectInfo;
|
private ProjectVO projectVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据仓库
|
* 数据仓库
|
||||||
|
@ -48,7 +48,7 @@ public class SimulationBuilder {
|
|||||||
if (Objects.nonNull(buildParams.getLoginUserInfo())) {
|
if (Objects.nonNull(buildParams.getLoginUserInfo())) {
|
||||||
simulation.setCreatorId(buildParams.getLoginUserInfo().getAccountVO().getIdStr());
|
simulation.setCreatorId(buildParams.getLoginUserInfo().getAccountVO().getIdStr());
|
||||||
simulation.setProject(buildParams.getLoginUserInfo().getProject());
|
simulation.setProject(buildParams.getLoginUserInfo().getProject());
|
||||||
simulation.setProjectInfo(buildParams.getLoginUserInfo().getProjectInfo());
|
simulation.setProjectVO(buildParams.getLoginUserInfo().getProjectInfo());
|
||||||
}
|
}
|
||||||
// 线路配置参数
|
// 线路配置参数
|
||||||
simulation.getRepository().setConfig(buildConfig(buildParams.getMap().getConfigVO(),
|
simulation.getRepository().setConfig(buildConfig(buildParams.getMap().getConfigVO(),
|
||||||
|
@ -70,7 +70,7 @@ public class SimulationRealDeviceThread {
|
|||||||
public void controlDevice(Simulation simulation) {
|
public void controlDevice(Simulation simulation) {
|
||||||
List<RealDeviceConfig> realDeviceList = simulation.getRealDeviceList();
|
List<RealDeviceConfig> realDeviceList = simulation.getRealDeviceList();
|
||||||
if (!CollectionUtils.isEmpty(realDeviceList)) {
|
if (!CollectionUtils.isEmpty(realDeviceList)) {
|
||||||
if (simulation.getProjectInfo().isControlDevice()) {
|
if (simulation.getProjectVO().isControlDevice()) {
|
||||||
Set<VirtualRealityScreenDoor> vrPsdSet = new HashSet<>();
|
Set<VirtualRealityScreenDoor> vrPsdSet = new HashSet<>();
|
||||||
Set<VirtualRealitySwitch> vrSwitchSet = new HashSet<>();
|
Set<VirtualRealitySwitch> vrSwitchSet = new HashSet<>();
|
||||||
for (RealDeviceConfig realDevice : realDeviceList) {
|
for (RealDeviceConfig realDevice : realDeviceList) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package club.joylink.rtss.simulation.rt;
|
package club.joylink.rtss.simulation.rt;
|
||||||
|
|
||||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.IDailyRunPlanService;
|
import club.joylink.rtss.services.IDailyRunPlanService;
|
||||||
import club.joylink.rtss.services.ILoadPlanService;
|
import club.joylink.rtss.services.ILoadPlanService;
|
||||||
@ -28,6 +27,7 @@ import club.joylink.rtss.vo.AccountVO;
|
|||||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
||||||
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||||
import club.joylink.rtss.vo.map.MapVO;
|
import club.joylink.rtss.vo.map.MapVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@ -82,8 +82,8 @@ public class RtSimulationService {
|
|||||||
}
|
}
|
||||||
rtSimulation.init();
|
rtSimulation.init();
|
||||||
// 郑州共赢驾驶默认加载一辆列车
|
// 郑州共赢驾驶默认加载一辆列车
|
||||||
Project project = projectService.queryLoginProjectByCode(mapVO.getProjectCode());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapVO.getProjectCode());
|
||||||
if (project.getDefaultLoadTrain() > 0 && Objects.equals(MapPrdTypeEnum.DRIVER, prdTypeEnum)) {
|
if (projectVO.getDefaultLoadTrain() > 0 && Objects.equals(MapPrdTypeEnum.DRIVER, prdTypeEnum)) {
|
||||||
this.srTrainOperationHandler.loadTrain(rtSimulation, "001", true, "T21");
|
this.srTrainOperationHandler.loadTrain(rtSimulation, "001", true, "T21");
|
||||||
}
|
}
|
||||||
simulationManager.start(rtSimulation.getId());
|
simulationManager.start(rtSimulation.getId());
|
||||||
@ -122,10 +122,10 @@ public class RtSimulationService {
|
|||||||
private void initCreatorPlayMember(RtSimulation rtSimulation, MapVO mapVO) {
|
private void initCreatorPlayMember(RtSimulation rtSimulation, MapVO mapVO) {
|
||||||
// RtSimulationMember simulationMember = rtSimulation.querySimulationMemberById("2");
|
// RtSimulationMember simulationMember = rtSimulation.querySimulationMemberById("2");
|
||||||
// List<RtSimulationMember> memberList = rtSimulation.querySimulationMembersOfRole(RtSimulationMember.Role.LOWS);
|
// List<RtSimulationMember> memberList = rtSimulation.querySimulationMembersOfRole(RtSimulationMember.Role.LOWS);
|
||||||
Project project = projectService.queryLoginProjectByCode(mapVO.getProjectCode());
|
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapVO.getProjectCode());
|
||||||
if (!StringUtils.isEmpty(project.getDefaultMemberId())) {
|
if (!StringUtils.isEmpty(projectVO.getDefaultMemberId())) {
|
||||||
// 大铁微机联锁项目默认新绛站值班员
|
// 大铁微机联锁项目默认新绛站值班员
|
||||||
this.simulationManager.memberPlayedByUser(rtSimulation.getId(), project.getDefaultMemberId(), rtSimulation.getCreator().getId());
|
this.simulationManager.memberPlayedByUser(rtSimulation.getId(), projectVO.getDefaultMemberId(), rtSimulation.getCreator().getId());
|
||||||
} else {
|
} else {
|
||||||
String memberId = rtSimulation.getSimulationMembers().stream().filter(r -> Objects.equals("001", r.deviceId))
|
String memberId = rtSimulation.getSimulationMembers().stream().filter(r -> Objects.equals("001", r.deviceId))
|
||||||
.map(RtSimulationMember::getId).findFirst().orElse("1");
|
.map(RtSimulationMember::getId).findFirst().orElse("1");
|
||||||
|
@ -5,6 +5,7 @@ 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.project.ProjectDeviceVO;
|
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@ -29,7 +30,7 @@ public class LoginUserInfoVO {
|
|||||||
private String project;
|
private String project;
|
||||||
|
|
||||||
//TODO 20220922 添加
|
//TODO 20220922 添加
|
||||||
private Project projectInfo;
|
private ProjectVO projectInfo;
|
||||||
|
|
||||||
private ProjectDeviceVO deviceVO;
|
private ProjectDeviceVO deviceVO;
|
||||||
|
|
||||||
@ -59,10 +60,10 @@ public class LoginUserInfoVO {
|
|||||||
this.token = buildToken();
|
this.token = buildToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUserInfoVO(AccountVO accountVO, Client client, Project projectInfo, ProjectDeviceVO deviceVO) {
|
public LoginUserInfoVO(AccountVO accountVO, Client client, ProjectVO projectVO, ProjectDeviceVO deviceVO) {
|
||||||
this.accountVO = accountVO;
|
this.accountVO = accountVO;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.projectInfo = projectInfo;
|
this.projectInfo = projectVO;
|
||||||
this.project = projectInfo.name();
|
this.project = projectInfo.name();
|
||||||
this.deviceVO = deviceVO;
|
this.deviceVO = deviceVO;
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package club.joylink.rtss.vo.client;
|
package club.joylink.rtss.vo.client;
|
||||||
|
|
||||||
import club.joylink.rtss.constants.Client;
|
import club.joylink.rtss.constants.Client;
|
||||||
import club.joylink.rtss.entity.project.Project;
|
|
||||||
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
||||||
|
import club.joylink.rtss.vo.project.ProjectVO;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -28,7 +28,7 @@ public class LoginStatusVO {
|
|||||||
private String project;
|
private String project;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private Project projectInfo;
|
private ProjectVO projectVO;
|
||||||
|
|
||||||
private ProjectDeviceVO deviceVO;
|
private ProjectDeviceVO deviceVO;
|
||||||
|
|
||||||
|
178
src/main/java/club/joylink/rtss/vo/project/ProjectVO.java
Normal file
178
src/main/java/club/joylink/rtss/vo/project/ProjectVO.java
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
package club.joylink.rtss.vo.project;
|
||||||
|
|
||||||
|
import club.joylink.rtss.entity.project.Project;
|
||||||
|
import club.joylink.rtss.util.JsonUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectVO {
|
||||||
|
/**
|
||||||
|
* 项目简称
|
||||||
|
*/
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目Code
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反序列化设置信息
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private ProjectServerConfig projectServerConfig;
|
||||||
|
|
||||||
|
public ProjectVO(Project project) {
|
||||||
|
this.label = project.getName();
|
||||||
|
this.value = project.getCode();
|
||||||
|
if (StringUtils.isEmpty(project.getServerSetting())) {
|
||||||
|
this.projectServerConfig = null;
|
||||||
|
} else {
|
||||||
|
this.projectServerConfig = JsonUtils.read(project.getServerSetting(), ProjectServerConfig.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回项目编码
|
||||||
|
*/
|
||||||
|
public String name() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否默认项目
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isDefault() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getDefaultProject() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public static boolean isDefault(String code) {
|
||||||
|
return Project.isDefault(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否登录就创建仿真
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isLoginWithCreateSimulation() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getLoginCreateSimulation() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isPermissionVail() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getCreateSimulationPermission() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isCreateLocalSimulation() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getCreateLocalSimulation() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isMapNeedCharge() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getMapNeedCharge() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否资源免费
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isFreeSource() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getFreeSource() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public boolean isControlDevice() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getControlDevice() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public int getDefaultLoadTrain() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getDefaultLoadTrain();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public String getDefaultMemberId() {
|
||||||
|
if (this.projectServerConfig == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.projectServerConfig.getDefaultMemberId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ProjectServerConfig {
|
||||||
|
/**
|
||||||
|
* 默认项目
|
||||||
|
*/
|
||||||
|
private int defaultProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录后创建仿真
|
||||||
|
*/
|
||||||
|
private int loginCreateSimulation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录时创建仿真的权限判断,原BJD使用
|
||||||
|
*/
|
||||||
|
private int createSimulationPermission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录时创建仿真判断,WJLS创建现地类型
|
||||||
|
*/
|
||||||
|
private int createLocalSimulation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地图需要收费:DRTS
|
||||||
|
*/
|
||||||
|
private int mapNeedCharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源免费:CGY、ZZWW
|
||||||
|
*/
|
||||||
|
private int freeSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需要控制装备:HEB
|
||||||
|
*/
|
||||||
|
private int controlDevice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认加载列车数
|
||||||
|
*/
|
||||||
|
private int defaultLoadTrain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认加载角色:WJLS默认加载2
|
||||||
|
*/
|
||||||
|
private String defaultMemberId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package club.joylink.rtss.vo.project;
|
||||||
|
|
||||||
|
import club.joylink.rtss.entity.project.ProjectView;
|
||||||
|
import club.joylink.rtss.util.JsonUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectViewVO {
|
||||||
|
private String markKey;
|
||||||
|
|
||||||
|
private String project;
|
||||||
|
|
||||||
|
private Map<String, Object> viewSetting;
|
||||||
|
|
||||||
|
public ProjectViewVO(ProjectView projectView) {
|
||||||
|
this.markKey = projectView.getMarkKey();
|
||||||
|
this.project = projectView.getProject();
|
||||||
|
if (StringUtils.isEmpty(projectView.getViewSetting())) {
|
||||||
|
this.viewSetting = new HashMap<>();
|
||||||
|
} else {
|
||||||
|
this.viewSetting = JsonUtils.read(projectView.getViewSetting(), Map.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,8 +5,7 @@
|
|||||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||||
<result column="code" property="code" jdbcType="VARCHAR"/>
|
<result column="code" property="code" jdbcType="VARCHAR"/>
|
||||||
<result column="name" property="name" jdbcType="VARCHAR"/>
|
<result column="name" property="name" jdbcType="VARCHAR"/>
|
||||||
<result column="name_en" property="nameEn" jdbcType="VARCHAR"/>
|
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||||
<result column="simple_name" property="simpleName" jdbcType="VARCHAR"/>
|
|
||||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||||
@ -76,7 +75,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, code, name, name_en, simple_name, create_time, update_time, status, view_show
|
id, code, name, description, create_time, update_time, status, view_show
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
server_setting
|
server_setting
|
||||||
@ -147,12 +146,8 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<insert id="insert" parameterType="club.joylink.rtss.entity.project.Project">
|
<insert id="insert" parameterType="club.joylink.rtss.entity.project.Project">
|
||||||
insert into project ( code,
|
insert into project ( code, name, description, create_time, update_time, status, server_setting,view_show)
|
||||||
name, name_en, simple_name,
|
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR},
|
||||||
create_time, update_time, status,
|
|
||||||
server_setting,view_show)
|
|
||||||
values (#{code,jdbcType=VARCHAR},
|
|
||||||
#{name,jdbcType=VARCHAR}, #{nameEn,jdbcType=VARCHAR}, #{simpleName,jdbcType=VARCHAR},
|
|
||||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
|
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
|
||||||
#{serverSetting,jdbcType=LONGVARCHAR},#{viewShow,jdbcType=INTEGER})
|
#{serverSetting,jdbcType=LONGVARCHAR},#{viewShow,jdbcType=INTEGER})
|
||||||
</insert>
|
</insert>
|
||||||
@ -169,11 +164,8 @@
|
|||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name,
|
name,
|
||||||
</if>
|
</if>
|
||||||
<if test="nameEn != null">
|
<if test="description != null">
|
||||||
name_en,
|
description,
|
||||||
</if>
|
|
||||||
<if test="simpleName != null">
|
|
||||||
simple_name,
|
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time,
|
create_time,
|
||||||
@ -201,11 +193,8 @@
|
|||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
#{name,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="nameEn != null">
|
<if test="description != null">
|
||||||
#{nameEn,jdbcType=VARCHAR},
|
#{description,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
|
||||||
<if test="simpleName != null">
|
|
||||||
#{simpleName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
@ -234,11 +223,8 @@
|
|||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="nameEn != null">
|
<if test="description != null">
|
||||||
name_en = #{nameEn,jdbcType=VARCHAR},
|
description = #{description,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
|
||||||
<if test="simpleName != null">
|
|
||||||
simple_name = #{simpleName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
@ -263,8 +249,7 @@
|
|||||||
update project
|
update project
|
||||||
set code = #{code,jdbcType=VARCHAR},
|
set code = #{code,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
name_en = #{nameEn,jdbcType=VARCHAR},
|
description = #{description,jdbcType=LONGVARCHAR},
|
||||||
simple_name = #{simpleName,jdbcType=VARCHAR},
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
status = #{status,jdbcType=INTEGER},
|
status = #{status,jdbcType=INTEGER},
|
||||||
@ -277,8 +262,7 @@
|
|||||||
update project
|
update project
|
||||||
set code = #{code,jdbcType=VARCHAR},
|
set code = #{code,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
name_en = #{nameEn,jdbcType=VARCHAR},
|
description = #{description,jdbcType=LONGVARCHAR},
|
||||||
simple_name = #{simpleName,jdbcType=VARCHAR},
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
status = #{status,jdbcType=INTEGER},
|
status = #{status,jdbcType=INTEGER},
|
||||||
|
Loading…
Reference in New Issue
Block a user