| | |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.performance.mapper.PerformanceShiftMapper; |
| | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | UserMapper userMapper; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) { |
| | | String laboratoryName = ""; |
| | | if(StringUtils.isNotEmpty(laboratory)) { |
| | | laboratoryName = baseMapper.selectLaboratory(Integer.parseInt(laboratory)); |
| | | } |
| | | //查询当前登录人员的架构 |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | //判断全部,个人,组织的权限 |
| | |
| | | String departLimsId = user.getDepartLimsId(); |
| | | if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //查询对应架构名称(通信实验室,电力实验室,检测办) |
| | | //查询对应架构名称(通信实验室,电力实验室,检测办) 检测办的可以全部查看 |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("实验室")) { |
| | | laboratory = departLims; |
| | | if(departLims.contains("检测办") || departLims.equals(laboratoryName)) { |
| | | laboratory = laboratoryName; |
| | | } |
| | | } |
| | | IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory); |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<Map<String, Object>>> getUserList() { |
| | | return baseMapper.findUserList().stream().collect(Collectors.groupingBy(m->m.get("depName").toString())); |
| | | } |
| | | |
| | | // 获取两个localDateTime的每一天 |
| | | public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) { |
| | | List<LocalDateTime> localDateTimes = new ArrayList<>(); |