| | |
| | | List<BaseFactoryUser> baseFactoryUserList=baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | List<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toList()); |
| | | List<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getFactoryCode).collect(Collectors.toList()); |
| | | 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 page; |
| | | } |
| | | } |
| | | if(eamMaintenanceStandard != null) { |
| | |
| | | // 创建项目详情 |
| | | EamMaintenanceStandardDetail detail = new EamMaintenanceStandardDetail(); |
| | | detail.setStandardId(standard.getId()); |
| | | detail.setItemCode(Integer.parseInt(getCellStringValue(row.getCell(0)))); |
| | | detail.setItemName(getCellStringValue(row.getCell(1))); |
| | | detail.setItemCategory(itemCategory); |
| | | |
| | |
| | | /*导入点检文件Excel--------------------------结束*/ |
| | | |
| | | /*导入二保三保文件Excel--------------------------开始*/ |
| | | |
| | | /** |
| | | * 统一保养规范导入入口 |
| | | * @param file 上传文件 |
| | |
| | | |
| | | List<XWPFTable> tables = doc.getTables(); |
| | | EamMaintenanceStandard standard = null; |
| | | boolean firstTableProcessed = false; |
| | | List<EamMaintenanceStandardDetail> items = new ArrayList<>(); |
| | | String standardId = null; |
| | | |
| | |
| | | items.addAll(extractThirdMaintenanceItems(table, standardId, true)); |
| | | } |
| | | |
| | | firstTableProcessed = true; |
| | | } else if (firstTableProcessed) { // 后续页面 |
| | | } else { // 后续页面 |
| | | // 提取后续页面的保养项目 |
| | | if ("SECOND".equals(type)) { |
| | | items.addAll(extractSecondMaintenanceItems(table, standardId, false)); |
| | |
| | | if (!items.isEmpty()) { |
| | | items.remove(0); |
| | | } |
| | | |
| | | // 2. 为缺失部位的数据填充前一条的保养部位 |
| | | String lastPart = ""; |
| | | int i =1; |
| | | for (EamMaintenanceStandardDetail item : items) { |
| | | item.setItemCode(i); |
| | | if (item.getItemPart() != null && !item.getItemPart().isEmpty()) { |
| | | lastPart = item.getItemPart(); |
| | | } else if (!lastPart.isEmpty()) { |
| | | item.setItemPart(lastPart); |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | |
| | | } else if (cellContents.size() == 1) { |
| | | // 单列模式:视为内容 |
| | | item.setItemName(cellContents.get(0)); |
| | | } else if (cellContents.isEmpty() && !isRowEmpty(row)) { |
| | | } else if (!isRowEmpty(row)) { |
| | | // 特殊处理:行非空但没有提取到内容(可能是复杂合并单元格) |
| | | // 尝试提取整行文本作为内容 |
| | | StringBuilder content = new StringBuilder(); |