| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.system.entity.BaseFactory; |
| | | import org.jeecg.modules.system.entity.BaseFactoryUser; |
| | | import org.jeecg.modules.system.service.IBaseFactoryService; |
| | | import org.jeecg.modules.system.service.IBaseFactoryUserService; |
| | | import org.jeecg.modules.system.entity.SysParams; |
| | | import org.jeecg.modules.system.service.*; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.EamMaintenanceStandardDetailCategory; |
| | | import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; |
| | |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.vo.UserSelector; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private IEamEquipmentExtendService eamEquipmentExtendService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private ISysParamsService sysParamsService; |
| | | |
| | | // 常量定义 |
| | | private static final String REPAIR_TITLE = "维修人员保养内容"; |
| | |
| | | eamMaintenanceStandardDetailService.saveBatch(allDetails); |
| | | } |
| | | |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("maintenance_import_type"); |
| | | |
| | | if (sysParams != null) { |
| | | if (sysParams.getSettingValue().equals("1")){ |
| | | //触发保养流程 |
| | | eamMaintenanceStandard.setStandardStatus(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name()); |
| | | eamMaintenanceStandardMapper.updateById(eamMaintenanceStandard); |
| | | } |
| | | }else { |
| | | return Result.error("未找到保养流程导入相关配置,请联系管理员"); |
| | | } |
| | | |
| | | return Result.OK("点检表导入成功"); |
| | | |
| | | } catch (Exception e) { |
| | |
| | | // 创建项目详情 |
| | | 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); |
| | | |
| | |
| | | |
| | | List<XWPFTable> tables = doc.getTables(); |
| | | EamMaintenanceStandard standard = null; |
| | | boolean firstTableProcessed = false; |
| | | List<EamMaintenanceStandardDetail> items = new ArrayList<>(); |
| | | String standardId = null; |
| | | |
| | |
| | | // 4. 保存项目 |
| | | eamMaintenanceStandardDetailService.saveBatch(items); |
| | | |
| | | |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("maintenance_import_type"); |
| | | |
| | | if (sysParams != null) { |
| | | if (sysParams.getSettingValue().equals("1")) { |
| | | standard.setStandardStatus(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name()); |
| | | eamMaintenanceStandardMapper.updateById(standard); |
| | | } |
| | | }else { |
| | | return Result.error("未找到保养流程导入相关配置,请联系管理员"); |
| | | } |
| | | |
| | | return Result.ok(fileName + ": 导入成功, 项目数: " + items.size()); |
| | | |
| | | } catch (ImportException e) { |
| | |
| | | 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(); |