|  |  | 
 |  |  | import com.alibaba.fastjson.JSONObject; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
 |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
 |  |  | import com.doumee.core.constants.ResponseStatus; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.haikang.model.HKConstants; | 
 |  |  | 
 |  |  | import com.doumee.dao.business.model.Platform; | 
 |  |  | import com.doumee.dao.business.model.PlatformDevice; | 
 |  |  | import com.doumee.dao.business.model.PlatformJob; | 
 |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.context.annotation.Lazy; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.*; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 设备信息表Service实现 | 
 |  |  | 
 |  |  |     private PlatformJobMapper platformJobMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private PlatformDeviceMapper platformDeviceMapper; | 
 |  |  |     @Autowired | 
 |  |  |     @Lazy | 
 |  |  |     private SystemDictDataBiz systemDictDataBiz; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 同步海康月台数据 | 
 |  |  | 
 |  |  |         return  true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public  List<Integer> getMenuConfig(String userId){ | 
 |  |  |         try { | 
 |  |  |             List<Integer> resultList= new ArrayList<>(); | 
 |  |  |             Map<String,String> param = new HashMap<>(); | 
 |  |  |             param.put("userId",userId); | 
 |  |  |             BaseResponse<MenuDataResponse> result = HKService.getMenuConfig(param); | 
 |  |  |             if(result !=null){ | 
 |  |  |                 if(!StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE)){ | 
 |  |  |                     throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),result.getMsg()); | 
 |  |  |                 } | 
 |  |  |                 MenuDataResponse menuDataResponse = result.getData(); | 
 |  |  |                 List<String> list = menuDataResponse.getList(); | 
 |  |  |                 if(CollectionUtils.isNotEmpty(list)){ | 
 |  |  |                     //分别判断4个菜单 | 
 |  |  |                     if(list.stream().filter(i->i.equals("Infovision iPark Platform_"+HKConstants.MenuPageId.afzx)).collect(Collectors.toList()).size()>Constants.ZERO){ | 
 |  |  |                         resultList.add(0); | 
 |  |  |                     } | 
 |  |  |                     if(list.stream().filter(i->i.equals("Infovision iPark Platform_"+HKConstants.MenuPageId.xkzx)).collect(Collectors.toList()).size()>Constants.ZERO){ | 
 |  |  |                         resultList.add(1); | 
 |  |  |                     } | 
 |  |  |                     if(list.stream().filter(i->i.equals("Infovision iPark Platform_"+HKConstants.MenuPageId.ngzx)).collect(Collectors.toList()).size()>Constants.ZERO){ | 
 |  |  |                         resultList.add(2); | 
 |  |  |                     } | 
 |  |  |                     if(list.stream().filter(i->i.equals("Infovision iPark Platform_"+HKConstants.MenuPageId.jsc)).collect(Collectors.toList()).size()>Constants.ZERO){ | 
 |  |  |                         resultList.add(3); | 
 |  |  |                     } | 
 |  |  |                     if(list.stream().filter(i->i.equals("Infovision iPark Platform_"+HKConstants.MenuPageId.kqgzt)).collect(Collectors.toList()).size()>Constants.ZERO){ | 
 |  |  |                         resultList.add(4); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 return resultList; | 
 |  |  |             }else{ | 
 |  |  |                 throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取菜单失败!"); | 
 |  |  |             } | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |         } | 
 |  |  |         throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取菜单失败,请稍后重试!"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |