| | |
| | | return baseDesc + newStatus.getDesc(); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门ID获取部门名称 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 部门名称,缺失时返回"/" |
| | | */ |
| | | private String getDeptName(Long deptId) { |
| | | if (deptId == null) { |
| | | return "/"; |
| | |
| | | return dept.getDeptName(); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID获取用户姓名 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 用户姓名,缺失时返回"/" |
| | | */ |
| | | private String getUserName(Long userId) { |
| | | if (userId == null) { |
| | | return "/"; |
| | |
| | | return StringUtil.isBlank(realName) ? "/" : realName; |
| | | } |
| | | |
| | | /** |
| | | * 上传巡查报告并保存附件信息 |
| | | * |
| | | * @param reportFile 报告文件 |
| | | * @param taskEntity 巡查任务 |
| | | * @return 是否保存成功 |
| | | */ |
| | | private boolean saveAttachFile(File reportFile, GdPatrolTaskEntity taskEntity) throws IOException { |
| | | if (reportFile == null || !reportFile.exists()) { |
| | | throw new RuntimeException("巡查报告文件不存在"); |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 构建附件元数据 |
| | | * |
| | | * @param taskEntity 巡查任务 |
| | | * @param reportFile 报告文件 |
| | | * @param bladeFile 文件上传结果 |
| | | * @param resultType 结果类型 |
| | | * @param desiredName 期望文件名 |
| | | * @return 附件信息 |
| | | */ |
| | | private Attach buildAttachInfo(GdPatrolTaskEntity taskEntity, File reportFile, BladeFile bladeFile, Integer resultType, String desiredName) { |
| | | Attach attach = new Attach(); |
| | | attach.setDomainUrl(bladeFile.getDomain()); |
| | |
| | | return attach; |
| | | } |
| | | |
| | | /** |
| | | * 生成报告附件名称 |
| | | * |
| | | * @param taskEntity 巡查任务 |
| | | * @param fallbackName 兜底文件名 |
| | | * @return 附件名称 |
| | | */ |
| | | private String buildReportAttachName(GdPatrolTaskEntity taskEntity, String fallbackName) { |
| | | String taskNo = taskEntity != null ? taskEntity.getTaskNo() : null; |
| | | if (StringUtil.isBlank(taskNo)) { |
| | |
| | | return taskNo + ".docx"; |
| | | } |
| | | |
| | | /** |
| | | * 解析巡查任务类型为结果类型 |
| | | * |
| | | * @param patrolTaskType 巡查任务类型 |
| | | * @return 结果类型 |
| | | */ |
| | | private Integer parseResultType(String patrolTaskType) { |
| | | if (StringUtil.isBlank(patrolTaskType)) { |
| | | return null; |