Compare commits

...

6 Commits

Author SHA1 Message Date
f14e377565 [新增]以终端反向信号机命名的信号机同样也用此信号机作为办理进路的按钮
All checks were successful
CI / Docker-Build (push) Successful in 2m13s
2024-09-29 09:31:21 +08:00
b302bb360b [新增]开启自动进路的信号机不能开放引导信号 2024-09-26 15:20:55 +08:00
1e2ed4d305 [新增]获取用户信息的接口中增加更新时间
All checks were successful
CI / Docker-Build (push) Successful in 2m12s
2024-09-25 13:27:39 +08:00
436a07bcf4 [新增]获取所有用户信息的接口
All checks were successful
CI / Docker-Build (push) Successful in 2m9s
2024-09-25 10:51:31 +08:00
235f4dce5b [新增]按id数组查询用户信息的接口
All checks were successful
CI / Docker-Build (push) Successful in 2m14s
2024-09-24 16:43:07 +08:00
ac87b0dbe9 [bug]实训中,有多个评分规则时,仅有一个评分规则被使用
All checks were successful
CI / Docker-Build (push) Successful in 2m12s
2024-09-18 10:37:33 +08:00
8 changed files with 2827 additions and 2608 deletions

View File

@ -4,15 +4,25 @@ import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.UserQueryVO; import club.joylink.rtss.vo.UserQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.user.*; import club.joylink.rtss.vo.client.user.MobileInfoVO;
import club.joylink.rtss.vo.client.user.RetrievePwdVO;
import club.joylink.rtss.vo.client.user.UpdateEmailVO;
import club.joylink.rtss.vo.client.user.UpdateMobileVO;
import club.joylink.rtss.vo.client.user.UpdatePasswordVO;
import club.joylink.rtss.vo.user.AccountCreateVO; import club.joylink.rtss.vo.user.AccountCreateVO;
import club.joylink.rtss.vo.user.AccountRegisterVO; import club.joylink.rtss.vo.user.AccountRegisterVO;
import club.joylink.rtss.vo.user.UserRegisterCheck; import club.joylink.rtss.vo.user.UserRegisterCheck;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 系统账户接口 * 系统账户接口
@ -21,165 +31,186 @@ import java.util.List;
@RequestMapping("/api/userinfo") @RequestMapping("/api/userinfo")
public class SysAccountController { public class SysAccountController {
@Autowired @Autowired
private ISysUserService iSysUserService; private ISysUserService iSysUserService;
@PostMapping("/register") @PostMapping("/register")
public void register(@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) { public void register(
this.iSysUserService.register(accountCreateVO); @RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
} this.iSysUserService.register(accountCreateVO);
}
/** /**
* 新注册接口 * 新注册接口
*/ */
@PostMapping("/register2") @PostMapping("/register2")
public void register2(@RequestBody @Validated AccountRegisterVO registerVO) { public void register2(@RequestBody @Validated AccountRegisterVO registerVO) {
this.iSysUserService.register2(registerVO); this.iSysUserService.register2(registerVO);
} }
/** /**
*根据姓名或电话号查询用户 * 根据姓名或电话号查询用户
*/ */
@GetMapping(path="/nameOrMobile") @GetMapping(path = "/nameOrMobile")
public List<AccountVO> queryUserByNameOrMobile(String query) { public List<AccountVO> queryUserByNameOrMobile(String query) {
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query); List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
return list; return list;
} }
/** /**
* 手机号是否已经注册 * 手机号是否已经注册
*/ */
@GetMapping("/isExist/mobile") @GetMapping("/isExist/mobile")
public boolean isMobileExist(String mobile) { public boolean isMobileExist(String mobile) {
return iSysUserService.isSameMobileExist(mobile); return iSysUserService.isSameMobileExist(mobile);
} }
/** /**
* 邮箱是否已经注册 * 邮箱是否已经注册
*/ */
@GetMapping("/isExist/email") @GetMapping("/isExist/email")
public boolean isEmailExist(String email) { public boolean isEmailExist(String email) {
return iSysUserService.isSameEmailExist(email); return iSysUserService.isSameEmailExist(email);
} }
/** /**
*根据用户id获取用户信息 * 根据用户id获取用户信息
*/ */
@GetMapping(path = "/{id}") @GetMapping(path = "/{id}")
public AccountVO getUserBaseInfoById(@PathVariable Long id) { public AccountVO getUserBaseInfoById(@PathVariable Long id) {
return this.iSysUserService.getUserBaseInfoById(id); return this.iSysUserService.getUserBaseInfoById(id);
} }
/** /**
*修改用户信息 * 修改用户信息
*/ */
@PutMapping(path = "/{id}") @PutMapping(path = "/{id}")
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) { public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
this.iSysUserService.modify(id, userInfo, vdcode); this.iSysUserService.modify(id, userInfo, vdcode);
} }
/** /**
*微信关注事件 * 微信关注事件
*/ */
@GetMapping(path = "/wxsubscribe") @GetMapping(path = "/wxsubscribe")
public void wxSubscribe(@RequestParam String wxId) { public void wxSubscribe(@RequestParam String wxId) {
iSysUserService.wxSubscribeEventHandle(wxId); iSysUserService.wxSubscribeEventHandle(wxId);
} }
/** /**
*批量修改用户的openId为unionId * 批量修改用户的openId为unionId
*/ */
@PutMapping(path = "/batchchange/unionid") @PutMapping(path = "/batchchange/unionid")
public void batchChangeOpenId2UnionId() { public void batchChangeOpenId2UnionId() {
this.iSysUserService.batchChangeOpenId2UnionId(); this.iSysUserService.batchChangeOpenId2UnionId();
} }
/** /**
*更新用户真实姓名 * 更新用户真实姓名
*/ */
@PutMapping(path = "/{id}/name") @PutMapping(path = "/{id}/name")
public void updateName(@PathVariable Long id, String name) { public void updateName(@PathVariable Long id, String name) {
this.iSysUserService.updateUserName(id, name); this.iSysUserService.updateUserName(id, name);
} }
/** /**
*更新用户昵称 * 更新用户昵称
*/ */
@PutMapping(path = "/{id}/nickname") @PutMapping(path = "/{id}/nickname")
public void updateNickname(@PathVariable Long id, String nickname) { public void updateNickname(@PathVariable Long id, String nickname) {
this.iSysUserService.updateNickname(id, nickname); this.iSysUserService.updateNickname(id, nickname);
} }
/** /**
*用户上传头像 * 用户上传头像
*/ */
@PostMapping(path = "/{id}/avatar") @PostMapping(path = "/{id}/avatar")
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) { public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath()); this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath());
} }
/** /**
*发送手机验证码 * 发送手机验证码
*/ */
@PostMapping(path = "/mobile/code") @PostMapping(path = "/mobile/code")
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) { public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
return this.iSysUserService.sendMobileValidCode(mobileInfoVO); return this.iSysUserService.sendMobileValidCode(mobileInfoVO);
} }
/** /**
*发送邮箱验证码 * 发送邮箱验证码
*/ */
@PostMapping(path = "/email/code") @PostMapping(path = "/email/code")
public String sendEmailValidCode(String email) { public String sendEmailValidCode(String email) {
return this.iSysUserService.sendEmailValidCode(email); return this.iSysUserService.sendEmailValidCode(email);
} }
/** /**
*更新用户手机号 * 更新用户手机号
*/ */
@PutMapping(path = "/{id}/mobile") @PutMapping(path = "/{id}/mobile")
public void updateMobile(@PathVariable Long id, @RequestBody @Validated UpdateMobileVO updateMobileVO) { public void updateMobile(@PathVariable Long id,
this.iSysUserService.updateMobile(id, updateMobileVO); @RequestBody @Validated UpdateMobileVO updateMobileVO) {
} this.iSysUserService.updateMobile(id, updateMobileVO);
}
/** /**
*更新用户邮箱 * 更新用户邮箱
*/ */
@PutMapping(path = "/{id}/email") @PutMapping(path = "/{id}/email")
public void updateEmail(@PathVariable Long id, @RequestBody @Validated UpdateEmailVO updateEmailVO) { public void updateEmail(@PathVariable Long id,
this.iSysUserService.updateEmail(id, updateEmailVO); @RequestBody @Validated UpdateEmailVO updateEmailVO) {
} this.iSysUserService.updateEmail(id, updateEmailVO);
}
/** /**
*更新用户登陆密码 * 更新用户登陆密码
*/ */
@PutMapping(path = "/{id}/password") @PutMapping(path = "/{id}/password")
public void updatePassword(@PathVariable Long id, @RequestBody @Validated UpdatePasswordVO updatePasswordVO) { public void updatePassword(@PathVariable Long id,
this.iSysUserService.updatePassword(id, updatePasswordVO); @RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
} this.iSysUserService.updatePassword(id, updatePasswordVO);
}
/** /**
* 按条件分页查询指定来源的账号 * 按条件分页查询指定来源的账号
*/ */
@GetMapping("/page/criteria/{source}") @GetMapping("/page/criteria/{source}")
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO, @PathVariable String source) { public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO,
queryVO.setSource(source); @PathVariable String source) {
return this.iSysUserService.queryPagedUser(queryVO); queryVO.setSource(source);
} return this.iSysUserService.queryPagedUser(queryVO);
}
/** /**
* 超管重置用户密码 * 超管重置用户密码
*/ */
@PutMapping("/{id}/reset/pwd") @PutMapping("/{id}/reset/pwd")
public void resetPwd(@PathVariable long id) { public void resetPwd(@PathVariable long id) {
iSysUserService.resetPwd(id); iSysUserService.resetPwd(id);
} }
/** /**
* 找回密码 * 找回密码
*/ */
@PutMapping("/retrieve/pwd") @PutMapping("/retrieve/pwd")
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) { public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
iSysUserService.retrievePwd(vo); iSysUserService.retrievePwd(vo);
} }
/**
* 根据用户id列表获取用户信息
*/
@PostMapping("/list/ids")
public List<AccountVO> listByIds(@RequestBody List<Long> ids) {
return iSysUserService.listByIds(ids);
}
/**
* 查询所有用户
*/
@GetMapping("/list/all")
public List<AccountVO> listAll() {
return iSysUserService.listAll();
}
} }

View File

@ -363,4 +363,8 @@ public interface ISysUserService {
boolean isSameMobileExist(String mobile); boolean isSameMobileExist(String mobile);
boolean isSameEmailExist(String email); boolean isSameEmailExist(String email);
List<AccountVO> listByIds(List<Long> ids);
List<AccountVO> listAll();
} }

View File

@ -1112,6 +1112,20 @@ public class SysUserService implements ISysUserService {
return sysAccountDAO.countByExample(example) > 0; return sysAccountDAO.countByExample(example) > 0;
} }
@Override
public List<AccountVO> listByIds(List<Long> ids) {
SysAccountExample example = new SysAccountExample();
example.createCriteria().andIdIn(ids);
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(example);
return AccountVO.convertFromDB(sysAccounts);
}
@Override
public List<AccountVO> listAll() {
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(null);
return AccountVO.convertFromDB(sysAccounts);
}
/** /**
* 查询包含组织信息的用户信息 * 查询包含组织信息的用户信息
*/ */

View File

@ -315,9 +315,12 @@ public class Training2Service {
Map<Long, Float> scoreMap = new HashMap<>(); Map<Long, Float> scoreMap = new HashMap<>();
if (!CollectionUtils.isEmpty(training2.getScoringRules())) { if (!CollectionUtils.isEmpty(training2.getScoringRules())) {
training2.getScoringRules().stream() training2.getScoringRules().stream()
// .filter(score -> Objects.equals(score.getMember().getId(), member.getId())) .flatMap(sr -> sr.getDetails().stream())
.findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails() .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()));
.forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()))); // training2.getScoringRules().stream()
//// .filter(score -> Objects.equals(score.getMember().getId(), member.getId()))
// .findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails()
// .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore())));
} }
// 前端传回的步骤信息 // 前端传回的步骤信息
Map<Long, PaperTrainAnswerDetail> answerDetailMap = new HashMap<>(); Map<Long, PaperTrainAnswerDetail> answerDetailMap = new HashMap<>();
@ -337,11 +340,11 @@ public class Training2Service {
} else { } else {
if (answerDetailMap.containsKey(step.getId())) { if (answerDetailMap.containsKey(step.getId())) {
detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess()); detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess());
detail.setScore(
detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F);
detail.setClientOperations(answerDetailMap.get(step.getId()).getClientOperations()); detail.setClientOperations(answerDetailMap.get(step.getId()).getClientOperations());
detail.setNotExistAppend(true); detail.setNotExistAppend(true);
} }
detail.setScore(
detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F);
} }
return detail; return detail;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

View File

@ -413,6 +413,10 @@ public class CiApiServiceImpl2 implements CiApiService {
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception( throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception(
"signalCode和routeCode不能都为空"); "signalCode和routeCode不能都为空");
} }
//开启联锁自动进路的信号机不能办理引导进路需先解除自动进路成都三操作文档
if (signal.getRouteList().stream().anyMatch(Route::isFleetMode)) {
throw BusinessExceptionAssertEnum.OPERATION_FAIL.exception("需先解除自动进路状态");
}
if (route == null && signal.getRouteList().stream().anyMatch(Route::isAnySwitchMasterLock)) { if (route == null && signal.getRouteList().stream().anyMatch(Route::isAnySwitchMasterLock)) {
openGuideAspect4GuideMasterLock(simulation, signal); openGuideAspect4GuideMasterLock(simulation, signal);

View File

@ -7,18 +7,17 @@ import club.joylink.rtss.vo.client.org.OrgVO;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import javax.validation.constraints.NotBlank;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
/** /**
* 账户对象 * 账户对象
@ -28,307 +27,316 @@ import java.util.List;
@Setter @Setter
@EqualsAndHashCode @EqualsAndHashCode
public class AccountVO implements Serializable { public class AccountVO implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** @JsonSerialize(using = ToStringSerializer.class)
* 登录账户名线下登录账户名 private Long id;
*/
private String account;
/**
* 父账户
*/
private String parentAccount;
/**
* 账户类型
*/
private String type;
public static final String Type_1 = "1"; // 个人账户
public static final String Type_2 = "2"; // 第三方企业账户
public static final String Type_3 = "3"; // 第三方企业子账户
/** /**
* 账号所属的组织是账号表里的字段 * 登录账户名线下登录账户名
*/ */
private Long orgId; private String account;
/**
* 父账户
*/
private String parentAccount;
/**
* 账户类型
*/
private String type;
public static final String Type_1 = "1"; // 个人账户
public static final String Type_2 = "2"; // 第三方企业账户
public static final String Type_3 = "3"; // 第三方企业子账户
/** /**
* 真实姓名 * 账号所属的组织是账号表里的字段
*/ */
@NotBlank(message = "姓名不能为空") private Long orgId;
private String name;
/** /**
* 昵称 * 真实姓名
*/ */
@NotBlank(message = "昵称不能为空") @NotBlank(message = "姓名不能为空")
private String nickname; private String name;
/** /**
* 头像资源地址 * 昵称
*/ */
private String avatarPath; @NotBlank(message = "昵称不能为空")
private String nickname;
/** /**
* 手机号 * 头像资源地址
*/ */
@NotBlank(message = "手机号码不能为空") private String avatarPath;
private String mobile;
/** /**
* 国家码 * 手机号
*/ */
private String nationcode; @NotBlank(message = "手机号码不能为空")
private String mobile;
private String password; /**
* 国家码
*/
private String nationcode;
/** private String password;
* 微信openId
*/
@NotBlank(message = "微信OPENID不能为空")
private String wxId;
/** /**
* 微信unionId * 微信openId
*/ */
private String wxUnionId; @NotBlank(message = "微信OPENID不能为空")
private String wxId;
/** /**
* 微信小程序openId * 微信unionId
*/ */
private String wmOpenId; private String wxUnionId;
/** /**
* 数据库的roles字段 * 微信小程序openId
*/ */
@JsonIgnore private String wmOpenId;
private String dbRoles;
/** /**
* 角色 * 数据库的roles字段
*/ */
private List<String> roles; @JsonIgnore
private String dbRoles;
/** /**
* 账号来源最初的目的是给cgy做注册人数变化曲线 * 角色
*/ */
private String source; private List<String> roles;
/** /**
* email邮箱 * 账号来源最初的目的是给cgy做注册人数变化曲线
*/ */
private String email; private String source;
/** /**
* 状态1-可用 * email邮箱
*/ */
private String status; private String email;
/** /**
* 创建时间 * 状态1-可用
*/ */
private LocalDateTime createTime; private String status;
//单位信息 /**
private Long companyId; * 创建时间
*/
private LocalDateTime createTime;
private String companyName; /**
private Boolean companyAdmin; * 更新时间
/** */
* 用户所属组织关联的项目 private LocalDateTime updateTime;
*/
private List<String> projectCodes; //单位信息
private Long companyId;
private String companyName;
private Boolean companyAdmin;
/**
* 用户所属组织关联的项目
*/
private List<String> projectCodes;
public AccountVO() { public AccountVO() {
}
public AccountVO(SysAccount account) {
this.id = account.getId();
this.account = account.getAccount();
this.parentAccount = account.getParentAccount();
this.type = account.getType();
this.orgId = account.getOrgId();
this.name = account.getName();
this.nickname = account.getNickname();
this.avatarPath = account.getAvatarPath();
this.mobile = account.getMobile();
this.nationcode = account.getNationcode();
this.password = account.getPassword();
this.wxId = account.getWxId();
this.wxUnionId = account.getWxUnionId();
this.wmOpenId = account.getWmOpenId();
this.setRolesByString(account.getRoles());
this.source = account.getSource();
this.email = account.getEmail();
this.status = account.getStatus();
this.createTime = account.getCreateTime();
this.updateTime = account.getUpdateTime();
}
public static AccountVO system() {
AccountVO accountVO = new AccountVO();
accountVO.setId(0L);
accountVO.setName("系统");
return accountVO;
}
public static SysAccount fromVO(AccountVO accountVo) {
SysAccount account = new SysAccount();
account.setId(accountVo.getId());
account.setName(accountVo.getName());
account.setNickname(accountVo.getNickname());
account.setNationcode(accountVo.getNationcode());
account.setMobile(accountVo.getMobile());
account.setWxId(accountVo.getWxId());
account.setWxUnionId(accountVo.getWxUnionId());
account.setRoles(accountVo.getRolesStr());
account.setEmail(accountVo.getEmail());
account.setStatus(accountVo.getStatus());
account.setCreateTime(accountVo.getCreateTime());
return account;
}
@JsonIgnore
public String getIdStr() {
return String.valueOf(this.id);
}
@JsonIgnore
public String getRolesStr() {
if (!CollectionUtils.isEmpty(this.roles)) {
return String.join(",", this.roles.toArray(new String[]{}));
} }
return null;
}
public AccountVO(SysAccount account) { public void setRolesByString(String roles) {
this.id = account.getId(); if (StringUtils.hasText(roles)) {
this.account = account.getAccount(); String[] splits = roles.split(",");
this.parentAccount = account.getParentAccount(); this.roles = new ArrayList<>();
this.type = account.getType(); Collections.addAll(this.roles, splits);
this.orgId = account.getOrgId();
this.name = account.getName();
this.nickname = account.getNickname();
this.avatarPath = account.getAvatarPath();
this.mobile = account.getMobile();
this.nationcode = account.getNationcode();
this.password = account.getPassword();
this.wxId = account.getWxId();
this.wxUnionId = account.getWxUnionId();
this.wmOpenId = account.getWmOpenId();
this.setRolesByString(account.getRoles());
this.source = account.getSource();
this.email = account.getEmail();
this.status = account.getStatus();
this.createTime = account.getCreateTime();
} }
}
public static AccountVO system() { public void setRolesByString() {
if (StringUtils.hasText(dbRoles)) {
String[] splits = dbRoles.split(",");
this.roles = new ArrayList<>();
Collections.addAll(this.roles, splits);
}
}
@Override
public String toString() {
return "UserVO [id=" + id + ", name=" + name + ", nickname=" + nickname + ", mobile=" + mobile
+ ", email=" + email + ", nationcode="
+ nationcode + ", wxId=" + wxId + "]";
}
public static List<AccountVO> convertFromDB(List<SysAccount> list) {
List<AccountVO> voList = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) {
list.forEach(account -> voList.add(new AccountVO(account)));
}
return voList;
}
public static List<AccountVO> convert2BaseInfoVO(List<SysAccount> list) {
List<AccountVO> voList = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) {
list.forEach(account -> {
AccountVO accountVO = new AccountVO(); AccountVO accountVO = new AccountVO();
accountVO.setId(0L); accountVO.setId(account.getId());
accountVO.setName("系统"); accountVO.setName(account.getName());
return accountVO; accountVO.setNickname(account.getNickname());
accountVO.setMobile(account.getMobile());
voList.add(accountVO);
});
} }
return voList;
}
public static SysAccount fromVO(AccountVO accountVo) { public static List<SysAccount> convert2UnionIdInfoVOs(List<AccountVO> voList) {
SysAccount account = new SysAccount(); List<SysAccount> list = new ArrayList<>();
account.setId(accountVo.getId()); if (!CollectionUtils.isEmpty(voList)) {
account.setName(accountVo.getName()); voList.forEach(userVO -> {
account.setNickname(accountVo.getNickname()); if (StringUtils.hasText(userVO.getWxUnionId())) {
account.setNationcode(accountVo.getNationcode()); SysAccount account = new SysAccount();
account.setMobile(accountVo.getMobile()); account.setId(userVO.getId());
account.setWxId(accountVo.getWxId()); account.setWxUnionId(userVO.getWxUnionId());
account.setWxUnionId(accountVo.getWxUnionId()); list.add(account);
account.setRoles(accountVo.getRolesStr());
account.setEmail(accountVo.getEmail());
account.setStatus(accountVo.getStatus());
account.setCreateTime(accountVo.getCreateTime());
return account;
}
@JsonIgnore
public String getIdStr() {
return String.valueOf(this.id);
}
@JsonIgnore
public String getRolesStr() {
if (!CollectionUtils.isEmpty(this.roles)) {
return String.join(",", this.roles.toArray(new String[]{}));
} }
return null; });
} }
return list;
}
public void setRolesByString(String roles) { /**
if (StringUtils.hasText(roles)) { * 是否管理员
String[] splits = roles.split(","); *
this.roles = new ArrayList<>(); * @return
Collections.addAll(this.roles, splits); */
} @JsonIgnore
} public boolean isAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(
BusinessConsts.ROLE_05));
}
public void setRolesByString() { /**
if (StringUtils.hasText(dbRoles)) { * 是否超级管理员
String[] splits = dbRoles.split(","); *
this.roles = new ArrayList<>(); * @return
Collections.addAll(this.roles, splits); */
} @JsonIgnore
} public boolean isSuperAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_05));
}
@Override public void filter4Client() {
public String toString() { this.password = null;
return "UserVO [id=" + id + ", name=" + name + ", nickname=" + nickname + ", mobile=" + mobile + ", email=" + email + ", nationcode=" this.wxUnionId = null;
+ nationcode + ", wxId=" + wxId + "]"; this.wxId = null;
} this.wmOpenId = null;
this.createTime = null;
}
public static List<AccountVO> convertFromDB(List<SysAccount> list) { public void forClient() {
List<AccountVO> voList = new ArrayList<>(); if (StringUtils.hasText(dbRoles)) {
if (!CollectionUtils.isEmpty(list)) { this.roles = List.of(dbRoles.split(","));
list.forEach(account -> voList.add(new AccountVO(account)));
}
return voList;
} }
}
public static List<AccountVO> convert2BaseInfoVO(List<SysAccount> list) { public void setOrgInfo(Org org, Boolean companyAdmin, List<String> projectCodes) {
List<AccountVO> voList = new ArrayList<>(); this.companyId = org.getId();
if (!CollectionUtils.isEmpty(list)) { this.companyName = org.getName();
list.forEach(account -> { this.companyAdmin = companyAdmin;
AccountVO accountVO = new AccountVO(); this.projectCodes = projectCodes;
accountVO.setId(account.getId()); }
accountVO.setName(account.getName());
accountVO.setNickname(account.getNickname());
accountVO.setMobile(account.getMobile());
voList.add(accountVO);
});
}
return voList;
}
public static List<SysAccount> convert2UnionIdInfoVOs(List<AccountVO> voList) { public void copyOrgInfo(AccountVO accountVO) {
List<SysAccount> list = new ArrayList<>(); if (accountVO != null) {
if (!CollectionUtils.isEmpty(voList)) { this.companyId = accountVO.getCompanyId();
voList.forEach(userVO -> { this.companyName = accountVO.getCompanyName();
if (StringUtils.hasText(userVO.getWxUnionId())) { this.companyAdmin = accountVO.getCompanyAdmin();
SysAccount account = new SysAccount(); this.projectCodes = accountVO.getProjectCodes();
account.setId(userVO.getId());
account.setWxUnionId(userVO.getWxUnionId());
list.add(account);
}
});
}
return list;
} }
}
/** @JsonIgnore
* 是否管理员 public boolean isThirdChildAccount() {
* return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount);
* @return }
*/
@JsonIgnore
public boolean isAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(BusinessConsts.ROLE_05));
}
/** public void setOrgProjectVO(OrgVO orgVO, boolean orgAdmin) {
* 是否超级管理员 if (orgVO != null) {
* this.companyId = orgVO.getId();
* @return this.companyName = orgVO.getName();
*/ this.companyAdmin = orgAdmin;
@JsonIgnore this.projectCodes = orgVO.getProjectCodes();
public boolean isSuperAdmin() { } else {
return !CollectionUtils.isEmpty(this.roles) this.companyId = null;
&& (this.roles.contains(BusinessConsts.ROLE_05)); this.companyName = null;
} this.companyAdmin = false;
this.projectCodes = List.of();
public void filter4Client() {
this.password = null;
this.wxUnionId = null;
this.wxId = null;
this.wmOpenId = null;
this.createTime = null;
}
public void forClient() {
if (StringUtils.hasText(dbRoles)) {
this.roles = List.of(dbRoles.split(","));
}
}
public void setOrgInfo(Org org, Boolean companyAdmin, List<String> projectCodes) {
this.companyId = org.getId();
this.companyName = org.getName();
this.companyAdmin = companyAdmin;
this.projectCodes = projectCodes;
}
public void copyOrgInfo(AccountVO accountVO) {
if (accountVO != null) {
this.companyId = accountVO.getCompanyId();
this.companyName = accountVO.getCompanyName();
this.companyAdmin = accountVO.getCompanyAdmin();
this.projectCodes = accountVO.getProjectCodes();
}
}
@JsonIgnore
public boolean isThirdChildAccount() {
return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount);
}
public void setOrgProjectVO(OrgVO orgVO, boolean orgAdmin) {
if (orgVO != null) {
this.companyId = orgVO.getId();
this.companyName = orgVO.getName();
this.companyAdmin = orgAdmin;
this.projectCodes = orgVO.getProjectCodes();
} else {
this.companyId = null;
this.companyName = null;
this.companyAdmin = false;
this.projectCodes = List.of();
}
} }
}
} }

View File

@ -1,140 +1,145 @@
package club.joylink.rtss.vo.map; package club.joylink.rtss.vo.map;
import lombok.Getter;
import lombok.Setter;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import lombok.Getter;
import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class MapCiGenerateConfig { public class MapCiGenerateConfig {
//--------------------联锁数据生成配置start------------------- //--------------------联锁数据生成配置start-------------------
/** /**
*是否类似哈尔滨一号线联锁分为ATP信号地面信号引导信号 * 是否类似哈尔滨一号线联锁分为ATP信号地面信号引导信号
*/ */
private boolean likeHa1; private boolean likeHa1;
/** /**
*是否生成侧防true-生成侧防不要联动道岔false-不生成侧防用联动道岔 * 是否生成侧防true-生成侧防不要联动道岔false-不生成侧防用联动道岔
*/ */
private boolean generateFls; private boolean generateFls;
/** /**
*信号机接近区段只取最近的一个 * 信号机接近区段只取最近的一个
*/ */
private boolean signalApproachOnlyOne; private boolean signalApproachOnlyOne;
/** /**
*信号机接近区段仅考虑定位道岔 * 信号机接近区段仅考虑定位道岔
*/ */
private boolean signalApproachOnlyNpSwitch; private boolean signalApproachOnlyNpSwitch;
/** /**
*信号机接近区段不跨过前方同向信号机 * 信号机接近区段不跨过前方同向信号机
*/ */
private boolean signalApproachNotPassPreSignal = true; private boolean signalApproachNotPassPreSignal = true;
/** /**
*进路名称使用终端信号机同区段反向信号机名称命名true-使用反向如果存在的话false-使用终端信号机命名 * 进路名称使用终端信号机同区段反向信号机名称命名true-使用反向如果存在的话false-使用终端信号机命名
*/ */
private boolean routeNameUseEndOppositeSignalName; private boolean routeNameUseEndOppositeSignalName;
/** /**
*是否生成折返进路 * 是否生成折返进路
*/ */
private boolean generateTbRoute; private boolean generateTbRoute;
/** /**
*折返进路名称使用终端信号机反向信号机名称 * 折返进路名称使用终端信号机反向信号机名称并且终端按钮亦使用反向信号机-成都三联锁
*/ */
private boolean tbRouteNameUseEndOppositeSignalName; private boolean tbRouteNameUseEndOppositeSignalName;
/** /**
*进路始端防护信号机是否总是绿灯true-总是开绿灯false-根据进路中有无反位道岔生成绿灯或黄灯 * 进路始端防护信号机是否总是绿灯true-总是开绿灯false-根据进路中有无反位道岔生成绿灯或黄灯
*/ */
private boolean routeSignalAlwaysGreen; private boolean routeSignalAlwaysGreen;
/** /**
*多个延续保护路径生成多条进路:true-生成多条进路false-生成一条进路 * 多个延续保护路径生成多条进路:true-生成多条进路false-生成一条进路
*/ */
private boolean routeApartByOverlap; private boolean routeApartByOverlap;
/** /**
*延续保护是否只构建道岔 * 延续保护是否只构建道岔
*/ */
private boolean overlapOnlySwitch; private boolean overlapOnlySwitch;
// //
// @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴") // @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴")
// private boolean overlapOnlyOneSwitch; // private boolean overlapOnlyOneSwitch;
/** /**
* 延续保护最小长度 * 延续保护最小长度
*/ */
private float overlapMinLen = 55; private float overlapMinLen = 55;
/** /**
*延续保护道岔是否只构建定位道岔 * 延续保护道岔是否只构建定位道岔
*/ */
private boolean overlapSwitchNpOnly; private boolean overlapSwitchNpOnly;
/** /**
*延续保护道岔在防护信号机与所属区段方向相反时只构建定位道岔 * 延续保护道岔在防护信号机与所属区段方向相反时只构建定位道岔
*/ */
private boolean overlapSignalOppositeSwitchNpOnly; private boolean overlapSignalOppositeSwitchNpOnly;
/** /**
*延续保护的建立方式true-通过触发建立false-随进路建立 * 延续保护的建立方式true-通过触发建立false-随进路建立
*/ */
private boolean overlapSettingByTrigger; private boolean overlapSettingByTrigger;
/** /**
*默认延续保护解锁时间 * 默认延续保护解锁时间
*/ */
private int overlapReleaseTime = 60; private int overlapReleaseTime = 60;
/** /**
*默认进路解锁时间 * 默认进路解锁时间
*/ */
private int routeReleaseTime = 45; private int routeReleaseTime = 45;
/** /**
*是否生成自动折返 * 是否生成自动折返
*/ */
private boolean generateCycle; private boolean generateCycle;
/** /**
*是否生成进路信号按钮 * 是否生成进路信号按钮
*/ */
private boolean routeButton; private boolean routeButton;
/** /**
*若生成进路信号按钮进路信号按钮是否取最近的一个信号机 * 若生成进路信号按钮进路信号按钮是否取最近的一个信号机
*/ */
private boolean getNearlySignal; private boolean getNearlySignal;
/** /**
*是否生成目的地码定义泰雷兹式 * 是否生成目的地码定义泰雷兹式
*/ */
private boolean generateDestination; private boolean generateDestination;
/** 上下行站台共享紧急关闭效果的车站 */ /**
private Set<String> sharingECStations = new HashSet<>(); * 上下行站台共享紧急关闭效果的车站
*/
private Set<String> sharingECStations = new HashSet<>();
/** 进路联锁不包含站台扣车 */ /**
private boolean routeInterlockDoNotIncludeStandHoldTrain; * 进路联锁不包含站台扣车
*/
private boolean routeInterlockDoNotIncludeStandHoldTrain;
// @ApiModelProperty(value = "是否分开生成ATP联锁和地面信号联锁") // @ApiModelProperty(value = "是否分开生成ATP联锁和地面信号联锁")
// private boolean apartGroundAndAtp; // private boolean apartGroundAndAtp;
/** 是否处理停车场/车辆段逻辑 */ /**
private boolean handleDepot; * 是否处理停车场/车辆段逻辑
*/
private boolean handleDepot;
/** /**
* 是大铁线路 * 是大铁线路
*/ */
private boolean railway; private boolean railway;
//--------------------联锁数据生成配置end------------------- //--------------------联锁数据生成配置end-------------------
} }