还原 语音指令

This commit is contained in:
tiger_zhou 2023-04-07 13:16:01 +08:00
parent e63cfbf5ad
commit 723de7ce28
35 changed files with 39 additions and 2657 deletions

View File

@ -152,7 +152,7 @@
<artifactId>mmseg4j-core</artifactId>
<version>1.10.0</version>
</dependency>-->
<dependency>
<!-- <dependency>
<groupId>org.ansj</groupId>
<artifactId>ansj_seg</artifactId>
<version>5.1.6</version>
@ -161,7 +161,7 @@
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
</dependency>
</dependency>-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>

View File

@ -1,47 +0,0 @@
package club.joylink.rtss.configuration;
import club.joylink.rtss.simulation.cbtc.command.voice2.analyse.AnalyseChain;
import club.joylink.rtss.simulation.cbtc.command.voice2.analyse.DefaultPinYinSplitWordAnalyse;
import club.joylink.rtss.simulation.cbtc.command.voice2.analyse.TestAnalye;
import club.joylink.rtss.simulation.cbtc.command.voice2.match.IVoiceCommandMatcher;
import club.joylink.rtss.simulation.cbtc.command.voice2.match.DefaultPinYinViolenceMatch;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.IDeviceWorkHandle;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.device.StandWork;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.device.SwitchWork;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
public class VoiceCommandConfig {
@PostConstruct
private void initAnalyse(){
//加入指令分析
AnalyseChain.addAnalyse(new TestAnalye());
AnalyseChain.addAnalyse(new DefaultPinYinSplitWordAnalyse());
// VoiceCommandAnalyseWork.addAnalyse(new DefaultPinYinSplitWordAnalyse());
}
/**
* 只能注入一次
* @return
*/
@Bean
public IVoiceCommandMatcher matchHandler(){
DefaultPinYinViolenceMatch matchHandler = new DefaultPinYinViolenceMatch();
return matchHandler;
}
@Bean
public IDeviceWorkHandle switchWork(){
return new SwitchWork();
}
@Bean
public IDeviceWorkHandle standWork(){
return new StandWork();
}
}

View File

@ -1,56 +0,0 @@
package club.joylink.rtss.controller.voice;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.services.voice.IVoiceConfigDataService;
import club.joylink.rtss.services.voice.IVoiceTrainingService;
import club.joylink.rtss.services.voice.baidu.TokenHolder;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.competition.VoiceErrorVO;
import club.joylink.rtss.vo.client.voice.VoiceRecognitionResult;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import club.joylink.rtss.vo.voice.VoiceQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 语音AI接口
*/
@RestController
@RequestMapping("/api/voice/cmds/manage")
public class VoiceCommandManageController {
@Autowired
private IVoiceConfigDataService configDataService;
@GetMapping("{id}")
public VoiceConfigDataVO voiceRecognition(@PathVariable(name = "id") Long id) {
return this.configDataService.findById(id);
}
@PostMapping("saveOrUpdate")
public void pagedQueryErrorSet(@RequestBody VoiceConfigDataVO configDataVO, @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO userInfoVO) {
this.configDataService.saveOrUpdate(configDataVO,userInfoVO);
}
@GetMapping("query")
public PageVO<VoiceConfigDataVO> query(@ModelAttribute VoiceQueryVO query){
return this.configDataService.query(query);
}
@GetMapping("change/{id}/{status}")
public void changeStatus(@PathVariable(name="id") Long id, @PathVariable(name = "status") Integer status){
this.configDataService.changeStatus(id,status);
}
@GetMapping("type")
public Map<String, List<OperateEnum>> findType(){
return this.configDataService.findDeviceType();
}
}

View File

@ -1,40 +0,0 @@
package club.joylink.rtss.dao.voice2;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface VoiceDeviceConfig2DAO {
long countByExample(VoiceDeviceConfig2Example example);
int deleteByExample(VoiceDeviceConfig2Example example);
int deleteByPrimaryKey(Long id);
int insert(VoiceDeviceConfig2 record);
int insertSelective(VoiceDeviceConfig2 record);
List<VoiceDeviceConfig2> selectByExampleWithBLOBs(VoiceDeviceConfig2Example example);
List<VoiceDeviceConfig2> selectByExample(VoiceDeviceConfig2Example example);
VoiceDeviceConfig2 selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") VoiceDeviceConfig2 record, @Param("example") VoiceDeviceConfig2Example example);
int updateByExampleWithBLOBs(@Param("record") VoiceDeviceConfig2 record, @Param("example") VoiceDeviceConfig2Example example);
int updateByExample(@Param("record") VoiceDeviceConfig2 record, @Param("example") VoiceDeviceConfig2Example example);
int updateByPrimaryKeySelective(VoiceDeviceConfig2 record);
int updateByPrimaryKeyWithBLOBs(VoiceDeviceConfig2 record);
int updateByPrimaryKey(VoiceDeviceConfig2 record);
}

View File

@ -1,70 +0,0 @@
package club.joylink.rtss.entity.voice2;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import lombok.Data;
/**
* @author
*
*/
@Data
public class VoiceDeviceConfig2 implements Serializable {
private Long id;
/**
* 描述
*/
private String describe;
/**
* 匹配类型唤醒参数
*/
private String wakeUpParmas;
/**
* 线路
*/
private Long mapId;
/**
* 编辑创建者
*/
private Long createId;
/**
* 开始时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 支持的设备类型
*/
private MapElement.DeviceType deviceType;
/**
* 操作类型
*/
private OperateEnum operateType;
/**
* 是否启用0=未启用1=启用
*/
private Integer status;
/**
* 操作匹配参数
*/
private String paramConfig;
private static final long serialVersionUID = 1L;
}

View File

@ -1,863 +0,0 @@
package club.joylink.rtss.entity.voice2;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class VoiceDeviceConfig2Example {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public VoiceDeviceConfig2Example() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Long getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andDescribeIsNull() {
addCriterion("`describe` is null");
return (Criteria) this;
}
public Criteria andDescribeIsNotNull() {
addCriterion("`describe` is not null");
return (Criteria) this;
}
public Criteria andDescribeEqualTo(String value) {
addCriterion("`describe` =", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotEqualTo(String value) {
addCriterion("`describe` <>", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeGreaterThan(String value) {
addCriterion("`describe` >", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeGreaterThanOrEqualTo(String value) {
addCriterion("`describe` >=", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLessThan(String value) {
addCriterion("`describe` <", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLessThanOrEqualTo(String value) {
addCriterion("`describe` <=", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeLike(String value) {
addCriterion("`describe` like", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotLike(String value) {
addCriterion("`describe` not like", value, "describe");
return (Criteria) this;
}
public Criteria andDescribeIn(List<String> values) {
addCriterion("`describe` in", values, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotIn(List<String> values) {
addCriterion("`describe` not in", values, "describe");
return (Criteria) this;
}
public Criteria andDescribeBetween(String value1, String value2) {
addCriterion("`describe` between", value1, value2, "describe");
return (Criteria) this;
}
public Criteria andDescribeNotBetween(String value1, String value2) {
addCriterion("`describe` not between", value1, value2, "describe");
return (Criteria) this;
}
public Criteria andWakeUpParmasIsNull() {
addCriterion("wake_up_parmas is null");
return (Criteria) this;
}
public Criteria andWakeUpParmasIsNotNull() {
addCriterion("wake_up_parmas is not null");
return (Criteria) this;
}
public Criteria andWakeUpParmasEqualTo(String value) {
addCriterion("wake_up_parmas =", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasNotEqualTo(String value) {
addCriterion("wake_up_parmas <>", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasGreaterThan(String value) {
addCriterion("wake_up_parmas >", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasGreaterThanOrEqualTo(String value) {
addCriterion("wake_up_parmas >=", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasLessThan(String value) {
addCriterion("wake_up_parmas <", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasLessThanOrEqualTo(String value) {
addCriterion("wake_up_parmas <=", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasLike(String value) {
addCriterion("wake_up_parmas like", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasNotLike(String value) {
addCriterion("wake_up_parmas not like", value, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasIn(List<String> values) {
addCriterion("wake_up_parmas in", values, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasNotIn(List<String> values) {
addCriterion("wake_up_parmas not in", values, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasBetween(String value1, String value2) {
addCriterion("wake_up_parmas between", value1, value2, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andWakeUpParmasNotBetween(String value1, String value2) {
addCriterion("wake_up_parmas not between", value1, value2, "wakeUpParmas");
return (Criteria) this;
}
public Criteria andMapIdIsNull() {
addCriterion("map_id is null");
return (Criteria) this;
}
public Criteria andMapIdIsNotNull() {
addCriterion("map_id is not null");
return (Criteria) this;
}
public Criteria andMapIdEqualTo(Long value) {
addCriterion("map_id =", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotEqualTo(Long value) {
addCriterion("map_id <>", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThan(Long value) {
addCriterion("map_id >", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThanOrEqualTo(Long value) {
addCriterion("map_id >=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThan(Long value) {
addCriterion("map_id <", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThanOrEqualTo(Long value) {
addCriterion("map_id <=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdIn(List<Long> values) {
addCriterion("map_id in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotIn(List<Long> values) {
addCriterion("map_id not in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdBetween(Long value1, Long value2) {
addCriterion("map_id between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotBetween(Long value1, Long value2) {
addCriterion("map_id not between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andCreateIdIsNull() {
addCriterion("create_id is null");
return (Criteria) this;
}
public Criteria andCreateIdIsNotNull() {
addCriterion("create_id is not null");
return (Criteria) this;
}
public Criteria andCreateIdEqualTo(Long value) {
addCriterion("create_id =", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdNotEqualTo(Long value) {
addCriterion("create_id <>", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdGreaterThan(Long value) {
addCriterion("create_id >", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdGreaterThanOrEqualTo(Long value) {
addCriterion("create_id >=", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdLessThan(Long value) {
addCriterion("create_id <", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdLessThanOrEqualTo(Long value) {
addCriterion("create_id <=", value, "createId");
return (Criteria) this;
}
public Criteria andCreateIdIn(List<Long> values) {
addCriterion("create_id in", values, "createId");
return (Criteria) this;
}
public Criteria andCreateIdNotIn(List<Long> values) {
addCriterion("create_id not in", values, "createId");
return (Criteria) this;
}
public Criteria andCreateIdBetween(Long value1, Long value2) {
addCriterion("create_id between", value1, value2, "createId");
return (Criteria) this;
}
public Criteria andCreateIdNotBetween(Long value1, Long value2) {
addCriterion("create_id not between", value1, value2, "createId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andDeviceTypeIsNull() {
addCriterion("device_type is null");
return (Criteria) this;
}
public Criteria andDeviceTypeIsNotNull() {
addCriterion("device_type is not null");
return (Criteria) this;
}
public Criteria andDeviceTypeEqualTo(String value) {
addCriterion("device_type =", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeNotEqualTo(String value) {
addCriterion("device_type <>", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeGreaterThan(String value) {
addCriterion("device_type >", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeGreaterThanOrEqualTo(String value) {
addCriterion("device_type >=", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeLessThan(String value) {
addCriterion("device_type <", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeLessThanOrEqualTo(String value) {
addCriterion("device_type <=", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeLike(String value) {
addCriterion("device_type like", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeNotLike(String value) {
addCriterion("device_type not like", value, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeIn(List<String> values) {
addCriterion("device_type in", values, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeNotIn(List<String> values) {
addCriterion("device_type not in", values, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeBetween(String value1, String value2) {
addCriterion("device_type between", value1, value2, "deviceType");
return (Criteria) this;
}
public Criteria andDeviceTypeNotBetween(String value1, String value2) {
addCriterion("device_type not between", value1, value2, "deviceType");
return (Criteria) this;
}
public Criteria andOperateTypeIsNull() {
addCriterion("operate_type is null");
return (Criteria) this;
}
public Criteria andOperateTypeIsNotNull() {
addCriterion("operate_type is not null");
return (Criteria) this;
}
public Criteria andOperateTypeEqualTo(String value) {
addCriterion("operate_type =", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeNotEqualTo(String value) {
addCriterion("operate_type <>", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeGreaterThan(String value) {
addCriterion("operate_type >", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeGreaterThanOrEqualTo(String value) {
addCriterion("operate_type >=", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeLessThan(String value) {
addCriterion("operate_type <", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeLessThanOrEqualTo(String value) {
addCriterion("operate_type <=", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeLike(String value) {
addCriterion("operate_type like", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeNotLike(String value) {
addCriterion("operate_type not like", value, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeIn(List<String> values) {
addCriterion("operate_type in", values, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeNotIn(List<String> values) {
addCriterion("operate_type not in", values, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeBetween(String value1, String value2) {
addCriterion("operate_type between", value1, value2, "operateType");
return (Criteria) this;
}
public Criteria andOperateTypeNotBetween(String value1, String value2) {
addCriterion("operate_type not between", value1, value2, "operateType");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -1,21 +0,0 @@
package club.joylink.rtss.services.voice;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import club.joylink.rtss.vo.voice.VoiceQueryVO;
import java.util.List;
import java.util.Map;
public interface IVoiceConfigDataService {
VoiceConfigDataVO findById(Long id);
void saveOrUpdate(VoiceConfigDataVO dataVO, LoginUserInfoVO userInfoVO);
void changeStatus(Long id,Integer status);
PageVO<VoiceConfigDataVO> query(VoiceQueryVO query);
Map<String, List<OperateEnum>> findDeviceType();
}

View File

@ -1,127 +0,0 @@
package club.joylink.rtss.services.voice.impl;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.dao.voice2.VoiceDeviceConfig2DAO;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.voice.IVoiceConfigDataService;
import club.joylink.rtss.simulation.cbtc.command.voice2.IVoiceCommandDataService;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import club.joylink.rtss.vo.voice.VoiceQueryVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Slf4j
public class VoiceConfigDataService implements IVoiceConfigDataService, IVoiceCommandDataService {
@Resource
private VoiceDeviceConfig2DAO config2DAO;
private Optional<VoiceDeviceConfig2> byId(Long id){
VoiceDeviceConfig2 configData = this.config2DAO.selectByPrimaryKey(id);
if(Objects.nonNull(configData)){
return Optional.of(configData);
}
return Optional.empty();
}
@Override
public VoiceConfigDataVO findById(Long id) {
Optional<VoiceDeviceConfig2> optional = this.byId(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(optional.isPresent(),"未找到对应的数据");
return VoiceConfigDataVO.converVO(optional.get());
}
@Override
public void saveOrUpdate(VoiceConfigDataVO dataVO, LoginUserInfoVO userInfoVO) {
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getMapId()),"请选择对应的线路");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getDeviceType()),"请选择操控的设备类型");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getOperateType()),"请选择设备对应的操作");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(dataVO.getOperateType().getDeviceType() == dataVO.getDeviceType(),"设备的操作与设备类型不匹配");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getWakeUpParmas()),"设备唤醒匹配关键字不能为空");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getParamConfig()),"操作参数不能为空");
// BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(dataVO.getParamConfig()),"操作关键字不能为空");
VoiceDeviceConfig2 vc = dataVO.converBean();
vc.setCreateId(userInfoVO.getAccountVO().getId());
vc.setStatus(BusinessConsts.STATUS_NOT_USE_INT);
LocalDateTime dateTime = LocalDateTime.now();
vc.setCreateTime(dateTime);
vc.setUpdateTime(dateTime);
if(Objects.isNull(dataVO.getId())){
this.config2DAO.insert(vc);
}else{
Optional<VoiceDeviceConfig2> optional = this.byId(vc.getId());
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(optional.isPresent(),"未找到对应的数据");
VoiceDeviceConfig2 db = optional.get();
BusinessExceptionAssertEnum.DATA_BEEN_USED.assertTrue(db.getStatus() != BusinessConsts.STATUS_USE_INT,"已上架的不能编辑");
this.config2DAO.updateByPrimaryKeySelective(vc);
}
}
@Override
public void changeStatus(Long id, Integer status) {
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(id),"数据信息不能为空");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(Objects.nonNull(status),"状态不能为空");
Optional<VoiceDeviceConfig2> optional = this.byId(id);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(optional.isPresent(),"未找到对应的数据");
BusinessExceptionAssertEnum.DATA_INVALID.assertTrue(status == BusinessConsts.STATUS_USE_INT || status == BusinessConsts.STATUS_NOT_USE_INT,"不确定的状态");
if(status == BusinessConsts.STATUS_USE_INT){
VoiceDeviceConfig2 db = optional.get();
VoiceDeviceConfig2Example example = new VoiceDeviceConfig2Example();
example.createCriteria().andMapIdEqualTo(db.getMapId()).andDeviceTypeEqualTo(db.getDeviceType().name())
.andOperateTypeEqualTo(db.getOperateType().name()).andStatusEqualTo(BusinessConsts.STATUS_USE_INT);
Long count = this.config2DAO.countByExample(example);
BusinessExceptionAssertEnum.DATA_BEEN_USED.assertTrue(count <= 0 ,"已经有上架类型的配置数据");
}
VoiceDeviceConfig2 configData = new VoiceDeviceConfig2();
configData.setId(id);
configData.setStatus(status);
this.config2DAO.updateByPrimaryKeySelective(configData);
}
@Override
public PageVO<VoiceConfigDataVO> query(VoiceQueryVO query) {
PageHelper.startPage(query.getPageNum(),query.getPageSize());
VoiceDeviceConfig2Example example = new VoiceDeviceConfig2Example();
Page<VoiceDeviceConfig2> sqlPage = (Page<VoiceDeviceConfig2>) this.config2DAO.selectByExampleWithBLOBs(query.createQuery(example));
List<VoiceConfigDataVO> dataVoList = sqlPage.getResult().stream().map(VoiceConfigDataVO::converVO).collect(Collectors.toList());
PageVO<VoiceConfigDataVO> page = PageVO.convert(sqlPage,dataVoList);
return page;
}
@Override
public Map<String,List<OperateEnum>> findDeviceType() {
Map<String,List<OperateEnum>> operateMapList = Arrays.stream(OperateEnum.values()).collect(Collectors.groupingBy(d->d.getDeviceType().name()));
return operateMapList;
}
@Override
public List<ConfigData> findConfigData(Long mapId) {
VoiceDeviceConfig2Example example = new VoiceDeviceConfig2Example();
VoiceQueryVO query = VoiceQueryVO.builder().mapId(mapId).status(BusinessConsts.STATUS_USE_INT).build();
List<VoiceDeviceConfig2> tmpList = this.config2DAO.selectByExampleWithBLOBs(query.createQuery(example));
List<ConfigData> voList = tmpList.stream().map(ConfigData::converVO).collect(Collectors.toList());
return voList;
}
}

View File

@ -6,9 +6,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository;
import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams;
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.simulation.cbtc.competition.CompetitionBO;
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
import club.joylink.rtss.simulation.cbtc.conversation.Conversation;
@ -34,7 +32,6 @@ import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.fault.FaultRuleVO;
import club.joylink.rtss.vo.permission.PermissionSubjectTypeEnum;
import club.joylink.rtss.vo.project.ProjectVO;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@ -128,11 +125,6 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation<Simulati
// */
// private Map<Long, SimulationUser> simulationUserMap = new ConcurrentHashMap<>();
/**
* 语音设备指令配置数据
*/
private List<ConfigData> voiceConfigDataList;
/**
* 真实设备列表
*/

View File

@ -5,10 +5,7 @@ import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.services.RunPlanDraftService;
import club.joylink.rtss.services.mapFunction.RtsMapFunctionService;
import club.joylink.rtss.services.permission.PermissionSubjectService;
import club.joylink.rtss.simulation.SimulationManager;
import club.joylink.rtss.simulation.cbtc.command.voice2.IVoiceCommandDataService;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.simulation.cbtc.event.SimulationCreateSuccessEvent;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
@ -27,7 +24,6 @@ import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
import club.joylink.rtss.vo.permission.PermissionSubjectTypeEnum;
import club.joylink.rtss.vo.permission.PermissionSystemAbilityVO;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import club.joylink.rtss.websocket.StompMessageService;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -71,8 +67,6 @@ public class SimulationServiceImpl implements SimulationService {
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IVoiceCommandDataService commandDataService;
@Override
public String createSimulation(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO,Map<String,Boolean> createUserType) {
@ -302,9 +296,6 @@ public class SimulationServiceImpl implements SimulationService {
//创建仿真
String simulationId = SimulationIdGenerator.generateGroup(loginUserInfoVO.getAccountVO().getId(), mapId);
Simulation simulation = initService.create(mapId, workParamVO, loginUserInfoVO, simulationId);
//加载语音指令配置数据
List<ConfigData> voiceConfigDataList = commandDataService.findConfigData(mapId);
simulation.setVoiceConfigDataList(voiceConfigDataList);
simulation.setMapFunctionId(mapFunctionId);
simulation.setCreateUserType(createUserType);
LoginUserInfoVO loginUserInfo = simulation.getBuildParams().getLoginUserInfo();

View File

@ -1,11 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import java.util.List;
public interface IVoiceCommandDataService {
List<ConfigData> findConfigData(Long mapId);
}

View File

@ -1,70 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.voice.IVoiceService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.analyse.AnalyseChain;
import club.joylink.rtss.simulation.cbtc.command.voice2.match.IVoiceCommandMatcher;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.WorkResult;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.VoiceCommandWork;
import club.joylink.rtss.vo.client.voice.VoiceRecognitionResult;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
@Component
@Slf4j
public class VoiceCommandHandle {
@Autowired
@Qualifier("baiDuVoiceService")
private IVoiceService iVoiceService;
@Autowired
private IVoiceCommandMatcher commandMatcher;
@Autowired
private VoiceCommandWork analyseWork;
public List<WorkResult> voiceCommand(Simulation simulation, String source){
List<ConfigData> configDataList = simulation.getVoiceConfigDataList();
BusinessExceptionAssertEnum.VOICE_COMMAND_CONFIG_NULL.assertTrue(!CollectionUtils.isEmpty(configDataList),"未找到语音配置的相关信息");
String tmpSource = source;
if(StringUtils.indexOf(source,"base64,") >= 0){
VoiceRecognitionResult result = this.iVoiceService.voiceRecognition(tmpSource);
tmpSource = result.getResult();
}
BusinessExceptionAssertEnum.VOICE_COMMAND_PARSE_ERROR.assertTrue(StringUtils.isNotEmpty(tmpSource),"语音指令未识别输入内容");
log.info("获取语音识别指令原文:[{}]",tmpSource);
return this.handle(configDataList,simulation,tmpSource);
}
private List<WorkResult> handle(List<ConfigData> configDataList,Simulation simulation,String result){
List<VoiceCommand> commandList = this.commandMatcher.matcher(configDataList,result);
BusinessExceptionAssertEnum.VOICE_COMMAND_PARSE_ERROR.assertTrue(!CollectionUtils.isEmpty(commandList),"语音指令未识别匹配的内容");
List<WorkResult> workResultList = Lists.newArrayList();
for (VoiceCommand command : commandList) {
AnalyseChain analyseChain = new AnalyseChain();
CommandParse commandParse = analyseChain.parse(simulation,command,result);
if(Objects.isNull(commandParse)){
log.error("数据结失败 类型[{}] 动作[{}] 语音指令[{}]",command.getOperate().getDeviceType(),command.getOperate(),result);
}else{
WorkResult workResult = this.analyseWork.work(simulation,commandParse,command.getOperate());
if(Objects.isNull(workResult)){
log.error("未找到对应的设备 类型[{}] 动作[{}] 语音指令[{}]",command.getOperate().getDeviceType(),command.getOperate(),result);
}else{
workResultList.add(workResult);
}
}
}
return workResultList;
}
}

View File

@ -1,34 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.analyse;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
public class AnalyseChain {
private final static List<IVoiceCommandAnalyse> ANALYSE_LIST = Lists.newArrayList();
public static void addAnalyse(IVoiceCommandAnalyse analyse){
boolean exist = ANALYSE_LIST.stream().anyMatch(d-> StringUtils.equalsIgnoreCase(d.getClass().getSimpleName(),analyse.getClass().getSimpleName()));
if(!exist){
ANALYSE_LIST.add(analyse);
}
}
private int index = 0;
public CommandParse parse(Simulation simulation, VoiceCommand command, String sourceCommandStr){
if(ANALYSE_LIST.isEmpty()){
return null;
}
if(index + 1 > ANALYSE_LIST.size()){
return null;
}
IVoiceCommandAnalyse analyse = ANALYSE_LIST.get(index++);
return analyse.parseCommand(simulation,command,sourceCommandStr,this);
}
}

View File

@ -1,83 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.analyse;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ParseDetail;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.util.PinYinUtil;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.ansj.domain.Result;
import org.ansj.domain.Term;
import org.ansj.library.DicLibrary;
import org.ansj.splitWord.analysis.DicAnalysis;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
public class DefaultPinYinSplitWordAnalyse implements IVoiceCommandAnalyse {
@Override
public CommandParse parseCommand(Simulation simulation, VoiceCommand command, String sourceCommandStr, AnalyseChain chain) {
this.initDic(simulation,command);
String pinyinStr = PinYinUtil.toPinYinSplitBlankSpace(sourceCommandStr);
Result reslut = DicAnalysis.parse(pinyinStr);
List<ParseDetail> resultList = Lists.newArrayList();
for (Term term : reslut) {
String name = term.getName().toUpperCase();
String nature = term.getNatureStr();
if(Objects.nonNull(nature) && StringUtils.isNotEmpty(name) && !StringUtils.startsWith(nature,"w")){
if(!StringUtils.equalsIgnoreCase(nature,DicLibrary.DEFAULT_NATURE)){
resultList.add(new ParseDetail(name,nature,term.getOffe(), term.toValue()));
}
}
}
if(CollectionUtils.isEmpty(resultList)){
return chain.parse(simulation,command,sourceCommandStr);
}
CommandParse commandParse = new CommandParse();
commandParse.setDetail(resultList);
return commandParse;
}
private void initDic(Simulation simulation,VoiceCommand command){
DicLibrary.clear(DicLibrary.DEFAULT);
for (Station station : simulation.getRepository().getStationList()) {
String pinYinTmp = PinYinUtil.toPinYinSplitBlankSpace(station.getName()).toLowerCase();
List<String> pinyin = Splitter.onPattern("\\s").omitEmptyStrings().splitToList(pinYinTmp);
DicLibrary.insert(DicLibrary.DEFAULT,pinYinTmp, IVoiceCommandAnalyse.DESCRIBE_NATURE,DicLibrary.DEFAULT_FREQ);
List<List<String>> subPinYinList = Lists.partition(pinyin,2);
for (List<String> strings : subPinYinList) {
String t = Joiner.on(" ").skipNulls().join(strings);
DicLibrary.insert(DicLibrary.DEFAULT,t, IVoiceCommandAnalyse.DESCRIBE_NATURE,DicLibrary.DEFAULT_FREQ);
}
subPinYinList = Lists.partition(pinyin,3);
for (List<String> strings : subPinYinList) {
String t = Joiner.on(" ").skipNulls().join(strings);
DicLibrary.insert(DicLibrary.DEFAULT,t, IVoiceCommandAnalyse.DESCRIBE_NATURE,DicLibrary.DEFAULT_FREQ);
}
}
String[] pinYinWakeUp = PinYinUtil.toPinYins(command.getWakeUpKW().getWakeups());
String[] pinYinAction = PinYinUtil.toPinYins(command.getWakeUpKW().getOperates());
// String[] pinYinNature = PinYinUtil.toPinYins(command.getOperateConfigData().getNatureKW());
this.insertDic(pinYinWakeUp,DicLibrary.DEFAULT_NATURE);
this.insertDic(pinYinAction,DicLibrary.DEFAULT_NATURE);
// this.insertDic(pinYinNature,IVoiceCommandAnalyse.DESCRIBE_NATURE);
}
private void insertDic(String[] dics , String nature){
for (String s : dics) {
DicLibrary.insert(DicLibrary.DEFAULT,s.toLowerCase(),nature,DicLibrary.DEFAULT_FREQ);
}
}
}

View File

@ -1,20 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.analyse;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
public interface IVoiceCommandAnalyse {
String DESCRIBE_NATURE = "nature";
/**
* 解析命令
* @param simulation
* @param command
* @param sourceCommand
* @param chain
* @return
*/
CommandParse parseCommand(Simulation simulation, VoiceCommand command, String sourceCommand, AnalyseChain chain);
}

View File

@ -1,43 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.match;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
import club.joylink.rtss.util.PinYinUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.Objects;
@Slf4j
public class DefaultPinYinViolenceMatch implements IVoiceCommandMatcher {
@Override
public List<VoiceCommand> matcher(List<ConfigData> configVOList, String sourceMsg) {
List<VoiceCommand> commandList = Lists.newArrayList();
for (ConfigData configData : configVOList) {
VoiceCommand command = this.matching(configData,sourceMsg);
if(Objects.nonNull(command.getOperate())){
commandList.add(command);
}
}
return commandList;
}
private VoiceCommand matching(ConfigData configData,String sourceMsg){
String pinYinSource = PinYinUtil.toPinYinSplitBlankSpace(sourceMsg);
String[] pinYinWakeUp = PinYinUtil.toPinYins(configData.getWakeUpKW().getWakeups());
String[] pinYinOperates = PinYinUtil.toPinYins(configData.getWakeUpKW().getOperates());
if(StringUtils.containsAny(pinYinSource,pinYinWakeUp) && StringUtils.containsAny(pinYinSource,pinYinOperates)){
VoiceCommand command = new VoiceCommand();
command.setWakeUpKW(configData.getWakeUpKW());
command.setOperate(configData.getOperateType());
command.setOperateConfigData(configData.getOperateConfigData());
return command;
}
return null;
}
}

View File

@ -1,12 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.match;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ConfigData;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.VoiceCommand;
import java.util.List;
public interface IVoiceCommandMatcher {
List<VoiceCommand> matcher(List<ConfigData> configVOList, String msg);
}

View File

@ -1,84 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.operate;
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsStandService;
import club.joylink.rtss.simulation.cbtc.CI.device.CiSwitchControlService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import lombok.Getter;
public enum OperateEnum {
SWITCH_DINGWEI(MapElement.DeviceType.SWITCH,"定位"){
@Override
public void handle(Simulation simulation,Object objectService, MapElement device) {
Switch aswitch = (Switch)device;
CiSwitchControlService controlService = (CiSwitchControlService) objectService;
controlService.turn2NormalPosition(simulation,aswitch);
}
},
SWITCH_FANWEI(MapElement.DeviceType.SWITCH,"反位"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
Switch aswitch = (Switch)device;
CiSwitchControlService controlService = (CiSwitchControlService) objectService;
controlService.turn2ReversePosition(simulation,aswitch);
}
},
/* STAND_HOLD_TRAIN(MapElement.DeviceType.STAND,"扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.holdTrain(simulation,device.getCode());
}
},
STAND_CANCEL_HOLD_TRAIN(MapElement.DeviceType.STAND,"取消扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.cancelHoldTrain(simulation,device.getCode());
}
},*/
STAND_UP_HOLD_TRAIN(MapElement.DeviceType.STAND,"上行扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.holdTrain(simulation,device.getCode());
}
},
STAND_DOWN_HOLD_TRAIN(MapElement.DeviceType.STAND,"下行扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.holdTrain(simulation,device.getCode());
}
},
STAND_CANCEL_UP_HOLD_TRAIN(MapElement.DeviceType.STAND,"上行取消扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.cancelHoldTrain(simulation,device.getCode());
}
},
STAND_CANCEL_DOWN_HOLD_TRAIN(MapElement.DeviceType.STAND,"下行取消扣车"){
@Override
public void handle(Simulation simulation, Object objectService, MapElement device) {
AtsStandService standService = (AtsStandService) objectService;
standService.cancelHoldTrain(simulation,device.getCode());
}
},
;
@Getter
private MapElement.DeviceType deviceType;
@Getter
private String describe;
public abstract void handle(Simulation simulation,Object objectService, MapElement device);
OperateEnum(MapElement.DeviceType deviceType, String describe) {
this.deviceType = deviceType;
this.describe = describe;
}
}

View File

@ -1,28 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
@Data
@NoArgsConstructor
public class CommandParse {
// private String descrbeCommand;
// private String translateDescrbeCommand;
// private OperateEnum operate;
private List<ParseDetail> detail;
public List<ParseDetail> findNatureDetail(String nature){
return this.detail.stream().filter(d-> StringUtils.equalsIgnoreCase(d.getNature(), nature)).collect(Collectors.toList());
}
public List<ParseDetail> findNotNatureDetail(String nature){
return this.detail.stream().filter(d->!StringUtils.equalsIgnoreCase(d.getNature(),nature)).collect(Collectors.toList());
}
}

View File

@ -1,39 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.util.JsonUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Data
public class ConfigData {
// private MapElement.DeviceType deviceType;
private WakeUpParam wakeUpKW;
private OperateConfigData operateConfigData;
private OperateEnum operateType;
public static ConfigData converVO(VoiceDeviceConfig2 vc){
ConfigData configVO = new ConfigData();
configVO.setOperateType(vc.getOperateType());
// configVO.setDeviceType(vc.getDeviceType());
if(StringUtils.isNotEmpty(vc.getWakeUpParmas())){
WakeUpParam wakeUpParam = JsonUtils.read(vc.getWakeUpParmas(),WakeUpParam.class);
// List<String> wakeUps = JsonUtils.readCollection(vc.getWakeUpParmas(), ArrayList.class,String.class);
// String[] ss = new String[wakeUps.size()];
// wakeUps.toArray(ss);
configVO.setWakeUpKW(wakeUpParam);
}
if(Objects.nonNull(vc.getParamConfig())){
OperateConfigData cd = JsonUtils.read(vc.getParamConfig(), OperateConfigData.class);
configVO.setOperateConfigData(cd);
}
return configVO;
}
}

View File

@ -1,31 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import lombok.Data;
@Data
public class OperateConfigData {
/**
* 需要提取设备的类型
*/
private MapElement.DeviceType deviceType;
/**
* 提取设备类型的属性
*/
private DeviceNameType deviceNameType;
/**
* 提取属性关键字
*/
private String[] natureKWs;
/**
* 提取设备名称/code或属性的正则
*/
private String[] regexs;
public enum DeviceNameType{
CODE,NAME,ATTR
}
}

View File

@ -1,20 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class ParseDetail {
private String name;
private String nature;
private int index;
private int end;
public ParseDetail(String name, String meta, int index, int end) {
this.name = name;
this.nature = meta;
this.index = index;
this.end = end;
}
}

View File

@ -1,24 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class VoiceCommand {
private OperateEnum operate;
private OperateConfigData operateConfigData;
/**
* 匹配的类型关键字
*/
private WakeUpParam wakeUpKW;
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
return sb.toString();
}
}

View File

@ -1,10 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import lombok.Data;
@Data
public class WakeUpParam {
private String[] wakeups;
private String[] operates;
}

View File

@ -1,29 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.vo;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class WorkResult {
@NotNull
private MapNamedElement device;
@NotNull
private OperateEnum operate;
public WorkResult(MapNamedElement device, OperateEnum operate) {
this.device = device;
this.operate = operate;
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("语音指令解析结果:\n");
sb.append(String.format("[%s] %s(%s) %s",operate.getDeviceType(),device.getCode(),device.getName(),operate.getDescribe()));
return sb.toString();
}
}

View File

@ -1,31 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.work;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import java.util.Optional;
public interface IDeviceWorkHandle {
/**
* 根据分析出的数据查找对应的设备
* @param simulation
* @param
* @return
*/
Optional<? extends MapNamedElement> findDevice(Simulation simulation, CommandParse commandParse,OperateEnum operate);
/**
* 执行对应的操作
* @param simulation
* @param
* @param device
* @return
*/
void work(Simulation simulation, OperateEnum operate, MapElement device);
MapElement.DeviceType deviceType();
}

View File

@ -1,51 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.work;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.WorkResult;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@Component
@Slf4j
public class VoiceCommandWork {
@Resource
private List<IDeviceWorkHandle> deviceWorks;
private IDeviceWorkHandle findDeviceWorkHandle(MapElement.DeviceType deviceType){
IDeviceWorkHandle deviceWork = this.deviceWorks.stream().filter(d->d.deviceType() == deviceType).findFirst().orElse(null);
BusinessExceptionAssertEnum.VOICE_COMMAND_WORK_UNDEFINED.assertTrue(Objects.nonNull(deviceWork),String.format("未找到对应的工作处理 类型:[%s]",deviceType));
return deviceWork;
}
/**
* 执行操作
* @param simulation
* @param commandParse
* @param operate
* @return
*/
public WorkResult work(Simulation simulation, CommandParse commandParse,OperateEnum operate){
IDeviceWorkHandle deviceWork = this.findDeviceWorkHandle(operate.getDeviceType());
Optional<? extends MapNamedElement> optional = deviceWork.findDevice(simulation,commandParse,operate);
if(optional.isEmpty()){
return null;
}else{
MapNamedElement device = optional.get();
deviceWork.work(simulation,operate,optional.get());
WorkResult result = new WorkResult(device,operate);
return result;
}
}
}

View File

@ -1,69 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.work.device;
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsStandService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.analyse.IVoiceCommandAnalyse;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ParseDetail;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.IDeviceWorkHandle;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.util.PinYinUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.similarity.JaroWinklerSimilarity;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
//@Component
public class StandWork implements IDeviceWorkHandle {
@Autowired
private AtsStandService atsStandService;
private String findStationCode(Simulation simulation, CommandParse commandParse){
List<ParseDetail> findCommandParse = commandParse.findNotNatureDetail(IVoiceCommandAnalyse.DESCRIBE_NATURE);
JaroWinklerSimilarity similarity = new JaroWinklerSimilarity();
Map<Double,String> similarityMaper = new HashMap<>();
for (Station station : simulation.getRepository().getStationList()) {
String stationName = station.getName();
String pinYinStation = PinYinUtil.toPinYinSplitBlankSpace(stationName);
for (ParseDetail cp : findCommandParse) {
double scope = similarity.apply(pinYinStation,cp.getName());
similarityMaper.put(scope,station.getCode());
}
}
if(similarityMaper.isEmpty()){
return null;
}
double max = similarityMaper.keySet().stream().mapToDouble(d->d).max().getAsDouble();
return similarityMaper.get(max);
}
@Override
public Optional<? extends MapNamedElement> findDevice(Simulation simulation, CommandParse commandParse,OperateEnum operate) {
String stationCode = this.findStationCode(simulation,commandParse);
if(StringUtils.isEmpty(stationCode)){
return Optional.empty();
}
final boolean isRight = (operate == OperateEnum.STAND_DOWN_HOLD_TRAIN || operate == OperateEnum.STAND_CANCEL_DOWN_HOLD_TRAIN) ? false : true;
Optional<Stand> stand = simulation.getRepository().getStandList().stream().filter(d->d.isRight() == isRight && StringUtils.equalsIgnoreCase(d.getStation().getCode(),stationCode)).findFirst();
return stand;
}
@Override
public void work(Simulation simulation, OperateEnum operate, MapElement device) {
operate.handle(simulation,this.atsStandService,device);
}
@Override
public MapElement.DeviceType deviceType() {
return MapElement.DeviceType.STAND;
}
}

View File

@ -1,52 +0,0 @@
package club.joylink.rtss.simulation.cbtc.command.voice2.work.device;
import club.joylink.rtss.simulation.cbtc.CI.device.CiSwitchControlService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.CommandParse;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.ParseDetail;
import club.joylink.rtss.simulation.cbtc.command.voice2.work.IDeviceWorkHandle;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import org.apache.commons.text.similarity.JaroWinklerSimilarity;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public class SwitchWork implements IDeviceWorkHandle {
@Autowired
private CiSwitchControlService ciSwitchControlService;
@Override
public Optional<MapNamedElement> findDevice(Simulation simulation, CommandParse commandParse,OperateEnum operate) {
JaroWinklerSimilarity similarity = new JaroWinklerSimilarity();
Map<Double,String> similarityMaper = new HashMap<>();
for (Switch aSwitch : simulation.getRepository().getSwitchList()) {
String switchName = aSwitch.getName();
for (ParseDetail cp : commandParse.getDetail()) {
double scope = similarity.apply(switchName.toUpperCase(),cp.getName());
similarityMaper.put(scope,aSwitch.getCode());
}
}
if(similarityMaper.isEmpty()){
return Optional.empty();
}
double max = similarityMaper.keySet().stream().mapToDouble(d->d).max().getAsDouble();
String deviceCode = similarityMaper.get(max);
MapElement device = simulation.getRepository().getByCode(deviceCode);
return Optional.of((MapNamedElement)device);
}
@Override
public void work(Simulation simulation, OperateEnum operate, MapElement device) {
operate.handle(simulation,this.ciSwitchControlService,device);
}
@Override
public MapElement.DeviceType deviceType() {
return MapElement.DeviceType.SWITCH;
}
}

View File

@ -1,105 +0,0 @@
package club.joylink.rtss.vo.voice;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.OperateConfigData;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.WakeUpParam;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.util.JsonUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Data
public class VoiceConfigDataVO implements Serializable {
private Long id;
/**
* 描述
*/
private String describe;
/**
* 匹配类型唤醒参数
*/
private WakeUpParam wakeUpParmas;
/**
* 线路
*/
private Long mapId;
/**
* 编辑创建者
*/
private Long createId;
/**
* 开始时间
*/
private LocalDateTime createTime;
/**
* 修改时间
*/
private LocalDateTime updateTime;
/**
* 支持的设备类型
*/
private MapElement.DeviceType deviceType;
/**
* 操作类型
*/
private OperateEnum operateType;
/**
* 操作匹配参数
*/
private List<OperateConfigData> paramConfig;
public VoiceDeviceConfig2 converBean(){
VoiceDeviceConfig2 vc = new VoiceDeviceConfig2();
BeanUtils.copyProperties(this, vc);
if(Objects.nonNull(this.wakeUpParmas)){
vc.setWakeUpParmas(JsonUtils.writeValueAsString(this.wakeUpParmas));
}
if(Objects.nonNull(this.paramConfig)){
vc.setParamConfig(JsonUtils.writeValueAsString(this.paramConfig));
}
return vc;
}
public static VoiceConfigDataVO converVO(VoiceDeviceConfig2 vc){
VoiceConfigDataVO configVO = new VoiceConfigDataVO();
configVO.setId(vc.getId());
configVO.setDescribe(vc.getDescribe());
configVO.setMapId(vc.getMapId());
configVO.setCreateId(vc.getCreateId());
configVO.setCreateTime(vc.getCreateTime());
configVO.setUpdateTime(vc.getUpdateTime());
configVO.setDeviceType(vc.getDeviceType());
configVO.setOperateType(vc.getOperateType());
if(StringUtils.isNotEmpty(vc.getWakeUpParmas())){
WakeUpParam wp = JsonUtils.read(vc.getWakeUpParmas(),WakeUpParam.class);
configVO.setWakeUpParmas(wp);
}
if(Objects.nonNull(vc.getWakeUpParmas())){
List<OperateConfigData> configDatas = JsonUtils.readCollection(vc.getWakeUpParmas(),ArrayList.class,OperateConfigData.class);
// OperateConfigData cd = JsonUtils.read(vc.getWakeUpParmas(),OperateConfigData.class);
configVO.setParamConfig(configDatas);
}
return configVO;
}
}

View File

@ -1,58 +0,0 @@
package club.joylink.rtss.vo.voice;
import club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import java.util.Objects;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class VoiceQueryVO extends PageQueryVO {
private Long id;
private String describe;
private Long mapId;
/**
* 处理方式目前只支持拼音
*/
// private HandleType handleType;
/**
* 支持的设备类型
*/
private MapElement.DeviceType deviceType;
/**
* 是否启用0=未启用1=启用
*/
private Integer status;
public VoiceDeviceConfig2Example createQuery(VoiceDeviceConfig2Example example){
VoiceDeviceConfig2Example.Criteria criteria = example.createCriteria();
if(StringUtils.isNotEmpty(this.getDescribe())){
criteria.andDescribeLike(String.format("%%%s%%", this.describe));
}
if(Objects.nonNull(this.mapId)){
criteria.andMapIdEqualTo(this.mapId);
}
// if(Objects.nonNull(this.handleType)){
// criteria.andHandleTypeEqualTo(this.handleType.name());
// }
if(Objects.nonNull(this.deviceType)){
criteria.andDeviceTypeEqualTo(this.deviceType.name());
}
if(Objects.nonNull(this.status)){
criteria.andStatusEqualTo(this.status);
}
return example;
}
}

View File

@ -1,368 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.voice2.VoiceDeviceConfig2DAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="describe" jdbcType="VARCHAR" property="describe" />
<result column="wake_up_parmas" jdbcType="VARCHAR" property="wakeUpParmas" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="create_id" jdbcType="BIGINT" property="createId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="operate_type" jdbcType="VARCHAR" property="operateType" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2">
<result column="param_config" jdbcType="LONGVARCHAR" property="paramConfig" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `describe`, wake_up_parmas, map_id, create_id, create_time, update_time, device_type,
operate_type, `status`
</sql>
<sql id="Blob_Column_List">
param_config
</sql>
<select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from rts_voice_device_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from rts_voice_device_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from rts_voice_device_config
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from rts_voice_device_config
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example">
delete from rts_voice_device_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2" useGeneratedKeys="true">
insert into rts_voice_device_config (`describe`, wake_up_parmas, map_id,
create_id, create_time, update_time,
device_type, operate_type, `status`,
param_config)
values (#{describe,jdbcType=VARCHAR}, #{wakeUpParmas,jdbcType=VARCHAR}, #{mapId,jdbcType=BIGINT},
#{createId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deviceType,jdbcType=VARCHAR}, #{operateType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{paramConfig,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2" useGeneratedKeys="true">
insert into rts_voice_device_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="describe != null">
`describe`,
</if>
<if test="wakeUpParmas != null">
wake_up_parmas,
</if>
<if test="mapId != null">
map_id,
</if>
<if test="createId != null">
create_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="operateType != null">
operate_type,
</if>
<if test="status != null">
`status`,
</if>
<if test="paramConfig != null">
param_config,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="describe != null">
#{describe,jdbcType=VARCHAR},
</if>
<if test="wakeUpParmas != null">
#{wakeUpParmas,jdbcType=VARCHAR},
</if>
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="createId != null">
#{createId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceType != null">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="operateType != null">
#{operateType,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="paramConfig != null">
#{paramConfig,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2Example" resultType="java.lang.Long">
select count(*) from rts_voice_device_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update rts_voice_device_config
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.describe != null">
`describe` = #{record.describe,jdbcType=VARCHAR},
</if>
<if test="record.wakeUpParmas != null">
wake_up_parmas = #{record.wakeUpParmas,jdbcType=VARCHAR},
</if>
<if test="record.mapId != null">
map_id = #{record.mapId,jdbcType=BIGINT},
</if>
<if test="record.createId != null">
create_id = #{record.createId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deviceType != null">
device_type = #{record.deviceType,jdbcType=VARCHAR},
</if>
<if test="record.operateType != null">
operate_type = #{record.operateType,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.paramConfig != null">
param_config = #{record.paramConfig,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update rts_voice_device_config
set id = #{record.id,jdbcType=BIGINT},
`describe` = #{record.describe,jdbcType=VARCHAR},
wake_up_parmas = #{record.wakeUpParmas,jdbcType=VARCHAR},
map_id = #{record.mapId,jdbcType=BIGINT},
create_id = #{record.createId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
device_type = #{record.deviceType,jdbcType=VARCHAR},
operate_type = #{record.operateType,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
param_config = #{record.paramConfig,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update rts_voice_device_config
set id = #{record.id,jdbcType=BIGINT},
`describe` = #{record.describe,jdbcType=VARCHAR},
wake_up_parmas = #{record.wakeUpParmas,jdbcType=VARCHAR},
map_id = #{record.mapId,jdbcType=BIGINT},
create_id = #{record.createId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
device_type = #{record.deviceType,jdbcType=VARCHAR},
operate_type = #{record.operateType,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2">
update rts_voice_device_config
<set>
<if test="describe != null">
`describe` = #{describe,jdbcType=VARCHAR},
</if>
<if test="wakeUpParmas != null">
wake_up_parmas = #{wakeUpParmas,jdbcType=VARCHAR},
</if>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="createId != null">
create_id = #{createId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="operateType != null">
operate_type = #{operateType,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="paramConfig != null">
param_config = #{paramConfig,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2">
update rts_voice_device_config
set `describe` = #{describe,jdbcType=VARCHAR},
wake_up_parmas = #{wakeUpParmas,jdbcType=VARCHAR},
map_id = #{mapId,jdbcType=BIGINT},
create_id = #{createId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
device_type = #{deviceType,jdbcType=VARCHAR},
operate_type = #{operateType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
param_config = #{paramConfig,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.voice2.VoiceDeviceConfig2">
update rts_voice_device_config
set `describe` = #{describe,jdbcType=VARCHAR},
wake_up_parmas = #{wakeUpParmas,jdbcType=VARCHAR},
map_id = #{mapId,jdbcType=BIGINT},
create_id = #{createId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
device_type = #{deviceType,jdbcType=VARCHAR},
operate_type = #{operateType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -1,46 +1,36 @@
package club.joylink.rtss.services.util;
import club.joylink.rtss.util.PinYinUtil;
import org.ansj.domain.Result;
import org.ansj.domain.Term;
import org.ansj.library.DicLibrary;
import org.ansj.splitWord.analysis.DicAnalysis;
import org.nlpcn.commons.lang.tire.domain.Forest;
public class SplitWordTest {
public static void main(String[] args) throws Exception {
// DicLibrary.insert(DicLibrary.DEFAULT, "dao cha", DicLibrary.DEFAULT_NATURE, 1);
// DicLibrary.insert(DicLibrary.DEFAULT, "ding wei", DicLibrary.DEFAULT_NATURE, 1);
// DicLibrary.insert(DicLibrary.DEFAULT, "fan wei", DicLibrary.DEFAULT_NATURE, 1);
// DicLibrary.insert(DicLibrary.DEFAULT, "ban li", DicLibrary.DEFAULT_NATURE, 1);
// DicLibrary.put("user",null);
// DicLibrary.put("user", "user", new Forest());
// DicLibrary.insert("user", PinYinUtil.toPinYinSplitBlankSpace("车险").toLowerCase(),"user",1000);
DicLibrary.insert(DicLibrary.DEFAULT, "zhan tai", DicLibrary.DEFAULT_NATURE, 1);
DicLibrary.insert(DicLibrary.DEFAULT, "zhan", "xxxws", 1);
DicLibrary.insert(DicLibrary.DEFAULT, "zhan", "user", 1);
DicLibrary.insert(DicLibrary.DEFAULT, "shang xing", DicLibrary.DEFAULT_NATURE, 1);
DicLibrary.insert(DicLibrary.DEFAULT, "kou che", DicLibrary.DEFAULT_NATURE, 1);
String source = "车险 车站01上行站台扣车";
String pinyin = PinYinUtil.toPinYinSplitBlankSpace(source);
print(pinyin);
}
private static void print(String s) throws Exception {
// print(BaseAnalysis.parse(s));
// print(ToAnalysis.parse(s));
// print(IndexAnalysis.parse(s));
print(DicAnalysis.parse(s,DicLibrary.get("user")));
// print(NlpAnalysis.parse(s));
// print(DicAnalysis.parse(s));
}
private static void print(Result result){
System.out.println("------------------------------");
for (Term term : result) {
String d = String.format("%s->%s->%s->%s--->%s"
,term.getName(),term.getNatureStr(),term.getOffe(),term.getSynonyms(),term.getSubTerm());
System.out.println(d);
}
}
}
//package club.joylink.rtss.services.util;
//
//import club.joylink.rtss.util.PinYinUtil;
//import org.ansj.domain.Result;
//import org.ansj.domain.Term;
//import org.ansj.library.DicLibrary;
//import org.ansj.splitWord.analysis.DicAnalysis;
//import org.nlpcn.commons.lang.tire.domain.Forest;
//
//public class SplitWordTest {
// public static void main(String[] args) throws Exception {
//
// DicLibrary.insert(DicLibrary.DEFAULT, "zhan tai", DicLibrary.DEFAULT_NATURE, 1);
// DicLibrary.insert(DicLibrary.DEFAULT, "zhan", "xxxws", 1);
// String source = "XXX站上行站台";
// source = PinYinUtil.toPinYinSplitBlankSpace(source);
// print(source);
// }
// private static void print(String s) throws Exception {
//// print(BaseAnalysis.parse(s));
//// print(ToAnalysis.parse(s));
//
//// print(IndexAnalysis.parse(s));
// print(DicAnalysis.parse(s/*,DicLibrary.get("user")*/));
//// print(NlpAnalysis.parse(s));
//// print(DicAnalysis.parse(s));
// }
// private static void print(Result result){
// System.out.println("------------------------------");
// for (Term term : result) {
// String d = String.format("%s->%s->%s->%s--->%s"
// ,term.getName(),term.getNatureStr(),term.getOffe(),term.getSynonyms(),term.getSubTerm());
// System.out.println(d);
// }
// }
//}

View File

@ -4,8 +4,6 @@ import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.simulation.SimulationManager;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.SimulationService;
import club.joylink.rtss.simulation.cbtc.command.voice2.VoiceCommandHandle;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.WorkResult;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.project.ProjectVO;
@ -21,8 +19,7 @@ import java.util.List;
@SpringBootTest
public class SimulationVoiceTest {
@Autowired
private VoiceCommandHandle commandService;
@Autowired
private SimulationService simulationService;
@Autowired
@ -65,17 +62,4 @@ public class SimulationVoiceTest {
}
@Test
public void newTestStand(){
LoginUserInfoVO userInfoVO = this.getInfo();
String simKey = simulationService.createSimulation(10642L,userInfoVO);
Simulation simulation = (Simulation)this.simulationManager.getById(simKey);
List<WorkResult> results = this.commandService.voiceCommand(simulation,"道岔p0707定位");
// List<WorkResult> results = this.commandService.voiceCommand(simulation,"办理车站十上行站台扣车");
// List<WorkResult> results = this.commandService.voiceCommand(simulation,"办理车站1上行站台扣车");
for (WorkResult result : results) {
System.out.println(result);
}
}
}

View File

@ -1,79 +0,0 @@
package club.joylink.rtss.services.voice;
import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.services.voice.impl.VoiceConfigDataService;
import club.joylink.rtss.simulation.cbtc.command.voice2.operate.OperateEnum;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.OperateConfigData;
import club.joylink.rtss.simulation.cbtc.command.voice2.vo.WakeUpParam;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.project.ProjectVO;
import club.joylink.rtss.vo.voice.VoiceConfigDataVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
//@Transactional
public class VoiceDataManageTest {
@Autowired
private VoiceConfigDataService dataService;
private LoginUserInfoVO getInfo(){
String testJsonData = "{\"accountVO\":{\"id\":\"8146\",\"account\":\"13992867352\",\"type\":\"2\",\"nickname\":\"13992867352\",\"mobile\":\"13992867352\",\"password\":\"e10adc3949ba59abbe56e057f20f883e\",\"roles\":[\"01\",\"05\"],\"email\":\"\",\"status\":\"1\",\"companyId\":124,\"companyName\":\"默认组织\",\"companyAdmin\":false,\"projectCodes\":[\"BJD\",\"CGY\",\"DEFAULT\",\"DRTS\",\"HEB\",\"HYD_RAILWAY\",\"JJJLM\",\"JXGM\",\"NOLOGO\",\"RICHOR\",\"RICHOR_CXJS\",\"RICHOR_HHCJ\",\"RICHOR_JOINT\",\"RICHOR_YGY\",\"SR_SANDBOX\",\"THAILAND_SANDBOX\",\"WJLS\",\"YJDDZH\",\"ZZWW\",\"ZZWWTEST\"]},\"client\":\"Joylink\",\"project\":\"DEFAULT\",\"token\":\"34a5b6916e60eea26a53c820c644c4e8\",\"projectDeviceLogin\":false,\"wechatLogin\":false,\"topOrgId\":124,\"dispatcherRaceTrainingLogin\":false}\n";
LoginUserInfoVO infoVO = JsonUtils.read(testJsonData,LoginUserInfoVO.class);
Project project = new Project();
project.setName("默认项目");
project.setCode("DEFAULT");
ProjectVO projectVO = new ProjectVO(project);
infoVO.setProjectInfo(projectVO);
return infoVO;
}
@Test
public void insert(){
VoiceConfigDataVO dataVO = new VoiceConfigDataVO();
dataVO.setDescribe("测试");
dataVO.setMapId(63L);
WakeUpParam wakeUpParam = new WakeUpParam();
wakeUpParam.setWakeups(new String[]{"道岔"});
wakeUpParam.setOperates(new String[]{"定位"});
dataVO.setWakeUpParmas(wakeUpParam);
dataVO.setDeviceType(MapElement.DeviceType.SWITCH);
dataVO.setOperateType(OperateEnum.SWITCH_DINGWEI);
OperateConfigData configData = new OperateConfigData();
configData.setDeviceType(MapElement.DeviceType.SWITCH);
configData.setDeviceNameType(OperateConfigData.DeviceNameType.NAME);
dataVO.setParamConfig(List.of(configData));
dataService.saveOrUpdate(dataVO,this.getInfo());
}
@Test
public void insert2(){
VoiceConfigDataVO dataVO = new VoiceConfigDataVO();
dataVO.setDescribe("测试站台");
dataVO.setMapId(63L);
WakeUpParam wakeUpParam = new WakeUpParam();
wakeUpParam.setWakeups(new String[]{"站台"});
wakeUpParam.setOperates(new String[]{"扣车"});
dataVO.setWakeUpParmas(wakeUpParam);
dataVO.setDeviceType(MapElement.DeviceType.STAND);
dataVO.setOperateType(OperateEnum.STAND_UP_HOLD_TRAIN);
OperateConfigData configData = new OperateConfigData();
configData.setDeviceType(MapElement.DeviceType.STAND);
configData.setDeviceNameType(OperateConfigData.DeviceNameType.CODE);
// configData.setRegexs(new String[]{"办理(.*)道岔定位","(.*?)道岔定位"});
dataVO.setParamConfig(List.of(configData));
dataService.saveOrUpdate(dataVO,this.getInfo());
}
@Test
public void changeStatus(){
dataService.changeStatus(1L,2);
}
}