@@ -84,7 +84,7 @@ public class AliyunOssController { | |||
log.info("Access Key Secret: " + response.getCredentials().getAccessKeySecret()); | |||
log.info("Security Token: " + response.getCredentials().getSecurityToken()); | |||
log.info("RequestId: " + response.getRequestId()); | |||
return JsonResult.success(response); | |||
return JsonResult.success(response.getCredentials()); | |||
} catch (ClientException e) { | |||
log.error("Error code: " + e.getErrCode()); | |||
log.error("Error message: " + e.getErrMsg()); |
@@ -75,6 +75,11 @@ public class Tenant extends BaseEntity implements Serializable { | |||
*/ | |||
private String email; | |||
/** | |||
* 机场调用邮箱 | |||
*/ | |||
private String airportUrl; | |||
/** | |||
* 省份编号 | |||
*/ |
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.entity.domain.Question; | |||
import com.tuoheng.admin.entity.domain.Tenant; | |||
import com.tuoheng.admin.entity.domain.ThMission; | |||
import com.tuoheng.admin.entity.dto.index.AirportDetailDto; | |||
import com.tuoheng.admin.entity.dto.index.QuestionListDto; | |||
@@ -15,6 +16,7 @@ import com.tuoheng.admin.entity.vo.MissionVO; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.enums.TaskStatusEnum; | |||
import com.tuoheng.admin.mapper.QuestionMapper; | |||
import com.tuoheng.admin.mapper.TenantMapper; | |||
import com.tuoheng.admin.mapper.ThMissionMapper; | |||
import com.tuoheng.admin.service.IndexService; | |||
import com.tuoheng.common.common.BaseQuery; | |||
@@ -22,6 +24,7 @@ import com.tuoheng.common.config.CommonConfig; | |||
import com.tuoheng.common.utils.HttpUtils; | |||
import com.tuoheng.common.utils.JacksonUtil; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.compress.utils.Lists; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -50,6 +53,9 @@ public class IndexServiceImpl implements IndexService { | |||
@Autowired | |||
private QuestionMapper questionMapper; | |||
@Autowired | |||
private TenantMapper tenantMapper; | |||
@Override | |||
@Transactional(readOnly = true) | |||
public IPage<MissionVO> getMissionList(BaseQuery baseQuery){ | |||
@@ -80,7 +86,8 @@ public class IndexServiceImpl implements IndexService { | |||
@Override | |||
public JsonResult getAirportDetail(GetAirportDetailDto getAirportDetailDto){ | |||
String url = CommonConfig.airportUrl +"/api/airportInterface/getAirportStatus"; | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
String url = tenant.getAirportUrl() +"/api/airportInterface/getAirportStatus"; | |||
String param = "airportId=" + getAirportDetailDto.getAirportId(); | |||
String result = HttpUtils.sendGet(url, param); | |||
JsonResult jsonResult = JacksonUtil.json2pojo(result, JsonResult.class); |
@@ -106,7 +106,7 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
public List<AirPortVO> airport() throws ServiceException, UnsupportedEncodingException { | |||
//这边需要配置到yml文件里面 | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
String url = CommonConfig.airportUrl +"/api/airportInterface/airportList"; | |||
String url = tenant.getAirportUrl() +"/api/airportInterface/airportList"; | |||
String param = "page=1&limit=1000&tenantName=" + URLEncoder.encode(tenant.getName(), "UTF-8"); | |||
String airPortStr = HttpUtils.sendGet(url, param); | |||
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); | |||
@@ -118,9 +118,9 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
@Override | |||
public List<AirLineVO> airLine(Integer droneId) throws ServiceException { | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
//这边需要配置到yml文件里面 | |||
String url = CommonConfig.airportUrl +"/api/airportInterface/taskByDroneId"; | |||
String url = tenant.getAirportUrl() +"/api/airportInterface/taskByDroneId"; | |||
String param="page=1&limit=100&droneId="+droneId; | |||
String airPortStr = HttpUtils.sendGet(url, param); | |||
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); | |||
@@ -138,7 +138,7 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
taskId=thMission.getInspectionLine().toString(); | |||
//这边需要配置到yml文件里面 | |||
String url = CommonConfig.airportUrl + "/api/airportInterface/executeTask"; | |||
String url = tenant.getAirportUrl() + "/api/airportInterface/executeTask"; | |||
JSONObject jsonObject = new JSONObject(); | |||
jsonObject.put("code", "hhz"); | |||
jsonObject.put("tenantName", tenant.getName()); | |||
@@ -168,8 +168,9 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
@Override | |||
public AirWeatherVO getWeather(Integer airportId) throws ServiceException{ | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
//这边需要配置到yml文件里面 | |||
String url = CommonConfig.airportUrl + "/api/airportInterface/getWeather"; | |||
String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather"; | |||
String param="airportId="+airportId; | |||
String weatherStr = HttpUtils.sendGet(url, param); | |||
JsonResult jsonResult; | |||
@@ -189,12 +190,12 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
@Override | |||
public JsonResult lineTrack(Integer missionId) { | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
ThMission thMission = missionMapper.selectById(missionId); | |||
Assert.notNull(thMission,"任务不能为空!"); | |||
Integer taskId= thMission.getInspectionLine(); | |||
//解析标准srt文件里面的坐标,调用硬件接口,返回数据 | |||
String url = CommonConfig.airportUrl + "/api/airportInterface/getLocationById"; | |||
String url = tenant.getAirportUrl() + "/api/airportInterface/getLocationById"; | |||
String param="id="+taskId; | |||
String airportLine = HttpUtils.sendGet(url, param); | |||
JsonResult jsonResult = JacksonUtil.json2pojo(airportLine, JsonResult.class); |
@@ -159,13 +159,12 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
.eq(WorkOrderQuestion::getWorkOrderId, request.getWorkOrderId()) | |||
.eq(WorkOrderQuestion::getQuestionId, request.getQuestionId())); | |||
//修改问题处理结果表 | |||
//问题处理结果表新增 | |||
QuestionHandle questionHandle = new QuestionHandle(); | |||
BeanUtils.copyProperties(request, questionHandle); | |||
questionHandle.setHandlerUser(ShiroUtils.getUserId()); | |||
questionHandle.setHandlerTime(new Date()); | |||
questionHandleMapper.update(questionHandle, new LambdaQueryWrapper<QuestionHandle>() | |||
.eq(QuestionHandle::getQuestionId, request.getQuestionId())); | |||
questionHandleMapper.insert(questionHandle); | |||
//查询工单下待处理的问题,如全部处理完,将工单状态修改为已完成 | |||
Integer count = workOrderQuestionMapper.selectCount(new LambdaQueryWrapper<WorkOrderQuestion>() |
@@ -28,11 +28,6 @@ public class CommonConfig { | |||
*/ | |||
public static String gaodeKey; | |||
/** | |||
* 机场域名 | |||
*/ | |||
public static String airportUrl; | |||
/** | |||
* 图片域名赋值 | |||
* | |||
@@ -73,15 +68,4 @@ public class CommonConfig { | |||
gaodeKey = key; | |||
} | |||
/** | |||
* 机场域名赋值 | |||
* | |||
* @param url 域名地址 | |||
*/ | |||
@Value("${tuoheng.airport-url}") | |||
public void setAirportURL(String url) { | |||
airportUrl = url; | |||
} | |||
} |