| | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.read.listener.PageReadListener; |
| | | import com.ycl.handler.ImageResourceHandler; |
| | | import com.ycl.platform.domain.dto.ImageResourceDTO; |
| | | import com.ycl.platform.domain.entity.CheckIndexVideo; |
| | | import com.ycl.platform.domain.entity.ImageResourceSecurity; |
| | | import com.ycl.platform.domain.entity.ImageResourceSecurityDetail; |
| | |
| | | @Override |
| | | public List<ImageResourceSecurity> selectImageResourceSecurityList(ImageResourceSecurity imageResourceSecurity) { |
| | | List<ImageResourceSecurity> list = imageResourceSecurityMapper.selectImageResourceSecurityList(imageResourceSecurity); |
| | | Map<Long, CheckIndexVideo> map = checkIndexVideoMapper.selectLastOneByDept(); |
| | | list.forEach(item -> item.setImageResourceSecurity( |
| | | Optional.ofNullable(map.get(item.getDeptId())) |
| | | .map(CheckIndexVideo::getImageResourceSecurity) |
| | | .orElse(BigDecimal.ZERO))); |
| | | List<ImageResourceDTO> dtos = checkIndexVideoMapper.selectLastOneByDept(); |
| | | for (ImageResourceSecurity item : list) { |
| | | Long deptId = item.getDeptId(); |
| | | boolean flag = false; |
| | | for (ImageResourceDTO dto : dtos) { |
| | | if(dto.getDeptId().equals(deptId)){ |
| | | item.setImageResourceSecurity(dto.getImageResourceSecurity()); |
| | | flag = true; |
| | | } |
| | | if(!flag){ |
| | | item.setImageResourceSecurity(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |