Kaynağa Gözat

Merge branch 'develop' into release

tags/v1.1.0^2
wanghaoran 1 yıl önce
ebeveyn
işleme
b9264aa50b
2 değiştirilmiş dosya ile 7 ekleme ve 13 silme
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/IThInspectionService.java
  2. +6
    -12
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/IThInspectionService.java Dosyayı Görüntüle

@@ -30,7 +30,7 @@ public interface IThInspectionService extends IBaseService<ThInspection> {

AirWeatherVO getWeather(Integer airportId);

JsonResult executeTask(String taskId,PushAndPullURLRequest pushAndPull) throws ServiceException;
JsonResult executeTask(String missionId,PushAndPullURLRequest pushAndPull) throws ServiceException;

JsonResult lineTrack(Integer missionId);
}

+ 6
- 12
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Dosyayı Görüntüle

@@ -9,7 +9,6 @@ import com.tuoheng.admin.entity.domain.Tenant;
import com.tuoheng.admin.entity.domain.ThInspection;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.InspectionRequest;
import com.tuoheng.admin.entity.request.MissionStatusRequest;
import com.tuoheng.admin.entity.request.PushAndPullURLRequest;
import com.tuoheng.admin.entity.vo.*;
import com.tuoheng.admin.enums.MarkTypeEnum;
@@ -21,20 +20,16 @@ import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.admin.service.IMissionService;
import com.tuoheng.admin.service.IThInspectionService;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.config.CommonConfig;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.*;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -132,19 +127,18 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
}

@Override
public JsonResult executeTask(String taskId,PushAndPullURLRequest pushAndPull) throws ServiceException{
public JsonResult executeTask(String missionId,PushAndPullURLRequest pushAndPull) throws ServiceException{
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
ThMission thMission = missionMapper.selectById(taskId);
ThMission thMission = missionMapper.selectById(Integer.parseInt(missionId));
Assert.notNull(thMission,"任务不能为空!");
taskId=thMission.getInspectionLine().toString();

//这边需要配置到yml文件里面
String url = tenant.getAirportUrl() + "/api/airportInterface/executeTask";
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", "lc");
jsonObject.put("tenantCode", tenant.getCode());
jsonObject.put("taskId", taskId);
jsonObject.put("requestId", String.valueOf(thMission.getId()));
jsonObject.put("taskId", thMission.getInspectionLine());
jsonObject.put("requestId", missionId);
log.info("***** executeTask url:{};param:{}", url, jsonObject.toJSONString());
String airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
if(StringUtils.isEmpty(airPortStr)){
@@ -157,8 +151,8 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
} else if (ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0) {
return JsonResult.error(jsonResult.getMsg());
} else {
ThMission thMissionUpdate=new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(thMission.getId());
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(Integer.parseInt(missionId));
//修改执行时间为当前
thMissionUpdate.setExecutionStartTime(new Date());
missionMapper.updateById(thMissionUpdate);

Yükleniyor…
İptal
Kaydet