| | |
| | | if (bladeFile == null || StringUtil.isBlank(bladeFile.getLink())) { |
| | | throw new RuntimeException("附件上传失败"); |
| | | } |
| | | Integer resultType = parseResultType(taskEntity != null ? taskEntity.getPatrolTaskType() : null); |
| | | Attach attach = buildAttachInfo(taskEntity, reportFile, bladeFile, resultType, desiredName); |
| | | // Integer resultType = parseResultType(taskEntity != null ? taskEntity.getPatrolTaskType() : null); |
| | | Attach attach = buildAttachInfo(taskEntity, reportFile, bladeFile, taskEntity.getPatrolTaskType(), desiredName); |
| | | Boolean saved = attachClient.saveAttachInfo(attach); |
| | | if (!Boolean.TRUE.equals(saved)) { |
| | | log.error("附件信息保存失败,报告文件:" + desiredName); |
| | |
| | | * @param desiredName 期望文件名 |
| | | * @return 附件信息 |
| | | */ |
| | | private Attach buildAttachInfo(GdPatrolTaskEntity taskEntity, File reportFile, BladeFile bladeFile, Integer resultType, String desiredName) { |
| | | private Attach buildAttachInfo(GdPatrolTaskEntity taskEntity, File reportFile, BladeFile bladeFile, List<List<String>> resultType, String desiredName) { |
| | | Attach attach = new Attach(); |
| | | attach.setDomainUrl(bladeFile.getDomain()); |
| | | attach.setLink(bladeFile.getLink()); |
| | |
| | | attach.setOriginalName(bladeFile.getOriginalName()); |
| | | attach.setAttachSize(reportFile.length()); |
| | | attach.setExtension(FileUtil.getFileExtension(reportFile.getName())); |
| | | attach.setResultType(resultType); |
| | | attach.setResultType(JSON.toJSONString(resultType)); |
| | | attach.setPatrolTaskId(String.valueOf(taskEntity != null ? taskEntity.getId() : null)); |
| | | Long createUser = taskEntity != null ? taskEntity.getCreateUser() : null; |
| | | Long updateUser = taskEntity != null ? taskEntity.getUpdateUser() : null; |
| | |
| | | } else if (StringUtil.isNotBlank(gdPatrolTaskVO.getTaskNo())) { |
| | | param.setName(gdPatrolTaskVO.getTaskNo()); |
| | | } |
| | | if (StringUtil.isNotBlank(gdPatrolTaskVO.getPatrolTaskType())) { |
| | | param.setInspectionType(gdPatrolTaskVO.getPatrolTaskType()); |
| | | } |
| | | // if (StringUtil.isNotBlank(gdPatrolTaskVO.getPatrolTaskType())) { |
| | | // param.setInspectionType(gdPatrolTaskVO.getPatrolTaskType()); |
| | | // } |
| | | if ((gdPatrolTaskVO.getId() != null)) { |
| | | param.setPatrolTaskId(String.valueOf(gdPatrolTaskVO.getId())); |
| | | } |
| | |
| | | // 机构 |
| | | param.setDeptId(gdPatrolTaskVO.getCreateDept()); |
| | | // 巡检类型 |
| | | // param.setInspectionTypeArr(gdPatrolTaskVO.getPatrolTaskType()); |
| | | param.setInspectionType(gdPatrolTaskVO.getPatrolTaskType()); |
| | | param.setInspectionTypeArr(gdPatrolTaskVO.getPatrolTaskType()); |
| | | // param.setInspectionType(gdPatrolTaskVO.getPatrolTaskType()); |
| | | // 机巢名称 |
| | | param.setAirportName(gdPatrolTaskVO.getDeviceName()); |
| | | param.setStatus("待执行"); |