package com.tuoheng.admin.entity.domain; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.tuoheng.common.common.BaseEntity; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
/** | |||||
* 巡检问题表 | |||||
* | |||||
* @author WangHaoran | |||||
* @since 2021-09-02 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@Accessors(chain = true) | |||||
@TableName("th_question_type") | |||||
public class QuestionType extends BaseEntity implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 项目名称:1水面 2岸线 3水质 4排口 | |||||
*/ | |||||
private Integer name; | |||||
/** | |||||
* 项目类型:1日常监测 2重点核查 | |||||
*/ | |||||
private String type; | |||||
/** | |||||
* 巡检内容 | |||||
*/ | |||||
private String content; | |||||
/** | |||||
* 排序 | |||||
*/ | |||||
private Integer sort; | |||||
/** | |||||
* 添加人名称 | |||||
*/ | |||||
private String createUserName; | |||||
/** | |||||
* 更新人名称 | |||||
*/ | |||||
private String updateUserName; | |||||
} |
package com.tuoheng.admin.service; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.tuoheng.admin.entity.domain.Question; | |||||
import com.tuoheng.admin.entity.domain.QuestionType; | |||||
import com.tuoheng.admin.entity.request.QuestionQuery; | |||||
import com.tuoheng.common.common.IBaseService; | |||||
/** | |||||
* 巡检问题表 服务类 | |||||
* | |||||
* @author WangHaoran | |||||
* @since 2021-09-02 | |||||
*/ | |||||
public interface IQuestionTypeService extends IBaseService<QuestionType> { | |||||
} |
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode()); | ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode()); | ||||
Assert.notNull(thMission, "飞行任务不能为空!"); | Assert.notNull(thMission, "飞行任务不能为空!"); | ||||
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); | ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); | ||||
thMissionUpdate.setId(thMission.getId()); | |||||
thMissionUpdate.setMileage(missionStatusRequest.getMileage()); | thMissionUpdate.setMileage(missionStatusRequest.getMileage()); | ||||
boolean result=false; | boolean result=false; | ||||
try { | try { | ||||
AirWeatherVO weather = inspectionService.getWeather(thMission.getAirportId()); | AirWeatherVO weather = inspectionService.getWeather(thMission.getAirportId()); | ||||
String weatherStr = WeatherUtil.getWeather(weather); | String weatherStr = WeatherUtil.getWeather(weather); | ||||
}else { | }else { | ||||
log.error("dsp实时调用失败:{}", responseJson); | log.error("dsp实时调用失败:{}", responseJson); | ||||
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode()); | thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode()); | ||||
thMissionMapper.updateById(thMissionUpdate); | |||||
} | } | ||||
thMissionMapper.updateById(thMissionUpdate); | |||||
}catch (Exception e){ | }catch (Exception e){ | ||||
log.error("dsp实时调用失败:{}", responseJson); | log.error("dsp实时调用失败:{}", responseJson); | ||||
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode()); | thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode()); |
ReportInfoVO reportInfoVO = detail(reportId); | ReportInfoVO reportInfoVO = detail(reportId); | ||||
//创建word | //创建word | ||||
String fileName = "汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.docx"; | |||||
String fileName = "汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc"; | |||||
String filePath = UploadFileConfig.uploadFolder+"/doc/"+fileName; | String filePath = UploadFileConfig.uploadFolder+"/doc/"+fileName; | ||||
File fd = new File(UploadFileConfig.uploadFolder+"/doc"); | File fd = new File(UploadFileConfig.uploadFolder+"/doc"); | ||||
File f = new File(filePath); | File f = new File(filePath); | ||||
//清空缓存 | //清空缓存 | ||||
response.reset(); | response.reset(); | ||||
// 定义浏览器响应表头,并定义下载名 | // 定义浏览器响应表头,并定义下载名 | ||||
String urlFileName = URLEncoder.encode("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.docx", "UTF-8"); | |||||
String urlFileName = URLEncoder.encode("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc", "UTF-8"); | |||||
response.setHeader("Content-Disposition", "attachment;filename=" + urlFileName); | response.setHeader("Content-Disposition", "attachment;filename=" + urlFileName); | ||||
response.setCharacterEncoding("utf-8"); | response.setCharacterEncoding("utf-8"); | ||||
//定义下载的类型 | //定义下载的类型 | ||||
out.flush(); | out.flush(); | ||||
System.out.println("结束。。。。。。"); | System.out.println("结束。。。。。。"); | ||||
}catch (Exception e){ | }catch (Exception e){ | ||||
log.info("异常信息:{}",e.getMessage()); | |||||
e.printStackTrace(); | e.printStackTrace(); | ||||
}finally { | }finally { | ||||
wordUtils.closeDocument(); | wordUtils.closeDocument(); |
return String.format("%d 天 %d 时 %d 分 %d 秒", day, hours, minutes, seconds); | return String.format("%d 天 %d 时 %d 分 %d 秒", day, hours, minutes, seconds); | ||||
}else if( day==0L && hours!=0L && minutes!=0L && seconds!=0L){ | }else if( day==0L && hours!=0L && minutes!=0L && seconds!=0L){ | ||||
return String.format("%d 时 %d 分 %d 秒", hours, minutes, seconds); | return String.format("%d 时 %d 分 %d 秒", hours, minutes, seconds); | ||||
}else if(day==0L && hours==0L && minutes!=0L && seconds!=0L){ | |||||
}else if(day==0L && hours==0L && minutes!=0L ){ | |||||
return String.format("%d 分 %d 秒", minutes, seconds); | return String.format("%d 分 %d 秒", minutes, seconds); | ||||
}else{ | }else{ | ||||
return String.format("%d 秒",seconds); | return String.format("%d 秒",seconds); |