轨道交通项目迁出问题修改
This commit is contained in:
parent
d1b2d4fde0
commit
4598550fb3
|
@ -3,7 +3,6 @@ package club.joylink.rtss.controller;
|
|||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.runplan.newdraw.RunPlanInput;
|
||||
import club.joylink.rtss.services.IRunPlanDraftService;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
|
|
|
@ -68,6 +68,7 @@ public class RunPlanTemplateController {
|
|||
|
||||
@ApiOperation(value = "使用此模板生成当日运行图")
|
||||
@PostMapping(path = "/generate/{planId}")
|
||||
@Role({RoleEnum.SuperAdmin,RoleEnum.Admin})
|
||||
public void generateDailyRunPlan(@PathVariable Long planId,
|
||||
@RequestParam Long mapId,
|
||||
@ApiIgnore @RequestAttribute UserVO user) {
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
package club.joylink.rtss.controller.simulation;
|
||||
|
||||
import club.joylink.rtss.services.record.ISimulationProcessRecordService;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@Api(tags = { "新仿真回放接口" })
|
||||
@RestController
|
||||
@RequestMapping("api/v1/simulationRecord")
|
||||
public class SimulationProcessRecordController {
|
||||
|
||||
@Autowired
|
||||
private ISimulationProcessRecordService recordService;
|
||||
|
||||
@ApiOperation(value = "开启记录")
|
||||
@GetMapping("/start")
|
||||
public void startRecord(String group, @ApiIgnore @RequestAttribute UserVO user) {
|
||||
this.recordService.startRecordSimulation(user,group);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "关闭记录")
|
||||
@GetMapping(path = "/stop")
|
||||
public void stopRecordSimulation(String group, @ApiIgnore @RequestAttribute UserVO user) {
|
||||
this.recordService.stopRecordSimulation(user, group);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "回访准备")
|
||||
@GetMapping(path = "/playback/ready")
|
||||
public Long readyPlayback(String group, @ApiIgnore @RequestAttribute UserVO user) {
|
||||
return this.recordService.readyPlayback(user, group);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "开始播放")
|
||||
@GetMapping(path = "/playback/startPlaying")
|
||||
public void startPlaying(@ApiIgnore @RequestAttribute UserVO user) {
|
||||
this.recordService.startPlaying(user);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设置倍速")
|
||||
@GetMapping("/playback/setPlaySpeed")
|
||||
public void setPlaySpeed(int level, @RequestAttribute UserVO user) {
|
||||
this.recordService.setPlaySpeed(user, level);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "暂停播放")
|
||||
@GetMapping("/playback/pausePlaying")
|
||||
public void pausePlaying(@RequestAttribute UserVO user) {
|
||||
this.recordService.pausePlaying(user);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "从暂停恢复播放")
|
||||
@GetMapping("/playback/playing")
|
||||
public void playing(@RequestAttribute UserVO user) {
|
||||
this.recordService.playing(user);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "结束回放")
|
||||
@GetMapping("/playback/endPlaying")
|
||||
public void endPlaying(@RequestAttribute UserVO user) {
|
||||
this.recordService.endPlaying(user);
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ public enum BusinessExceptionAssertEnum implements BusinessExceptionAssert {
|
|||
DATA_ALREADY_EXIST(10012, "data already exist"),
|
||||
SIMULATION_PERMISSION_NOT_EXIST(10013, "simulation permission not exist"),
|
||||
SIMULATION_PERMISSION_NOT_AVAILABLE(10014, "simulation permission not available"),
|
||||
UNSUPPORTED_FILE_FORMAT(10015, "unsupported file format"),
|
||||
|
||||
|
||||
DATA_ERROR(11000, "data error"),
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.joylink.base.exception.DBException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.dao.CompanyDAO;
|
||||
import club.joylink.rtss.entity.Company;
|
||||
import club.joylink.rtss.entity.CompanyExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.completition.IRaceQuestionsRuleService;
|
||||
import club.joylink.rtss.vo.client.CompanyQueryVO;
|
||||
import club.joylink.rtss.vo.client.CompanyVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -72,9 +71,8 @@ public class CompanyService implements ICompanyService {
|
|||
@Override
|
||||
public CompanyVO getById(Integer companyId) {
|
||||
Company entity = companyDAO.selectByPrimaryKey(companyId);
|
||||
if (entity == null) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST, String.format("id为[%s]的公司不存在", companyId));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(entity,
|
||||
String.format("id为[%s]的公司不存在", companyId));
|
||||
return new CompanyVO(entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import club.joylink.rtss.services.cache.ICacheService;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.dao.RunPlanDailyDAO;
|
||||
import club.joylink.rtss.entity.RunPlanDaily;
|
||||
import club.joylink.rtss.entity.RunPlanDailyExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.cache.ICacheService;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanQueryVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -249,4 +249,12 @@ public class DailyRunPlanService implements IDailyRunPlanService {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTemplateId(Long templatePlanId) {
|
||||
RunPlanDailyExample example = new RunPlanDailyExample();
|
||||
example.createCriteria()
|
||||
.andTemplateIdEqualTo(templatePlanId);
|
||||
this.runPlanDailyDAO.deleteByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.dao.DraftMapDAO;
|
||||
import club.joylink.rtss.dao.DraftMapRunPlanDAO;
|
||||
import club.joylink.rtss.entity.DraftMapRunPlan;
|
||||
import club.joylink.rtss.entity.DraftMapRunPlanExample;
|
||||
import club.joylink.rtss.simulation.GroupSimulationManager;
|
||||
import club.joylink.rtss.simulation.SimulationConstructData;
|
||||
import club.joylink.rtss.simulation.constant.SimulationType;
|
||||
import club.joylink.rtss.simulation.util.SimulationIdGenerator;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.map.MapDataVO;
|
||||
import club.joylink.rtss.vo.client.map.MapStationVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DraftMapRunPlanService implements IDraftMapRunPlanService {
|
||||
@Autowired
|
||||
private IRunPlanTemplateService iRunPlanTemplateService;
|
||||
|
||||
@Autowired
|
||||
private DraftMapRunPlanDAO draftMapRunPlanDAO;
|
||||
|
||||
@Autowired
|
||||
private DraftMapDAO draftMapDAO;
|
||||
|
||||
@Autowired
|
||||
private IDraftMapService iDraftMapService;
|
||||
|
||||
@Autowired
|
||||
private GroupSimulationManager groupSimulationManager;
|
||||
|
||||
/**
|
||||
* 从正式发布地图的运行图中导入到用户自己玩的运行图
|
||||
* @param templateId
|
||||
* @param name
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void createFrom(Long templateId, String name, Long draftMapId) {
|
||||
RunPlanVO runPlanVO = iRunPlanTemplateService.getRunPlan(templateId);
|
||||
DraftMapRunPlan draftMapRunPlan = new DraftMapRunPlan();
|
||||
draftMapRunPlan.setCreateTime(LocalDateTime.now());
|
||||
draftMapRunPlan.setMapId(draftMapId);
|
||||
draftMapRunPlan.setName(name);
|
||||
draftMapRunPlan.setTrips(JsonUtils.writeValueAsString(runPlanVO.getTripList()));
|
||||
draftMapRunPlanDAO.insert(draftMapRunPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据草稿地图id查询草稿地图运行图
|
||||
* @param draftMapId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DraftMapRunPlan> findByDraftMapId(Long draftMapId) {
|
||||
DraftMapRunPlanExample example = new DraftMapRunPlanExample();
|
||||
example.createCriteria().andMapIdEqualTo(draftMapId);
|
||||
return draftMapRunPlanDAO.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据草稿运行图id查询数据绘制运行图
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RunPlanEChartsDataVO selectDiagramData(Long planId) {
|
||||
DraftMapRunPlan draftMapRunPlan = draftMapRunPlanDAO.selectByPrimaryKey(planId);
|
||||
//运行列车集合
|
||||
List<RunPlanTripVO> tripList = JsonUtils.read(draftMapRunPlan.getTrips(), JsonUtils.getCollectionType(List.class, RunPlanTripVO.class));
|
||||
return new RunPlanEChartsDataVO(tripList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行图仿真测试
|
||||
* @param planId
|
||||
* @param userVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String simulationCheck(Long planId, UserVO userVO) {
|
||||
RunPlanVO runPlanVO = getRunPlanById(planId);
|
||||
MapDataVO mapData = iDraftMapService.getMapData(runPlanVO.getMapId());
|
||||
SimulationConstructData constructData = new SimulationConstructData(userVO, SimulationType.RunPlan,
|
||||
null, mapData, null, runPlanVO, null);
|
||||
String group = SimulationIdGenerator.generateGroup(userVO.getId());
|
||||
groupSimulationManager.prepareSimulation(group, constructData);
|
||||
// 生成通用的测试用派班计划
|
||||
groupSimulationManager.generateCommonSchedulingPlan(group);
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据运行计划id查询RunPlanVO
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
private RunPlanVO getRunPlanById(Long planId){
|
||||
DraftMapRunPlan draftMapRunPlan = draftMapRunPlanDAO.selectByPrimaryKey(planId);
|
||||
RunPlanVO runPlanVO = new RunPlanVO();
|
||||
runPlanVO.setTripList(JsonUtils.read(draftMapRunPlan.getTrips(), JsonUtils.getCollectionType(List.class, RunPlanTripVO.class)));
|
||||
runPlanVO.setName(draftMapRunPlan.getName());
|
||||
runPlanVO.setId(draftMapRunPlan.getId());
|
||||
runPlanVO.setCreateTime(draftMapRunPlan.getCreateTime());
|
||||
runPlanVO.setMapId(draftMapRunPlan.getMapId());
|
||||
return runPlanVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据草稿地图id查询车站
|
||||
* @param draftMapId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List selectMapStation(Long draftMapId) {
|
||||
MapDataVO mapDataVO = iDraftMapService.getMapData(draftMapId);
|
||||
if(mapDataVO.isDrawWay()){
|
||||
|
||||
List<MapStationNewVO> stationNewList = mapDataVO.getShapeDataNew().getStationList();
|
||||
stationNewList.sort(Comparator.comparing(MapStationNewVO::getKmRange));
|
||||
return stationNewList;
|
||||
}
|
||||
List<MapStationVO> stationList = mapDataVO.getShapeData().getStationList();
|
||||
stationList.sort(Comparator.comparing(MapStationVO::getKmRange));
|
||||
return stationList;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.configuration.configProp.MailConfig;
|
||||
import club.joylink.rtss.configuration.configProp.OtherConfig;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.constants.EmailSubject;
|
||||
|
@ -30,8 +29,8 @@ public class EmailService implements IEmailService {
|
|||
@Autowired
|
||||
private JavaMailSender mailSender; //自动注入的Bean
|
||||
|
||||
@Autowired
|
||||
private MailConfig mailConfig;
|
||||
// @Autowired
|
||||
// private MailConfig mailConfig;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
@ -42,7 +41,7 @@ public class EmailService implements IEmailService {
|
|||
@Override
|
||||
public void sendToOne(String toUser, String subject, String content) {
|
||||
SimpleMailMessage smm = new SimpleMailMessage();
|
||||
smm.setFrom(this.mailConfig.getUsername());
|
||||
// smm.setFrom(this.mailConfig.getUsername());
|
||||
smm.setTo(toUser);
|
||||
smm.setSubject(subject);
|
||||
smm.setText(content);
|
||||
|
@ -54,7 +53,7 @@ public class EmailService implements IEmailService {
|
|||
if (Objects.isNull(userId)) return;
|
||||
log.info("用户正在{}群发邮件",userId);
|
||||
SimpleMailMessage smm = new SimpleMailMessage();
|
||||
smm.setFrom(this.mailConfig.getUsername());
|
||||
// smm.setFrom(this.mailConfig.getUsername());
|
||||
List<UserVO> usersWithEmail = sysUserService.getUsersWithEmail();
|
||||
if(CollectionUtils.isEmpty(usersWithEmail)){
|
||||
log.warn("邮件群发:不存在绑定邮件的用户!");
|
||||
|
|
|
@ -118,4 +118,6 @@ public interface IDailyRunPlanService {
|
|||
boolean isUserRunPlanOfDayExist(Long userId, Long mapId, Long templatePlanId, LocalDate day);
|
||||
|
||||
boolean isCommonRunPlanExist(Long mapId, Long templatePlanId, LocalDate day);
|
||||
|
||||
void deleteByTemplateId(Long templatePlanId);
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapRunPlan;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IDraftMapRunPlanService {
|
||||
/**
|
||||
* 从正式发布地图的运行图中导入到用户自己玩的运行图
|
||||
* @param templateId
|
||||
* @param name
|
||||
* @param draftMapId
|
||||
*/
|
||||
void createFrom(Long templateId, String name, Long draftMapId);
|
||||
|
||||
/**
|
||||
* 根据草稿地图id查询草稿地图运行图
|
||||
* @param draftMapId
|
||||
* @return
|
||||
*/
|
||||
List<DraftMapRunPlan> findByDraftMapId(Long draftMapId);
|
||||
|
||||
/**
|
||||
* 根据草稿运行图id查询数据绘制运行图
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
RunPlanEChartsDataVO selectDiagramData(Long planId);
|
||||
|
||||
/**
|
||||
* 运行图仿真测试
|
||||
* @param planId
|
||||
* @param userVO
|
||||
* @return
|
||||
*/
|
||||
String simulationCheck(Long planId, UserVO userVO);
|
||||
|
||||
/**
|
||||
* 根据草稿地图id查询车站
|
||||
* @param draftMapId
|
||||
* @return
|
||||
*/
|
||||
List selectMapStation(Long draftMapId);
|
||||
}
|
|
@ -1,212 +0,0 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.JointTrainingRoomDeviceVO;
|
||||
import club.joylink.rtss.vo.client.JointTrainingRoomNewVO;
|
||||
import club.joylink.rtss.vo.client.JointTrainingRoomRequestVO;
|
||||
import club.joylink.rtss.vo.client.JointTrainingUserNewVO;
|
||||
import club.joylink.rtss.vo.client.room.RoomSimulationRealDeviceVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IJointTrainingV1Service {
|
||||
|
||||
/**
|
||||
* 创建房间
|
||||
* @param user
|
||||
* @param requestVO
|
||||
* @return
|
||||
*/
|
||||
String createRoom(UserVO user, JointTrainingRoomRequestVO requestVO);
|
||||
|
||||
/**创建比赛房间*/
|
||||
String createCompetitionRoom(UserVO user, Long competitionId, JointTrainingRoomRequestVO requestVO);
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
*
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
String generateQrCode(String group);
|
||||
|
||||
/**
|
||||
* 获取权限加入房间
|
||||
* @param code
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
JointTrainingUserNewVO getPermission(String code, String group);
|
||||
|
||||
/**
|
||||
* 扫码
|
||||
* @param group
|
||||
* @param userVO
|
||||
*/
|
||||
JointTrainingUserNewVO scanQrCode(String group, UserVO userVO);
|
||||
|
||||
/**
|
||||
* 销毁房间
|
||||
* @param group
|
||||
*/
|
||||
void destroy(String group, UserVO user);
|
||||
|
||||
/**
|
||||
* 获取邀请房间列表,根据项目查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<JointTrainingRoomNewVO> getRoomListByProject(Long id, String projectCode);
|
||||
|
||||
List<JointTrainingRoomNewVO> getCompetitionRoomByCreatorAndMap(List<Long> creatorIds, Long mapId, Long competitionId);
|
||||
|
||||
/**
|
||||
* 加入房间
|
||||
* @param group
|
||||
* @param userId
|
||||
*/
|
||||
void join(String group, Long userId);
|
||||
|
||||
/**
|
||||
* 文字聊天
|
||||
* @param group
|
||||
* @param message
|
||||
* @param userVO
|
||||
*/
|
||||
void chatWithText(String group, String message, UserVO userVO);
|
||||
|
||||
/**
|
||||
* 语音聊天
|
||||
* @param group
|
||||
* @param file
|
||||
* @param userVO
|
||||
*/
|
||||
void chatWithAudio(String group, MultipartFile file, UserVO userVO);
|
||||
|
||||
/**
|
||||
* 设置用户角色
|
||||
* @param group
|
||||
* @param jointTrainingUserVOList
|
||||
* @param user
|
||||
*/
|
||||
void setUserRole(String group, List<JointTrainingUserNewVO> jointTrainingUserVOList, UserVO user);
|
||||
|
||||
/**
|
||||
* 添加或更新真实设备连接仿真设备
|
||||
* @param group
|
||||
* @param roomDeviceVO
|
||||
*/
|
||||
void addOrUpdateRealDeviceConnection(String group, JointTrainingRoomDeviceVO roomDeviceVO);
|
||||
|
||||
/**
|
||||
* 删除真实设备连接仿真设备
|
||||
* @param group
|
||||
* @param id
|
||||
*/
|
||||
void deleteRealDeviceConnection(String group, Long id);
|
||||
|
||||
/**
|
||||
* 查询创建的房间
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
JointTrainingRoomNewVO selectRoom(String group);
|
||||
|
||||
/**
|
||||
* 退出综合演练房间
|
||||
* @param group
|
||||
* @param userId
|
||||
*/
|
||||
void exit(String group, Long userId);
|
||||
|
||||
/**
|
||||
* 获取房间里的用户列表
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
List<JointTrainingUserNewVO> selectUserList(String group);
|
||||
|
||||
/**
|
||||
* 开始综合演练
|
||||
* @param group
|
||||
* @param userVO
|
||||
*/
|
||||
void startSimulation(String group, UserVO userVO);
|
||||
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param group
|
||||
* @param userId
|
||||
*/
|
||||
void deleteUser(String group, Long userId);
|
||||
|
||||
/**
|
||||
* 查询创建的房间
|
||||
*
|
||||
* @param mapId
|
||||
* @param userVO
|
||||
* @return
|
||||
*/
|
||||
List<JointTrainingRoomNewVO> findCreatedRoom(long mapId, UserVO userVO);
|
||||
|
||||
/**
|
||||
* 根据userid获取user信息
|
||||
* @param group
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
JointTrainingUserNewVO getUserInfoById(String group, Long userId);
|
||||
|
||||
/**
|
||||
* 用户结束仿真返回房间
|
||||
* @param userId
|
||||
* @param group
|
||||
*/
|
||||
JointTrainingRoomNewVO userExitSimulation(Long userId, String group);
|
||||
|
||||
/**
|
||||
* 管理员结束所有人的仿真
|
||||
* @param userVO
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
JointTrainingRoomNewVO adminFinishSimulation(UserVO userVO, String group);
|
||||
|
||||
/**
|
||||
* 用户进入仿真
|
||||
* @param userId
|
||||
* @param group
|
||||
*/
|
||||
void userEnterSimulation(Long userId, String group);
|
||||
|
||||
/**
|
||||
* 获取房间真实设备连接关系列表
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
List<JointTrainingRoomDeviceVO> getRoomDeviceList(String group);
|
||||
|
||||
/**
|
||||
* 获取房间真实设备连接关系列表
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
List<RoomSimulationRealDeviceVO> getRoomRealDeviceList(String group);
|
||||
|
||||
/**
|
||||
* 更新真实设备连接对象
|
||||
* @param group
|
||||
* @param deviceVOList
|
||||
*/
|
||||
void updateRealDeviceConnect(String group, List<RoomSimulationRealDeviceVO> deviceVOList);
|
||||
|
||||
/**
|
||||
* 真实设备是否已被其他仿真使用
|
||||
* @param group
|
||||
* @param projectCode
|
||||
* @return
|
||||
*/
|
||||
boolean isRealDeviceUsed(String group, String projectCode);
|
||||
}
|
|
@ -75,4 +75,6 @@ public interface ILoadPlanService {
|
|||
* @return
|
||||
*/
|
||||
RunPlanLoadVO findCommonLoadPlanOfMap(Long mapId);
|
||||
|
||||
void deleteByTemplateId(Long templateId);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.util.AudioUtil;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.VoiceRecognitionResult;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import net.bytebuddy.utility.RandomString;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public interface IVoiceService {
|
|||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
static VoiceService.VoiceFile saveFile(InputStream inputStream) throws IOException {
|
||||
static VoiceFile saveFile(InputStream inputStream) throws IOException {
|
||||
String filePath = getFilePath();
|
||||
OutputStream os = null;
|
||||
File saveFile = null;
|
||||
|
@ -52,27 +53,15 @@ public interface IVoiceService {
|
|||
os.close();
|
||||
}
|
||||
}
|
||||
return new VoiceService.VoiceFile(filePath.replace(AudioFileBasePath, ""), saveFile);
|
||||
return new VoiceFile(filePath.replace(AudioFileBasePath, ""), saveFile);
|
||||
}
|
||||
static VoiceService.VoiceFile handleAndSaveFile(MultipartFile file) throws IOException {
|
||||
static VoiceFile handleAndSaveFile(MultipartFile file) throws IOException {
|
||||
String contentType = file.getContentType();
|
||||
boolean needConvert;
|
||||
if("audio/mpeg".equals(contentType)) { // mp3
|
||||
needConvert = true;
|
||||
} else if("audio/wave".equals(contentType) ||
|
||||
"audio/wav".equals(contentType)) { // wav
|
||||
needConvert = false;
|
||||
} else {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, String.format("不支持的文件格式[%s]", contentType));
|
||||
}
|
||||
BusinessExceptionAssertEnum.UNSUPPORTED_FILE_FORMAT.assertTrue(
|
||||
"audio/wave".equals(contentType) || "audio/wav".equals(contentType),
|
||||
String.format("不支持的文件格式[%s]", contentType));
|
||||
InputStream inputStream = file.getInputStream();
|
||||
String filePath = getFilePath();
|
||||
if(needConvert) {
|
||||
File saveFile = AudioUtil.convertMp3ToWav(inputStream, filePath);
|
||||
return new VoiceService.VoiceFile(filePath.replace(AudioFileBasePath, ""), saveFile);
|
||||
} else {
|
||||
return saveFile(inputStream);
|
||||
}
|
||||
return saveFile(inputStream);
|
||||
}
|
||||
/**
|
||||
* 识别服务器收到的语音文件
|
||||
|
@ -87,4 +76,18 @@ public interface IVoiceService {
|
|||
* @return 文件路径
|
||||
*/
|
||||
String synthesis(String message, String per);
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
class VoiceFile {
|
||||
private String path;
|
||||
|
||||
private File file;
|
||||
|
||||
public VoiceFile(String path, File file) {
|
||||
this.path = path;
|
||||
this.file = file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.DBException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.dao.RunPlanLoadDAO;
|
||||
import club.joylink.rtss.entity.RunPlanLoad;
|
||||
import club.joylink.rtss.entity.RunPlanLoadExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadQueryVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -165,47 +163,29 @@ public class LoadPlanService implements ILoadPlanService {
|
|||
Objects.requireNonNull(id);
|
||||
RunPlanLoad runPlanLoad = this.runPlanLoadDAO.selectByPrimaryKey(id);
|
||||
if(Objects.nonNull(runPlanLoad)) {
|
||||
if(user.isSuperAdmin() ||
|
||||
((Objects.nonNull(runPlanLoad.getUserId()) && runPlanLoad.getUserId().equals(user.getId())))) {
|
||||
// 超级管理员,或是用户自己的计划,才可删除
|
||||
this.runPlanLoadDAO.deleteByPrimaryKey(id);
|
||||
} else {
|
||||
throw new BusinessException(ExceptionMapping.ROLE_OPERATION_REFUSE);
|
||||
}
|
||||
this.runPlanLoadDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCommonLoadPlan(RunPlanLoadVO runPlanLoadVO, UserVO user) {
|
||||
if(!user.isSuperAdmin()) { // 只有管理员才能创建
|
||||
throw new BusinessException(ExceptionMapping.ROLE_OPERATION_REFUSE);
|
||||
}
|
||||
Objects.requireNonNull(runPlanLoadVO);
|
||||
RunPlanVO templatePlan = this.iRunPlanTemplateService.getRunPlan(runPlanLoadVO.getTemplatePlanId());
|
||||
if (!Objects.equals(runPlanLoadVO.getMapId(), templatePlan.getMapId())) {
|
||||
throw new BusinessException(ExceptionMapping.ARGUMENT_ILLEGAL,
|
||||
String.format("所选运行图模板不是所选地图运行图"));
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertEquals(runPlanLoadVO.getMapId(), templatePlan.getMapId(),
|
||||
"所选运行图模板不是所选地图运行图");
|
||||
RunPlanLoadExample example = new RunPlanLoadExample();
|
||||
example.createCriteria()
|
||||
.andMapIdEqualTo(runPlanLoadVO.getMapId())
|
||||
.andUserIdIsNull()
|
||||
.andLoadTimeIsNull();
|
||||
List<RunPlanLoad> loadPlanList = this.runPlanLoadDAO.selectByExample(example);
|
||||
if(CollectionUtils.isEmpty(loadPlanList)) { // 没有数据,新增
|
||||
RunPlanLoad loadPlan = new RunPlanLoad();
|
||||
loadPlan.setCreatorId(user.getId());
|
||||
loadPlan.setMapId(runPlanLoadVO.getMapId());
|
||||
loadPlan.setTemplatePlanId(runPlanLoadVO.getTemplatePlanId());
|
||||
this.runPlanLoadDAO.insert(loadPlan);
|
||||
} else {
|
||||
throw new BusinessException(ExceptionMapping.DATA_EXISTS, "此地图的通用加载计划已存在");
|
||||
// RunPlanLoad loadPlan = loadPlanList.get(0);
|
||||
// if(!loadPlan.getTemplatePlanId().equals(runPlanLoadVO.getTemplatePlanId())) { // 当存在数据且模板运行计划不同时,修改模板运行计划
|
||||
// loadPlan.setTemplatePlanId(runPlanLoadVO.getTemplatePlanId());
|
||||
// this.runPlanLoadDAO.updateByPrimaryKey(loadPlan);
|
||||
// }
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertCollectionEmpty(loadPlanList,
|
||||
"此地图的通用加载计划已存在");
|
||||
RunPlanLoad loadPlan = new RunPlanLoad();
|
||||
loadPlan.setCreatorId(user.getId());
|
||||
loadPlan.setMapId(runPlanLoadVO.getMapId());
|
||||
loadPlan.setTemplatePlanId(runPlanLoadVO.getTemplatePlanId());
|
||||
this.runPlanLoadDAO.insert(loadPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -227,9 +207,7 @@ public class LoadPlanService implements ILoadPlanService {
|
|||
@Override
|
||||
public RunPlanLoadVO getUserLoadPlan(Long userId, Long mapId, LocalDate date) {
|
||||
RunPlanLoadVO userLoadPlan = this.findUserLoadPlan(userId, mapId, date);
|
||||
if (Objects.isNull(userLoadPlan)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST,"运行图加载计划不存在");
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(userLoadPlan, "运行图加载计划不存在");
|
||||
return userLoadPlan;
|
||||
}
|
||||
|
||||
|
@ -246,4 +224,12 @@ public class LoadPlanService implements ILoadPlanService {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTemplateId(Long templateId) {
|
||||
RunPlanLoadExample example = new RunPlanLoadExample();
|
||||
example.createCriteria()
|
||||
.andTemplatePlanIdEqualTo(templateId);
|
||||
this.runPlanLoadDAO.deleteByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,26 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import club.joylink.rtss.constants.MapStatus;
|
||||
import club.joylink.rtss.dao.RunPlanLoadDAO;
|
||||
import club.joylink.rtss.dao.RunPlanTemplateDAO;
|
||||
import club.joylink.rtss.dao.RunPlanTemplateVersionDAO;
|
||||
import club.joylink.rtss.dao.SchedulingPlanDAO;
|
||||
import club.joylink.rtss.entity.*;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.util.VersionUtil;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
import club.joylink.rtss.vo.client.runplan.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -105,16 +106,16 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
@Override
|
||||
@Transactional
|
||||
public void deletePlan(Long planId, UserVO userVO) {
|
||||
// RunPlanLoadExample runPlanLoadExample = new RunPlanLoadExample();
|
||||
// runPlanLoadExample.createCriteria().andTemplatePlanIdEqualTo(planId);
|
||||
// List<RunPlanLoad> runPlanLoadList = runPlanLoadDAO.selectByExample(runPlanLoadExample);
|
||||
// if (!CollectionUtils.isEmpty(runPlanLoadList)) {
|
||||
// throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, "模板已被加载计划使用,无法删除");
|
||||
// }
|
||||
// RunPlanTemplateVersionExample versionExample = new RunPlanTemplateVersionExample();
|
||||
// versionExample.createCriteria().andPlanIdEqualTo(planId);
|
||||
// runPlanTemplateVersionDAO.deleteByExample(versionExample);
|
||||
// 逻辑删除
|
||||
// 先删除引用的数据
|
||||
// 模板版本
|
||||
RunPlanTemplateVersionExample versionExample = new RunPlanTemplateVersionExample();
|
||||
versionExample.createCriteria().andPlanIdEqualTo(planId);
|
||||
this.runPlanTemplateVersionDAO.deleteByExample(versionExample);
|
||||
// 每日运行图
|
||||
this.iDailyRunPlanService.deleteByTemplateId(planId);
|
||||
// 运行图加载
|
||||
this.iLoadPlanService.deleteByTemplateId(planId);
|
||||
RunPlanTemplate runPlanTemplate = this.runPlanTemplateDAO.selectByPrimaryKey(planId);
|
||||
runPlanTemplate.setStatus(MapStatus.Delete.getCode());
|
||||
this.runPlanTemplateDAO.updateByPrimaryKey(runPlanTemplate);
|
||||
|
@ -164,12 +165,10 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
MapVO mapInfo = this.iMapService.getMapInfoById(mapId);
|
||||
RunPlanVO runPlan = this.getRunPlan(id);
|
||||
MapVO mapVO = iMapService.getMapDetail(runPlan.getMapId());
|
||||
if(!Objects.equals(mapVO.getLineCode(), mapInfo.getLineCode())) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, "基于不同真实线路的不能复制");
|
||||
}
|
||||
if(Objects.equals(runPlan.getMapId(), mapInfo.getId())) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, "相同地图下不能复制");
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertEquals(mapVO.getLineCode(), mapInfo.getLineCode(),
|
||||
"基于不同真实线路的不能复制");
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertEquals(runPlan.getMapId(), mapInfo.getId(),
|
||||
"相同地图下不能复制");
|
||||
runPlan.setName(name);
|
||||
runPlan.setMapId(mapId);
|
||||
this.draftPublish(runPlan, user);
|
||||
|
@ -179,10 +178,6 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
public RunPlanVO generateDailyRunPlan(Long planId, Long mapId, UserVO userVO) {
|
||||
Objects.requireNonNull(planId);
|
||||
Objects.requireNonNull(mapId);
|
||||
// 判断权限,只有超级管理员才可以执行此操作
|
||||
if (!iSysUserService.isAdmin(userVO)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION);
|
||||
}
|
||||
return this.iDailyRunPlanService.createCommonDailyRunPlan(this.getRunPlan(planId), mapId, LocalDate.now());
|
||||
}
|
||||
|
||||
|
@ -205,10 +200,8 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
@Override
|
||||
public RunPlanVO getRunPlan(Long id) {
|
||||
RunPlanVO runPlan = this.findRunPlan(id);
|
||||
if (Objects.isNull(runPlan)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST,
|
||||
String.format("id为[%s]的模板运行图不存在", id));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(runPlan,
|
||||
String.format("id为[%s]的模板运行图不存在", id));
|
||||
return runPlan;
|
||||
}
|
||||
|
||||
|
@ -225,7 +218,7 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
RunPlanTemplate template = templateList.get(0);
|
||||
return new RunPlanVO(template);
|
||||
}
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST, "模板运行图不存在");
|
||||
throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception("模板运行图不存在");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -264,8 +257,6 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
|
|||
// 创建每日运行图
|
||||
this.iDailyRunPlanService.createCommonDailyRunPlan(new RunPlanVO(loadTemplateNew),
|
||||
targetMapId, this.iDailyRunPlanService.getRunPlanDate());
|
||||
// 生成通用的派班计划
|
||||
this.iSchedulingPlanService.copyCommonSchedulingPlan(sourceMapId, targetMapId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,112 +0,0 @@
|
|||
package club.joylink.rtss.services;
|
||||
|
||||
import com.baidu.aip.speech.AipSpeech;
|
||||
import com.baidu.aip.speech.TtsResponse;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.vo.client.VoiceRecognitionResult;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Service("oldBaiDuVoiceService")
|
||||
public class VoiceService implements IVoiceService {
|
||||
|
||||
public static final String AudioFileBasePath = "/usr/local/joylink/jlcloud/audio/";
|
||||
|
||||
private AipSpeech aipSpeech;
|
||||
|
||||
{
|
||||
//设置APPID/AK/SK
|
||||
// final String APP_ID = "15475998";
|
||||
// final String API_KEY = "aa8I1wLlNF66rLkTlnxn4SPC";
|
||||
// final String SECRET_KEY = "V5n95lsIVkv7Fg0RNv2xxF1GnjgtPlgf";
|
||||
|
||||
final String APP_ID = "17048486";
|
||||
final String API_KEY = "owDE3FR55ZXpZzAATbBlwKZZ";
|
||||
final String SECRET_KEY = "oFjGfwXFkIGCrK8OntwfuxgzNK4k0oNH";
|
||||
// 初始化一个AipSpeech
|
||||
// URL url = VoiceService.class.getResource("/log4j.properties");
|
||||
// System.setProperty(AipClientConst.LOG4J_CONF_PROPERTY, url.getPath());
|
||||
aipSpeech = new AipSpeech(APP_ID, API_KEY, SECRET_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoiceRecognitionResult voiceRecognition(MultipartFile multipartFile, String lang) {
|
||||
try {
|
||||
VoiceFile voiceFile = IVoiceService.handleAndSaveFile(multipartFile);
|
||||
File file = voiceFile.getFile();
|
||||
byte[] data;
|
||||
data = FileCopyUtils.copyToByteArray(file);
|
||||
HashMap<String, Object> options = new HashMap<>();
|
||||
if("en".equalsIgnoreCase(lang)) { // 英文
|
||||
options.put("dev_pid", 1737);
|
||||
}else { // 默认中文
|
||||
options.put("dev_pid", 1536);
|
||||
}
|
||||
JSONObject asrRes2 = aipSpeech.asr(data, "wav", 16000, options);
|
||||
log.info(String.format("百度语音识别结果:%s", asrRes2.toString()));
|
||||
if(asrRes2.has("err_no") && asrRes2.get("err_no").equals(0)) {
|
||||
String result = ((JSONArray) asrRes2.get("result")).get(0).toString().replaceAll("\"", "");
|
||||
return new VoiceRecognitionResult(voiceFile.getPath(), result);
|
||||
} else {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, asrRes2.toString());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String synthesis(String message, String per) {
|
||||
// 设置可选参数
|
||||
HashMap<String, Object> options = new HashMap<>();
|
||||
options.put("vol", "8");
|
||||
if(!"0".equals(per) && !"1".equals(per) && !"3".equals(per) && !"4".equals(per)) {
|
||||
per = "0";
|
||||
}
|
||||
options.put("per", per);
|
||||
TtsResponse response = this.aipSpeech.synthesis(message, "zh", 1, options);
|
||||
JSONObject result = response.getResult(); //服务器返回的内容,合成成功时为null,失败时包含error_no等信息
|
||||
if(Objects.isNull(result)) {
|
||||
try {
|
||||
byte[] data = response.getData();
|
||||
VoiceFile voiceFile = IVoiceService.saveFile(new ByteArrayInputStream(data));//生成的音频数据
|
||||
return voiceFile.getPath();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, e);
|
||||
}
|
||||
}else {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, result.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class VoiceFile {
|
||||
private String path;
|
||||
|
||||
private File file;
|
||||
|
||||
public VoiceFile(String path, File file) {
|
||||
this.path = path;
|
||||
this.file = file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,5 @@
|
|||
package club.joylink.rtss.services.completition;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.joylink.base.exception.DBException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.dao.RaceQuestionsRulesDAO;
|
||||
import club.joylink.rtss.entity.RaceQuestionsRules;
|
||||
|
@ -12,6 +8,8 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
|||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.competition.TheoryQuestionRuleQueryVO;
|
||||
import club.joylink.rtss.vo.client.competition.TheoryQuestionsRuleVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -108,9 +106,7 @@ public class RaceQuestionsRuleService implements IRaceQuestionsRuleService {
|
|||
@Override
|
||||
public TheoryQuestionsRuleVO getById(Integer ruleId) {
|
||||
RaceQuestionsRules entity = raceQuestionsRulesDAO.selectByPrimaryKey(ruleId);
|
||||
if (entity == null) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST, String.format("id为[%s]的出题规则不存在", ruleId));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(entity, String.format("id为[%s]的出题规则不存在", ruleId));
|
||||
return new TheoryQuestionsRuleVO(entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package club.joylink.rtss.services.completition.question;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.joylink.base.exception.DBException;
|
||||
import com.joylink.base.exception.SysBizException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.dao.RaceQuestionDAO;
|
||||
|
@ -13,6 +8,7 @@ import club.joylink.rtss.entity.RaceQuestion;
|
|||
import club.joylink.rtss.entity.RaceQuestionExample;
|
||||
import club.joylink.rtss.entity.RaceQuestionOption;
|
||||
import club.joylink.rtss.entity.RaceQuestionOptionExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.completition.IUserQuestionProgressService;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
|
@ -20,10 +16,12 @@ import club.joylink.rtss.vo.client.competition.TheoryQuestionCountVO;
|
|||
import club.joylink.rtss.vo.client.question.QuestionOptionVO;
|
||||
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
|
||||
import club.joylink.rtss.vo.client.question.QuestionVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
@ -140,9 +138,7 @@ public class QuestionBankService implements IQuestionBankService {
|
|||
@Override
|
||||
public QuestionVO getQuestion(Long questionId) {
|
||||
RaceQuestion question = questionDAO.selectByPrimaryKey(questionId);
|
||||
if (Objects.isNull(question)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST);
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(question);
|
||||
RaceQuestionOptionExample optionExample = new RaceQuestionOptionExample();
|
||||
optionExample.createCriteria().andQuestionIdEqualTo(question.getId());
|
||||
List<RaceQuestionOption> testQuestionOptions = questionOptionDAO.selectByExample(optionExample);
|
||||
|
@ -154,13 +150,16 @@ public class QuestionBankService implements IQuestionBankService {
|
|||
@Override
|
||||
@Transactional
|
||||
public void addQuestion(QuestionVO questionVO, UserVO userVO) {
|
||||
if ((Objects.equals(BusinessConsts.TheoryType.select, questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.judge, questionVO.getType())) && questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count() != 1) {
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "单选或判断题正确答案有且只有一个!");
|
||||
}
|
||||
if ((Objects.equals(BusinessConsts.TheoryType.fill, questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.answer, questionVO.getType()))
|
||||
&& questionVO.getOptionList().stream().filter(op -> !op.getCorrect()).count() != 0) {
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "填空或问答题不能有错误选项!");
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
(Objects.equals(BusinessConsts.TheoryType.select, questionVO.getType()) ||
|
||||
Objects.equals(BusinessConsts.TheoryType.judge, questionVO.getType())) &&
|
||||
questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count() == 1,
|
||||
"单选或判断题正确答案有且只有一个!");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
(Objects.equals(BusinessConsts.TheoryType.fill, questionVO.getType()) ||
|
||||
Objects.equals(BusinessConsts.TheoryType.answer, questionVO.getType())) &&
|
||||
questionVO.getOptionList().stream().filter(op -> !op.getCorrect()).count() == 0,
|
||||
"填空或问答题不能有错误选项!");
|
||||
RaceQuestion question = questionVO.convert2DB();
|
||||
question.setCreateUserId(userVO.getId());
|
||||
question.setCreateTime(LocalDateTime.now());
|
||||
|
@ -177,26 +176,24 @@ public class QuestionBankService implements IQuestionBankService {
|
|||
public void importProjectQuestion(List<QuestionVO> questions, String projectCode, Integer companyId, UserVO userVO) {
|
||||
|
||||
questions.forEach(questionVO -> {
|
||||
if ((Objects.equals(BusinessConsts.TheoryType.select, questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.judge, questionVO.getType()))
|
||||
&& questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count() != 1) {
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "单选或判断题正确答案有且只有一个!");
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
(Objects.equals(BusinessConsts.TheoryType.select, questionVO.getType()) ||
|
||||
Objects.equals(BusinessConsts.TheoryType.judge, questionVO.getType())) &&
|
||||
questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count() == 1,
|
||||
"单选或判断题正确答案有且只有一个!");
|
||||
if ((Objects.equals(BusinessConsts.TheoryType.fill, questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.answer, questionVO.getType()))) {
|
||||
if (questionVO.getOptionList().stream().filter(op -> !op.getCorrect()).count() != 0) {
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "填空或问答题不能有错误选项!");
|
||||
}
|
||||
if (questionVO.getOptionList().stream().filter(op -> Objects.isNull(op.getOrder())).count() != 0) {
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "填空或问答题选项缺少序号!");
|
||||
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
questionVO.getOptionList().stream().filter(op -> !op.getCorrect()).count() == 0,
|
||||
"填空或问答题不能有错误选项!");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
questionVO.getOptionList().stream().filter(op -> Objects.isNull(op.getOrder())).count() == 0,
|
||||
"填空或问答题选项缺少序号!");
|
||||
if (questionVO.getOptionList().stream().filter(op -> Objects.isNull(op.getOrder())).count() != 0) {
|
||||
questionVO.getOptionList().sort(Comparator.comparing(QuestionOptionVO::getOrder));
|
||||
AtomicInteger i = new AtomicInteger(1);
|
||||
questionVO.getOptionList().forEach(o -> {
|
||||
if (o.getOrder() == i.getAndIncrement()) {
|
||||
return;
|
||||
}
|
||||
throw new SysBizException(ExceptionMapping.ARGUMENT_ILLEGAL.getErrcode(), "填空或问答题选项序号不对!");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertEquals(o.getOrder(), i.getAndIncrement(),
|
||||
"填空或问答题选项序号不对!");
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -257,9 +254,7 @@ public class QuestionBankService implements IQuestionBankService {
|
|||
@Transactional
|
||||
public void updateQuestion(Long questionId, QuestionVO questionVO) {
|
||||
RaceQuestion question = questionDAO.selectByPrimaryKey(questionId);
|
||||
if (Objects.isNull(question)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST);
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(question);
|
||||
questionVO.convert2DB(question);
|
||||
questionDAO.updateByPrimaryKey(question);
|
||||
// RaceQuestionOptionExample optionExample = new RaceQuestionOptionExample();
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package club.joylink.rtss.services.local;
|
||||
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.dao.*;
|
||||
import club.joylink.rtss.entity.*;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.local.LocalDataVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -94,9 +93,7 @@ public class LocalDataServiceImpl implements LocalDataService {
|
|||
|
||||
@Override
|
||||
public LocalDataVO exportLocalMapData(List<Long> mapIdList, UserVO user) {
|
||||
if (CollectionUtils.isEmpty(mapIdList)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, "没有指定需要导出的地图");
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(mapIdList, "没有指定需要导出的地图");
|
||||
LocalDataVO localDataVO = new LocalDataVO();
|
||||
// 地图info
|
||||
MapInfoExample mapInfoExample = new MapInfoExample();
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
package club.joylink.rtss.services.project;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.DBException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.constants.ProjectDeviceType;
|
||||
import club.joylink.rtss.dao.ProjectDeviceDAO;
|
||||
import club.joylink.rtss.entity.ProjectDevice;
|
||||
import club.joylink.rtss.entity.ProjectDeviceExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.gateway.ProjectDevicePageQueryVO;
|
||||
import club.joylink.rtss.vo.client.project.*;
|
||||
import club.joylink.rtss.vo.client.project.gzb.GzbSignalConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.gzb.GzbSwitchConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.xty.XtyPsdConfigVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
@ -57,10 +54,8 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
|
||||
@Override
|
||||
public boolean isDeviceCodeExist(Project project, String code) {
|
||||
if (Objects.isNull(project) || Objects.equals(project, Project.DEFAULT)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("项目[%s]没有权限", project));
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotEquals(project, Project.DEFAULT,
|
||||
String.format("项目[%s]没有权限", project));
|
||||
ProjectDeviceExample example = new ProjectDeviceExample();
|
||||
example.createCriteria()
|
||||
.andProjectCodeEqualTo(project.name())
|
||||
|
@ -74,10 +69,8 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public String create(ProjectDeviceVO deviceVO, LoginUserInfoVO userLoginInfo) {
|
||||
ProjectDevice projectDevice = deviceVO.buildDB();
|
||||
if (Objects.equals(userLoginInfo.getProject(), Project.DEFAULT)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("项目[%s]无权添加设备", userLoginInfo.getProject()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotEquals(userLoginInfo.getProject(), Project.DEFAULT,
|
||||
String.format("项目[%s]无权添加设备", userLoginInfo.getProject()));
|
||||
projectDevice.setProjectCode(userLoginInfo.getProject().name());
|
||||
projectDevice.setCreator(userLoginInfo.getUserVO().getId());
|
||||
projectDevice.setCreateTime(LocalDateTime.now());
|
||||
|
@ -91,10 +84,8 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
example.createCriteria()
|
||||
.andIdEqualTo(id);
|
||||
List<ProjectDevice> projectDevices = this.projectDeviceDAO.selectByExample(example);
|
||||
if (CollectionUtils.isEmpty(projectDevices)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST,
|
||||
String.format("id为[%s]的设备不存在"));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(projectDevices,
|
||||
String.format("id为[%s]的设备不存在"));
|
||||
ProjectDevice projectDevice = projectDevices.get(0);
|
||||
ProjectDeviceVO projectDeviceVO = new ProjectDeviceVO(projectDevice);
|
||||
return projectDeviceVO;
|
||||
|
@ -103,10 +94,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updatePlcGatewayConfig(Long id, PlcGatewayConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PLC_GATEWAY)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是PLC网关,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PLC_GATEWAY,
|
||||
String.format("设备[%s(%s)]不是PLC网关,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -114,10 +104,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateSwitchConfig(Long id, SwitchConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SWITCH)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是道岔,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SWITCH,
|
||||
String.format("设备[%s(%s)]不是道岔,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -125,10 +114,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateSignalConfig(Long id, SignalConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SIGNAL)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是信号机,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SIGNAL,
|
||||
String.format("设备[%s(%s)]不是信号机,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -136,10 +124,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updatePscConfig(Long id, PscConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSC)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是屏蔽门控制柜,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSC,
|
||||
String.format("设备[%s(%s)]不是屏蔽门控制柜,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -147,10 +134,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updatePsdConfig(Long id, PsdConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSD)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是屏蔽门,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSD,
|
||||
String.format("设备[%s(%s)]不是屏蔽门,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -158,10 +144,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updatePslConfig(Long id, PslConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSL)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是屏蔽门控制盒,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.PSL,
|
||||
String.format("设备[%s(%s)]不是屏蔽门控制盒,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -169,10 +154,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateIbpConfig(Long id, IbpConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.IBP)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是IBP盘,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.IBP,
|
||||
String.format("设备[%s(%s)]不是IBP盘,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -180,10 +164,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateVrIbpConfig(Long id, VrIbpConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.VR_IBP)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是虚拟IBP盘,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.VR_IBP,
|
||||
String.format("设备[%s(%s)]不是虚拟IBP盘,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -191,10 +174,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateLwConfig(Long id, LwConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.LW)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是现地工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.LW,
|
||||
String.format("设备[%s(%s)]不是现地工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -202,10 +184,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateLswConfig(Long id, LswConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.LSW)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是大屏工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.LSW,
|
||||
String.format("设备[%s(%s)]不是大屏工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -213,10 +194,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateCctvConfig(Long id, RelationLoginConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.CCTV)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是CCTV工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.CCTV,
|
||||
String.format("设备[%s(%s)]不是CCTV工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -224,10 +204,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateSandboxConfig(Long id, RelationLoginConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SANDBOX)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是电子沙盘工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.SANDBOX,
|
||||
String.format("设备[%s(%s)]不是电子沙盘工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -235,10 +214,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateIscsLwConfig(Long id, RelationLoginConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ISCS_LW)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是现地综合监控工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ISCS_LW,
|
||||
String.format("设备[%s(%s)]不是现地综合监控工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -246,10 +224,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateIscsCwConfig(Long id, RelationLoginConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ISCS_CW)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是中心综合监控工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ISCS_CW,
|
||||
String.format("设备[%s(%s)]不是中心综合监控工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -257,10 +234,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateVrpsdConfig(Long id, VrpsdConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.VR_PSD)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是虚拟屏蔽门工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.VR_PSD,
|
||||
String.format("设备[%s(%s)]不是虚拟屏蔽门工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -268,10 +244,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public void updateIlwConfig(Long id, RelationLoginConfigVO configVO) {
|
||||
ProjectDevice device = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (!Objects.equals(ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ILW)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("设备[%s(%s)]不是联锁工作站,不能更新", device.getCode(), device.getType()));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertEquals(
|
||||
ProjectDeviceType.valueOf(device.getType()), ProjectDeviceType.ILW,
|
||||
String.format("设备[%s(%s)]不是联锁工作站,不能更新", device.getCode(), device.getType()));
|
||||
device.setConfig(configVO.toJson());
|
||||
this.projectDeviceDAO.updateByPrimaryKeySelective(device);
|
||||
}
|
||||
|
@ -283,10 +258,8 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
|
||||
@Override
|
||||
public List<ProjectDeviceVO> queryByType(ProjectDeviceType type, Project project) {
|
||||
if (Objects.isNull(project) || Objects.equals(project, Project.DEFAULT)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("项目[%s]没有权限", project));
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotEquals(project, Project.DEFAULT,
|
||||
String.format("项目[%s]没有权限", project));
|
||||
ProjectDeviceExample example = new ProjectDeviceExample();
|
||||
example.createCriteria()
|
||||
.andProjectCodeEqualTo(project.name())
|
||||
|
@ -298,10 +271,7 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
@Override
|
||||
public ProjectDeviceVO getDeviceDetailInfoById(Long id) {
|
||||
ProjectDevice projectDevice = this.projectDeviceDAO.selectByPrimaryKey(id);
|
||||
if (Objects.isNull(projectDevice)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST,
|
||||
String.format("id为[%s]的设备不存在", id));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(projectDevice, String.format("id为[%s]的设备不存在", id));
|
||||
ProjectDeviceVO projectDeviceVO = new ProjectDeviceVO(projectDevice);
|
||||
return projectDeviceVO;
|
||||
}
|
||||
|
@ -313,10 +283,8 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
.andProjectCodeEqualTo(project.name())
|
||||
.andCodeEqualTo(deviceCode);
|
||||
List<ProjectDevice> projectDevices = this.projectDeviceDAO.selectByExampleWithBLOBs(example);
|
||||
if (CollectionUtils.isEmpty(projectDevices)) {
|
||||
throw new DBException(ExceptionMapping.DATA_NOT_EXIST,
|
||||
String.format("[project:%s,code:%s]的设备不存在", project, deviceCode));
|
||||
}
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(projectDevices,
|
||||
String.format("[project:%s,code:%s]的设备不存在", project, deviceCode));
|
||||
ProjectDeviceVO projectDeviceVO = new ProjectDeviceVO(projectDevices.get(0));
|
||||
return projectDeviceVO;
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package club.joylink.rtss.services.record;
|
||||
|
||||
import club.joylink.rtss.record.SimulationProcessRecordPO;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
|
||||
public interface ISimulationProcessRecordService {
|
||||
|
||||
void addNewRecord(SimulationProcessRecordPO record);
|
||||
|
||||
|
||||
void startRecordSimulation(UserVO user, String group);
|
||||
|
||||
void stopRecordSimulation(UserVO user, String group);
|
||||
|
||||
Long readyPlayback(UserVO user, String group);
|
||||
|
||||
void startPlaying(UserVO user);
|
||||
|
||||
void setPlaySpeed(UserVO user, int level);
|
||||
|
||||
void pausePlaying(UserVO user);
|
||||
|
||||
void playing(UserVO user);
|
||||
|
||||
void endPlaying(UserVO user);
|
||||
}
|
|
@ -1,127 +0,0 @@
|
|||
package club.joylink.rtss.services.record;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import club.joylink.rtss.dao.SimulationProcessRecordDAO;
|
||||
import club.joylink.rtss.entity.SimulationProcessRecord;
|
||||
import club.joylink.rtss.entity.SimulationProcessRecordExample;
|
||||
import club.joylink.rtss.record.SimulationProcessRecordPO;
|
||||
import club.joylink.rtss.record.SimulationRecordHandle;
|
||||
import club.joylink.rtss.record.SimulationRecordPlay;
|
||||
import club.joylink.rtss.record.SimulationRecordQueryVO;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Repository
|
||||
public class SimulationProcessRecordService implements ISimulationProcessRecordService{
|
||||
|
||||
@Autowired
|
||||
private SimulationProcessRecordDAO recordDAO;
|
||||
|
||||
@Autowired
|
||||
private SimulationRecordHandle recordHandler;
|
||||
|
||||
@Override
|
||||
public void addNewRecord(SimulationProcessRecordPO record) {
|
||||
log.debug("仿真[{}]过程数据记录中>>>>>>",record.getSimulationGroup());
|
||||
recordDAO.insert(record.convert2DB());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void startRecordSimulation(UserVO user, String group){
|
||||
log.debug("用户[{}]开启仿真[{}]记录>>>>>>", user.getId(), group);
|
||||
recordHandler.startRecordSimulation(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopRecordSimulation(UserVO user, String group){
|
||||
log.debug("用户[{}]关闭仿真[{}]记录>>>>>>", user.getId(), group);
|
||||
recordHandler.cancelRecordSimulation(group);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long readyPlayback(UserVO user, String group) {
|
||||
log.debug("用户[{}]准备仿真[{}]回放>>>>>>", user.getId(), group);
|
||||
return loadRecord2CacheQueue(String.valueOf(user.getId()), group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startPlaying(UserVO user){
|
||||
log.debug("用户[{}]开启仿真回放>>>>>>",user.getId());
|
||||
recordHandler.startPlaying(String.valueOf(user.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlaySpeed(UserVO user,int level){
|
||||
log.debug("用户[{}]设置仿真回放倍速>>>>>>{}",user.getId(),level);
|
||||
recordHandler.setPlaySpeed(String.valueOf(user.getId()),level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pausePlaying(UserVO user){
|
||||
log.debug("用户[{}]暂停仿真回放>>>>>>",user.getId());
|
||||
recordHandler.pausePlaying(String.valueOf(user.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playing(UserVO user) {
|
||||
log.debug("用户[{}]从暂停启动仿真回放>>>>>>",user.getId());
|
||||
recordHandler.playing(String.valueOf(user.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endPlaying(UserVO user) {
|
||||
log.debug("用户[{}]结束仿真回放>>>>>>",user.getId());
|
||||
recordHandler.endPlaying(String.valueOf(user.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Long loadRecord2CacheQueue(String userId, String group){
|
||||
log.info("回放准备初始化数据");
|
||||
SimulationRecordPlay player = new SimulationRecordPlay();
|
||||
SimulationRecordQueryVO queryVO = new SimulationRecordQueryVO();
|
||||
queryVO.setGroup(group);
|
||||
queryVO.setPageNum(player.getPage());
|
||||
queryVO.setPageSize(200);//初始加载80条
|
||||
List<SimulationProcessRecordPO> records = getByPage(queryVO,player);
|
||||
if(CollectionUtils.isEmpty(records)){
|
||||
return null;
|
||||
}
|
||||
log.info("回放正在初始化缓存数据");
|
||||
recordHandler.putPlayer(userId, player);
|
||||
player.setGroup(group);
|
||||
queryVO.setPageSize(300);//以后每次加载300
|
||||
player.setCachePageConfig(queryVO);
|
||||
records.forEach(player::putRecordMayAwait);
|
||||
return records.get(0).getMapId();
|
||||
}
|
||||
|
||||
private List<SimulationProcessRecordPO> getByPage(SimulationRecordQueryVO queryVO, SimulationRecordPlay player) {
|
||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||
SimulationProcessRecordExample example = new SimulationProcessRecordExample();
|
||||
// example.setLimit(queryVO.getPageSize());
|
||||
// example.setOffset((long)((queryVO.getPageNum()-1)*queryVO.getPageSize()+1));
|
||||
example.setOrderByClause("date_time");
|
||||
if(StringUtils.hasText(queryVO.getGroup())){
|
||||
example.createCriteria().andSimulationGroupEqualTo(queryVO.getGroup());
|
||||
}
|
||||
Page<SimulationProcessRecord> page = (Page<SimulationProcessRecord>) recordDAO.selectByExampleWithBLOBs(example);
|
||||
player.setTotalRows(page.getTotal());
|
||||
if(page.getTotal()==0){
|
||||
return null;
|
||||
}
|
||||
List<SimulationProcessRecord> records = page.getResult();
|
||||
return SimulationProcessRecordPO.convert2POList(records);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package club.joylink.rtss.services.simulation;
|
||||
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
|
@ -45,10 +43,8 @@ public class ProjectSimulationServiceImpl implements ProjectSimulationService {
|
|||
|
||||
// 查询项目地图,默认取第一个(暂时这样处理,后面考虑配置实训室-地图对应?)
|
||||
List<MapVO> mapList = this.iMapService.findOnlineMapByProjectCode(project.name());
|
||||
if (CollectionUtils.isEmpty(mapList)) {
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION,
|
||||
String.format("项目[%s]无地图", project));
|
||||
}
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertCollectionNotEmpty(mapList,
|
||||
String.format("项目[%s]无地图", project));
|
||||
Long mapId = mapList.get(0).getId();
|
||||
|
||||
// 权限判断
|
||||
|
|
|
@ -3,25 +3,22 @@ package club.joylink.rtss.services.simulation;
|
|||
import club.joylink.rtss.simulation.cbtc.GroupSimulationCache;
|
||||
import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.SimulationVO;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationUser;
|
||||
import club.joylink.rtss.simulation.GroupSimulationManager;
|
||||
import club.joylink.rtss.simulation.UserSimulationCache;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.simulationv1.ExistSimulationQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
@ -38,18 +35,6 @@ public class SimulationManageServiceImpl implements SimulationManageService {
|
|||
@Autowired
|
||||
private GroupSimulationService groupSimulationService;
|
||||
|
||||
@Autowired
|
||||
private SimulationLifeCycleService simulationLifeCycleService;
|
||||
|
||||
/**
|
||||
* 旧仿真缓存
|
||||
*/
|
||||
@Autowired
|
||||
private UserSimulationCache userSimulationCache;
|
||||
|
||||
@Autowired
|
||||
private GroupSimulationManager groupSimulationManager;
|
||||
|
||||
@Scheduled(fixedRate = 500)
|
||||
public void deleteUselessSimulation() {
|
||||
Map<String, Simulation> groupSimulationMap = this.groupSimulationCache.getGroupSimulationMap();
|
||||
|
@ -88,15 +73,6 @@ public class SimulationManageServiceImpl implements SimulationManageService {
|
|||
simulationVO.setOnlineUserIdList(onlineUserIdList);
|
||||
voList.add(simulationVO);
|
||||
});
|
||||
ArrayList<club.joylink.rtss.simulation.Simulation> oldList = this.userSimulationCache.queryAllSimulation();
|
||||
oldList.forEach(simulation -> {
|
||||
SimulationVO simulationVO = SimulationVO.buildOldSimulationBasicInfo(simulation);
|
||||
Set<String> userIdList = this.userSimulationCache.getUserSessionsByGroup(simulation.getGroup());
|
||||
if (!CollectionUtils.isEmpty(userIdList)) {
|
||||
simulationVO.setOnlineUserIdList(new ArrayList<>(userIdList));
|
||||
}
|
||||
voList.add(simulationVO);
|
||||
});
|
||||
Stream<SimulationVO> stream = voList.stream();
|
||||
if (StringUtils.hasText(queryVO.getGroup())) {
|
||||
stream = stream.filter(simulationVO -> Objects.equals(simulationVO.getGroup(), queryVO.getGroup()));
|
||||
|
@ -118,28 +94,13 @@ public class SimulationManageServiceImpl implements SimulationManageService {
|
|||
|
||||
@Override
|
||||
public SimulationVO getSimulationBasicInfo(String group) {
|
||||
Simulation simulation = this.groupSimulationCache.findSimulationByGroup(group);
|
||||
if (Objects.nonNull(simulation)) {
|
||||
return SimulationVO.buildBasicInfo(this.groupSimulationCache.getSimulationByGroup(group));
|
||||
} else {
|
||||
club.joylink.rtss.simulation.Simulation oldSimulation = this.userSimulationCache.getSimulationByGroup(group);
|
||||
if (Objects.isNull(oldSimulation)) {
|
||||
log.warn(String.format("group为[%s]的旧仿真不存在", group));
|
||||
throw new SimulationException(SimulationExceptionType.Simulation_Not_Exist);
|
||||
}
|
||||
return SimulationVO.buildOldSimulationBasicInfo(oldSimulation);
|
||||
}
|
||||
Simulation simulation = this.groupSimulationCache.getSimulationByGroup(group);
|
||||
return SimulationVO.buildBasicInfo(this.groupSimulationCache.getSimulationByGroup(group));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroySimulation(String group, UserVO user) {
|
||||
SimulationVO simulationVO = this.getSimulationBasicInfo(group);
|
||||
if (simulationVO.isNew()) { // 新仿真
|
||||
this.groupSimulationService.clearSimulation(group, user);
|
||||
// this.simulationLifeCycleService.destroy(this.groupSimulationCache.getSimulationByGroup(group));
|
||||
// this.groupSimulationCache.removeSimulation(group);
|
||||
} else { // 旧仿真
|
||||
this.groupSimulationManager.clearSimulation(group);
|
||||
}
|
||||
this.groupSimulationService.clearSimulation(group, user);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package club.joylink.rtss.services.training;
|
||||
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
import club.joylink.rtss.services.*;
|
||||
import club.joylink.rtss.services.ICommandService;
|
||||
import club.joylink.rtss.services.IMapService;
|
||||
import club.joylink.rtss.services.IOperateService;
|
||||
import club.joylink.rtss.services.IRunPlanTemplateService;
|
||||
import club.joylink.rtss.services.training.data.GenerateConfig;
|
||||
import club.joylink.rtss.services.training.generatornew.GeneratorFactoryNew;
|
||||
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
||||
|
@ -34,9 +37,6 @@ public class GenerateTask {
|
|||
@Autowired
|
||||
private IMapService iMapService;
|
||||
|
||||
@Autowired
|
||||
private ITrainingService iTrainingService;
|
||||
|
||||
@Autowired
|
||||
private ITrainingV1Service iTrainingV1Service;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.services.training.generatornew;
|
||||
|
||||
import club.joylink.rtss.training.generatornew.annotation.GeneratorSelectorNew;
|
||||
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package club.joylink.rtss.services.training.generatornew.base;
|
||||
|
||||
import club.joylink.rtss.services.training.data.GenerateConfig;
|
||||
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
||||
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.training.data.GenerateConfig;
|
||||
import club.joylink.rtss.training.generatornew.GeneratorNew;
|
||||
import club.joylink.rtss.training.generatornew.annotation.GeneratorSelectorNew;
|
||||
import club.joylink.rtss.vo.client.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package club.joylink.rtss.services.voice.baidu;
|
||||
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.IVoiceService;
|
||||
import club.joylink.rtss.services.VoiceService;
|
||||
import club.joylink.rtss.vo.client.VoiceRecognitionResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -27,14 +25,14 @@ public class VoiceServiceImpl implements IVoiceService {
|
|||
@Override
|
||||
public VoiceRecognitionResult voiceRecognition(MultipartFile multipartFile, String lang) {
|
||||
try {
|
||||
VoiceService.VoiceFile voiceFile = IVoiceService.handleAndSaveFile(multipartFile);
|
||||
VoiceFile voiceFile = IVoiceService.handleAndSaveFile(multipartFile);
|
||||
File file = voiceFile.getFile();
|
||||
String json = this.asrService.runJsonPostMethod(file, TokenHolder.getInstance().getToken());
|
||||
log.info(String.format("百度语音识别结果:[%s]", json));
|
||||
VoiceAsrResult result = VoiceAsrResult.fromJson(json);
|
||||
return new VoiceRecognitionResult(voiceFile.getPath(), result.getResult().get(0));
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, e);
|
||||
throw BusinessExceptionAssertEnum.THIRD_SERVICE_CALL_EXCEPTION.exception();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,10 +40,10 @@ public class VoiceServiceImpl implements IVoiceService {
|
|||
public String synthesis(String message, String per) {
|
||||
try {
|
||||
byte[] data = this.ttsService.run(message, per, TokenHolder.getInstance().getToken());
|
||||
VoiceService.VoiceFile voiceFile = IVoiceService.saveFile(new ByteArrayInputStream(data));//生成的音频数据
|
||||
VoiceFile voiceFile = IVoiceService.saveFile(new ByteArrayInputStream(data));//生成的音频数据
|
||||
return voiceFile.getPath();
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException(ExceptionMapping.AUDIO_EXCEPTION, e);
|
||||
throw BusinessExceptionAssertEnum.THIRD_SERVICE_CALL_EXCEPTION.exception();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package club.joylink.rtss.simulation.cbtc.ATS.service;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.ATSMessageCollectAndDispatcher;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
package club.joylink.rtss.simulation.cbtc;
|
||||
|
||||
import club.joylink.rtss.configuration.configProp.OtherConfig;
|
||||
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
import club.joylink.rtss.constants.SystemEnv;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.*;
|
||||
import club.joylink.rtss.services.script.IScriptService2;
|
||||
import club.joylink.rtss.services.simulation.IScriptSimulationService;
|
||||
import club.joylink.rtss.services.simulation.SchedulingService;
|
||||
import club.joylink.rtss.services.training.ITrainingV1Service;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.ATSMessageCollectAndDispatcher;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.data.AtsAlarm;
|
||||
|
@ -25,17 +34,6 @@ import club.joylink.rtss.simulation.cbtc.member.MemberManager;
|
|||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationUser;
|
||||
import club.joylink.rtss.simulation.cbtc.script.ScriptBO;
|
||||
import club.joylink.rtss.configuration.configProp.OtherConfig;
|
||||
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
import club.joylink.rtss.constants.SystemEnv;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.*;
|
||||
import club.joylink.rtss.services.record.ISimulationProcessRecordService;
|
||||
import club.joylink.rtss.services.script.IScriptService2;
|
||||
import club.joylink.rtss.services.simulation.IScriptSimulationService;
|
||||
import club.joylink.rtss.services.simulation.SchedulingService;
|
||||
import club.joylink.rtss.simulation.GroupSimulationManager;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
|
@ -54,11 +52,11 @@ import club.joylink.rtss.vo.client.simulationv1.*;
|
|||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.websocket.StompMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -107,9 +105,6 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||
@Autowired
|
||||
private MemberManager memberManager;
|
||||
|
||||
@Autowired
|
||||
private GroupSimulationManager groupSimulationManager;
|
||||
|
||||
@Autowired
|
||||
private ITrainingV1Service iTrainingV1Service;
|
||||
|
||||
|
@ -128,9 +123,6 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||
@Autowired
|
||||
private IScriptService2 iScriptService2;
|
||||
|
||||
@Autowired
|
||||
private ISimulationProcessRecordService simulationProcessRecordService;
|
||||
|
||||
@Autowired
|
||||
private OtherConfig otherConfig;
|
||||
|
||||
|
@ -365,13 +357,8 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||
|
||||
@Override
|
||||
public SimulationVO getSimulationBasicInfo(String group) {
|
||||
Simulation simulation = this.groupSimulationCache.findSimulationByGroup(group);
|
||||
if (Objects.nonNull(simulation)) {
|
||||
return SimulationVO.buildBasicInfo(this.groupSimulationCache.getSimulationByGroup(group));
|
||||
} else {
|
||||
club.joylink.rtss.simulation.Simulation oldSimulation = this.groupSimulationManager.getSimulationByGroup(group);
|
||||
return SimulationVO.buildOldSimulationBasicInfo(oldSimulation);
|
||||
}
|
||||
Simulation simulation = this.groupSimulationCache.getSimulationByGroup(group);
|
||||
return SimulationVO.buildBasicInfo(this.groupSimulationCache.getSimulationByGroup(group));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -464,7 +451,6 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||
throw new SimulationException(SimulationExceptionType.Simulation_Clear_Failed,
|
||||
String.format("不是仿真[%s]创建者或管理员,无权销毁仿真", group));
|
||||
}
|
||||
simulationProcessRecordService.stopRecordSimulation(user, group);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -506,11 +492,6 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
|||
groupList.add(group);
|
||||
}
|
||||
});
|
||||
// 【兼容】旧仿真在线查询,以后删除
|
||||
List<String> oldSimulationGroupList = this.groupSimulationManager.getRunningSimulationGroup(null, userVO);
|
||||
if (!CollectionUtils.isEmpty(oldSimulationGroupList)) {
|
||||
groupList.addAll(oldSimulationGroupList);
|
||||
}
|
||||
return groupList;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package club.joylink.rtss.simulation.cbtc.data.vo;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
import lombok.Builder;
|
||||
|
@ -81,29 +80,6 @@ public class SimulationVO {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static SimulationVO buildOldSimulationBasicInfo(club.joylink.rtss.simulation.Simulation oldSimulation) {
|
||||
MapVO mapVO = new MapVO();
|
||||
mapVO.setId(oldSimulation.getMapId());
|
||||
mapVO.setDrawWay(false);
|
||||
UserVO user = oldSimulation.getUserVO();
|
||||
UserVO creator = new UserVO();
|
||||
creator.setId(user.getId());
|
||||
creator.setName(user.getName());
|
||||
creator.setNickname(user.getNickname());
|
||||
int systemTime = oldSimulation.now()
|
||||
.plusHours(SimulationConstants.RUN_DIAGRAM_TRANS_TIME).toSecondOfDay();
|
||||
return SimulationVO.builder()
|
||||
.group(oldSimulation.getGroup())
|
||||
.map(mapVO)
|
||||
.creator(creator)
|
||||
.prodType(oldSimulation.getPrdType())
|
||||
.systemTime(systemTime)
|
||||
.planRunning(oldSimulation.isRunAsPlan())
|
||||
.pause(oldSimulation.isPause())
|
||||
.error(oldSimulation.isError())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static List<SimulationVO> convert2VOList(List<Simulation> simulationList) {
|
||||
List<SimulationVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(simulationList)) {
|
||||
|
@ -112,14 +88,6 @@ public class SimulationVO {
|
|||
return voList;
|
||||
}
|
||||
|
||||
public static List<SimulationVO> convertOld2VOList(ArrayList<club.joylink.rtss.simulation.Simulation> oldList) {
|
||||
List<SimulationVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(oldList)) {
|
||||
oldList.forEach(simulation -> voList.add(buildOldSimulationBasicInfo(simulation)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return this.map.isDrawWay();
|
||||
}
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.entity.SimulationConversationMessage;
|
||||
import club.joylink.rtss.simulation.conversation.ConversationMessage;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ApiModel(value = "消息对象")
|
||||
@Getter
|
||||
@Setter
|
||||
public class ConversationMessageVO {
|
||||
|
||||
@ApiModelProperty(value = "会话id")
|
||||
private String conversationId;
|
||||
|
||||
@ApiModelProperty(value = "是否群聊")
|
||||
private boolean group;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "是否语音")
|
||||
private Boolean isAudio;
|
||||
|
||||
@ApiModelProperty(value = "语音文件路径")
|
||||
private String audioPath;
|
||||
|
||||
@ApiModelProperty(value = "聊天时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone="GMT+8")
|
||||
private LocalDateTime chatTime;
|
||||
|
||||
@ApiModelProperty(value = "仿真成员")
|
||||
private SimulationMemberVO member;
|
||||
|
||||
@ApiModelProperty(value = "目标仿真成员")
|
||||
private SimulationMemberVO targetMember;
|
||||
|
||||
@ApiModelProperty(value = "命令")
|
||||
private MapDeviceChangeVO changeVO;
|
||||
|
||||
public ConversationMessageVO() {
|
||||
this.chatTime = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public ConversationMessageVO(String conversationId, SimulationMemberVO member) {
|
||||
this(conversationId, member, null);
|
||||
}
|
||||
|
||||
public ConversationMessageVO(String conversationId, SimulationMemberVO member, MapDeviceChangeVO changeVO) {
|
||||
this();
|
||||
this.conversationId = conversationId;
|
||||
this.member = member;
|
||||
this.changeVO = changeVO;
|
||||
}
|
||||
|
||||
public ConversationMessageVO(SimulationConversationMessage message) {
|
||||
this.conversationId = ConvertUtil.long2Str(message.getConversationId());
|
||||
this.chatTime = message.getCreateTime();
|
||||
this.isAudio = Objects.equals(message.getType(), BusinessConsts.ConversationMessage.Type.Type02);
|
||||
this.message = message.getContent();
|
||||
this.audioPath = message.getFileUrl();
|
||||
}
|
||||
|
||||
public ConversationMessageVO(ConversationMessage message) {
|
||||
this.conversationId = message.getConversation().getId();
|
||||
this.group = message.getConversation().isGroup();
|
||||
this.member = new SimulationMemberVO(message.getFrom());
|
||||
if(Objects.nonNull(message.getTarget())) {
|
||||
this.targetMember = new SimulationMemberVO(message.getTarget());
|
||||
}
|
||||
this.chatTime = message.getTime();
|
||||
this.message = message.getContent();
|
||||
this.audioPath = message.getAudioPath();
|
||||
if(!StringUtils.isEmpty(this.audioPath)) {
|
||||
this.isAudio = true;
|
||||
} else {
|
||||
this.isAudio = false;
|
||||
}
|
||||
if(Objects.nonNull(message.getCommand())) {
|
||||
this.changeVO = new MapDeviceChangeVO(message.getCommand());
|
||||
}
|
||||
}
|
||||
|
||||
public static List<ConversationMessageVO> convert2VOList(List<ConversationMessage> messageList) {
|
||||
List<ConversationMessageVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(messageList)) {
|
||||
messageList.forEach(message -> voList.add(new ConversationMessageVO(message)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public ConversationMessageVO clone() {
|
||||
ConversationMessageVO messageVO = new ConversationMessageVO();
|
||||
messageVO.setConversationId(this.getConversationId());
|
||||
messageVO.setMember(this.getMember());
|
||||
messageVO.setIsAudio(this.getIsAudio());
|
||||
messageVO.setAudioPath(this.getAudioPath());
|
||||
messageVO.setMessage(this.getMessage());
|
||||
messageVO.setChatTime(this.getChatTime());
|
||||
messageVO.setChangeVO(this.getChangeVO());
|
||||
messageVO.setTargetMember(this.targetMember);
|
||||
return messageVO;
|
||||
}
|
||||
|
||||
public SimulationConversationMessage convert2DB() {
|
||||
SimulationConversationMessage conversationMessage = new SimulationConversationMessage();
|
||||
conversationMessage.setContent(this.getMessage());
|
||||
conversationMessage.setType(this.getIsAudio() ? BusinessConsts.ConversationMessage.Type.Type02 : BusinessConsts.ConversationMessage.Type.Type01);
|
||||
conversationMessage.setFileUrl(this.getAudioPath());
|
||||
conversationMessage.setCreateTime(this.getChatTime());
|
||||
return conversationMessage;
|
||||
}
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.simulation.conversation.Conversation;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ConversationVO {
|
||||
|
||||
private String id;
|
||||
|
||||
@JsonIgnore
|
||||
private String creatorId;
|
||||
|
||||
private String name;
|
||||
|
||||
@JsonIgnore
|
||||
private SimulationMemberVO creator;
|
||||
|
||||
@JsonIgnore
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private boolean group;
|
||||
|
||||
private List<SimulationMemberVO> memberList;
|
||||
|
||||
@JsonIgnore
|
||||
private List<ConversationMessageVO> messageList;
|
||||
|
||||
public ConversationVO(Conversation conversation) {
|
||||
this.id = conversation.getId();
|
||||
this.name = conversation.getName();
|
||||
this.group = conversation.isGroup();
|
||||
this.memberList = SimulationMemberVO.convert2VOList(conversation.getMemberList());
|
||||
}
|
||||
|
||||
public static List<ConversationVO> convertSO2VO(List<Conversation> soList) {
|
||||
List<ConversationVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(soList)) {
|
||||
soList.forEach(conversation -> voList.add(new ConversationVO(conversation)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ConversationVO that = (ConversationVO) o;
|
||||
return Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getId());
|
||||
}
|
||||
|
||||
public void addMember(SimulationMemberVO member) {
|
||||
this.memberList.add(member);
|
||||
}
|
||||
|
||||
public void addMessage(ConversationMessageVO messageVO) {
|
||||
this.messageList.add(messageVO);
|
||||
}
|
||||
|
||||
public SimulationMemberVO getMemberByUserId(String id) {
|
||||
SimulationMemberVO member = null;
|
||||
for (SimulationMemberVO temp : this.memberList) {
|
||||
if(StringUtils.hasText(id) && id.equals(temp.getUserId())) {
|
||||
member = temp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Objects.isNull(member))
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, String.format("会话用户‘%s’不存在", id));
|
||||
return member;
|
||||
}
|
||||
|
||||
public SimulationMemberVO getOtherMemberBy(String id) {
|
||||
SimulationMemberVO member = null;
|
||||
for (SimulationMemberVO temp : this.memberList) {
|
||||
if(StringUtils.hasText(id) && !id.equals(temp.getUserId())) {
|
||||
member = temp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return member;
|
||||
}
|
||||
|
||||
public SimulationMemberVO getOtherMemberBy(SimulationMemberVO member) {
|
||||
for (SimulationMemberVO memberVO : this.memberList) {
|
||||
if(!memberVO.equals(member)) {
|
||||
return memberVO;
|
||||
}
|
||||
}
|
||||
return member;
|
||||
}
|
||||
|
||||
public Long getCreatorIdLong() {
|
||||
return ConvertUtil.str2Long(this.creatorId);
|
||||
}
|
||||
|
||||
public boolean isConversationMember(SimulationMemberVO member) {
|
||||
return this.isGroup() || this.memberList.contains(member);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.entity.SimulationRoomDevice;
|
||||
import club.joylink.rtss.simulation.data.real.RealDeviceType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "综合演练房间设备成员")
|
||||
public class JointTrainingRoomDeviceVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roomId;
|
||||
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private RealDeviceType deviceType;
|
||||
|
||||
@ApiModelProperty(value = "关联设备编码")
|
||||
private String deviceCode;
|
||||
|
||||
public JointTrainingRoomDeviceVO(SimulationRoomDevice roomDevice) {
|
||||
this.id = roomDevice.getId();
|
||||
this.roomId = roomDevice.getRoomId();
|
||||
this.deviceType = RealDeviceType.valueOf(roomDevice.getDeviceType());
|
||||
this.deviceCode = roomDevice.getDeviceCode();
|
||||
}
|
||||
|
||||
public static List<JointTrainingRoomDeviceVO> convert2VOList(List<SimulationRoomDevice> roomDeviceList) {
|
||||
List<JointTrainingRoomDeviceVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(roomDeviceList)) {
|
||||
roomDeviceList.forEach(roomDevice -> voList.add(new JointTrainingRoomDeviceVO(roomDevice)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public SimulationRoomDevice toDB() {
|
||||
SimulationRoomDevice device = new SimulationRoomDevice();
|
||||
device.setId(id);
|
||||
device.setRoomId(roomId);
|
||||
device.setDeviceCode(deviceCode);
|
||||
device.setDeviceType(deviceType.name());
|
||||
return device;
|
||||
}
|
||||
}
|
|
@ -1,179 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.entity.SimulationRoom;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
import club.joylink.rtss.vo.client.room.RoomSimulationRealDeviceVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "综合演练房间对象")
|
||||
public class JointTrainingRoomNewVO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long mapId;
|
||||
|
||||
private String mapName;
|
||||
|
||||
private String prdType;
|
||||
|
||||
private String group;
|
||||
|
||||
private String roomName;
|
||||
|
||||
private JointTrainingUserNewVO creator;
|
||||
|
||||
@ApiModelProperty(value = "可分配角色权限数量")
|
||||
private int permissionNum;
|
||||
|
||||
@ApiModelProperty(value = "观众权限数量")
|
||||
private int audiencePermissionNum;
|
||||
|
||||
@JsonIgnore
|
||||
private List<JointTrainingUserNewVO> userList;
|
||||
|
||||
@JsonIgnore
|
||||
private List<JointTrainingRoomDeviceVO> deviceList;
|
||||
|
||||
@JsonIgnore
|
||||
private List<RoomSimulationRealDeviceVO> realDeviceList;
|
||||
|
||||
private String state;
|
||||
|
||||
/**竞赛id*/
|
||||
private Long competitionId;
|
||||
|
||||
public JointTrainingRoomNewVO(MapVO mapVO, String prdType, String group, String roomName,
|
||||
int permissionNum, int audiencePermissionNum, String state, Long competitionId) {
|
||||
this.mapId = mapVO.getId();
|
||||
this.mapName = mapVO.getName();
|
||||
this.prdType = prdType;
|
||||
this.group = group;
|
||||
this.roomName = roomName;
|
||||
this.permissionNum = permissionNum;
|
||||
this.audiencePermissionNum = audiencePermissionNum;
|
||||
this.state = state;
|
||||
this.competitionId = competitionId;
|
||||
this.userList = Collections.synchronizedList(new ArrayList<>(permissionNum + audiencePermissionNum));
|
||||
this.deviceList = new ArrayList<>();
|
||||
this.realDeviceList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Long getCreatorId() {
|
||||
return this.getCreator().getId();
|
||||
}
|
||||
|
||||
public JointTrainingUserNewVO getUserById(Long id) {
|
||||
for (JointTrainingUserNewVO userVO : this.userList) {
|
||||
if (id.equals(userVO.getId())) {
|
||||
return userVO;
|
||||
}
|
||||
}
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, String.format("用户‘%s’不存在", id));
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getTotalPermissionNum() {
|
||||
return this.permissionNum + this.audiencePermissionNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取在线的用户id
|
||||
* @return Set
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Set<String> getOnlineUser() {
|
||||
return this.userList.stream().filter(JointTrainingUserNewVO::isInRoom).map(JointTrainingUserNewVO::getIdStr).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Set<String> getSimulationUser() {
|
||||
return this.userList.stream().filter(JointTrainingUserNewVO::isInSimulation).map(JointTrainingUserNewVO::getIdStr).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public static JointTrainingRoomNewVO db2VO(SimulationRoom simulationRoom) {
|
||||
JointTrainingRoomNewVO roomVO = new JointTrainingRoomNewVO();
|
||||
roomVO.setId(simulationRoom.getId());
|
||||
roomVO.setMapId(simulationRoom.getMapId());
|
||||
roomVO.setPrdType(simulationRoom.getPrdType());
|
||||
roomVO.setGroup(simulationRoom.getCode());
|
||||
roomVO.setRoomName(simulationRoom.getName());
|
||||
roomVO.setPermissionNum(simulationRoom.getRolePermitAmount());
|
||||
roomVO.setAudiencePermissionNum(simulationRoom.getAudiencePermitAmount());
|
||||
roomVO.setState(simulationRoom.getStatus());
|
||||
return roomVO;
|
||||
}
|
||||
|
||||
public static SimulationRoom vo2DB(JointTrainingRoomNewVO jointTrainingRoomVO) {
|
||||
SimulationRoom simulationRoom = new SimulationRoom();
|
||||
simulationRoom.setId(jointTrainingRoomVO.getId());
|
||||
simulationRoom.setMapId(jointTrainingRoomVO.getMapId());
|
||||
simulationRoom.setPrdType(jointTrainingRoomVO.getPrdType());
|
||||
simulationRoom.setCode(jointTrainingRoomVO.getGroup());
|
||||
simulationRoom.setName(jointTrainingRoomVO.getRoomName());
|
||||
simulationRoom.setRolePermitAmount(jointTrainingRoomVO.getPermissionNum());
|
||||
simulationRoom.setAudiencePermitAmount(jointTrainingRoomVO.getAudiencePermissionNum());
|
||||
simulationRoom.setCreatorId(jointTrainingRoomVO.getCreatorId());
|
||||
simulationRoom.setCreateTime(LocalDateTime.now());
|
||||
simulationRoom.setStatus(jointTrainingRoomVO.getState());
|
||||
|
||||
return simulationRoom;
|
||||
}
|
||||
|
||||
public JointTrainingRoomDeviceVO findRoomDevice(Long id) {
|
||||
if (!CollectionUtils.isEmpty(this.deviceList)) {
|
||||
for (JointTrainingRoomDeviceVO temp : this.deviceList) {
|
||||
if (Objects.equals(temp.getId(), id)) {
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addRoomDevice(JointTrainingRoomDeviceVO roomDevice) {
|
||||
if (!this.deviceList.contains(roomDevice)) {
|
||||
this.deviceList.add(roomDevice);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteRoomDevice(Long id) {
|
||||
JointTrainingRoomDeviceVO roomDevice = this.findRoomDevice(id);
|
||||
if (Objects.nonNull(roomDevice)) {
|
||||
this.deviceList.remove(roomDevice);
|
||||
}
|
||||
}
|
||||
|
||||
public RoomSimulationRealDeviceVO findRoomRealDeviceConnectConfig(Long projectDeviceId) {
|
||||
if (!CollectionUtils.isEmpty(this.realDeviceList)) {
|
||||
for (RoomSimulationRealDeviceVO realDeviceVO : this.realDeviceList) {
|
||||
if (Objects.equals(realDeviceVO.getProjectDeviceId(), projectDeviceId)) {
|
||||
return realDeviceVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addRoomRealDevice(RoomSimulationRealDeviceVO realDevice) {
|
||||
this.realDeviceList.add(realDevice);
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class JointTrainingRoomRequestVO {
|
||||
@NotNull(message = "地图id不能为空")
|
||||
private Long mapId;
|
||||
|
||||
@NotBlank(message = "产品类型不能为空")
|
||||
private String prdType;
|
||||
}
|
|
@ -1,213 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.joylink.base.exception.BusinessException;
|
||||
import com.joylink.base.exception.constant.ExceptionMapping;
|
||||
import club.joylink.rtss.entity.SimulationRoom;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
import club.joylink.rtss.vo.client.room.RoomSimulationRealDeviceVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "综合演练房间对象")
|
||||
public class JointTrainingRoomVO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long mapId;
|
||||
|
||||
@JsonIgnore
|
||||
private MapVO mapVO;
|
||||
|
||||
private String mapName;
|
||||
|
||||
private String prdType;
|
||||
|
||||
private String group;
|
||||
|
||||
private String roomName;
|
||||
|
||||
private JointTrainingUserVO creator;
|
||||
|
||||
@ApiModelProperty(value = "可分配角色权限数量")
|
||||
private int permissionNum;
|
||||
|
||||
@ApiModelProperty(value = "观众权限数量")
|
||||
private int audiencePermissionNum;
|
||||
|
||||
@JsonIgnore
|
||||
private List<JointTrainingUserVO> userList;
|
||||
|
||||
@JsonIgnore
|
||||
private List<JointTrainingRoomDeviceVO> deviceList;
|
||||
|
||||
@JsonIgnore
|
||||
private List<RoomSimulationRealDeviceVO> realDeviceList;
|
||||
|
||||
private String state;
|
||||
|
||||
public JointTrainingRoomVO(MapVO mapVO, String prdType, String group, String roomName,
|
||||
int permissionNum, int audiencePermissionNum, String state) {
|
||||
this.mapVO = mapVO;
|
||||
this.mapId = mapVO.getId();
|
||||
this.mapName = mapVO.getName();
|
||||
this.prdType = prdType;
|
||||
this.group = group;
|
||||
this.roomName = roomName;
|
||||
this.permissionNum = permissionNum;
|
||||
this.audiencePermissionNum = audiencePermissionNum;
|
||||
this.state = state;
|
||||
this.userList = Collections.synchronizedList(new ArrayList<>(permissionNum + audiencePermissionNum));
|
||||
this.deviceList = new ArrayList<>();
|
||||
this.realDeviceList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static List<SimulationVO> convert2SimulationVOs(List<JointTrainingRoomVO> oldRoomList) {
|
||||
List<SimulationVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(oldRoomList)) {
|
||||
for (JointTrainingRoomVO roomVO : oldRoomList) {
|
||||
voList.add(SimulationVO.builder()
|
||||
.creator(roomVO.getCreatorUser())
|
||||
.group(roomVO.group)
|
||||
.map(roomVO.getMapVO())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
private UserVO getCreatorUser() {
|
||||
UserVO userVO = new UserVO();
|
||||
userVO.setId(this.getCreator().getId());
|
||||
userVO.setName(this.getCreator().getName());
|
||||
userVO.setNickname(this.getCreator().getNickName());
|
||||
return userVO;
|
||||
}
|
||||
|
||||
public Long getCreatorId() {
|
||||
return this.getCreator().getId();
|
||||
}
|
||||
|
||||
public JointTrainingUserVO getUserById(Long id) {
|
||||
for (JointTrainingUserVO userVO : this.userList) {
|
||||
if (id.equals(userVO.getId())) {
|
||||
return userVO;
|
||||
}
|
||||
}
|
||||
throw new BusinessException(ExceptionMapping.ILLEGAL_OPERATION, String.format("用户‘%s’不存在", id));
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public int getTotalPermissionNum() {
|
||||
return this.permissionNum + this.audiencePermissionNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取在线的用户id
|
||||
* @return Set
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Set<String> getOnlineUser() {
|
||||
return this.userList.stream().filter(JointTrainingUserVO::isInRoom).map(JointTrainingUserVO::getIdStr).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Set<String> getSimulationUser() {
|
||||
return this.userList.stream().filter(JointTrainingUserVO::isInSimulation).map(JointTrainingUserVO::getIdStr).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取有角色的用户列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public List<JointTrainingUserVO> getRoleUsers() {
|
||||
return this.userList.stream().filter(JointTrainingUserVO::isNotAudience).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static JointTrainingRoomVO db2VO(SimulationRoom simulationRoom) {
|
||||
JointTrainingRoomVO roomVO = new JointTrainingRoomVO();
|
||||
roomVO.setId(simulationRoom.getId());
|
||||
roomVO.setMapId(simulationRoom.getMapId());
|
||||
roomVO.setPrdType(simulationRoom.getPrdType());
|
||||
roomVO.setGroup(simulationRoom.getCode());
|
||||
roomVO.setRoomName(simulationRoom.getName());
|
||||
roomVO.setPermissionNum(simulationRoom.getRolePermitAmount());
|
||||
roomVO.setAudiencePermissionNum(simulationRoom.getAudiencePermitAmount());
|
||||
roomVO.setState(simulationRoom.getStatus());
|
||||
return roomVO;
|
||||
}
|
||||
|
||||
public static SimulationRoom vo2DB(JointTrainingRoomVO jointTrainingRoomVO) {
|
||||
SimulationRoom simulationRoom = new SimulationRoom();
|
||||
simulationRoom.setId(jointTrainingRoomVO.getId());
|
||||
simulationRoom.setMapId(jointTrainingRoomVO.getMapId());
|
||||
simulationRoom.setPrdType(jointTrainingRoomVO.getPrdType());
|
||||
simulationRoom.setCode(jointTrainingRoomVO.getGroup());
|
||||
simulationRoom.setName(jointTrainingRoomVO.getRoomName());
|
||||
simulationRoom.setRolePermitAmount(jointTrainingRoomVO.getPermissionNum());
|
||||
simulationRoom.setAudiencePermitAmount(jointTrainingRoomVO.getAudiencePermissionNum());
|
||||
simulationRoom.setCreatorId(jointTrainingRoomVO.getCreatorId());
|
||||
simulationRoom.setCreateTime(LocalDateTime.now());
|
||||
simulationRoom.setStatus(jointTrainingRoomVO.getState());
|
||||
|
||||
return simulationRoom;
|
||||
}
|
||||
|
||||
public JointTrainingRoomDeviceVO findRoomDevice(Long id) {
|
||||
if (!CollectionUtils.isEmpty(this.deviceList)) {
|
||||
for (JointTrainingRoomDeviceVO temp : this.deviceList) {
|
||||
if (Objects.equals(temp.getId(), id)) {
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addRoomDevice(JointTrainingRoomDeviceVO roomDevice) {
|
||||
if (!this.deviceList.contains(roomDevice)) {
|
||||
this.deviceList.add(roomDevice);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteRoomDevice(Long id) {
|
||||
JointTrainingRoomDeviceVO roomDevice = this.findRoomDevice(id);
|
||||
if (Objects.nonNull(roomDevice)) {
|
||||
this.deviceList.remove(roomDevice);
|
||||
}
|
||||
}
|
||||
|
||||
public RoomSimulationRealDeviceVO findRoomRealDeviceConnectConfig(Long projectDeviceId) {
|
||||
if (!CollectionUtils.isEmpty(this.realDeviceList)) {
|
||||
for (RoomSimulationRealDeviceVO realDeviceVO : this.realDeviceList) {
|
||||
if (Objects.equals(realDeviceVO.getProjectDeviceId(), projectDeviceId)) {
|
||||
return realDeviceVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addRoomRealDevice(RoomSimulationRealDeviceVO realDevice) {
|
||||
this.realDeviceList.add(realDevice);
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.entity.SimulationRoomMember;
|
||||
import club.joylink.rtss.entity.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "综合演练用户对象")
|
||||
public class JointTrainingUserNewVO extends BaseUserVO {
|
||||
|
||||
private SimulationMember.Type userType;
|
||||
|
||||
private String deviceCode;
|
||||
|
||||
private String ibpPart;
|
||||
|
||||
private boolean inRoom;
|
||||
|
||||
private boolean inSimulation;
|
||||
|
||||
private boolean delete;
|
||||
|
||||
public JointTrainingUserNewVO(Long id, String wxId, String name, String nickName) {
|
||||
super(id, wxId, name, nickName);
|
||||
}
|
||||
|
||||
public static SimulationRoomMember vo2DB(JointTrainingUserNewVO jointTrainingUserVO) {
|
||||
SimulationRoomMember member = new SimulationRoomMember();
|
||||
member.setUserId(jointTrainingUserVO.getId());
|
||||
member.setNickName(jointTrainingUserVO.getNickName());
|
||||
member.setRole(jointTrainingUserVO.getUserType().name());
|
||||
member.setDeviceCode(jointTrainingUserVO.getDeviceCode());
|
||||
member.setIbpPart(jointTrainingUserVO.getIbpPart());
|
||||
member.setInRoom(jointTrainingUserVO.isInRoom());
|
||||
member.setInSimulation(jointTrainingUserVO.isInSimulation());
|
||||
return member;
|
||||
}
|
||||
|
||||
public static JointTrainingUserNewVO db2VO(SimulationRoomMember simulationRoomMember, SysUser user) {
|
||||
JointTrainingUserNewVO trainingUserVO = new JointTrainingUserNewVO();
|
||||
trainingUserVO.setId(simulationRoomMember.getUserId());
|
||||
trainingUserVO.setNickName(simulationRoomMember.getNickName());
|
||||
if(Objects.isNull(user)) {
|
||||
trainingUserVO.setDelete(true);
|
||||
} else {
|
||||
trainingUserVO.setName(user.getName());
|
||||
trainingUserVO.setWxId(user.getWxId());
|
||||
}
|
||||
trainingUserVO.setUserType(SimulationMember.Type.valueOf(simulationRoomMember.getRole().toUpperCase()));
|
||||
trainingUserVO.setDeviceCode(simulationRoomMember.getDeviceCode());
|
||||
trainingUserVO.setIbpPart(simulationRoomMember.getIbpPart());
|
||||
return trainingUserVO;
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.entity.SimulationRoomMember;
|
||||
import club.joylink.rtss.entity.SysUser;
|
||||
import club.joylink.rtss.simulation.member.MemberRoleEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "综合演练用户对象")
|
||||
public class JointTrainingUserVO extends BaseUserVO {
|
||||
|
||||
private MemberRoleEnum userRole;
|
||||
|
||||
private String deviceCode;
|
||||
|
||||
private String ibpPart;
|
||||
|
||||
private boolean inRoom;
|
||||
|
||||
private boolean inSimulation;
|
||||
|
||||
private boolean delete;
|
||||
|
||||
public JointTrainingUserVO(Long id, String wxId, String name, String nickName) {
|
||||
super(id, wxId, name, nickName);
|
||||
}
|
||||
|
||||
public JointTrainingUserVO(JointTrainingUserNewVO newVO) {
|
||||
this(newVO.getId(), newVO.getWxId(), newVO.getName(), newVO.getNickName());
|
||||
this.userRole = MemberRoleEnum.valueOf(newVO.getUserType().name());
|
||||
this.deviceCode = newVO.getDeviceCode();
|
||||
this.ibpPart = newVO.getIbpPart();
|
||||
this.inRoom = newVO.isInRoom();
|
||||
this.inSimulation = newVO.isInSimulation();
|
||||
this.delete = newVO.isDelete();
|
||||
}
|
||||
|
||||
public boolean isNotAudience() {
|
||||
return !MemberRoleEnum.Audience.equals(this.userRole);
|
||||
}
|
||||
|
||||
public static SimulationRoomMember vo2DB(JointTrainingUserVO jointTrainingUserVO) {
|
||||
SimulationRoomMember member = new SimulationRoomMember();
|
||||
member.setUserId(jointTrainingUserVO.getId());
|
||||
member.setNickName(jointTrainingUserVO.getNickName());
|
||||
member.setRole(jointTrainingUserVO.getUserRole().name());
|
||||
member.setDeviceCode(jointTrainingUserVO.getDeviceCode());
|
||||
member.setIbpPart(jointTrainingUserVO.getIbpPart());
|
||||
member.setInRoom(jointTrainingUserVO.isInRoom());
|
||||
member.setInSimulation(jointTrainingUserVO.isInSimulation());
|
||||
return member;
|
||||
}
|
||||
|
||||
public static JointTrainingUserVO db2VO(SimulationRoomMember simulationRoomMember, SysUser user) {
|
||||
JointTrainingUserVO trainingUserVO = new JointTrainingUserVO();
|
||||
trainingUserVO.setId(simulationRoomMember.getUserId());
|
||||
trainingUserVO.setNickName(simulationRoomMember.getNickName());
|
||||
if(Objects.isNull(user)) {
|
||||
trainingUserVO.setDelete(true);
|
||||
} else {
|
||||
trainingUserVO.setName(user.getName());
|
||||
trainingUserVO.setWxId(user.getWxId());
|
||||
}
|
||||
trainingUserVO.setUserRole(MemberRoleEnum.valueOf(simulationRoomMember.getRole()));
|
||||
trainingUserVO.setDeviceCode(simulationRoomMember.getDeviceCode());
|
||||
trainingUserVO.setIbpPart(simulationRoomMember.getIbpPart());
|
||||
return trainingUserVO;
|
||||
}
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.simulation.data.command.Command;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@ApiModel(value = "仿真指令对象")
|
||||
public class MapDeviceChangeVO {
|
||||
|
||||
/**
|
||||
* 操作序号
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Integer order;
|
||||
|
||||
/**
|
||||
* 车站/集中站 编号
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private String stationCode;
|
||||
|
||||
/**
|
||||
* 设备的唯一编码
|
||||
*/
|
||||
@ApiModelProperty(value = "设备唯一编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 设备类型码
|
||||
*/
|
||||
@ApiModelProperty(value = "设备类型码")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 操作码
|
||||
*/
|
||||
@ApiModelProperty(value = "事件操作码")
|
||||
private String operation;
|
||||
|
||||
/**
|
||||
* 操作返回值
|
||||
*/
|
||||
@ApiModelProperty(value = "携带的参数(若有多个,用::分隔开)")
|
||||
private String param;
|
||||
|
||||
/**
|
||||
* 发送指令的成员
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 发送指令用户
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private UserVO userVO;
|
||||
|
||||
public MapDeviceChangeVO() {}
|
||||
|
||||
public MapDeviceChangeVO(Command command) {
|
||||
this.code = command.getCode();
|
||||
this.type = command.getType();
|
||||
this.operation = command.getEvent();
|
||||
this.param = command.getParam();
|
||||
this.memberId = command.getFromMember().getId();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.entity.SimulationConversationMember;
|
||||
import club.joylink.rtss.simulation.data.DeviceType;
|
||||
import club.joylink.rtss.simulation.data.device.MapDevice;
|
||||
import club.joylink.rtss.simulation.data.device.Station;
|
||||
import club.joylink.rtss.simulation.data.device.Train;
|
||||
import club.joylink.rtss.simulation.member.Member;
|
||||
import club.joylink.rtss.simulation.member.MemberRoleEnum;
|
||||
import club.joylink.rtss.util.RandomGenerator;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
public class SimulationMemberVO {
|
||||
|
||||
private String id;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
private String name;
|
||||
|
||||
private SimulationMember.Gender gender;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private MemberRoleEnum role;
|
||||
|
||||
private String deviceType;
|
||||
|
||||
private String deviceCode;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
@Setter
|
||||
private boolean online;
|
||||
|
||||
public SimulationMemberVO(JointTrainingUserVO jtUser, MapDevice device) {
|
||||
this.id = RandomGenerator.uuid();
|
||||
if(Objects.nonNull(jtUser)) {
|
||||
this.userId = jtUser.getId();
|
||||
this.name = jtUser.getName();
|
||||
this.nickName = jtUser.getNickName();
|
||||
this.role = jtUser.getUserRole();
|
||||
}
|
||||
if(Objects.nonNull(device)) {
|
||||
if(device._type.equals(DeviceType.Station)) {
|
||||
Station station = (Station) device;
|
||||
this.role = MemberRoleEnum.Attendant;
|
||||
this.deviceName = station.getName();
|
||||
} else if(device._type.equals(DeviceType.Train)) {
|
||||
Train train = (Train) device;
|
||||
this.role = MemberRoleEnum.Driver;
|
||||
this.deviceName = train.getGroupNumber();
|
||||
}
|
||||
this.deviceType = device._type.name();
|
||||
this.deviceCode = device.getCode();
|
||||
}
|
||||
}
|
||||
|
||||
public SimulationMemberVO(SimulationConversationMember member) {
|
||||
this.role = MemberRoleEnum.valueOf(member.getRole());
|
||||
this.userId = member.getUserId();
|
||||
this.name = member.getName();
|
||||
this.nickName = member.getNickName();
|
||||
this.deviceCode = member.getDeviceCode();
|
||||
this.deviceType = member.getDeviceType();
|
||||
}
|
||||
|
||||
public SimulationMemberVO(Member member) {
|
||||
this.id = member.getId();
|
||||
this.userId = member.getUserId();
|
||||
this.name = member.getName();
|
||||
this.nickName = member.getNickName();
|
||||
this.role = member.getRole();
|
||||
MapDevice device = member.getDevice();
|
||||
if(Objects.nonNull(device)) {
|
||||
this.deviceType = device._type.name();
|
||||
this.deviceCode = device.getCode();
|
||||
this.deviceName = device.getName();
|
||||
}
|
||||
this.online = member.isOnline();
|
||||
}
|
||||
|
||||
public static List<SimulationMemberVO> convert2VOList(Collection<Member> memberList) {
|
||||
List<SimulationMemberVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(memberList)) {
|
||||
memberList.forEach(member -> voList.add(new SimulationMemberVO(member)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public SimulationConversationMember convert2DB() {
|
||||
SimulationConversationMember conversationMember = new SimulationConversationMember();
|
||||
conversationMember.setRole(this.getRole().name());
|
||||
conversationMember.setUserId(this.getUserId());
|
||||
conversationMember.setName(this.getName());
|
||||
conversationMember.setNickName(this.getNickName());
|
||||
conversationMember.setDeviceType(this.getDeviceType());
|
||||
conversationMember.setDeviceCode(this.getDeviceCode());
|
||||
return conversationMember;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
SimulationMemberVO memberVO = (SimulationMemberVO) o;
|
||||
return Objects.equals(getUserId(), memberVO.getUserId()) &&
|
||||
Objects.equals(role, memberVO.role) &&
|
||||
Objects.equals(deviceType, memberVO.deviceType) &&
|
||||
Objects.equals(deviceCode, memberVO.deviceCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getUserId(), role, deviceType, deviceCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否机器人
|
||||
* @return
|
||||
*/
|
||||
public boolean isRobot() {
|
||||
return Objects.isNull(this.getUserId());
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import club.joylink.rtss.entity.SimulationRecord;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "仿真记录对象")
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class SimulationRecordVO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 地图id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@ApiModelProperty(value = "地图id")
|
||||
private String mapId;
|
||||
|
||||
/**
|
||||
* 地图名称
|
||||
*/
|
||||
@ApiModelProperty(value = "地图名称")
|
||||
private String mapName;
|
||||
|
||||
@ApiModelProperty(value = "产品类型")
|
||||
private String prdType;
|
||||
|
||||
/**
|
||||
* 创建用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户id")
|
||||
private String creatorId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 销毁时间
|
||||
*/
|
||||
@ApiModelProperty(value = "销毁时间")
|
||||
private LocalDateTime destroyTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
public SimulationRecordVO(SimulationRecord record) {
|
||||
this.setId(ConvertUtil.long2Str(record.getId()));
|
||||
this.setMapId(ConvertUtil.long2Str(record.getMapId()));
|
||||
this.setMapName(record.getMapName());
|
||||
this.setPrdType(record.getPrdType());
|
||||
this.setCreatorId(ConvertUtil.long2Str(record.getCreatorId()));
|
||||
this.setCreateTime(record.getCreateTime());
|
||||
this.setDestroyTime(record.getDestroyTime());
|
||||
this.setStatus(record.getStatus());
|
||||
}
|
||||
|
||||
public static List<SimulationRecordVO> convert2VOList(List<SimulationRecord> list) {
|
||||
List<SimulationRecordVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(record -> voList.add(new SimulationRecordVO(record)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import club.joylink.rtss.simulation.Simulation;
|
||||
import club.joylink.rtss.simulation.constant.SimulationType;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "仿真")
|
||||
public class SimulationVO {
|
||||
|
||||
@ApiModelProperty(value = "仿真group")
|
||||
private String group;
|
||||
|
||||
@ApiModelProperty(value = "皮肤编号")
|
||||
private String skinCode;
|
||||
|
||||
@ApiModelProperty(value = "仿真类型")
|
||||
private SimulationType type;
|
||||
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private UserVO creator;
|
||||
|
||||
@ApiModelProperty(value = "产品类型")
|
||||
private String prdType;
|
||||
|
||||
@ApiModelProperty(value = "仿真是否按计划行车")
|
||||
private boolean runAsPlan;
|
||||
|
||||
@ApiModelProperty(value = "仿真是否暂停")
|
||||
private boolean pause;
|
||||
|
||||
@ApiModelProperty(value = "仿真是否错误")
|
||||
private boolean error;
|
||||
|
||||
@ApiModelProperty(value = "仿真任务是否加载")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long questId;
|
||||
|
||||
@ApiModelProperty(value = "在仿真中的用户id列表")
|
||||
private List<String> sessionList;
|
||||
|
||||
public SimulationVO(Simulation simulation) {
|
||||
this.group = simulation.getGroup();
|
||||
this.skinCode = simulation.getSkinCode();
|
||||
this.type = simulation.getType();
|
||||
this.creator = simulation.getUserVO();
|
||||
this.prdType = simulation.getPrdType();
|
||||
this.runAsPlan = simulation.isRunAsPlan();
|
||||
this.pause = simulation.isPause();
|
||||
this.error = simulation.isError();
|
||||
if(Objects.nonNull(simulation.getQuest()) && !SimulationType.ScriptWrite.equals(simulation.getType())) {
|
||||
this.questId = simulation.getQuest().getId();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<SimulationVO> convert2VOList(List<Simulation> list) {
|
||||
List<SimulationVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(simulation -> voList.add(new SimulationVO(simulation)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.entity.Task;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "任务对象")
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class TaskListVO {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "参数")
|
||||
private String parameter;
|
||||
|
||||
@ApiModelProperty(value = "皮肤风格")
|
||||
private String skinStyle;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "结果")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "完成时间")
|
||||
private Date finishTime;
|
||||
|
||||
public TaskListVO(Task task) {
|
||||
this.id = ConvertUtil.long2Str(task.getId());
|
||||
this.name = task.getName();
|
||||
this.parameter = task.getParameter();
|
||||
this.type = task.getType();
|
||||
this.status = task.getStatus();
|
||||
this.result = task.getResult();
|
||||
this.createTime = task.getCreateTime();
|
||||
this.startTime = task.getStartTime();
|
||||
this.finishTime = task.getFinishTime();
|
||||
}
|
||||
|
||||
public static List<TaskListVO> convert2VOList(List<Task> list) {
|
||||
List<TaskListVO> taskListVOList = new ArrayList<>();
|
||||
list.forEach(task -> taskListVOList.add(new TaskListVO(task)));
|
||||
return taskListVOList;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ApiModel(value = "任务查询对象")
|
||||
@Getter
|
||||
@Setter
|
||||
public class TaskQueryVO extends PageQueryVO {
|
||||
|
||||
// @ApiModelProperty(value = "名称")
|
||||
// private String name;
|
||||
|
||||
// @ApiModelProperty(value = "类型")
|
||||
// private String type;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "地图id")
|
||||
private Long mapId;
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package club.joylink.rtss.vo.client;
|
||||
|
||||
import club.joylink.rtss.entity.Task;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@ApiModel(value = "任务对象")
|
||||
@Getter
|
||||
@Setter
|
||||
public class TaskVO {
|
||||
|
||||
// @ApiModelProperty(value = "名称")
|
||||
// @NotBlank(message = "名称不能为空")
|
||||
// private String name;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@NotBlank(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "参数")
|
||||
@NotBlank(message = "参数不能为空")
|
||||
private String parameter;
|
||||
|
||||
public Task convert2DB() {
|
||||
Task task = new Task();
|
||||
// task.setName(this.getName());
|
||||
task.setType(this.getType());
|
||||
task.setParameter(this.getParameter());
|
||||
return task;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package club.joylink.rtss.vo.client.runplan;
|
||||
|
||||
import club.joylink.rtss.entity.MpStationRunning;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
|
@ -17,7 +18,8 @@ import java.util.stream.Collectors;
|
|||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class MapStationRunningVO {
|
||||
private String id;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "起始车站")
|
||||
private String startStationCode;
|
||||
|
@ -40,7 +42,7 @@ public class MapStationRunningVO {
|
|||
private RunPlanLevelVO runPlanLevelVO;
|
||||
|
||||
public MapStationRunningVO (MpStationRunning stationRunning) {
|
||||
this.id = ConvertUtil.long2Str(stationRunning.getId());
|
||||
this.id = stationRunning.getId();
|
||||
this.startStationCode = stationRunning.getStartStationCode();
|
||||
this.startSectionCode = stationRunning.getStartSectionCode();
|
||||
this.endStationCode = stationRunning.getEndStationCode();
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package club.joylink.rtss.vo.client.runplan;
|
||||
|
||||
import club.joylink.rtss.entity.RunPlanLevel;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import club.joylink.rtss.entity.RunPlanLevel;
|
||||
import club.joylink.rtss.util.ConvertUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -14,20 +13,20 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static club.joylink.rtss.util.ConvertUtil.long2Str;
|
||||
|
||||
@ApiModel(value = "运行等级对象")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class RunPlanLevelVO {
|
||||
|
||||
private String id;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 站间运行ID
|
||||
*/
|
||||
private String stationRunningId;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long stationRunningId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
|
@ -61,8 +60,8 @@ public class RunPlanLevelVO {
|
|||
private Integer level5;
|
||||
|
||||
public RunPlanLevelVO(RunPlanLevel level) {
|
||||
this.id = long2Str(level.getId());
|
||||
this.stationRunningId = long2Str(level.getStationRunningId());
|
||||
this.id = level.getId();
|
||||
this.stationRunningId = level.getStationRunningId();
|
||||
this.userId = level.getUserId();
|
||||
this.level1 = level.getLevel1();
|
||||
this.level2 = level.getLevel2();
|
||||
|
@ -73,7 +72,7 @@ public class RunPlanLevelVO {
|
|||
|
||||
public RunPlanLevel convert2DB() {
|
||||
RunPlanLevel level = new RunPlanLevel();
|
||||
level.setStationRunningId(ConvertUtil.str2Long(this.getStationRunningId()));
|
||||
level.setStationRunningId(this.getStationRunningId());
|
||||
level.setUserId(this.getUserId());
|
||||
level.setLevel1(this.getLevel1());
|
||||
level.setLevel2(this.getLevel2());
|
||||
|
@ -84,7 +83,7 @@ public class RunPlanLevelVO {
|
|||
}
|
||||
|
||||
public boolean compareToDB(RunPlanLevel level) {
|
||||
return (Objects.equals(ConvertUtil.str2Long(this.getStationRunningId()), level.getStationRunningId()) &&
|
||||
return (Objects.equals(this.getStationRunningId(), level.getStationRunningId()) &&
|
||||
Objects.equals(this.getUserId(), level.getUserId())) && (
|
||||
!Objects.equals(this.getLevel1(), level.getLevel1()) ||
|
||||
!Objects.equals(this.getLevel2(), level.getLevel2()) ||
|
||||
|
|
|
@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
@ -18,7 +17,6 @@ public class RunPlanServiceConfigVO {
|
|||
|
||||
@ApiModelProperty(value = "表号")
|
||||
@NotBlank
|
||||
@Length(min = 2, max = 3)
|
||||
private String serviceNumber;
|
||||
|
||||
@Valid
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.scheduling;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "派班计划冲突检查结果")
|
||||
public class SchedulingCheckResult {
|
||||
|
||||
@ApiModelProperty(value = "检查是否通过")
|
||||
private boolean pass;
|
||||
|
||||
@ApiModelProperty(value = "冲突列表")
|
||||
private List<List<Long>> conflictList;
|
||||
|
||||
public SchedulingCheckResult(boolean pass, List<List<Long>> conflictList) {
|
||||
this.pass = pass;
|
||||
this.conflictList = conflictList;
|
||||
}
|
||||
|
||||
public static SchedulingCheckResult buildSuccess() {
|
||||
return new SchedulingCheckResult(true, null);
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.scheduling;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "派班计划")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class SchedulingPlanVO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "计划日期")
|
||||
private LocalDate planDate;
|
||||
|
||||
@ApiModelProperty(value = "运行图名称")
|
||||
private String runPlanName;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "列车派班列表")
|
||||
private List<SchedulingTrainEditVO> planList;
|
||||
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.scheduling;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import club.joylink.rtss.simulation.data.runPlan.RunDiagramTrip;
|
||||
import club.joylink.rtss.simulation.scheduling.SchedulingTrain;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "派班计划列车编辑")
|
||||
public class SchedulingTrainEditVO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "列车车组号")
|
||||
private String groupNumber;
|
||||
|
||||
@ApiModelProperty(value = "列车编码", required = true)
|
||||
@NotBlank(message = "列车编码不能为空")
|
||||
private String trainCode;
|
||||
|
||||
@ApiModelProperty(value = "司机号")
|
||||
private String driverCode;
|
||||
|
||||
@ApiModelProperty(value = "上线服务号")
|
||||
private String onlineServerNumber;
|
||||
|
||||
@ApiModelProperty(value = "上线车次号")
|
||||
private String onlineTripNumber;
|
||||
|
||||
@ApiModelProperty(value = "上线方向码")
|
||||
private String onlineDirectionCode;
|
||||
|
||||
@ApiModelProperty(value = "下线服务号")
|
||||
private String offlineServerNumber;
|
||||
|
||||
@ApiModelProperty(value = "下线车次号")
|
||||
private String offlineTripNumber;
|
||||
|
||||
@ApiModelProperty(value = "下线方向码")
|
||||
private String offlineDirectionCode;
|
||||
|
||||
@ApiModelProperty(value = "出库段")
|
||||
private String outDepot;
|
||||
|
||||
@ApiModelProperty(value = "出库状态")
|
||||
private boolean outStatus;
|
||||
|
||||
@ApiModelProperty(value = "回库段")
|
||||
private String inDepot;
|
||||
|
||||
@ApiModelProperty(value = "回库状态")
|
||||
private boolean inStatus;
|
||||
|
||||
@ApiModelProperty(value = "上线轨")
|
||||
private String onlineSection;
|
||||
|
||||
@ApiModelProperty(value = "上线时间")
|
||||
private LocalTime onlineTime;
|
||||
|
||||
@ApiModelProperty(value = "上线目的地")
|
||||
private String onlineTargetNumber;
|
||||
|
||||
@ApiModelProperty(value = "下线轨")
|
||||
private String offlineSection;
|
||||
|
||||
@ApiModelProperty(value = "下线时间")
|
||||
private LocalTime offlineTime;
|
||||
|
||||
@ApiModelProperty(value = "下线目的地")
|
||||
private String offlineTargetNumber;
|
||||
|
||||
public SchedulingTrainEditVO(SchedulingTrain plan, RunDiagramTrip onlineTrip, RunDiagramTrip offlineTrip) {
|
||||
this.id = plan.getId();
|
||||
this.groupNumber = plan.getGroupNumber();
|
||||
this.trainCode = plan.getTrainCode();
|
||||
this.driverCode = plan.getDriverCode();
|
||||
this.onlineServerNumber = plan.getOnlineServerNumber();
|
||||
this.onlineTripNumber = plan.getOnlineTripNumber();
|
||||
this.onlineDirectionCode = plan.getOnlineDirectionCode();
|
||||
this.offlineServerNumber = plan.getOfflineServerNumber();
|
||||
this.offlineTripNumber = plan.getOfflineTripNumber();
|
||||
this.offlineDirectionCode = plan.getOfflineDirectionCode();
|
||||
|
||||
this.outDepot = Objects.nonNull(onlineTrip.getStartSection().getRelStand()) ?
|
||||
onlineTrip.getStartSection().getRelStand().getStation().getName() : "";
|
||||
this.outStatus = false;
|
||||
this.onlineSection = onlineTrip.getStartSection().getName();
|
||||
this.onlineTime = onlineTrip.getFirstPlan().getCorrectArriveTime();
|
||||
this.onlineTargetNumber = onlineTrip.getStartSection().getDestinationCode();
|
||||
|
||||
this.inDepot = Objects.nonNull(offlineTrip.getEndSection().getRelStand()) ?
|
||||
offlineTrip.getEndSection().getRelStand().getStation().getName() : "";
|
||||
this.inStatus = false;
|
||||
this.offlineSection = offlineTrip.getEndSection().getName();
|
||||
this.offlineTime = offlineTrip.getFirstPlan().getCorrectArriveTime();
|
||||
this.offlineTargetNumber = offlineTrip.getEndSection().getDestinationCode();
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.scheduling;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@ApiModel(value = "派班计划-每辆列车出库计划")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class SchedulingTrainVO {
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.scheduling;
|
||||
|
||||
import club.joylink.rtss.simulation.data.device.Train;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "列车基础信息")
|
||||
public class TrainBaseInfoVO {
|
||||
|
||||
@ApiModelProperty(value = "列车唯一编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "列车车组号")
|
||||
private String groupNumber;
|
||||
|
||||
public TrainBaseInfoVO(Train train) {
|
||||
this.code = train.getCode();
|
||||
this.groupNumber = train.getGroupNumber();
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "批量连接设备结果")
|
||||
public class BatchConnectDeviceResult {
|
||||
|
||||
@ApiModelProperty(value = "总数")
|
||||
private Integer total;
|
||||
|
||||
@ApiModelProperty(value = "成功数量")
|
||||
private Integer success;
|
||||
|
||||
@ApiModelProperty(value = "连接失败的设备编码列表")
|
||||
private List<String> failList;
|
||||
|
||||
public BatchConnectDeviceResult(Integer total, Integer success, List<String> failList) {
|
||||
this.total = total;
|
||||
this.success = success;
|
||||
this.failList = failList;
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "IBP盘按钮操作")
|
||||
public class IBPOperation {
|
||||
|
||||
@ApiModelProperty(value = "车站编码")
|
||||
@NotBlank(message = "车站编码不能为空")
|
||||
private String stationCode;
|
||||
|
||||
@ApiModelProperty(value = "操作类型")
|
||||
@NotBlank(message = "操作类型不能为空")
|
||||
private String operate;
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import club.joylink.rtss.simulation.constant.SimulationType;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@ApiModel(value = "仿真分页查询对象")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class SimulationPageQueryVO extends PageQueryVO {
|
||||
|
||||
@ApiModelProperty(value = "仿真group")
|
||||
private String group;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "皮肤编号")
|
||||
private String skinCode;
|
||||
|
||||
@ApiModelProperty(value = "仿真类型")
|
||||
private SimulationType type;
|
||||
|
||||
@ApiModelProperty(value = "产品类型")
|
||||
private String prdType;
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "仿真微信语音会话参数")
|
||||
public class SimulationWxChatConversationParam extends SimulationWxChatParam {
|
||||
|
||||
@ApiModelProperty(value = "会话id")
|
||||
private String conversationId;
|
||||
|
||||
public SimulationWxChatConversationParam(MultipartFile file, String lang, String per, String conversationId) {
|
||||
super(file, lang, per);
|
||||
this.conversationId = conversationId;
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "仿真微信语音成员参数")
|
||||
public class SimulationWxChatMemberParam extends SimulationWxChatParam {
|
||||
|
||||
@ApiModelProperty(value = "对话目标成员id")
|
||||
private String memberId;
|
||||
|
||||
public SimulationWxChatMemberParam(MultipartFile file, String lang, String per, String memberId) {
|
||||
super(file, lang, per);
|
||||
this.memberId = memberId;
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package club.joylink.rtss.vo.client.simulation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel(value = "仿真微信会话参数")
|
||||
public class SimulationWxChatParam {
|
||||
|
||||
/**
|
||||
* 语音文件
|
||||
*/
|
||||
@ApiModelProperty(value = "语音文件")
|
||||
private MultipartFile file;
|
||||
|
||||
@ApiModelProperty(value = "语音")
|
||||
private String lang;
|
||||
|
||||
@ApiModelProperty(value = "人声类型(男/女等)")
|
||||
private String per;
|
||||
|
||||
protected SimulationWxChatParam(MultipartFile file, String lang, String per) {
|
||||
this.file = file;
|
||||
this.lang = lang;
|
||||
this.per = per;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package club.joylink.rtss.websocket;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.event.*;
|
||||
import club.joylink.rtss.configuration.WebsocketConfig;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
|
|
Loading…
Reference in New Issue