|
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -41,6 +42,9 @@ public class LaserService {
|
|
|
@Autowired
|
|
|
IUserService userService;
|
|
|
|
|
|
+ private final String SAVE_SCENE_URL_TEMPLATE="/laser/init/%s/saveOrEdit";
|
|
|
+
|
|
|
+
|
|
|
public PageInfo pageList(SceneParam param) {
|
|
|
LaserSceneParam newParam = new LaserSceneParam();
|
|
|
BeanUtils.copyProperties(param,newParam);
|
|
@@ -120,7 +124,7 @@ public class LaserService {
|
|
|
phone = user.getUserName();
|
|
|
}
|
|
|
}
|
|
|
- String url = basePath + String.format("/laser/init/%s/saveOrEdit",newNum);
|
|
|
+ String url = basePath + String.format(SAVE_SCENE_URL_TEMPLATE,newNum);
|
|
|
Map<String,Object> params = new HashMap<>();
|
|
|
params.put("childName",snCode);
|
|
|
params.put("createTime", createTime);
|
|
@@ -139,4 +143,17 @@ public class LaserService {
|
|
|
log.error("激光场景状态同步失败!");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void delete(String num) {
|
|
|
+ String url = basePath + String.format(SAVE_SCENE_URL_TEMPLATE,num);
|
|
|
+ Map<String,Object> params = new HashMap<>();
|
|
|
+ params.put("sceneCode", num);
|
|
|
+ params.put("status", -1);
|
|
|
+ log.info("自研激光转台相机同步,url:{},params:{}",url, JSONObject.toJSONString(params));
|
|
|
+ ResponseEntity<Result> responseEntity = restTemplate.postForEntity(url,params, Result.class);
|
|
|
+ log.info("自研激光转台相机同步,url:{},params:{},结果:{}",url, JSONObject.toJSONString(params),JSONObject.toJSONString(responseEntity.getBody()));
|
|
|
+ if(responseEntity.getStatusCode() != HttpStatus.OK || responseEntity.getBody().getCode() != HttpStatus.OK.value()){
|
|
|
+ log.error("激光场景状态同步失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|