|
@@ -42,6 +42,7 @@ import java.nio.charset.StandardCharsets;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -84,7 +85,7 @@ public class SceneEditServiceImpl implements ISceneEditService {
|
|
private FdkankanMiniClient fdkankanMiniClient;
|
|
private FdkankanMiniClient fdkankanMiniClient;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public SceneAuthVO getAuth(BaseSceneParamVO param) throws Exception{
|
|
|
|
|
|
+ public SceneAuthVO getAuth(BaseSceneParamVO param, String token) throws Exception{
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getOne(
|
|
ScenePlus scenePlus = scenePlusService.getOne(
|
|
new LambdaQueryWrapper<ScenePlus>().eq(ScenePlus::getNum, param.getNum())
|
|
new LambdaQueryWrapper<ScenePlus>().eq(ScenePlus::getNum, param.getNum())
|
|
@@ -130,40 +131,22 @@ public class SceneEditServiceImpl implements ISceneEditService {
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------start
|
|
// TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------start
|
|
- String url = fkankanMiniHost + "/api/user/increment/findByCameraId?cameraId=" + scenePlus.getCameraId();
|
|
|
|
- Result<UserIncrementBean> userIncrementResult =
|
|
|
|
- fdkankanMiniClient.getUserIncrementByCameraId(
|
|
|
|
- url, new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback());
|
|
|
|
- UserIncrementBean userIncrement = userIncrementResult.getData();
|
|
|
|
- if(userIncrement != null){
|
|
|
|
- if(userIncrement.getIsExpired() == 0){
|
|
|
|
- isVip = true;
|
|
|
|
- }
|
|
|
|
- if(userIncrement.getIsExpired() == 1){
|
|
|
|
- isExpired = true;
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- url = fkankanMiniHost + "/api/user/camera/getCameraByCameraId?cameraId=" + scenePlus.getCameraId();
|
|
|
|
- Result<CameraBean> cameraResult =
|
|
|
|
- fdkankanMiniClient.getCameraByCameraId(
|
|
|
|
- url,new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback());
|
|
|
|
- CameraBean camera = cameraResult.getData();
|
|
|
|
- if(camera == null || Objects.isNull(camera.getId())){
|
|
|
|
- throw new BusinessException(ServerCode.FEIGN_REQUEST_FAILD);
|
|
|
|
- }
|
|
|
|
- Date date = DateUtil.parse("2021-09-09 00:00:00", DateExtUtil.dateStyle);
|
|
|
|
- //非07批次的放开
|
|
|
|
- String pc = camera.getSnCode().substring(0,2);
|
|
|
|
- if(!pc.equals("07") ){
|
|
|
|
- if(camera.getCreateTime()!=null && date.after(camera.getCreateTime())){
|
|
|
|
- isVip = true;
|
|
|
|
- isExpired = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ String url = fkankanMiniHost + "/api/scene/isLogin?num=" + param.getNum();
|
|
|
|
+ Result<Map<String, Object>> isLoginResult = fdkankanMiniClient
|
|
|
|
+ .getIsLogin(url, token, new FdkkMiniReqSuccessCallback(),
|
|
|
|
+ new FdkkMiniReqErrorCallback());
|
|
|
|
+ Map<String, Object> data = isLoginResult.getData();
|
|
|
|
+ isVip = (boolean)data.get("isIncrement");
|
|
|
|
+ isExpired = (boolean)data.get("isExpired");
|
|
|
|
+ Integer company = data.get("company") == null ? null : (int)data.get("company");
|
|
// TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------end
|
|
// TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------end
|
|
|
|
|
|
- return SceneAuthVO.builder().isExpired(isExpired).isVip(isVip).build();
|
|
|
|
|
|
+ return SceneAuthVO.builder()
|
|
|
|
+ .isExpired(isExpired).isVip(isVip)
|
|
|
|
+ .company(company)
|
|
|
|
+ .exclude(data.get("exclude"))
|
|
|
|
+ .include(data.get("include"))
|
|
|
|
+ .build();
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|