|
@@ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.http.Method;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.shcd.entity.dredging.*;
|
|
|
import com.shcd.mapper.dredging.BasiceMapper;
|
|
|
import com.shcd.service.dredging.*;
|
|
@@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import sun.net.www.http.HttpClient;
|
|
|
|
|
|
import javax.net.ssl.HostnameVerifier;
|
|
|
+import java.sql.Wrapper;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -173,6 +175,22 @@ public class DredgingServiceImpl implements DredgingService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //更新船舶绑定的videId
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("projectId",dredgingImportRule.getProjectOverviewId());
|
|
|
+ HttpResponse response = HttpUtil.createPost(dredgingWorkCameraUrl).body(jsonObject.toString()).setConnectionTimeout(30000).execute();
|
|
|
+ List<HashMap> hashMaps = JSONArray.parseArray(response.body(), HashMap.class);
|
|
|
+ List<DredgingProjectShips> projectShips = dredgingProjectShipService.list(Wrappers.<DredgingProjectShips>lambdaQuery().eq(DredgingProjectShips::getOverviewId, projectOverviewId));
|
|
|
+ for (DredgingProjectShips projectShip : projectShips) {
|
|
|
+ for (HashMap hashMap : hashMaps) {
|
|
|
+ if (hashMap.get("ShipCode").equals(projectShip.getCode())){
|
|
|
+ projectShip.setVideoId(hashMap.get("Code").toString());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dredgingProjectShipService.updateBatchById(projectShips);
|
|
|
} else {
|
|
|
//这里代表主表的信息不存在,没必要继续进行
|
|
|
return null;
|
|
@@ -196,16 +214,4 @@ public class DredgingServiceImpl implements DredgingService {
|
|
|
public List<DredgingImportRule> getAllProjectId() {
|
|
|
return basiceMapper.getAllProjectId();
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateShipCamera(String projectOverviewId) {
|
|
|
- HttpResponse token = getToken();
|
|
|
- if (Boolean.parseBoolean(token.body())){
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("projectId",projectOverviewId);
|
|
|
- HttpResponse response = HttpUtil.createPost(dredgingWorkCameraUrl).body(jsonObject.toString()).setConnectionTimeout(30000).execute();
|
|
|
- List<HashMap> hashMaps = JSONArray.parseArray(response.body(), HashMap.class);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
}
|