| | |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.EamReportAccidentsRegisterEnum; |
| | | import org.jeecg.modules.eam.constant.EamReportProductHazardsEnum; |
| | | import org.jeecg.modules.eam.constant.SecondMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; |
| | | import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamReportAccidentsRegister; |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 产品安全隐患确认打印 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EamReportProductHazardsDto> findListByIds(String ids){ |
| | | QueryWrapper<EamReportProductHazardsDto> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("erph.del_flag",CommonConstant.DEL_FLAG_0.toString()); |
| | | queryWrapper.eq("erph.confirm_status",EamReportProductHazardsEnum.REPAIR_COMPLETED.name() ); |
| | | //用户数据权限 |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return new ArrayList<>(); |
| | | } |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | //选择了设备,根据设备id过滤设备 |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | //没有选择设备,根据中心过滤设备 |
| | | List<BaseFactoryUser> baseFactoryUserList=baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("e.factory_org_code", factoryCode); |
| | | } else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | //查询条件过滤 |
| | | if (StrUtil.isNotEmpty(ids)) { |
| | | List<String> idList = Arrays.asList(ids.split(",")); |
| | | queryWrapper.in("erph.id", idList); |
| | | } else { |
| | | queryWrapper.orderByDesc("erph.create_time"); |
| | | } |
| | | return this.baseMapper.queryList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | |