Merge remote-tracking branch 'origin/feature-BOX一期' into feature-BOX一期
This commit is contained in:
commit
f5f7b0a526
@ -16,6 +16,8 @@ public enum AskTypeEnum {
|
|||||||
|
|
||||||
UPDATE(100, "固件升级"),
|
UPDATE(100, "固件升级"),
|
||||||
BOX_ON_LINE(101, "Box配网成功"),
|
BOX_ON_LINE(101, "Box配网成功"),
|
||||||
|
BOX_OFF_LINE(102, "Box离线"),
|
||||||
|
COMMAND_N(200, "指令后必须跟的名称词")
|
||||||
;
|
;
|
||||||
AskTypeEnum(Integer c, String n){
|
AskTypeEnum(Integer c, String n){
|
||||||
code = c;
|
code = c;
|
||||||
|
|||||||
@ -69,7 +69,7 @@ public class SystemTalkAnswerConfigEntity extends GenericEntity<Long> {
|
|||||||
@Column(name = "key_order", nullable = false)
|
@Column(name = "key_order", nullable = false)
|
||||||
private Long keyOrder;
|
private Long keyOrder;
|
||||||
|
|
||||||
@Comment("回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级")
|
@Comment("回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级 101:Box上线 200:动作后必须跟的名称词")
|
||||||
@Column(name = "answer_type", nullable = false)
|
@Column(name = "answer_type", nullable = false)
|
||||||
private Integer answerType;
|
private Integer answerType;
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class SystemTalkAnswerConfigRequest implements java.io.Serializable {
|
|||||||
//关键字的排序,越小越第一个匹配上
|
//关键字的排序,越小越第一个匹配上
|
||||||
private Long keyOrder;
|
private Long keyOrder;
|
||||||
|
|
||||||
//"回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级"
|
//回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级 101:Box上线 200:动作后必须跟的名称词
|
||||||
private Integer answerType;
|
private Integer answerType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class SystemTalkAnswerConfigResp {
|
|||||||
//关键字的排序,越小越第一个匹配上
|
//关键字的排序,越小越第一个匹配上
|
||||||
private Long keyOrder;
|
private Long keyOrder;
|
||||||
|
|
||||||
//"回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级"
|
//回答类型0:文本问答 1:iOT控制 2:天气 3:闹钟 4:U3D 5:音乐声音 100:固件升级 101:Box上线 200:动作后必须跟的名称词
|
||||||
private Integer answerType;
|
private Integer answerType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.qiuguo.iot.data.service.system;
|
package com.qiuguo.iot.data.service.system;
|
||||||
|
|
||||||
|
|
||||||
|
import com.qiuguo.iot.base.enums.AskTypeEnum;
|
||||||
import com.qiuguo.iot.base.utils.StringUtils;
|
import com.qiuguo.iot.base.utils.StringUtils;
|
||||||
import com.qiuguo.iot.data.entity.system.SystemTalkAnswerConfigEntity;
|
import com.qiuguo.iot.data.entity.system.SystemTalkAnswerConfigEntity;
|
||||||
import com.qiuguo.iot.data.request.system.SystemTalkAnswerConfigRequest;
|
import com.qiuguo.iot.data.request.system.SystemTalkAnswerConfigRequest;
|
||||||
@ -20,8 +21,10 @@ import reactor.core.scheduler.Scheduler;
|
|||||||
import reactor.core.scheduler.Schedulers;
|
import reactor.core.scheduler.Schedulers;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,9 +41,16 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public class SystemTalkAnswerConfigService extends GenericReactiveCrudService<SystemTalkAnswerConfigEntity, Long> {
|
public class SystemTalkAnswerConfigService extends GenericReactiveCrudService<SystemTalkAnswerConfigEntity, Long> {
|
||||||
|
|
||||||
private static Integer MAX_COUT = 1000;
|
private static Integer MAX_COUT = 1000;
|
||||||
//内存中缓存这些数据,正常这些数据不会很多
|
/**
|
||||||
|
* 内存中缓存这些数据自定义指令,正常这些数据不会很多
|
||||||
|
*/
|
||||||
private static ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> group = new ConcurrentHashMap<>();
|
private static ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> group = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内存中缓存这些数据自定义指令,正常这些数据不会很多
|
||||||
|
*/
|
||||||
|
private static List<SystemTalkAnswerConfigEntity> groupCommand = new ArrayList<>();
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void initGroup() {
|
public void initGroup() {
|
||||||
log.info("初始化自定义回答缓存数据");
|
log.info("初始化自定义回答缓存数据");
|
||||||
@ -49,10 +59,17 @@ public class SystemTalkAnswerConfigService extends GenericReactiveCrudService<Sy
|
|||||||
reactiveQuery = reactiveQuery.and("is_delete", 0);
|
reactiveQuery = reactiveQuery.and("is_delete", 0);
|
||||||
|
|
||||||
reactiveQuery.paging(0, MAX_COUT.intValue()).fetch().map(item ->{
|
reactiveQuery.paging(0, MAX_COUT.intValue()).fetch().map(item ->{
|
||||||
group.put(item.getAskKey(), item);
|
if(item.getAnswerType() < AskTypeEnum.UPDATE.getCode()) {
|
||||||
|
group.put(item.getAskKey(), item);
|
||||||
|
}else if(item.getAnswerType().equals(AskTypeEnum.COMMAND_N.getCode())){
|
||||||
|
groupCommand.add(item);
|
||||||
|
}
|
||||||
return item;
|
return item;
|
||||||
}).doFinally(signalType -> {
|
}).doFinally(signalType -> {
|
||||||
log.info("配置最多读取{}条,实际读取了{}条自定义回答指令", MAX_COUT, group.size());
|
groupCommand.sort((a, b) ->{
|
||||||
|
return b.getAskKey().length() - a.getAskKey().length();
|
||||||
|
});
|
||||||
|
log.info("配置最多读取{}条,实际读取了{}条自定义回答指令,指令后参数名称{}条", MAX_COUT, group.size(), groupCommand.size());
|
||||||
}).subscribeOn(Schedulers.single()).subscribe();
|
}).subscribeOn(Schedulers.single()).subscribe();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -296,4 +313,8 @@ public class SystemTalkAnswerConfigService extends GenericReactiveCrudService<Sy
|
|||||||
public ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> getSystemTalkWithKeyGroup() {
|
public ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> getSystemTalkWithKeyGroup() {
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SystemTalkAnswerConfigEntity> getCommandList() {
|
||||||
|
return groupCommand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
package com.qiuguo.iot.third.enums;
|
package com.qiuguo.iot.third.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.qiuguo.iot.base.enums.AskTypeEnum;
|
||||||
import com.qiuguo.iot.base.utils.StringUtils;
|
import com.qiuguo.iot.base.utils.StringUtils;
|
||||||
import com.qiuguo.iot.data.entity.device.DeviceUserBindEntity;
|
import com.qiuguo.iot.data.entity.device.DeviceUserBindEntity;
|
||||||
import com.qiuguo.iot.data.entity.system.SystemTalkAnswerConfigEntity;
|
import com.qiuguo.iot.data.entity.system.SystemTalkAnswerConfigEntity;
|
||||||
import com.qiuguo.iot.third.nlp.action.Action;
|
import com.qiuguo.iot.third.nlp.action.Action;
|
||||||
import com.qiuguo.iot.third.nlp.action.ActionTime;
|
import com.qiuguo.iot.third.nlp.action.ActionTime;
|
||||||
import com.qiuguo.iot.third.nlp.action.Actions;
|
import com.qiuguo.iot.third.nlp.action.Actions;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -17,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
* 作者:吴林
|
* 作者:吴林
|
||||||
* */
|
* */
|
||||||
// 中文词性表
|
// 中文词性表
|
||||||
|
@Slf4j
|
||||||
public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
||||||
|
|
||||||
v(0, "动词"){
|
v(0, "动词"){
|
||||||
@ -26,7 +29,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
action.setAction(key);
|
action.setAction(key);
|
||||||
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(action.getAction(), keyGroup);
|
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(action.getAction(), keyGroup);
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
@ -43,7 +47,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -54,7 +59,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -68,7 +74,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -79,7 +86,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},//LAC PER
|
},//LAC PER
|
||||||
@ -90,7 +98,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -101,7 +110,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -112,7 +122,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
action.getLbs().add(key);
|
action.getLbs().add(key);
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
@ -124,8 +135,9 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
return nt.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs);
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
return nt.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOC(4, "机构团体"){
|
LOC(4, "机构团体"){
|
||||||
@ -135,8 +147,9 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
return nt.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs);
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
return nt.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*nz(5, "其他专名"){
|
/*nz(5, "其他专名"){
|
||||||
@ -146,7 +159,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -157,26 +171,32 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
//匹配到关键词就不能作为名词加入,未匹配到的,分割前的都加入名词
|
//匹配到关键词就不能作为名词加入,未匹配到的,分割前的都加入名词
|
||||||
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(key, keyGroup);
|
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(key, keyGroup);
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
systemTalkAnswerConfigEntities.add(entity);
|
if(entity.getAnswerType().equals(AskTypeEnum.IOT.getCode())){
|
||||||
actions.setA(1);
|
systemTalkAnswerConfigEntities.add(entity);
|
||||||
//已记录的加进去
|
actions.setA(1);
|
||||||
if(StringUtils.isNotEmpty(actions.getName())){
|
//已记录的加进去
|
||||||
//
|
if(StringUtils.isNotEmpty(actions.getName())){
|
||||||
entity = getSystemTalkWithKey(actions.getName(), keyGroup);
|
//
|
||||||
if(entity != null){
|
entity = getSystemTalkWithKey(actions.getName(), keyGroup);
|
||||||
systemTalkAnswerConfigEntities.add(entity);
|
if(entity != null){
|
||||||
actions.setA(1);
|
systemTalkAnswerConfigEntities.add(entity);
|
||||||
}else{
|
actions.setA(1);
|
||||||
//这里会走到a+b=2
|
}else{
|
||||||
action.setName(actions.getName());
|
//这里会走到a+b=2
|
||||||
actions.setB(1);
|
action.setName(actions.getName());
|
||||||
actions.setName("");
|
actions.setB(1);
|
||||||
|
actions.setName("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
log.info("IOT不支持的自定义指令");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(actions.getB() == 1 && actions.getA() == 0){
|
if(actions.getB() == 1 && actions.getA() == 0){
|
||||||
//本名称没有找到对应的动作
|
//本名称没有找到对应的动作
|
||||||
@ -204,7 +224,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -216,7 +237,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -227,13 +249,19 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
if(StringUtils.isNotEmpty(actions.getName())){
|
if(StringUtils.isNotEmpty(actions.getName())){
|
||||||
//action.setName(name);//.add(name);
|
//action.setName(name);//.add(name);
|
||||||
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(actions.getName(), keyGroup);
|
SystemTalkAnswerConfigEntity entity = getSystemTalkWithKey(actions.getName(), keyGroup);
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
systemTalkAnswerConfigEntities.add(entity);
|
if(entity.getAnswerType().equals(AskTypeEnum.IOT.getCode())){
|
||||||
actions.setA(1);//a = 1;
|
systemTalkAnswerConfigEntities.add(entity);
|
||||||
|
actions.setA(1);//a = 1;
|
||||||
|
}else{
|
||||||
|
log.info("IOT不支持的自定义指令");
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(actions.getB() == 1 && actions.getA() == 0){
|
if(actions.getB() == 1 && actions.getA() == 0){
|
||||||
//本名称没有找到对应的动作
|
//本名称没有找到对应的动作
|
||||||
@ -266,7 +294,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -277,7 +306,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -288,7 +318,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -299,7 +330,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -310,7 +342,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -321,7 +354,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},//LAC t
|
},//LAC t
|
||||||
@ -332,7 +366,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},//LAC vn
|
},//LAC vn
|
||||||
@ -343,7 +378,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -354,7 +390,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -365,7 +402,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -376,7 +414,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
action.setStatus(key);
|
action.setStatus(key);
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
@ -388,7 +427,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -399,7 +439,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -411,7 +452,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -422,7 +464,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -433,7 +476,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
ist<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
ist<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -444,7 +488,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
//解析时间关键字
|
//解析时间关键字
|
||||||
action.setTime(new ActionTime());
|
action.setTime(new ActionTime());
|
||||||
action.getTime().setTime(key);
|
action.getTime().setTime(key);
|
||||||
@ -458,8 +503,9 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
return t.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs);
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
return t.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||||
}
|
}
|
||||||
},//LAC TIME
|
},//LAC TIME
|
||||||
/* u(26, "助词"){
|
/* u(26, "助词"){
|
||||||
@ -469,7 +515,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -480,10 +527,11 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},*/
|
||||||
|
|
||||||
a(28, "形容词:包含 ad ag an"){
|
a(28, "形容词:包含 ad ag an"){
|
||||||
@Override
|
@Override
|
||||||
@ -492,18 +540,20 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
return action;
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
return n.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ag(28, "形玉素"){
|
/*ag(28, "形玉素"){
|
||||||
@Override
|
@Override
|
||||||
public Action getAction(ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> keyGroup,
|
public Action getAction(ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> keyGroup,
|
||||||
String key,
|
String key,
|
||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -514,7 +564,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -525,7 +576,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -536,8 +588,9 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
return c.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs);
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
return c.getAction(keyGroup, key, actions, action, systemTalkAnswerConfigEntities, includs, commands);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*x(30, "非语素词"){
|
/*x(30, "非语素词"){
|
||||||
@ -547,7 +600,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -558,7 +612,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},//LAC xc
|
},//LAC xc
|
||||||
@ -569,7 +624,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},//LAC xc
|
},//LAC xc
|
||||||
@ -580,7 +636,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -591,7 +648,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -602,7 +660,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
@ -614,7 +673,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
if(actions.getB() == 1 && actions.getA() == 0){
|
if(actions.getB() == 1 && actions.getA() == 0){
|
||||||
//本名称没有找到对应的动作
|
//本名称没有找到对应的动作
|
||||||
action.setSystemTalkAnswerConfigEntity(actions.getLastSystemTalkAnswerConfigEntity());
|
action.setSystemTalkAnswerConfigEntity(actions.getLastSystemTalkAnswerConfigEntity());
|
||||||
@ -629,7 +689,7 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
action.setLbs(new ArrayList<>());
|
action.setLbs(new ArrayList<>());
|
||||||
action.setAsk(actions.getRecordText());
|
action.setAsk(actions.getRecordText());
|
||||||
}
|
}
|
||||||
int index = Integer.parseInt(key.replace(">", "").replace("<", ""));
|
int index = Integer.parseInt(key.replace(">", ""));
|
||||||
action.setDeviceUserBindEntity(includs.get(index));
|
action.setDeviceUserBindEntity(includs.get(index));
|
||||||
actions.setName("");
|
actions.setName("");
|
||||||
action.setName(action.getDeviceUserBindEntity().getBindName());
|
action.setName(action.getDeviceUserBindEntity().getBindName());
|
||||||
@ -637,6 +697,20 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
qj(101, "在查找字符串时用来临时替换系统自定义动词后面词,目前最多同时支持20个,见LAC字典>1<"){
|
||||||
|
@Override
|
||||||
|
public Action getAction(ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> keyGroup,
|
||||||
|
String key,
|
||||||
|
Actions actions,
|
||||||
|
Action action,
|
||||||
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
|
int index = Integer.parseInt(key.replace("#", ""));
|
||||||
|
action.setActionCommand(commands.get(index).getAskKey());
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
},
|
||||||
DEFAULT(1000, "默认"){
|
DEFAULT(1000, "默认"){
|
||||||
@Override
|
@Override
|
||||||
public Action getAction(ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> keyGroup,
|
public Action getAction(ConcurrentHashMap<String, SystemTalkAnswerConfigEntity> keyGroup,
|
||||||
@ -644,7 +718,8 @@ public enum ChinesePartSpeechEnum implements IChinesePartSpeech{
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs){
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands){
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,5 +14,6 @@ public interface IChinesePartSpeech {
|
|||||||
Actions actions,
|
Actions actions,
|
||||||
Action action,
|
Action action,
|
||||||
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
List<SystemTalkAnswerConfigEntity> systemTalkAnswerConfigEntities,
|
||||||
List<DeviceUserBindEntity> includs);
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,17 +11,34 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class Action {
|
public class Action {
|
||||||
|
|
||||||
//匹配系统的动作
|
/**
|
||||||
|
* 匹配系统的动作
|
||||||
|
*/
|
||||||
private SystemTalkAnswerConfigEntity systemTalkAnswerConfigEntity;
|
private SystemTalkAnswerConfigEntity systemTalkAnswerConfigEntity;
|
||||||
private String action;//动作(动词)
|
/**
|
||||||
|
* 动作(动词、指令)
|
||||||
|
*/
|
||||||
|
private String action;
|
||||||
|
/**
|
||||||
|
* 动作后跟的名词(自定义)
|
||||||
|
*/
|
||||||
|
private String actionCommand;
|
||||||
/**
|
/**
|
||||||
* 动作对象(名词)。可能存在多个,如果有关系词连接
|
* 动作对象(名词)。可能存在多个,如果有关系词连接
|
||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
private String status;//动作程度结果(名词,量词)
|
/**
|
||||||
|
* 动作程度结果(名词,量词)
|
||||||
private ActionTime time;//具体时间
|
*/
|
||||||
private List<String> lbs;//一些城市地狱名词
|
private String status;
|
||||||
|
/**
|
||||||
|
* 具体时间
|
||||||
|
*/
|
||||||
|
private ActionTime time;
|
||||||
|
/**
|
||||||
|
* 一些城市地狱名词
|
||||||
|
*/
|
||||||
|
private List<String> lbs;
|
||||||
/**
|
/**
|
||||||
* 人名
|
* 人名
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -50,29 +50,43 @@ public class NlpService {
|
|||||||
return b.getBindName().length() - a.getBindName().length();
|
return b.getBindName().length() - a.getBindName().length();
|
||||||
});//按照名称由长到短排序
|
});//按照名称由长到短排序
|
||||||
List<DeviceUserBindEntity> includs = new ArrayList<>();
|
List<DeviceUserBindEntity> includs = new ArrayList<>();
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands = new ArrayList<>();
|
||||||
String pText = text;
|
String pText = text;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
//放在这里是因为用户有物联网设备才有意义
|
||||||
|
for (SystemTalkAnswerConfigEntity entity:systemTalkAnswerConfigService.getCommandList()
|
||||||
|
) {
|
||||||
|
if(pText.indexOf(entity.getAskKey()) >= 0){
|
||||||
|
//找到对应的名称
|
||||||
|
pText = pText.replace(entity.getAskKey(), "#" + (i++) + "#");
|
||||||
|
commands.add(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
for (DeviceUserBindEntity entity:list
|
for (DeviceUserBindEntity entity:list
|
||||||
) {
|
) {
|
||||||
if(pText.indexOf(entity.getBindName()) >= 0){
|
if(pText.indexOf(entity.getBindName()) >= 0){
|
||||||
//找到对应的名称
|
//找到对应的名称
|
||||||
pText = pText.replace(entity.getBindName(), ">" + (i++) + "<");
|
pText = pText.replace(entity.getBindName(), ">" + (i++) + ">");
|
||||||
includs.add(entity);
|
includs.add(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(includs.size() > 0) {
|
if(includs.size() > 0) {
|
||||||
return getActions(pText, text, includs);
|
return getActions(pText, text, includs, commands);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return getActions(text, text, null);
|
return getActions(text, text, null, null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//20230928日记,后期改成先匹配用户的设备名称,再找动词
|
//20230928日记,后期改成先匹配用户的设备名称,再找动词
|
||||||
return getActions(text, text, null);
|
return getActions(text, text, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mono<Actions> getActions(String text, String recordText, List<DeviceUserBindEntity> includs) {
|
public Mono<Actions> getActions(String text, String recordText,
|
||||||
|
List<DeviceUserBindEntity> includs,
|
||||||
|
List<SystemTalkAnswerConfigEntity> commands) {
|
||||||
return liguoNlpService.geSingletNlp(text).map(nlp -> {
|
return liguoNlpService.geSingletNlp(text).map(nlp -> {
|
||||||
Actions actions = new Actions();
|
Actions actions = new Actions();
|
||||||
actions.setActions(new ArrayList<>());
|
actions.setActions(new ArrayList<>());
|
||||||
@ -127,7 +141,8 @@ public class NlpService {
|
|||||||
actions,
|
actions,
|
||||||
action,
|
action,
|
||||||
systemTalkAnswerConfigEntities,
|
systemTalkAnswerConfigEntities,
|
||||||
includs);
|
includs,
|
||||||
|
commands);
|
||||||
|
|
||||||
}
|
}
|
||||||
//下面判断最后一个名词
|
//下面判断最后一个名词
|
||||||
|
|||||||
@ -118,7 +118,8 @@ public class BaseWebSocketProcess {
|
|||||||
sendMessage(action, baseSession, resp);
|
sendMessage(action, baseSession, resp);
|
||||||
}else{
|
}else{
|
||||||
//查询是否有相关指令绑定
|
//查询是否有相关指令绑定
|
||||||
controllerDevice(action, binds.getData().get(0), baseSession, action.getName());
|
action.setDeviceUserBindEntity(binds.getData().get(0));
|
||||||
|
controllerDevice(action, action.getDeviceUserBindEntity(), baseSession, action.getName());
|
||||||
|
|
||||||
}
|
}
|
||||||
return Mono.empty();
|
return Mono.empty();
|
||||||
@ -238,6 +239,9 @@ public class BaseWebSocketProcess {
|
|||||||
SystemTalkBindDeviceRequest systemTalkBindDeviceRequest = new SystemTalkBindDeviceRequest();
|
SystemTalkBindDeviceRequest systemTalkBindDeviceRequest = new SystemTalkBindDeviceRequest();
|
||||||
systemTalkBindDeviceRequest.setCategoryCode(deviceUserBindEntity.getCategoryCode());
|
systemTalkBindDeviceRequest.setCategoryCode(deviceUserBindEntity.getCategoryCode());
|
||||||
systemTalkBindDeviceRequest.setSystemTalkId(action.getSystemTalkAnswerConfigEntity().getId());
|
systemTalkBindDeviceRequest.setSystemTalkId(action.getSystemTalkAnswerConfigEntity().getId());
|
||||||
|
if(StringUtils.isNotEmpty(action.getActionCommand())){
|
||||||
|
systemTalkBindDeviceRequest.setAskCommon(action.getActionCommand());
|
||||||
|
}
|
||||||
systemTalkBindDeviceService.selectSystemTalkBindDeviceByRequest(systemTalkBindDeviceRequest)
|
systemTalkBindDeviceService.selectSystemTalkBindDeviceByRequest(systemTalkBindDeviceRequest)
|
||||||
.defaultIfEmpty(new SystemTalkBindDeviceEntity())
|
.defaultIfEmpty(new SystemTalkBindDeviceEntity())
|
||||||
.map(systemTalkBindDeviceEntity -> {
|
.map(systemTalkBindDeviceEntity -> {
|
||||||
@ -258,7 +262,7 @@ public class BaseWebSocketProcess {
|
|||||||
String msg = "";
|
String msg = "";
|
||||||
if(isOk.getCode().equals(RespCodeEnum.SUCESS.getCode())){
|
if(isOk.getCode().equals(RespCodeEnum.SUCESS.getCode())){
|
||||||
//通知打开灯成功
|
//通知打开灯成功
|
||||||
msg = action.getSystemTalkAnswerConfigEntity().getAnswerValue().replaceAll("#name#", deviceName);
|
msg = systemTalkBindDeviceEntity.getAnswerValue().replaceAll("#name#", deviceName);
|
||||||
if(StringUtils.isNotEmpty(action.getStatus())){
|
if(StringUtils.isNotEmpty(action.getStatus())){
|
||||||
msg = msg.replace("#value#", action.getStatus());
|
msg = msg.replace("#value#", action.getStatus());
|
||||||
}
|
}
|
||||||
@ -266,7 +270,7 @@ public class BaseWebSocketProcess {
|
|||||||
log.info("执行指令");
|
log.info("执行指令");
|
||||||
}else{
|
}else{
|
||||||
//通知开灯失败;
|
//通知开灯失败;
|
||||||
msg = action.getSystemTalkAnswerConfigEntity().getAnswerValueFaild().replaceAll("#name#", deviceName);
|
msg = systemTalkBindDeviceEntity.getAnswerValueFaild().replaceAll("#name#", deviceName);
|
||||||
log.info("执行指令失败");
|
log.info("执行指令失败");
|
||||||
}
|
}
|
||||||
BoxMessageResp resp = new BoxMessageResp();
|
BoxMessageResp resp = new BoxMessageResp();
|
||||||
|
|||||||
@ -119,6 +119,8 @@ public class BoxWebSocketHandler extends BaseWebSocketProcess implements WebSock
|
|||||||
// MDC.put(LogMdcConfiguration.PRINT_LOG_ID, requestId);
|
// MDC.put(LogMdcConfiguration.PRINT_LOG_ID, requestId);
|
||||||
boxGroup.remove(boxSession.getSn());//断链后及时移除
|
boxGroup.remove(boxSession.getSn());//断链后及时移除
|
||||||
log.info("设备断开连接SN:{}", boxSession.getSn());
|
log.info("设备断开连接SN:{}", boxSession.getSn());
|
||||||
|
//通知用户端设备绑定成功
|
||||||
|
sendNoticeToUser(boxSession.getUserId(), "设备离线,设备序列号:" + boxSession.getSn(), AskTypeEnum.BOX_OFF_LINE.getCode());
|
||||||
deviceInfoService.setOnLineStatus(sn, YesNo.NO.getCode()).subscribe();
|
deviceInfoService.setOnLineStatus(sn, YesNo.NO.getCode()).subscribe();
|
||||||
ReactiveValueOperations<String, String> operations = reactiveStringRedisTemplate.opsForValue();
|
ReactiveValueOperations<String, String> operations = reactiveStringRedisTemplate.opsForValue();
|
||||||
UserDeviceInfoModel userDeviceInfoModel = new UserDeviceInfoModel();
|
UserDeviceInfoModel userDeviceInfoModel = new UserDeviceInfoModel();
|
||||||
@ -132,6 +134,19 @@ public class BoxWebSocketHandler extends BaseWebSocketProcess implements WebSock
|
|||||||
}).then();
|
}).then();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendNoticeToUser(Long userId, String text, Integer type){
|
||||||
|
BaseSession userSession = getUserSessionWithUserId(userId);
|
||||||
|
if(userSession != null){
|
||||||
|
//log.info("推送用户通知设备绑定成功");
|
||||||
|
UserMessageResp userMsgResp = new UserMessageResp();
|
||||||
|
userMsgResp.setType(type);
|
||||||
|
userMsgResp.setText(text);
|
||||||
|
String msg = JSONObject.toJSONString(userMsgResp);
|
||||||
|
log.info("推送通知到端msg:{}", msg);
|
||||||
|
userSession.getSink().next(userSession.getSession().textMessage(msg));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void checkToken(String sn, Long linkTime, String signature, Long userId){
|
private void checkToken(String sn, Long linkTime, String signature, Long userId){
|
||||||
@ -196,16 +211,9 @@ public class BoxWebSocketHandler extends BaseWebSocketProcess implements WebSock
|
|||||||
//跟新在线状态
|
//跟新在线状态
|
||||||
deviceInfoService.setOnLineStatus(dv.getId(), YesNo.YES.getCode()).subscribe();
|
deviceInfoService.setOnLineStatus(dv.getId(), YesNo.YES.getCode()).subscribe();
|
||||||
//通知用户端设备绑定成功
|
//通知用户端设备绑定成功
|
||||||
BaseSession userSession = getUserSessionWithUserId(userId);
|
sendNoticeToUser(userId, "设备联网成功,设备序列号:" + dv.getSn(), AskTypeEnum.BOX_ON_LINE.getCode());
|
||||||
if(userSession != null){
|
|
||||||
//log.info("推送用户通知设备绑定成功");
|
|
||||||
UserMessageResp userMsgResp = new UserMessageResp();
|
|
||||||
userMsgResp.setType(AskTypeEnum.BOX_ON_LINE.getCode());
|
|
||||||
userMsgResp.setText("设备联网成功,设备序列号:" + dv.getSn());
|
|
||||||
String msg = JSONObject.toJSONString(userMsgResp);
|
|
||||||
log.info("推送通知到端msg:{}", msg);
|
|
||||||
userSession.getSink().next(userSession.getSession().textMessage(msg));
|
|
||||||
}
|
|
||||||
deviceUserBindService.selectDeviceUserBindByRequest(request)
|
deviceUserBindService.selectDeviceUserBindByRequest(request)
|
||||||
.defaultIfEmpty(new DeviceUserBindEntity())
|
.defaultIfEmpty(new DeviceUserBindEntity())
|
||||||
.map(entity ->{
|
.map(entity ->{
|
||||||
@ -239,9 +247,5 @@ public class BoxWebSocketHandler extends BaseWebSocketProcess implements WebSock
|
|||||||
}
|
}
|
||||||
return Mono.empty();
|
return Mono.empty();
|
||||||
}).subscribe();
|
}).subscribe();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class MysqlUtilTable2Bean {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String temp = "";
|
String temp = "";
|
||||||
temp += " //" + tb.getComment() + "\n";
|
temp += " /**\n *" + tb.getComment() + "\n */\n";
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -57,9 +57,9 @@ public class MysqlUtilTable2Bean {
|
|||||||
}
|
}
|
||||||
temp += " private " + tb.getJavaType() + " " + tb.getJavaCode() + ";";
|
temp += " private " + tb.getJavaType() + " " + tb.getJavaCode() + ";";
|
||||||
if(tb.getJavaType().equals("Date")/*tb.getField().equals("modify_time") || tb.getField().equals("create_time")*/){
|
if(tb.getJavaType().equals("Date")/*tb.getField().equals("modify_time") || tb.getField().equals("create_time")*/){
|
||||||
temp += "\n //" + tb.getComment() + "搜索开始\n";
|
temp += "\n /**\n *" + tb.getComment() + "搜索开始\n */\n";
|
||||||
temp += "\n private " + tb.getJavaType() + " " + tb.getJavaCode() + "Start;\n";
|
temp += "\n private " + tb.getJavaType() + " " + tb.getJavaCode() + "Start;\n";
|
||||||
temp += "\n //" + tb.getComment() + "搜索结束\n";
|
temp += "\n /**\n *" + tb.getComment() + "搜索结束\n */\n";
|
||||||
temp += " private " + tb.getJavaType() + " " + tb.getJavaCode() + "End;";
|
temp += " private " + tb.getJavaType() + " " + tb.getJavaCode() + "End;";
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ public class MysqlUtilTable2Bean {
|
|||||||
// 定义声明
|
// 定义声明
|
||||||
for (FieldBean tb : list) {
|
for (FieldBean tb : list) {
|
||||||
String temp = "";
|
String temp = "";
|
||||||
temp += " //" + tb.getComment() + "\n";
|
temp += " /**\n *" + tb.getComment() + "\n */\n";
|
||||||
if (MysqlMain.dto_exclude.contains("," + tb.getField() + ",")) {
|
if (MysqlMain.dto_exclude.contains("," + tb.getField() + ",")) {
|
||||||
continue;
|
continue;
|
||||||
}/*else{
|
}/*else{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user