dengsixing 9 months ago
parent
commit
6e99a5f33f

+ 48 - 1
src/main/java/com/fdkankan/SceneApplication.java

@@ -1,8 +1,19 @@
 package com.fdkankan;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.dtflys.forest.springboot.annotation.ForestScan;
+import com.fdkankan.redis.constant.RedisKey;
+import com.fdkankan.redis.util.RedisClient;
+import com.fdkankan.scene.entity.Scene;
+import com.fdkankan.scene.entity.SceneConvertLog;
+import com.fdkankan.scene.service.SceneConvertLogService;
+import com.fdkankan.scene.service.SceneService;
 import com.yomahub.tlog.core.enhance.bytes.AspectLogEnhance;
+import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -10,14 +21,25 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import javax.annotation.Resource;
+import java.util.List;
+
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients
 @EnableScheduling
 @MapperScan("com.fdkankan.**.mapper")
 @ForestScan("com.fdkankan.scene.httpclient")
+@Slf4j
 public class SceneApplication implements CommandLineRunner {
 
+    @Autowired
+    private SceneService sceneService;
+    @Autowired
+    private SceneConvertLogService sceneConvertLogService;
+    @Resource
+    private RedisClient redisClient;
+
     static {
         AspectLogEnhance.enhance();
     }
@@ -29,7 +51,32 @@ public class SceneApplication implements CommandLineRunner {
     @Override
     public void run(String... args) throws Exception {
 
+        String initscene = redisClient.get("initscene");
+        if(StrUtil.isNotEmpty(initscene)){
+            return;
+        }
+        redisClient.add("initscene", "111");
 
-
+        log.info("初始化站址编码和时间任务开始");
+        List<Scene> list = sceneService.list(new LambdaQueryWrapper<Scene>().select(Scene::getId, Scene::getNum).isNull(Scene::getStationcode));
+        list.stream().forEach(s->{
+            String num = s.getNum();
+            try {
+                List<SceneConvertLog> logs = sceneConvertLogService.list(new LambdaQueryWrapper<SceneConvertLog>()
+                        .eq(SceneConvertLog::getEntityId, num)
+                        .eq(SceneConvertLog::getStatus, 1)
+                        .orderByDesc(SceneConvertLog::getCreateTime));
+                if(CollUtil.isNotEmpty(logs)){
+                    SceneConvertLog sceneConvertLog = logs.get(0);
+                    s.setStationcode(sceneConvertLog.getStationCode());
+                    s.setAlgorithmTime(sceneConvertLog.getCreateTime());
+                    sceneService.updateById(s);
+                }
+            }catch (Exception e){
+                log.error("填充场景站址编码和时间失败, num:{}", num, e);
+            }
+        });
+        log.info("初始化站址编码和时间任务结束");
+        redisClient.del("initscene");
     }
 }

+ 97 - 97
src/main/java/com/fdkankan/scene/Interceptor/CheckTokenAspect.java

@@ -1,97 +1,97 @@
-package com.fdkankan.scene.Interceptor;
-
-import cn.hutool.http.HttpUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.exception.BusinessException;
-import com.fdkankan.common.util.ThreeDESUtil;
-import com.fdkankan.common.util.UserAgentUtils;
-import com.fdkankan.common.util.WebUtil;
-import com.fdkankan.feign.TietaFeignClient;
-import com.fdkankan.feign.WS4AServiceClient;
-import com.fdkankan.scene.entity.SceneViewLog;
-import com.fdkankan.scene.service.SceneViewLogService;
-import lombok.extern.log4j.Log4j2;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-@Log4j2
-@Aspect
-@Component
-@Order(101)
-public class CheckTokenAspect {
-
-	@Value("${spring.cloud.nacos.discovery.access-key}")
-	private String accessKey;
-
-	@Value("${tieta.checkToken.syscode}")
-	private String syscode;
-	@Value("${gateway.key:6#dPz>3F}")
-	private String gatewayKey;
-	@Value("${gateway.url}")
-	private String gatewayUrl;
-	@Resource
-	private TietaFeignClient tietaFeignClient;
-	@Autowired
-	private WS4AServiceClient ws4AServiceClient;
-	@Autowired
-	private SceneViewLogService sceneViewLogService;
-
-	@Pointcut("@annotation(com.fdkankan.scene.annotation.CheckToken)")
-	public void CheckToken() {
-	}
-
-	/**
-	 * 前置通知 用于判断用户协作场景是否有协作权限
-	 *
-	 * @param joinPoint
-	 *            切点
-	 * @throws IOException
-	 */
-	@Before("CheckToken()")
-	public void doBefore(JoinPoint joinPoint) throws Exception {
-		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-
-		//请求4a接口获取用户信息
-		Map<String, Object> parameter = WebUtil.getParameter(joinPoint, request);
-		String acctId = (String) parameter.get("acctId");
-		String token = (String) parameter.get("token");
-		String num = (String) parameter.get("num");
-
-		//token校验
-		JSONObject checkProwadaTokenParam = new JSONObject();
-		JSONObject params = new JSONObject();
-		params.put("SYSCODE", syscode);
-		params.put("ACCTID", acctId);
-		params.put("TOKEN", token);
-		String encode = ThreeDESUtil.encode(JSON.toJSONString(params), gatewayKey);
-		checkProwadaTokenParam.put("args", encode);
-		JSONObject result = ws4AServiceClient.checkProwadaToken(checkProwadaTokenParam);
-		log.info("场景:{},4A校验token结果:{}", num, result);
-		if(!"SUCCESS".equals(result.getString("resultStat"))){
-			throw new BusinessException(4000, "4A鉴权失败");
-		}
-		String data = result.getString("data");
-		JSONObject dataObj = JSONObject.parseObject(data);
-		if(!"0".equals(dataObj.getString("RSP"))){
-			throw new BusinessException(4000, "4A鉴权失败:" + dataObj.getString("ERRDESC"));
-		}
-	}
-
-}
+//package com.fdkankan.scene.Interceptor;
+//
+//import cn.hutool.http.HttpUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONArray;
+//import com.alibaba.fastjson.JSONObject;
+//import com.fdkankan.common.exception.BusinessException;
+//import com.fdkankan.common.util.ThreeDESUtil;
+//import com.fdkankan.common.util.UserAgentUtils;
+//import com.fdkankan.common.util.WebUtil;
+//import com.fdkankan.feign.TietaFeignClient;
+//import com.fdkankan.feign.WS4AServiceClient;
+//import com.fdkankan.scene.entity.SceneViewLog;
+//import com.fdkankan.scene.service.SceneViewLogService;
+//import lombok.extern.log4j.Log4j2;
+//import org.aspectj.lang.JoinPoint;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.aspectj.lang.annotation.Pointcut;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.core.annotation.Order;
+//import org.springframework.stereotype.Component;
+//import org.springframework.web.context.request.RequestContextHolder;
+//import org.springframework.web.context.request.ServletRequestAttributes;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletRequest;
+//import java.io.IOException;
+//import java.util.Date;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//@Log4j2
+//@Aspect
+//@Component
+//@Order(101)
+//public class CheckTokenAspect {
+//
+//	@Value("${spring.cloud.nacos.discovery.access-key}")
+//	private String accessKey;
+//
+//	@Value("${tieta.checkToken.syscode}")
+//	private String syscode;
+//	@Value("${gateway.key:6#dPz>3F}")
+//	private String gatewayKey;
+//	@Value("${gateway.url}")
+//	private String gatewayUrl;
+//	@Resource
+//	private TietaFeignClient tietaFeignClient;
+//	@Autowired
+//	private WS4AServiceClient ws4AServiceClient;
+//	@Autowired
+//	private SceneViewLogService sceneViewLogService;
+//
+//	@Pointcut("@annotation(com.fdkankan.scene.annotation.CheckToken)")
+//	public void CheckToken() {
+//	}
+//
+//	/**
+//	 * 前置通知 用于判断用户协作场景是否有协作权限
+//	 *
+//	 * @param joinPoint
+//	 *            切点
+//	 * @throws IOException
+//	 */
+//	@Before("CheckToken()")
+//	public void doBefore(JoinPoint joinPoint) throws Exception {
+//		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+//
+//		//请求4a接口获取用户信息
+//		Map<String, Object> parameter = WebUtil.getParameter(joinPoint, request);
+//		String acctId = (String) parameter.get("acctId");
+//		String token = (String) parameter.get("token");
+//		String num = (String) parameter.get("num");
+//
+//		//token校验
+//		JSONObject checkProwadaTokenParam = new JSONObject();
+//		JSONObject params = new JSONObject();
+//		params.put("SYSCODE", syscode);
+//		params.put("ACCTID", acctId);
+//		params.put("TOKEN", token);
+//		String encode = ThreeDESUtil.encode(JSON.toJSONString(params), gatewayKey);
+//		checkProwadaTokenParam.put("args", encode);
+//		JSONObject result = ws4AServiceClient.checkProwadaToken(checkProwadaTokenParam);
+//		log.info("场景:{},4A校验token结果:{}", num, result);
+//		if(!"SUCCESS".equals(result.getString("resultStat"))){
+//			throw new BusinessException(4000, "4A鉴权失败");
+//		}
+//		String data = result.getString("data");
+//		JSONObject dataObj = JSONObject.parseObject(data);
+//		if(!"0".equals(dataObj.getString("RSP"))){
+//			throw new BusinessException(4000, "4A鉴权失败:" + dataObj.getString("ERRDESC"));
+//		}
+//	}
+//
+//}

+ 0 - 4
src/main/java/com/fdkankan/scene/Interceptor/InitEditInfoAspect.java

@@ -99,10 +99,6 @@ public class InitEditInfoAspect {
 			scene = scenes.get(0);
 		}
 
-		if(StrUtil.isEmpty(scene.getStationcode())){
-
-		}
-
 		SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scene.getId());
 		if(Objects.isNull(sceneEditInfo)){
 			sceneEditInfo = new SceneEditInfo();

+ 172 - 172
src/main/java/com/fdkankan/scene/Interceptor/ViewLogAspect.java

@@ -1,172 +1,172 @@
-package com.fdkankan.scene.Interceptor;
-
-import cn.hutool.http.HttpUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.util.ThreeDESUtil;
-import com.fdkankan.common.util.UserAgentUtils;
-import com.fdkankan.common.util.WebUtil;
-import com.fdkankan.common.exception.BusinessException;
-import com.fdkankan.feign.TietaFeignClient;
-import com.fdkankan.feign.WS4AServiceClient;
-import com.fdkankan.scene.entity.SceneViewLog;
-import com.fdkankan.scene.service.SceneViewLogService;
-import lombok.extern.log4j.Log4j2;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-@Log4j2
-@Aspect
-@Component
-@Order(101)
-public class ViewLogAspect {
-
-	@Value("${spring.cloud.nacos.discovery.access-key}")
-	private String accessKey;
-
-	@Value("${tieta.checkToken.syscode}")
-	private String syscode;
-	@Value("${gateway.key:6#dPz>3F}")
-	private String gatewayKey;
-	@Value("${gateway.url}")
-	private String gatewayUrl;
-	@Resource
-	private TietaFeignClient tietaFeignClient;
-	@Autowired
-	private WS4AServiceClient ws4AServiceClient;
-	@Autowired
-	private SceneViewLogService sceneViewLogService;
-
-	@Pointcut("@annotation(com.fdkankan.scene.annotation.VrLog)")
-	public void checkCooperationPermit() {
-	}
-
-	/**
-	 * 前置通知 用于判断用户协作场景是否有协作权限
-	 *
-	 * @param joinPoint
-	 *            切点
-	 * @throws IOException
-	 */
-	@Before("checkCooperationPermit()")
-	public void doBefore(JoinPoint joinPoint) throws Exception {
-		log.info("记录日志开始");
-		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-		boolean mobileDevice = UserAgentUtils.isMobileDevice(request);
-		String userAgent = "pc";
-		if(mobileDevice){
-			userAgent = "mobile";
-		}
-
-		//请求4a接口获取用户信息
-		Map<String, Object> parameter = WebUtil.getParameter(joinPoint, request);
-		String acctId = (String) parameter.get("acctId");
-		String token = (String) parameter.get("token");
-		String num = (String) parameter.get("num");
-        String syscode = (String) parameter.get("syscode");
-
-		//token校验
-		JSONObject checkProwadaTokenParam = new JSONObject();
-		JSONObject params = new JSONObject();
-		params.put("SYSCODE", syscode);
-		params.put("ACCTID", acctId);
-		params.put("TOKEN", token);
-		String encode = ThreeDESUtil.encode(JSON.toJSONString(params), gatewayKey);
-		checkProwadaTokenParam.put("args", encode);
-		JSONObject result = ws4AServiceClient.checkProwadaToken(checkProwadaTokenParam);
-		log.info("场景:{},4A校验token结果:{}", num, result);
-		if(!"SUCCESS".equals(result.getString("resultStat"))){
-			throw new BusinessException(4000, "4A鉴权失败");
-		}
-		String data = result.getString("data");
-		JSONObject dataObj = JSONObject.parseObject(data);
-		if(!"0".equals(dataObj.getString("RSP"))){
-			throw new BusinessException(4000, "4A鉴权失败:" + dataObj.getString("ERRDESC"));
-		}
-		String USERCODE = dataObj.getString("USERCODE");
-//		String SERVICEID = dataObj.getString("SERVICEID");
-		String ORGCODE = dataObj.getString("ORGCODE");
-
-		//查询用户信息
-		JSONObject param2 = new JSONObject();
-		param2.put("SERVICEID", syscode);
-		param2.put("LOGINACCOUNT", USERCODE);
-		param2.put("TOKEN", token);
-		encode = ThreeDESUtil.encode(JSON.toJSONString(param2), gatewayKey);
-		Map<String, Object> param = new HashMap<>();
-		param.put("args", encode);
-		String queryLoginUserInfoResp = HttpUtil.get(gatewayUrl + "/QUERY4A/user/queryLoginUserInfo?args=" + encode);
-		result = JSON.parseObject(queryLoginUserInfoResp);
-//		result = ws4AServiceClient.queryLoginUserInfo(encode);
-		log.info("场景:{},4A查询用户信息结果:{}", num, result);
-		if(!"SUCCESS".equals(result.getString("resultStat"))){
-			throw new BusinessException(4000, "4A查询用户信息失败");
-		}
-		data = result.getString("data");
-		dataObj = JSONObject.parseObject(data);
-		if(!"0".equals(dataObj.getString("RSP"))){
-			throw new BusinessException(4000, "4A查询用户信息失败:" + dataObj.getString("ERRDESC"));
-		}
-		String nickName = dataObj.getString("LOGINNAME");
-
-		JSONObject param3 = new JSONObject();
-		param3.put("SERVICEID", syscode);
-		param3.put("QUERYMODE", "3");
-		param3.put("ORGCODE", ORGCODE);
-		param3.put("TOKEN", token);
-		encode = ThreeDESUtil.encode(JSON.toJSONString(param3), gatewayKey);
-//		result = ws4AServiceClient.queryOrgs(encode);
-		String queryOrgsResp = HttpUtil.get(gatewayUrl + "/QUERY4A/query/queryOrgs?args=" + encode);
-		result = JSON.parseObject(queryOrgsResp);
-		log.info("场景:{},4A查询用户组织结果:{}", num, result);
-		if(!"SUCCESS".equals(result.getString("resultStat"))){
-			throw new BusinessException(4000, "查询用户组织失败");
-		}
-		data = result.getString("data");
-		dataObj = JSONObject.parseObject(data);
-		if(!"0".equals(dataObj.getString("RSP"))){
-			throw new BusinessException(4000, "4A查询用户组织失败:" + dataObj.getString("ERRDESC"));
-		}
-		JSONObject ORGS = dataObj.getJSONObject("ORGS");
-		JSONArray ORG = ORGS.getJSONArray("ORG");
-		JSONObject ORG1 = ORG.getJSONObject(0);
-		String ORGNAMEPATH = ORG1.getString("ORGNAMEPATH");
-
-		//写入表
-		SceneViewLog sceneViewLog = new SceneViewLog();
-		sceneViewLog.setOrgNamePath(ORGNAMEPATH);
-		sceneViewLog.setFuncName("VR全景");
-		sceneViewLog.setFuncDesc("VR全景试图");
-		sceneViewLog.setUserName(USERCODE);
-		sceneViewLog.setNickName(nickName);
-		sceneViewLog.setCreateTime(new Date());
-		sceneViewLog.setTerminalType(userAgent);
-		sceneViewLogService.save(sceneViewLog);
-	}
-
-	public static void main(String[] args) {
-		JSONObject param2 = new JSONObject();
-		param2.put("SERVICEID", "CHNTRMS2");
-		param2.put("LOGINACCOUNT", "wx-sunql3");
-		param2.put("TOKEN", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJSRVMiLCJpc3MiOiJXUzRBIiwiZXhwIjoxNzMzMzEwNjY1LCJOQU5PU0VDT05EIjo0MjAxNTczODIzODYyMjgzOH0.sQR4qkTeRZEOQMI-Rjck35dFswoOMYHsGSuNcXH45TI");
-		String encode = ThreeDESUtil.encode(JSON.toJSONString(param2), "6#dPz>3F");
-		System.out.println(encode);
-	}
-
-}
+//package com.fdkankan.scene.Interceptor;
+//
+//import cn.hutool.http.HttpUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONArray;
+//import com.alibaba.fastjson.JSONObject;
+//import com.fdkankan.common.util.ThreeDESUtil;
+//import com.fdkankan.common.util.UserAgentUtils;
+//import com.fdkankan.common.util.WebUtil;
+//import com.fdkankan.common.exception.BusinessException;
+//import com.fdkankan.feign.TietaFeignClient;
+//import com.fdkankan.feign.WS4AServiceClient;
+//import com.fdkankan.scene.entity.SceneViewLog;
+//import com.fdkankan.scene.service.SceneViewLogService;
+//import lombok.extern.log4j.Log4j2;
+//import org.aspectj.lang.JoinPoint;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.aspectj.lang.annotation.Pointcut;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.core.annotation.Order;
+//import org.springframework.stereotype.Component;
+//import org.springframework.web.context.request.RequestContextHolder;
+//import org.springframework.web.context.request.ServletRequestAttributes;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletRequest;
+//import java.io.IOException;
+//import java.util.Date;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//@Log4j2
+//@Aspect
+//@Component
+//@Order(101)
+//public class ViewLogAspect {
+//
+//	@Value("${spring.cloud.nacos.discovery.access-key}")
+//	private String accessKey;
+//
+//	@Value("${tieta.checkToken.syscode}")
+//	private String syscode;
+//	@Value("${gateway.key:6#dPz>3F}")
+//	private String gatewayKey;
+//	@Value("${gateway.url}")
+//	private String gatewayUrl;
+//	@Resource
+//	private TietaFeignClient tietaFeignClient;
+//	@Autowired
+//	private WS4AServiceClient ws4AServiceClient;
+//	@Autowired
+//	private SceneViewLogService sceneViewLogService;
+//
+//	@Pointcut("@annotation(com.fdkankan.scene.annotation.VrLog)")
+//	public void checkCooperationPermit() {
+//	}
+//
+//	/**
+//	 * 前置通知 用于判断用户协作场景是否有协作权限
+//	 *
+//	 * @param joinPoint
+//	 *            切点
+//	 * @throws IOException
+//	 */
+//	@Before("checkCooperationPermit()")
+//	public void doBefore(JoinPoint joinPoint) throws Exception {
+//		log.info("记录日志开始");
+//		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+//		boolean mobileDevice = UserAgentUtils.isMobileDevice(request);
+//		String userAgent = "pc";
+//		if(mobileDevice){
+//			userAgent = "mobile";
+//		}
+//
+//		//请求4a接口获取用户信息
+//		Map<String, Object> parameter = WebUtil.getParameter(joinPoint, request);
+//		String acctId = (String) parameter.get("acctId");
+//		String token = (String) parameter.get("token");
+//		String num = (String) parameter.get("num");
+//        String syscode = (String) parameter.get("syscode");
+//
+//		//token校验
+//		JSONObject checkProwadaTokenParam = new JSONObject();
+//		JSONObject params = new JSONObject();
+//		params.put("SYSCODE", syscode);
+//		params.put("ACCTID", acctId);
+//		params.put("TOKEN", token);
+//		String encode = ThreeDESUtil.encode(JSON.toJSONString(params), gatewayKey);
+//		checkProwadaTokenParam.put("args", encode);
+//		JSONObject result = ws4AServiceClient.checkProwadaToken(checkProwadaTokenParam);
+//		log.info("场景:{},4A校验token结果:{}", num, result);
+//		if(!"SUCCESS".equals(result.getString("resultStat"))){
+//			throw new BusinessException(4000, "4A鉴权失败");
+//		}
+//		String data = result.getString("data");
+//		JSONObject dataObj = JSONObject.parseObject(data);
+//		if(!"0".equals(dataObj.getString("RSP"))){
+//			throw new BusinessException(4000, "4A鉴权失败:" + dataObj.getString("ERRDESC"));
+//		}
+//		String USERCODE = dataObj.getString("USERCODE");
+////		String SERVICEID = dataObj.getString("SERVICEID");
+//		String ORGCODE = dataObj.getString("ORGCODE");
+//
+//		//查询用户信息
+//		JSONObject param2 = new JSONObject();
+//		param2.put("SERVICEID", syscode);
+//		param2.put("LOGINACCOUNT", USERCODE);
+//		param2.put("TOKEN", token);
+//		encode = ThreeDESUtil.encode(JSON.toJSONString(param2), gatewayKey);
+//		Map<String, Object> param = new HashMap<>();
+//		param.put("args", encode);
+//		String queryLoginUserInfoResp = HttpUtil.get(gatewayUrl + "/QUERY4A/user/queryLoginUserInfo?args=" + encode);
+//		result = JSON.parseObject(queryLoginUserInfoResp);
+////		result = ws4AServiceClient.queryLoginUserInfo(encode);
+//		log.info("场景:{},4A查询用户信息结果:{}", num, result);
+//		if(!"SUCCESS".equals(result.getString("resultStat"))){
+//			throw new BusinessException(4000, "4A查询用户信息失败");
+//		}
+//		data = result.getString("data");
+//		dataObj = JSONObject.parseObject(data);
+//		if(!"0".equals(dataObj.getString("RSP"))){
+//			throw new BusinessException(4000, "4A查询用户信息失败:" + dataObj.getString("ERRDESC"));
+//		}
+//		String nickName = dataObj.getString("LOGINNAME");
+//
+//		JSONObject param3 = new JSONObject();
+//		param3.put("SERVICEID", syscode);
+//		param3.put("QUERYMODE", "3");
+//		param3.put("ORGCODE", ORGCODE);
+//		param3.put("TOKEN", token);
+//		encode = ThreeDESUtil.encode(JSON.toJSONString(param3), gatewayKey);
+////		result = ws4AServiceClient.queryOrgs(encode);
+//		String queryOrgsResp = HttpUtil.get(gatewayUrl + "/QUERY4A/query/queryOrgs?args=" + encode);
+//		result = JSON.parseObject(queryOrgsResp);
+//		log.info("场景:{},4A查询用户组织结果:{}", num, result);
+//		if(!"SUCCESS".equals(result.getString("resultStat"))){
+//			throw new BusinessException(4000, "查询用户组织失败");
+//		}
+//		data = result.getString("data");
+//		dataObj = JSONObject.parseObject(data);
+//		if(!"0".equals(dataObj.getString("RSP"))){
+//			throw new BusinessException(4000, "4A查询用户组织失败:" + dataObj.getString("ERRDESC"));
+//		}
+//		JSONObject ORGS = dataObj.getJSONObject("ORGS");
+//		JSONArray ORG = ORGS.getJSONArray("ORG");
+//		JSONObject ORG1 = ORG.getJSONObject(0);
+//		String ORGNAMEPATH = ORG1.getString("ORGNAMEPATH");
+//
+//		//写入表
+//		SceneViewLog sceneViewLog = new SceneViewLog();
+//		sceneViewLog.setOrgNamePath(ORGNAMEPATH);
+//		sceneViewLog.setFuncName("VR全景");
+//		sceneViewLog.setFuncDesc("VR全景试图");
+//		sceneViewLog.setUserName(USERCODE);
+//		sceneViewLog.setNickName(nickName);
+//		sceneViewLog.setCreateTime(new Date());
+//		sceneViewLog.setTerminalType(userAgent);
+//		sceneViewLogService.save(sceneViewLog);
+//	}
+//
+//	public static void main(String[] args) {
+//		JSONObject param2 = new JSONObject();
+//		param2.put("SERVICEID", "CHNTRMS2");
+//		param2.put("LOGINACCOUNT", "wx-sunql3");
+//		param2.put("TOKEN", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJSRVMiLCJpc3MiOiJXUzRBIiwiZXhwIjoxNzMzMzEwNjY1LCJOQU5PU0VDT05EIjo0MjAxNTczODIzODYyMjgzOH0.sQR4qkTeRZEOQMI-Rjck35dFswoOMYHsGSuNcXH45TI");
+//		String encode = ThreeDESUtil.encode(JSON.toJSONString(param2), "6#dPz>3F");
+//		System.out.println(encode);
+//	}
+//
+//}

+ 14 - 0
src/main/java/com/fdkankan/scene/entity/Scene.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -62,6 +64,18 @@ public class Scene extends Model<Scene> {
     @TableField("STATIONCODE")
     private String stationcode;
 
+    @TableField("SHOOT_TIME")
+    private Date shootTime;
+
+
+    @TableField("UP_TIME")
+    private Date upTime;
+
+
+    @TableField("ALGORITHM_TIME")
+    private Date algorithmTime;
+
+
 
     @Override
     public Serializable pkVal() {

+ 4 - 0
src/main/java/com/fdkankan/scene/mapper/SceneConvertLogMapper.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fdkankan.scene.entity.SceneConvertLog;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -15,4 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface SceneConvertLogMapper extends BaseMapper<SceneConvertLog> {
 
+    List<SceneConvertLog> listDistinctByNum(String num);
+
 }

+ 3 - 1
src/main/java/com/fdkankan/scene/service/SceneConvertLogService.java

@@ -3,6 +3,8 @@ package com.fdkankan.scene.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.scene.entity.SceneConvertLog;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -13,7 +15,7 @@ import com.fdkankan.scene.entity.SceneConvertLog;
  */
 public interface SceneConvertLogService extends IService<SceneConvertLog> {
 
-
+    List<SceneConvertLog> listDistinctByNum(String num);
 
 
 

+ 2 - 0
src/main/java/com/fdkankan/scene/service/SceneService.java

@@ -34,4 +34,6 @@ public interface SceneService extends IService<Scene> {
 
     List<Scene> listByNum(String num, Integer subgroup);
 
+    List<Scene> listByStationcode(String stationCode);
+
 }

+ 7 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneConvertLogServiceImpl.java

@@ -1,11 +1,14 @@
 package com.fdkankan.scene.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.scene.entity.SceneConvertLog;
 import com.fdkankan.scene.mapper.SceneConvertLogMapper;
 import com.fdkankan.scene.service.SceneConvertLogService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class SceneConvertLogServiceImpl extends ServiceImpl<SceneConvertLogMapper, SceneConvertLog> implements SceneConvertLogService {
 
+    @Override
+    public List<SceneConvertLog> listDistinctByNum(String num) {
+        return list(new LambdaQueryWrapper<>());
+    }
 }

+ 15 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -426,6 +426,16 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
                 //俊波要求这两个字段查看页一定是0
                 sceneInfo.getControls().setShowDollhouse(CommonStatus.NO.code());
                 sceneInfo.getControls().setShowFloorplan(CommonStatus.NO.code());
+
+                List<Scene> sceneList = sceneService.listByStationcode(sceneInfo.getStationCode());
+                List<Map<String, String>> roomList = new ArrayList<>();
+                for (Scene scene : sceneList) {
+                    Map<String, String> item = new HashMap<>();
+                    item.put("stationCode", scene.getStationcode());
+                    item.put("roomEntityID", scene.getNum());
+                    roomList.add(item);
+                }
+                sceneInfo.setEntityList(roomList);
         }
 
         return sceneInfo;
@@ -504,6 +514,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
 //        sceneInfoVO.setMosaicList(this.getMosaicList(num));
 
         sceneInfoVO.setSubgroup(scenePlus.getSubgroup());
+        sceneInfoVO.setStationCode(scenePlus.getStationcode());
         long count = sceneService.count(new LambdaQueryWrapper<Scene>().eq(Scene::getNum, num).ne(Scene::getSubgroup, 0));
         if(count > 0){
             sceneInfoVO.setHasHighAndLow(CommonStatus.YES.code());
@@ -526,6 +537,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, S
             }
         }
 
+        sceneInfoVO.setShootTime(scenePlus.getShootTime());
+        sceneInfoVO.setUpTime(scenePlus.getUpTime());
+        sceneInfoVO.setAlgorithmTime(scenePlus.getAlgorithmTime());
+
         return sceneInfoVO;
     }
 

+ 5 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -168,4 +168,9 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
     public List<Scene> listByNum(String num, Integer subgroup) {
         return this.list(new LambdaQueryWrapper<Scene>().eq(Scene::getNum, num).eq(Scene::getSubgroup, subgroup));
     }
+
+    @Override
+    public List<Scene> listByStationcode(String stationCode) {
+        return this.list(new LambdaQueryWrapper<Scene>().eq(Scene::getStationcode, stationCode).eq(Scene::getSubgroup, 0));
+    }
 }

+ 19 - 0
src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java

@@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
 import java.util.Map;
@@ -266,7 +269,23 @@ public class SceneInfoVO {
 
     private JSONObject visions;
 
+    private String stationCode;
+
+    List<Map<String, String>> entityList;
+
+//    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date algorithmTime;
+
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date shootTime;
+
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date upTime;
+
 //    private Map<String, String> mapping;
 
 
+
+
 }

+ 10 - 0
src/main/resources/mapper/scene/SceneConvertLogMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.scene.mapper.SceneConvertLogMapper">
+
+    <select id="listDistinctByNum" parameterType="java.lang.String" resultType="com.fdkankan.scene.entity.SceneConvertLog">
+        select DISTINCT station_code, entity_id from t_scene_convert_log where entity_id = #{num} and status = 1;
+    </select>
+
+
+</mapper>