|
|
@@ -1,274 +1,290 @@
|
|
|
package cn.vbdsm.manage.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import javax.core.common.Page;
|
|
|
-import javax.core.common.ResultMsg;
|
|
|
-import javax.core.common.utils.DataUtils;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import cn.vbdsm.common.config.I18nConfig;
|
|
|
import cn.vbdsm.common.constants.SystemConstant;
|
|
|
import cn.vbdsm.manage.dao.WarnAlarmParamsDao;
|
|
|
import cn.vbdsm.manage.model.AlarmParam;
|
|
|
import cn.vbdsm.manage.mvc.vo.ExplorerMenuVo;
|
|
|
import cn.vbdsm.manage.mvc.vo.TreeMenuNewVo;
|
|
|
-import cn.vbdsm.manage.service.IApplyCategoryService;
|
|
|
-import cn.vbdsm.manage.service.IApplyService;
|
|
|
-import cn.vbdsm.manage.service.IDesktopService;
|
|
|
-import cn.vbdsm.manage.service.IExplorerService;
|
|
|
-import cn.vbdsm.manage.service.ITreemenuService;
|
|
|
+import cn.vbdsm.manage.service.*;
|
|
|
import cn.vbdsm.model.Apply;
|
|
|
import cn.vbdsm.model.ApplyCategory;
|
|
|
import cn.vbdsm.model.TreeMenu;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.core.common.Page;
|
|
|
+import javax.core.common.ResultMsg;
|
|
|
+import javax.core.common.utils.DataUtils;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class ExplorerService implements IExplorerService {
|
|
|
- @Autowired IApplyCategoryService applyCategoryService;
|
|
|
- @Autowired IDesktopService desktopService;
|
|
|
- @Autowired IApplyService applyService;
|
|
|
- @Autowired ITreemenuService treemenuService;
|
|
|
- @Autowired WarnAlarmParamsDao warnAlarmParamsDao;
|
|
|
+ @Autowired
|
|
|
+ IApplyCategoryService applyCategoryService;
|
|
|
+ @Autowired
|
|
|
+ IDesktopService desktopService;
|
|
|
+ @Autowired
|
|
|
+ IApplyService applyService;
|
|
|
+ @Autowired
|
|
|
+ ITreemenuService treemenuService;
|
|
|
+ @Autowired
|
|
|
+ WarnAlarmParamsDao warnAlarmParamsDao;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultMsg<?> getMyApplies(String local, int isRoot, List<Long> roleIds, Integer siteId, TreeMenu condition, Long cid, Long uid) {
|
|
|
+ //菜单集合
|
|
|
+ List<ExplorerMenuVo> list = new ArrayList<ExplorerMenuVo>();
|
|
|
+
|
|
|
+ //获取全部分类
|
|
|
+ ResultMsg<?> applyCategoryResult = applyCategoryService.getAll(local);
|
|
|
+ //获取应用
|
|
|
+ ResultMsg<?> applyResult = applyService.getAll(local, isRoot, roleIds, siteId);
|
|
|
+
|
|
|
+ //获取菜单
|
|
|
+ ResultMsg<Page<TreeMenu>> treemenuResult = treemenuService.getAll(local, condition, cid, uid);
|
|
|
+
|
|
|
+ //Set<String> relationMenus = new HashSet<String>();
|
|
|
+
|
|
|
+ Page<ApplyCategory> applyCategoryPage = (Page<ApplyCategory>) applyCategoryResult.getData();
|
|
|
+ Page<Apply> applyPage = (Page<Apply>) applyResult.getData();
|
|
|
+ for (ApplyCategory applyCategory : applyCategoryPage.getRows()) {
|
|
|
+ List<ExplorerMenuVo> applies = new ArrayList<ExplorerMenuVo>();
|
|
|
+ for (Apply apply : applyPage.getRows()) {
|
|
|
+ if (!applyCategory.getId().equals(apply.getCategoryId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //System.out.println(JSONObject.toJSONString(apply));
|
|
|
+ //JSONObject attr = new JSONObject();
|
|
|
+ ExplorerMenuVo applyVo = new ExplorerMenuVo();
|
|
|
+ applyVo.setId(apply.getId());
|
|
|
+ applyVo.setText(apply.getTitle());
|
|
|
+ String icon = apply.getIcon();
|
|
|
+ String[] iconArr = icon.split("@");
|
|
|
+
|
|
|
+ applyVo.setIconCls(iconArr[0]);
|
|
|
+ //attr.put("icon", apply.getIcon());
|
|
|
+ //applyVo.setAttributes(attr);
|
|
|
+ String content = apply.getContent();
|
|
|
+ content = content.substring(1, content.length() - 1);
|
|
|
+ String[] menuIds = content.split(",");
|
|
|
+ List<ExplorerMenuVo> treeMenus = new ArrayList<ExplorerMenuVo>();
|
|
|
+ for (String s : menuIds) {
|
|
|
+ if (s.equals("0") || s.equals("null")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (TreeMenu treeMenu : treemenuResult.getData().getRows()) {
|
|
|
+ if (!DataUtils.getLong(s).equals(treeMenu.getId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ ExplorerMenuVo treeMenuVo = new ExplorerMenuVo();
|
|
|
+ treeMenuVo.setId(treeMenu.getId());
|
|
|
+ treeMenuVo.setText(treeMenu.getName());
|
|
|
+ Map attributes = new HashMap();
|
|
|
+ attributes.put("appId", apply.getId());
|
|
|
+ attributes.put("menuId", treeMenu.getId());
|
|
|
+ attributes.put("url", treeMenu.getUrl());
|
|
|
+ attributes.put("platform", treeMenu.getPlatform());
|
|
|
+ treeMenuVo.setAttributes(attributes);
|
|
|
+ treeMenus.add(treeMenuVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (treeMenus.size() > 1) {
|
|
|
+ applyVo.setChildren(treeMenus);
|
|
|
+ } else {
|
|
|
+ //((Map)treeMenus.get(0).getAttributes()).remove("url");
|
|
|
+ ((Map) treeMenus.get(0).getAttributes()).put("icon", apply.getIcon());
|
|
|
+ applyVo.setAttributes(treeMenus.get(0).getAttributes());
|
|
|
+ }
|
|
|
+ applies.add(applyVo);
|
|
|
+ }
|
|
|
+ if (applies.size() > 0) {
|
|
|
+ ExplorerMenuVo applyCategoryVo = new ExplorerMenuVo();
|
|
|
+ applyCategoryVo.setId(applyCategory.getId());
|
|
|
+ applyCategoryVo.setText(applyCategory.getTitle());
|
|
|
+ applyCategoryVo.setIconCls("");
|
|
|
+ applyCategoryVo.setChildren(applies);
|
|
|
+ list.add(applyCategoryVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new ResultMsg<List<ExplorerMenuVo>>(SystemConstant.RESULT_STATUS_SUCCESS, I18nConfig.getValue(local, "tips", "get_success"), list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultMsg<?> getMyTreeApplies(String local, int isRoot, List<Long> roleIds, Integer siteId,
|
|
|
+ TreeMenu condition, Long cid, Long uid, String userType, String authCid) {
|
|
|
+ //菜单集合
|
|
|
+ List<TreeMenuNewVo> list = new ArrayList<TreeMenuNewVo>();
|
|
|
+ //大屏展示菜单集合
|
|
|
+ List<TreeMenuNewVo> bigScreen = new ArrayList<TreeMenuNewVo>();
|
|
|
|
|
|
- @Override
|
|
|
- public ResultMsg<?> getMyApplies(String local,int isRoot,List<Long> roleIds,Integer siteId,TreeMenu condition,Long cid,Long uid) {
|
|
|
- //菜单集合
|
|
|
- List<ExplorerMenuVo> list = new ArrayList<ExplorerMenuVo>();
|
|
|
+ //获取全部分类
|
|
|
+ ResultMsg<?> applyCategoryResult = applyCategoryService.getAll(local);
|
|
|
+ //获取应用
|
|
|
+ ResultMsg<?> applyResult = applyService.getAll(local, isRoot, roleIds, siteId);
|
|
|
+ //获取菜单
|
|
|
+ ResultMsg<Page<TreeMenu>> treemenuResult = treemenuService.getAll(local, condition, cid, uid);
|
|
|
|
|
|
- //获取全部分类
|
|
|
- ResultMsg<?> applyCategoryResult = applyCategoryService.getAll(local);
|
|
|
- //获取应用
|
|
|
- ResultMsg<?> applyResult = applyService.getAll(local, isRoot, roleIds, siteId);
|
|
|
+ Page<ApplyCategory> applyCategoryPage = (Page<ApplyCategory>) applyCategoryResult.getData();
|
|
|
+ Page<Apply> applyPage = (Page<Apply>) applyResult.getData();
|
|
|
+ //
|
|
|
+ Map<String, Map<String, Object>> big = new HashMap<String, Map<String, Object>>();
|
|
|
+ AlarmParam alarmParam = warnAlarmParamsDao.selectOne();
|
|
|
+ Long roleId = roleIds.get(0);
|
|
|
+ for (ApplyCategory applyCategory : applyCategoryPage.getRows()) {
|
|
|
+ List<TreeMenuNewVo> applies = new ArrayList<TreeMenuNewVo>();
|
|
|
|
|
|
- //获取菜单
|
|
|
- ResultMsg<Page<TreeMenu>> treemenuResult = treemenuService.getAll(local, condition, cid, uid);
|
|
|
+ for (Apply apply : applyPage.getRows()) {
|
|
|
+ if (!applyCategory.getId().equals(apply.getCategoryId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ TreeMenuNewVo applyVo = new TreeMenuNewVo();
|
|
|
+ applyVo.setId(apply.getId());
|
|
|
+ applyVo.setText(apply.getTitle());
|
|
|
|
|
|
- //Set<String> relationMenus = new HashSet<String>();
|
|
|
+ String content = apply.getContent();
|
|
|
+ content = content.substring(1, content.length() - 1);
|
|
|
+ String[] menuIds = content.split(",");
|
|
|
+ //menuIds大于1的时候,不需要图标,二级菜单为sub-icon
|
|
|
+ // 修改icon
|
|
|
+ String icon = apply.getIcon();
|
|
|
+ String[] iconArr = icon.split("@");
|
|
|
+ applyVo.setIcon(iconArr[0]);
|
|
|
+ //}
|
|
|
+ List<TreeMenuNewVo> treeMenus = new ArrayList<TreeMenuNewVo>();
|
|
|
+ for (String s : menuIds) {
|
|
|
+ if (s.equals("0") || s.equals("null")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (TreeMenu treeMenu : treemenuResult.getData().getRows()) {
|
|
|
+ if (!DataUtils.getLong(s).equals(treeMenu.getId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //平台中心进去统一用电概况
|
|
|
+ if (authCid != null && !"".equals(authCid)) {
|
|
|
+ //if (apply.getId() == 142) {
|
|
|
+ if (apply.getId() == 73) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", apply.getTitle());
|
|
|
+ big.put("index", map);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //政府监管
|
|
|
+ //if (roleId == 33 || roleId == 45) {
|
|
|
+ if (roleId == 7 || roleId == 8) {
|
|
|
+ //大屏显示
|
|
|
+ //if (applyCategory.getId() == 36) {
|
|
|
+ if (applyCategory.getId() == 14) {
|
|
|
+ if ("01080006".equals(userType)) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", apply.getTitle());
|
|
|
+ map.put("dispalyNum", alarmParam.getDispalyNum());
|
|
|
+ map.put("delay", alarmParam.getBroadcastTime());
|
|
|
+ big.put(apply.getIcon(), map);
|
|
|
+ }
|
|
|
+ //} else if (applyCategory.getId() == 32) {
|
|
|
+ //数据中心
|
|
|
+ } else if (applyCategory.getId() == 11) {
|
|
|
+ //运行
|
|
|
+ //if (apply.getId() == 143 && !"01080006".equals(userType) && s.equals("1536")) {
|
|
|
+ if (apply.getId() == 74 && !"01080006".equals(userType) && s.equals("51")) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", treeMenu.getName());
|
|
|
+ big.put("index", map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // } else if (roleId == 35 || roleId == 36 || roleId == 43 || roleId == 44) {
|
|
|
+ //电能管理师 及 园区监管
|
|
|
+ } else if (roleId == 2 || roleId == 3 || roleId == 4 || roleId == 9) {
|
|
|
+ //电能服务
|
|
|
+ //if (apply.getId() == 94) {
|
|
|
+ if (apply.getId() == 42) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", apply.getTitle());
|
|
|
+ big.put("index", map);
|
|
|
+ }
|
|
|
+ } else if (roleId == 1) {
|
|
|
+ //if (apply.getId() == 143 && s.equals("1536")) {
|
|
|
+ if (apply.getId() == 74 && s.equals("51")) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", apply.getTitle());
|
|
|
+ big.put("index", map);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //默认用电概况
|
|
|
+ //if (apply.getId() == 142) {
|
|
|
+ if (apply.getId() == 73) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", treeMenu.getUrl());
|
|
|
+ map.put("appId", apply.getId());
|
|
|
+ map.put("menuId", treeMenu.getId());
|
|
|
+ map.put("platform", treeMenu.getPlatform());
|
|
|
+ map.put("text", apply.getTitle());
|
|
|
+ big.put("index", map);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- Page<ApplyCategory> applyCategoryPage = (Page<ApplyCategory>)applyCategoryResult.getData();
|
|
|
- Page<Apply> applyPage = (Page<Apply>)applyResult.getData();
|
|
|
- for(ApplyCategory applyCategory:applyCategoryPage.getRows()){
|
|
|
- List<ExplorerMenuVo> applies = new ArrayList<ExplorerMenuVo>();
|
|
|
- for(Apply apply:applyPage.getRows()){
|
|
|
- if(!applyCategory.getId().equals(apply.getCategoryId())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- //System.out.println(JSONObject.toJSONString(apply));
|
|
|
- //JSONObject attr = new JSONObject();
|
|
|
- ExplorerMenuVo applyVo = new ExplorerMenuVo();
|
|
|
- applyVo.setId(apply.getId());
|
|
|
- applyVo.setText(apply.getTitle());
|
|
|
- applyVo.setIconCls(apply.getIcon());
|
|
|
- //attr.put("icon", apply.getIcon());
|
|
|
- //applyVo.setAttributes(attr);
|
|
|
- String content = apply.getContent();
|
|
|
- content = content.substring(1, content.length()-1);
|
|
|
- String []menuIds = content.split(",");
|
|
|
- List<ExplorerMenuVo> treeMenus = new ArrayList<ExplorerMenuVo>();
|
|
|
- for (String s : menuIds) {
|
|
|
- if(s.equals("0") || s.equals("null")){
|
|
|
- continue;
|
|
|
- }
|
|
|
- for(TreeMenu treeMenu:treemenuResult.getData().getRows()){
|
|
|
- if(!DataUtils.getLong(s).equals(treeMenu.getId())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- ExplorerMenuVo treeMenuVo = new ExplorerMenuVo();
|
|
|
- treeMenuVo.setId(treeMenu.getId());
|
|
|
- treeMenuVo.setText(treeMenu.getName());
|
|
|
- Map attributes = new HashMap();
|
|
|
- attributes.put("appId", apply.getId());
|
|
|
- attributes.put("menuId", treeMenu.getId());
|
|
|
- attributes.put("url", treeMenu.getUrl());
|
|
|
- attributes.put("platform", treeMenu.getPlatform());
|
|
|
- treeMenuVo.setAttributes(attributes);
|
|
|
- treeMenus.add(treeMenuVo);
|
|
|
- }
|
|
|
- }
|
|
|
- if(treeMenus.size() > 1){
|
|
|
- applyVo.setChildren(treeMenus);
|
|
|
- }else{
|
|
|
- //((Map)treeMenus.get(0).getAttributes()).remove("url");
|
|
|
- ((Map)treeMenus.get(0).getAttributes()).put("icon", apply.getIcon());
|
|
|
- applyVo.setAttributes(treeMenus.get(0).getAttributes());
|
|
|
- }
|
|
|
- applies.add(applyVo);
|
|
|
- }
|
|
|
- if(applies.size() > 0){
|
|
|
- ExplorerMenuVo applyCategoryVo = new ExplorerMenuVo();
|
|
|
- applyCategoryVo.setId(applyCategory.getId());
|
|
|
- applyCategoryVo.setText(applyCategory.getTitle());
|
|
|
- applyCategoryVo.setIconCls("");
|
|
|
- applyCategoryVo.setChildren(applies);
|
|
|
- list.add(applyCategoryVo);
|
|
|
- }
|
|
|
- }
|
|
|
- return new ResultMsg<List<ExplorerMenuVo>>(SystemConstant.RESULT_STATUS_SUCCESS, I18nConfig.getValue(local, "tips","get_success"), list);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public ResultMsg<?> getMyTreeApplies(String local, int isRoot, List<Long> roleIds, Integer siteId,
|
|
|
- TreeMenu condition, Long cid, Long uid,String userType,String authCid) {
|
|
|
- //菜单集合
|
|
|
- List<TreeMenuNewVo> list = new ArrayList<TreeMenuNewVo>();
|
|
|
- //大屏展示菜单集合
|
|
|
- List<TreeMenuNewVo> bigScreen = new ArrayList<TreeMenuNewVo>();
|
|
|
-
|
|
|
- //获取全部分类
|
|
|
- ResultMsg<?> applyCategoryResult = applyCategoryService.getAll(local);
|
|
|
- //获取应用
|
|
|
- ResultMsg<?> applyResult = applyService.getAll(local, isRoot, roleIds, siteId);
|
|
|
- //获取菜单
|
|
|
- ResultMsg<Page<TreeMenu>> treemenuResult = treemenuService.getAll(local, condition, cid, uid);
|
|
|
|
|
|
- Page<ApplyCategory> applyCategoryPage = (Page<ApplyCategory>)applyCategoryResult.getData();
|
|
|
- Page<Apply> applyPage = (Page<Apply>)applyResult.getData();
|
|
|
- //
|
|
|
- Map<String, Map<String,Object>> big = new HashMap<String, Map<String,Object>>();
|
|
|
- AlarmParam alarmParam = warnAlarmParamsDao.selectOne();
|
|
|
- Long roleId = roleIds.get(0);
|
|
|
- for(ApplyCategory applyCategory:applyCategoryPage.getRows()){
|
|
|
- List<TreeMenuNewVo> applies = new ArrayList<TreeMenuNewVo>();
|
|
|
-
|
|
|
- for(Apply apply:applyPage.getRows()){
|
|
|
- if(!applyCategory.getId().equals(apply.getCategoryId())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- TreeMenuNewVo applyVo = new TreeMenuNewVo();
|
|
|
- applyVo.setId(apply.getId());
|
|
|
- applyVo.setText(apply.getTitle());
|
|
|
-
|
|
|
- String content = apply.getContent();
|
|
|
- content = content.substring(1, content.length()-1);
|
|
|
- String []menuIds = content.split(",");
|
|
|
- //menuIds大于1的时候,不需要图标,二级菜单为sub-icon
|
|
|
- //重新修改为自由2级菜单有数据
|
|
|
- applyVo.setIcon(apply.getIcon());
|
|
|
- //}
|
|
|
- List<TreeMenuNewVo> treeMenus = new ArrayList<TreeMenuNewVo>();
|
|
|
- for (String s : menuIds) {
|
|
|
- if(s.equals("0") || s.equals("null")){
|
|
|
- continue;
|
|
|
- }
|
|
|
- for(TreeMenu treeMenu:treemenuResult.getData().getRows()){
|
|
|
- if(!DataUtils.getLong(s).equals(treeMenu.getId())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- //平台中心进去统一用电概况
|
|
|
- if(authCid!=null&&!"".equals(authCid)) {
|
|
|
- if(apply.getId()==142) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", apply.getTitle());
|
|
|
- big.put("index", map);
|
|
|
- }
|
|
|
- }else {
|
|
|
- //数据中心
|
|
|
- if(roleId ==33||roleId ==45) {
|
|
|
- if(applyCategory.getId() ==36) {
|
|
|
- if("01080006".equals(userType)) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", apply.getTitle());
|
|
|
- map.put("dispalyNum", alarmParam.getDispalyNum());
|
|
|
- map.put("delay", alarmParam.getBroadcastTime());
|
|
|
- big.put(apply.getIcon(), map);
|
|
|
- }
|
|
|
- }else if(applyCategory.getId()==32){
|
|
|
- //运行
|
|
|
- if(apply.getId() ==143 &&!"01080006".equals(userType)&&s.equals("1536")) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", treeMenu.getName());
|
|
|
- big.put("index", map);
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(roleId ==35||roleId==36||roleId ==43||roleId ==44) {
|
|
|
- //电能服务
|
|
|
- if(apply.getId()==94) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", apply.getTitle());
|
|
|
- big.put("index", map);
|
|
|
- }
|
|
|
- }else if(roleId==1){
|
|
|
- if(apply.getId() ==143&&s.equals("1536")) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", apply.getTitle());
|
|
|
- big.put("index", map);
|
|
|
- }
|
|
|
- }else {
|
|
|
- //默认用电概况
|
|
|
- if(apply.getId()==142) {
|
|
|
- Map<String,Object> map = new HashMap<String, Object>();
|
|
|
- map.put("url", treeMenu.getUrl());
|
|
|
- map.put("appId", apply.getId());
|
|
|
- map.put("menuId", treeMenu.getId());
|
|
|
- map.put("platform", treeMenu.getPlatform());
|
|
|
- map.put("text", apply.getTitle());
|
|
|
- big.put("index", map);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- TreeMenuNewVo treeMenuVo = new TreeMenuNewVo();
|
|
|
- treeMenuVo.setId(treeMenu.getId());
|
|
|
- treeMenuVo.setText(treeMenu.getName());
|
|
|
- if(treeMenu.getUrl() != null || !"".equals(treeMenu.getUrl())) {
|
|
|
- treeMenuVo.setHref("flag");
|
|
|
- }
|
|
|
- Map attributes = new HashMap();
|
|
|
- attributes.put("appId", apply.getId());
|
|
|
- attributes.put("menuId", treeMenu.getId());
|
|
|
- attributes.put("url", treeMenu.getUrl());
|
|
|
- attributes.put("platform", treeMenu.getPlatform());
|
|
|
- treeMenuVo.setAttributes(attributes);
|
|
|
- treeMenuVo.setIcon("sub-icon");
|
|
|
- treeMenus.add(treeMenuVo);
|
|
|
- }
|
|
|
- }
|
|
|
- if(treeMenus.size() > 1){
|
|
|
- applyVo.setNodes(treeMenus);
|
|
|
- }else{
|
|
|
- //((Map)treeMenus.get(0).getAttributes()).put("icon", "sub-icon");
|
|
|
- applyVo.setAttributes(treeMenus.get(0).getAttributes());
|
|
|
- }
|
|
|
- applies.add(applyVo);
|
|
|
- }
|
|
|
- if(applies.size() > 0){
|
|
|
- TreeMenuNewVo treeMenuNewVo = new TreeMenuNewVo();
|
|
|
- if(applyCategory.getId() !=36) {
|
|
|
- treeMenuNewVo.setId(applyCategory.getId());
|
|
|
- treeMenuNewVo.setText(applyCategory.getTitle());
|
|
|
- treeMenuNewVo.setIcon(applyCategory.getIcon());
|
|
|
- treeMenuNewVo.setNodes(applies);
|
|
|
- list.add(treeMenuNewVo);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ TreeMenuNewVo treeMenuVo = new TreeMenuNewVo();
|
|
|
+ treeMenuVo.setId(treeMenu.getId());
|
|
|
+ treeMenuVo.setText(treeMenu.getName());
|
|
|
+ if (treeMenu.getUrl() != null || !"".equals(treeMenu.getUrl())) {
|
|
|
+ treeMenuVo.setHref("flag");
|
|
|
+ }
|
|
|
+ Map attributes = new HashMap();
|
|
|
+ attributes.put("appId", apply.getId());
|
|
|
+ attributes.put("menuId", treeMenu.getId());
|
|
|
+ attributes.put("url", treeMenu.getUrl());
|
|
|
+ attributes.put("platform", treeMenu.getPlatform());
|
|
|
+ treeMenuVo.setAttributes(attributes);
|
|
|
+ treeMenuVo.setIcon("sub-icon");
|
|
|
+ treeMenus.add(treeMenuVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (treeMenus.size() > 1) {
|
|
|
+ applyVo.setNodes(treeMenus);
|
|
|
+ } else {
|
|
|
+ //((Map)treeMenus.get(0).getAttributes()).put("icon", "sub-icon");
|
|
|
+ applyVo.setAttributes(treeMenus.get(0).getAttributes());
|
|
|
+ }
|
|
|
+ applies.add(applyVo);
|
|
|
+ }
|
|
|
+ if (applies.size() > 0) {
|
|
|
+ TreeMenuNewVo treeMenuNewVo = new TreeMenuNewVo();
|
|
|
+ if (applyCategory.getId() != 36) {
|
|
|
+ treeMenuNewVo.setId(applyCategory.getId());
|
|
|
+ treeMenuNewVo.setText(applyCategory.getTitle());
|
|
|
+ treeMenuNewVo.setIcon(applyCategory.getIcon());
|
|
|
+ treeMenuNewVo.setNodes(applies);
|
|
|
+ list.add(treeMenuNewVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// TreeMenuNewVo bigScreenMenuNewVo = new TreeMenuNewVo();
|
|
|
// for (TreeMenuNewVo treeMenuNewVo : list) {
|
|
|
// if(treeMenuNewVo.getId()==36) {
|
|
|
@@ -285,15 +301,15 @@ public class ExplorerService implements IExplorerService {
|
|
|
// if(bigScreenMenuNewVo.getId()!=null) {
|
|
|
// list.add(bigScreenMenuNewVo);
|
|
|
// }
|
|
|
- Map map = new HashMap<String, Object>();
|
|
|
- map.put("list", list);
|
|
|
+ Map map = new HashMap<String, Object>();
|
|
|
+ map.put("list", list);
|
|
|
// if(bigScreen.size()>0) {
|
|
|
// map.put("bigScreen", bigScreen);
|
|
|
// }
|
|
|
- if(!big.isEmpty()) {
|
|
|
- map.put("bigScreen", big);
|
|
|
- }
|
|
|
- return new ResultMsg<Object>(SystemConstant.RESULT_STATUS_SUCCESS, I18nConfig.getValue(local, "tips","get_success"), map);
|
|
|
- }
|
|
|
+ if (!big.isEmpty()) {
|
|
|
+ map.put("bigScreen", big);
|
|
|
+ }
|
|
|
+ return new ResultMsg<Object>(SystemConstant.RESULT_STATUS_SUCCESS, I18nConfig.getValue(local, "tips", "get_success"), map);
|
|
|
+ }
|
|
|
|
|
|
}
|