| | |
| | | import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; |
| | | import org.jeecg.modules.eam.vo.EamMaintenanceStandardVo; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private IEamEquipmentService eamEquipmentService; |
| | | |
| | | /** |
| | | * 流程启动,保存对应的数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "保养标准-流程启动保存对应的数据", notes = "保养标准-流程启动保存对应的数据") |
| | | @GetMapping(value = "/saveEamMaintenanceStandardProcess") |
| | | public Result<?> saveEamMaintenanceStandardProcess(String id){ |
| | | return Result.OK(eamMaintenanceStandardService.saveEamMaintenanceStandardProcess(id)); |
| | | } |
| | | |
| | | /** |
| | | * 流程审核 |
| | | * @param eamMaintenanceStandardVo |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "保养标准-流程审核", notes = "保养标准-流程审核") |
| | | @PostMapping(value = "/audit") |
| | | public Result<?> auditEamMaintenanceStandard(EamMaintenanceStandardVo eamMaintenanceStandardVo){ |
| | | return Result.OK(eamMaintenanceStandardService.auditEamMaintenanceStandard(eamMaintenanceStandardVo)); |
| | | } |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | //文件编码 |
| | | Cell fileCode = row.getCell(13); |
| | | request.setFileCode(fileCode.getStringCellValue()); |
| | | |
| | | Map<String, PictureData> pictures; |
| | | if (isXSSFWorkbook) { |
| | | pictures = PoiPublicUtil.getSheetPictrues07((XSSFSheet) book.getSheetAt(0), (XSSFWorkbook) book); |
| | | } else { |
| | | pictures = PoiPublicUtil.getSheetPictrues03((HSSFSheet) book.getSheetAt(0), (HSSFWorkbook) book); |
| | | } |
| | | |
| | | if (CollectionUtil.isNotEmpty(pictures)) { |
| | | //只会存在一张图片 |
| | | PictureData pictureData = pictures.get(pictures.keySet().iterator().next()); |
| | | byte[] data = pictureData.getData(); |
| | | String fileName = request.getEquipmentCode() + "[" + request.getFileCode() + "]" + "." + pictureData.suggestFileExtension(); |
| | | FileUploadResult fileUploadResult = FileUtil.uploadFile(data, fileName); |
| | | if(fileUploadResult != null) { |
| | | List<FileUploadResult> fileList = request.getFileList(); |
| | | if(fileList == null) { |
| | | fileList = new ArrayList<FileUploadResult>(); |
| | | } |
| | | fileList.add(fileUploadResult); |
| | | request.setFileList(fileList); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("读取Excel信息失败:{}", e.getMessage(), e); |
| | | } |