Merge branch 'version_20210122_task' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_20210122_task

This commit is contained in:
DirectionOfMind 2021-01-27 09:28:09 +08:00
commit a9477b6626

View File

@ -61,11 +61,16 @@ public class ThirdTaskController {
log.info("commandDto:" + a); log.info("commandDto:" + a);
a = a.replaceAll("\\\\u0000", ""); //替换掉前面的空格 a = a.replaceAll("\\\\u0000", ""); //替换掉前面的空格
log.info("替换空格之后的命令:" + a); log.info("替换空格之后的命令:" + a);
commandDto = JSONObject.parseObject(a,CommandDto.class); commandDto = JSONObject.parseObject(a, CommandDto.class);
String[] tokens = TaskCommand.parse(commandDto.getCommand()); String[] tokens = TaskCommand.parse(commandDto.getCommand());
log.info("parse data :" + Arrays.toString(tokens)); log.info("parse data :" + Arrays.toString(tokens));
Object object = SpringContextUtils.getBean(tokens[0]); Object object = null;
if (object == null) { try {
object = SpringContextUtils.getBean(tokens[0]);
if (object == null) {
return R.error("命令不存在。");
}
} catch (Exception e) {
return R.error("命令不存在。"); return R.error("命令不存在。");
} }
ICommand iCommand = (ICommand) object; ICommand iCommand = (ICommand) object;