Quellcode durchsuchen

问题列表修改

tags/v1.1.0^2
chenjiandong vor 1 Jahr
Ursprung
Commit
21ba57c213
4 geänderte Dateien mit 21 neuen und 24 gelöschten Zeilen
  1. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Tenant.java
  2. +8
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/IndexServiceImpl.java
  3. +8
    -7
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  4. +0
    -16
      tuoheng-common/src/main/java/com/tuoheng/common/config/CommonConfig.java

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Tenant.java Datei anzeigen

@@ -75,6 +75,11 @@ public class Tenant extends BaseEntity implements Serializable {
*/
private String email;

/**
* 机场调用邮箱
*/
private String airportUrl;

/**
* 省份编号
*/

+ 8
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/IndexServiceImpl.java Datei anzeigen

@@ -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);

+ 8
- 7
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Datei anzeigen

@@ -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);

+ 0
- 16
tuoheng-common/src/main/java/com/tuoheng/common/config/CommonConfig.java Datei anzeigen

@@ -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;
}


}

Laden…
Abbrechen
Speichern