|
@@ -7,6 +7,7 @@ import com.fdkankan.ucenter.entity.Camera;
|
|
|
import com.fdkankan.ucenter.entity.CameraDetail;
|
|
|
import com.fdkankan.ucenter.entity.User;
|
|
|
import com.fdkankan.ucenter.httpClient.client.LaserClient;
|
|
|
+import com.fdkankan.ucenter.service.ICameraService;
|
|
|
import com.fdkankan.ucenter.service.IUserService;
|
|
|
import com.fdkankan.ucenter.vo.response.SceneNumVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -31,6 +32,8 @@ public class LaserService {
|
|
|
private LaserClient laserClient;
|
|
|
@Autowired
|
|
|
private IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ ICameraService cameraService;
|
|
|
/**
|
|
|
* 根据用户获取激光相机数量
|
|
|
* @param token
|
|
@@ -112,4 +115,33 @@ public class LaserService {
|
|
|
}
|
|
|
return JSONObject.parseObject(JSONObject.toJSONString(result.getData()));
|
|
|
}
|
|
|
+
|
|
|
+ public void copy(Long camaraId, String createTime, String newNum, Integer status, String sceneKey, String sceneName, Long userId){
|
|
|
+ String phone = null;
|
|
|
+ String snCode = null;
|
|
|
+ if(userId != null){
|
|
|
+ User user = userService.getById(userId);
|
|
|
+ phone = user == null ? null :user.getUserName();
|
|
|
+ }
|
|
|
+ if(camaraId != null){
|
|
|
+ Camera camera = cameraService.getById(camaraId);
|
|
|
+ snCode = camera == null ? null :camera.getSnCode();
|
|
|
+ }
|
|
|
+ Map<String,Object> params = new HashMap<>();
|
|
|
+ params.put("childName",snCode);
|
|
|
+ params.put("createTime", createTime);
|
|
|
+ params.put("phone", phone);
|
|
|
+ params.put("sceneCode", newNum);
|
|
|
+ params.put("snCode",snCode);
|
|
|
+ params.put("status", status);
|
|
|
+ params.put("password", sceneKey);
|
|
|
+ params.put("title", sceneName);
|
|
|
+ params.put("userId", userId);
|
|
|
+ params.put("copy", true);
|
|
|
+ Result result = laserClient.saveOrEdit(newNum, params);
|
|
|
+ if( result.getCode() != HttpStatus.OK.value()){
|
|
|
+ log.error("激光场景状态同步失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|