Commit 2b19b110 LN

Merge remote-tracking branch 'origin/master'

2 个父辈 de442d51 6422255e
......@@ -10,7 +10,7 @@
</parent>
<groupId>com.neotel</groupId>
<artifactId>smf-core</artifactId>
<version>1.7.1</version>
<version>1.8.1312</version>
<packaging>war</packaging>
<name>smf-core</name>
<description>SMF project for Spring Boot</description>
......
......@@ -15,11 +15,12 @@
*/
package com.neotel.smfcore.core.system.websocket;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev")
@Configuration
public class WebSocketConfig {
......
......@@ -17,6 +17,7 @@ package com.neotel.smfcore.core.system.websocket;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Component;
import javax.websocket.*;
......@@ -30,6 +31,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
/**
* WebSocket与客户端通信
*/
@ConditionalOnClass(value = WebSocketConfig.class)
@ServerEndpoint("/webSocket/{sid}")
@Slf4j
@Component
......
......@@ -104,7 +104,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
commandMap.put(command.getEventId(),command);
log.info("发送检查物料条码请求:" + command.toReqMsg());
ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg());
testCheckOK(command);
//testCheckOK(command);
resultBean.setMsg("Check Material result:"+resultBean.getMsg());
return resultBean;
}
......
......@@ -76,11 +76,10 @@ public class MenuController {
} catch (Exception ex) {
log.error("获取当前用户出错:" + ex);
}
String language= servletRequest.getLocale().getLanguage();
List<Menu> menuList = menuManager.findByUserId(userId);
List<Menu> buildMenuList=menuManager.buildTree(menuList);
// List<MenuDto> menuDtoList = menuMapper.toDto(menuManager.buildTree(menuList));
List<MenuVo> vos = menuManager.buildMenus(buildMenuList,language);
List<MenuVo> vos = menuManager.buildMenus(buildMenuList,servletRequest.getLocale());
return new ResponseEntity<>(vos, HttpStatus.OK);
}
......
......@@ -11,6 +11,7 @@ import com.neotel.smfcore.security.service.po.Role;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import java.util.Set;
......@@ -39,7 +40,7 @@ public interface IMenuManager extends IBaseManager<Menu> {
* @param menus /
* @return /
*/
List<MenuVo> buildMenus(List<Menu> menus,String language);
List<MenuVo> buildMenus(List<Menu> menus, Locale locale);
/**
* 懒加载菜单数据
......
......@@ -117,7 +117,7 @@ public class MenuManagerImpl implements IMenuManager {
}
@Override
public List<MenuVo> buildMenus(List<Menu> menuList,String language) {
public List<MenuVo> buildMenus(List<Menu> menuList,Locale locale) {
List<MenuVo> list=new LinkedList<>() ;
menuList.forEach(menu -> {
......@@ -127,7 +127,7 @@ public class MenuManagerImpl implements IMenuManager {
MenuVo menuVo=new MenuVo();
String oldName=ObjectUtil.isNotEmpty(menu.getComponentName())?menu.getComponentName():menu.getTitle();
String titleKey=menu.GetMsgKey();
String title= MessageUtils.getText(titleKey, new Locale(language),oldName);
String title= MessageUtils.getText(titleKey, locale,oldName);
// log.info(titleKey+"="+title);
menuVo.setName(title);
boolean pidIsNull=(menu.getPid()==null)||(StringUtils.isBlank(menu.getPid())||menu.getPid().equals("0"));
......@@ -148,7 +148,7 @@ public class MenuManagerImpl implements IMenuManager {
if(CollectionUtil.isNotEmpty(menuDtoList)){
menuVo.setAlwaysShow(true);
menuVo.setRedirect("noredirect");
menuVo.setChildren(buildMenus(menuDtoList,language));
menuVo.setChildren(buildMenus(menuDtoList,locale));
}else if (pidIsNull) {
MenuVo menuVo1=new MenuVo();
menuVo1.setMeta(menuVo.getMeta());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!