| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.sxkj.common.constant.WordOrderConstant; |
| | |
| | | import org.sxkj.gd.common.GdMultipartFileUtil; |
| | | import org.sxkj.resource.entity.Attach; |
| | | import org.sxkj.resource.feign.IAttachClient; |
| | | import org.sxkj.system.cache.SysCache; |
| | | import org.sxkj.system.entity.Dept; |
| | | import org.sxkj.system.entity.User; |
| | | import org.sxkj.system.feign.ISysClient; |
| | |
| | | @Autowired |
| | | private IGdTaskResultService gdTaskResultService; |
| | | @Override |
| | | public IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask, List<Long> deptIdList) { |
| | | return page.setRecords(baseMapper.selectGdPatrolTaskPage(page, gdPatrolTask, deptIdList)); |
| | | public IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask) { |
| | | return page.setRecords(baseMapper.selectGdPatrolTaskPage(page, gdPatrolTask, SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())))); |
| | | } |
| | | |
| | | |
| | |
| | | boolean allSubTasksAudited = checkAllSubTasksStatus(subTasks, PatrolTaskStatusEnum.ACCEPTANCE_PASSED); |
| | | // 这里可以根据allSubTasksAudited的结果执行后续逻辑,比如更新工单状态等 |
| | | if (allSubTasksAudited) { |
| | | // 执行工单状态更新逻辑 |
| | | // 1.验收通过,生成报告 |
| | | asyncExportPatrolReport(task.getId()); |
| | | // 2.执行工单状态更新逻辑 |
| | | return updateWorkOrderStatusAndFlow(task.getWorkOrderId(), |
| | | WorkOrderStatusEnum.ACCEPTED_TO_BE_SETTLED); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 异步生成巡查报告 |
| | | * |
| | | * @param patrolTaskId 巡查任务ID |
| | | */ |
| | | @Async |
| | | public void asyncExportPatrolReport(Long patrolTaskId) { |
| | | try { |
| | | exportPatrolReport(patrolTaskId); |
| | | } catch (Exception e) { |
| | | // 记录异步执行错误日志 |
| | | log.error("异步生成巡查报告失败,任务ID: {}"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查拒绝原因是否必填 |
| | |
| | | attach.setAttachSize(reportFile.length()); |
| | | attach.setExtension(FileUtil.getFileExtension(reportFile.getName())); |
| | | attach.setResultType(resultType); |
| | | attach.setPatrolTaskId(String.valueOf(taskEntity != null ? taskEntity.getId() : null)); |
| | | Long createUser = taskEntity != null ? taskEntity.getCreateUser() : null; |
| | | Long updateUser = taskEntity != null ? taskEntity.getUpdateUser() : null; |
| | | Long createDept = taskEntity != null ? taskEntity.getCreateDept() : null; |