|
@@ -7,8 +7,11 @@ import com.fdkankan.contro.entity.Camera;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
import com.fdkankan.contro.entity.ScenePro;
|
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
|
+import com.fdkankan.contro.service.IScenePlusService;
|
|
|
+import com.fdkankan.contro.service.ISceneProService;
|
|
|
import com.fdkankan.web.response.Result;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -34,11 +37,18 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
|
|
|
private RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISceneProService sceneProService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
+
|
|
|
public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime) {
|
|
|
String url = laserHost + String.format(SAVE_SCENE_URL_TEMPLATE, sceneCode);
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("sceneCode", sceneCode);
|
|
|
params.put("status", sceneStatus);
|
|
|
+ params.put("version",getSceneVersion(sceneCode));
|
|
|
params.put("createTime", DateUtil.date2String(createTime, null));
|
|
|
if (!ObjectUtils.isEmpty(path)) {
|
|
|
params.put("path", path);
|
|
@@ -114,6 +124,7 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
} else {
|
|
|
params.put("status", 4);
|
|
|
}
|
|
|
+ params.put("version",getSceneVersion(scenePlus.getNum()));
|
|
|
params.put("title", scenePlus.getTitle());
|
|
|
params.put("userId", scenePlus.getUserId());
|
|
|
log.info("自研激光转台相机同步,url:{},params:{}", url, JSONObject.toJSONString(params));
|
|
@@ -138,6 +149,7 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
} else {
|
|
|
params.put("status", 4);
|
|
|
}
|
|
|
+ params.put("version",getSceneVersion(scenePro.getNum()));
|
|
|
params.put("title", scenePro.getSceneName());
|
|
|
params.put("userId", scenePro.getUserId());
|
|
|
log.info("自研激光转台相机同步,url:{},params:{}", url, JSONObject.toJSONString(params));
|
|
@@ -148,4 +160,16 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private String getSceneVersion(String num) {
|
|
|
+ String version = "V3";
|
|
|
+ ScenePro scenepro = sceneProService.getByNum(num);
|
|
|
+ if (scenepro == null || scenepro.getIsUpgrade() == 1) {
|
|
|
+ ScenePlus plus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ if (plus != null) {
|
|
|
+ version = "V4";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return version;
|
|
|
+ }
|
|
|
+
|
|
|
}
|