| | |
| | | String time = df.format(new Date());// new Date()为获取当前系统时间 |
| | | String pastDate = getPastDate(7); |
| | | List<AlarmVO> alarmVOS = alarmService.selectListSe(pastDate, time); |
| | | |
| | | //获取部门数据 |
| | | List<DeptVo> deptVos = deptFeignApi.selDeptList(); |
| | | |
| | | //遍历数据 |
| | | for (int j = 0; j < alarmVOS.size(); j++) { |
| | | if (null!=alarmVOS.get(j).getDeptId()){ |
| | | String[] split = alarmVOS.get(j).getDeptId().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | StringBuffer deptNameBuiffer = new StringBuffer(); |
| | | //数据匹配封装 |
| | | for (String deptId:list) { |
| | | for (DeptVo deptVo:deptVos) { |
| | | if (deptId.equals(deptVo.getId().toString())){ |
| | | deptNameBuiffer.append(deptVo.getDeptName()).append(","); |
| | | } |
| | | } |
| | | } |
| | | //封装部门名称数据 |
| | | alarmVOS.get(j).setDeptName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1)); |
| | | } |
| | | } |
| | | |
| | | return R.data(alarmVOS); |
| | | } |
| | | |