SceneController.java 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875
  1. package com.fdkankan.scene.controller;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.core.metadata.IPage;
  4. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  5. import com.fdkankan.common.constant.ErrorCode;
  6. import com.fdkankan.common.constant.PayStatus;
  7. import com.fdkankan.common.constant.SceneInfoReqType;
  8. import com.fdkankan.common.constant.ServerCode;
  9. import com.fdkankan.common.exception.BusinessException;
  10. import com.fdkankan.common.response.ResultData;
  11. import com.fdkankan.redis.util.RedisUtil;
  12. import com.fdkankan.scene.entity.SceneDataDownload;
  13. import com.fdkankan.scene.entity.SceneEditInfo;
  14. import com.fdkankan.scene.entity.ScenePro;
  15. import com.fdkankan.scene.service.*;
  16. import com.fdkankan.scene.vo.*;
  17. import java.util.Objects;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.validation.annotation.Validated;
  20. import org.springframework.web.bind.annotation.*;
  21. /**
  22. * <p>
  23. * 场景表 前端控制器
  24. * </p>
  25. *
  26. * @author dengsixing
  27. * @since 2021-12-23
  28. */
  29. @RestController
  30. @RequestMapping("/service/scene")
  31. public class SceneController {
  32. @Autowired
  33. ISceneProService sceneProService;
  34. @Autowired
  35. ISceneService sceneService;
  36. @Autowired
  37. ISceneFileBuildService sceneFileBuildService;
  38. @Autowired
  39. IVideoSceneProgressService videoSceneProgressService;
  40. @Autowired
  41. IPicSceneProgressService picSceneProgressService;
  42. @Autowired
  43. ISceneEditInfoService sceneEditInfoService;
  44. @Autowired
  45. IScenePlusService scenePlusService;
  46. // /**
  47. // * 获取场景详情
  48. // */
  49. // @PostMapping(value = "/getInfo")
  50. // public SceneVO getInfo(@RequestBody SceneParamVO param){
  51. // return sceneProService.getInfo(param.getNum());
  52. // }
  53. /**
  54. * 获取场景详情
  55. */
  56. @GetMapping(value = "/getInfo")
  57. public SceneInfoVO getInfo(@Validated SceneInfoParamVO param) throws Exception{
  58. param.setReqType(SceneInfoReqType.VIEW.code());
  59. return sceneEditInfoService.getSceneInfo(param);
  60. }
  61. /**
  62. * 场景浏览
  63. * @param param
  64. * @return
  65. */
  66. @PostMapping(value = "/search")
  67. public IPage<SceneVO> search(@RequestBody SceneParamVO param) {
  68. return sceneService.search(param);
  69. }
  70. /**
  71. * 场景浏览
  72. * @param param
  73. * @return
  74. */
  75. @PostMapping(value = "/loadScene")
  76. public Page loadScene(@RequestBody SceneParamVO param) {
  77. return sceneService.loadScene(param);
  78. }
  79. /**
  80. * 场景浏览
  81. * @param param
  82. * @return
  83. */
  84. @PostMapping(value = "/loadAllScene")
  85. public Page loadAllScene(@RequestBody SceneParamVO param){
  86. return sceneService.loadAllScene2(param);
  87. }
  88. /**
  89. * 更新浏览次数
  90. */
  91. @PostMapping(value = "/updateViewCount")
  92. public ResultData updateViewCount(@RequestBody SceneParamVO param){
  93. return sceneService.updateViewCount(param.getNum());
  94. }
  95. /**
  96. * 手动更新浏览数据到数据库
  97. */
  98. @PostMapping(value = "/updatePv")
  99. public ResultData updatePv() throws Exception {
  100. sceneService.updatePv();
  101. return ResultData.ok();
  102. }
  103. /**
  104. * 场景模型重新计算
  105. */
  106. @PostMapping(value = "/rebuildScene")
  107. public ResultData rebuildScene(@RequestParam("num") String num) throws Exception {
  108. return sceneFileBuildService.rebuildScene(num);
  109. }
  110. /**
  111. * 场景模型重新计算
  112. */
  113. @PostMapping(value = "/rebuildVideoScene")
  114. public ResultData rebuildVideoScene(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
  115. return sceneFileBuildService.rebuildVideoScene(param);
  116. }
  117. /**
  118. * 场景模型重新计算
  119. */
  120. @PostMapping(value = "/rebuildPicScene")
  121. public ResultData rebuildPicScene(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
  122. return sceneFileBuildService.rebuildPicScene(param);
  123. }
  124. /**
  125. * 场景视频重新计算进度
  126. */
  127. @PostMapping(value = "/rebuildVideoSceneProgress")
  128. public ResultData rebuildVideoSceneProgress(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
  129. return videoSceneProgressService.rebuildVideoSceneProgress(param);
  130. }
  131. /**
  132. * 场景视频重新计算进度
  133. */
  134. @PostMapping(value = "/rebuildPicSceneProgress")
  135. public ResultData rebuildPicSceneProgress(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
  136. return picSceneProgressService.rebuildPicSceneProgress(param);
  137. }
  138. /**
  139. * 查看场景对应的数据,给刘强用的
  140. */
  141. @PostMapping(value = "/querySceneDataSource")
  142. public ResultData querySceneDataSource(@RequestBody SceneParamVO param){
  143. return sceneService.querySceneDataSource(param);
  144. }
  145. /**
  146. * 查看场景对应的场景码,给刘强用的
  147. */
  148. @PostMapping(value = "/querySceneNum")
  149. public ResultData querySceneNum(@RequestBody SceneParamVO param){
  150. return sceneService.querySceneNum(param);
  151. }
  152. /**
  153. * 查看场景对应的数据,给刘强用的
  154. */
  155. @PostMapping(value = "/downloadCapture")
  156. public ResultData downloadCapture(@RequestBody SceneParamVO param) throws Exception {
  157. return sceneProService.downloadCapture(param);
  158. }
  159. /**
  160. * 上传results数据
  161. * @param param
  162. */
  163. @PostMapping(value = "/uploadResultsData")
  164. public ResultData uploadResultsData(@RequestBody SceneParamVO param) throws Exception{
  165. return sceneProService.uploadResultsData(param);
  166. }
  167. /**
  168. * 一键换装完成修改场景状态
  169. * @param param
  170. */
  171. @PostMapping(value = "/updateStatusByScene")
  172. public ResultData updateStatusByScene(@RequestBody SceneParamVO param) throws Exception{
  173. return sceneProService.updateStatusByScene(param);
  174. }
  175. /**
  176. * 获取一键换装场景状态
  177. */
  178. @PostMapping(value = "/getStatusByScene")
  179. public ResultData getStatusByScene(SceneParamVO param) throws Exception{
  180. return sceneProService.getStatusByScene(param);
  181. }
  182. // /**
  183. // * 获取场景详情
  184. // */
  185. // @ApiOperation("获取场景详情")
  186. // @PostMapping(value = "/getSceneAndCameras")
  187. // public ResultData getSceneAndCameras(@RequestBody Map<String,Object> params) throws Exception {
  188. // String userName = params.get("userName").toString();
  189. // List excludeNums = (List)params.get("excludeNums");
  190. // UserEntity user = userService.findUserByUserName(userName);
  191. // if(ObjectUtils.isEmpty(user)){
  192. // throw new BaseRuntimeException("用户不存在");
  193. // }
  194. // return sceneProService.getSceneAndCameras(user.getId(),excludeNums);
  195. // }
  196. //
  197. // /**
  198. // * 获取场景详情
  199. // */
  200. // @ApiOperation("获取场景详情")
  201. // @PostMapping(value = "/findSceneEcs")
  202. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
  203. // public ResultData findSceneEcs(HttpServletRequest request) throws Exception{
  204. // String sceneNum = request.getParameter("num");
  205. // if(StringUtils.isEmpty(sceneNum)){
  206. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  207. // }
  208. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  209. // if(sceneProEntity == null){
  210. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  211. // }
  212. // return Result.success((Object) sceneProEntity.getEcs());
  213. // }
  214. //
  215. /**
  216. * 根据场景密码打开场景
  217. */
  218. @PostMapping(value = "/check/key")
  219. public ResultData checkKey(@RequestBody @Validated SceneCheckKeyParamVO param) throws Exception {
  220. return sceneEditInfoService.checkKey(param);
  221. }
  222. // /**
  223. // * 是否已登录
  224. // * @return
  225. // */
  226. // @ApiOperation("是否已登录")
  227. // @PostMapping(value = "/isLogin")
  228. // @ApiImplicitParams({
  229. // @ApiImplicitParam(name = "token", value = "用户token", dataType = "String"),
  230. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")})
  231. // public ResultData isLogin(HttpServletRequest request) throws Exception{
  232. // String num = request.getParameter("num");
  233. // String token = request.getHeader("token");
  234. // if(StringUtil.isEmpty(num) ){
  235. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  236. // }
  237. //
  238. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  239. // if (ssoUser == null){
  240. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3004, LoginConstant.FAILURE_MSG_3004);
  241. // }
  242. //
  243. // // 解密获得username,用于和数据库进行对比
  244. // String username = JwtUtil.getUsername(token);
  245. //
  246. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
  247. // if(sceneProEntity == null){
  248. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  249. // }
  250. // if(sceneProEntity.getPayStatus() != 1){
  251. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  252. // }
  253. // if(sceneProEntity.getStatus() != 1 && sceneProEntity.getStatus() != -2){
  254. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  255. // }
  256. //
  257. // JSONObject jsonObject = new JSONObject();
  258. //
  259. // List<SceneResourceEntity> exclude = new ArrayList<>();
  260. // SceneResourceEntity excludeEntity = new SceneResourceEntity();
  261. // excludeEntity.setKeyWord("data");
  262. // exclude.add(excludeEntity);
  263. //
  264. // CameraEntity cameraEntity = goodsService.findByChildName(username);
  265. // jsonObject.put("exclude", exclude);
  266. // jsonObject.put("include", new ArrayList<>());
  267. // jsonObject.put("company", null);
  268. // Result result = Result.success(jsonObject);
  269. //
  270. // //判断该场景是否属于增值权益
  271. // boolean isIncrement = false;
  272. // //获取该相机是否有权益
  273. // boolean isExpired = false;
  274. // CameraEntity sceneCamera = goodsService.findCameraById(sceneProEntity.getCameraId());
  275. // if(sceneCamera != null){
  276. // UserIncrementEntity userIncrementEntity = userIncrementService.findByCameraId(sceneCamera.getId());
  277. //
  278. // if(userIncrementEntity != null){
  279. // if( userIncrementEntity.getIsExpired().intValue() == 0){
  280. // isIncrement = true;
  281. // }
  282. // if(userIncrementEntity.getIsExpired().intValue() == 1){
  283. // isExpired = true;
  284. // }
  285. // }else{
  286. // try {
  287. // Date date = DateUtil.string2Date("2021-09-09 00:00:00",null);
  288. //
  289. // //非07批次的放开
  290. // String pc = sceneCamera.getSnCode().substring(0,2);
  291. // if(!pc.equals("07") ){
  292. // if(sceneCamera.getCreateTime()!=null && date.after(sceneCamera.getCreateTime())){
  293. //
  294. // isIncrement = true;
  295. // isExpired = false;
  296. // }
  297. // }
  298. // }catch (Exception e){
  299. // e.printStackTrace();
  300. // }
  301. // }
  302. // }
  303. //
  304. // jsonObject.put("isExpired", isExpired );
  305. // jsonObject.put("isIncrement", isIncrement);
  306. //
  307. // //判断过期时间
  308. // Date date = DateUtil.string2Date(expectedTime,null);
  309. //
  310. // jsonObject.put("isTransition",DateUtil.isBeforeNow2(date));
  311. //
  312. //
  313. // if(cameraEntity != null){
  314. // CameraDetailEntity cameraDetailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
  315. // if(cameraDetailEntity.getCompanyId() != null){
  316. // if(cameraDetailEntity.getCompanyId().longValue() == 1 || cameraDetailEntity.getCompanyId().longValue() == 14){
  317. // jsonObject.put("exclude", new ArrayList<>());
  318. // jsonObject.put("company", cameraDetailEntity.getCompanyId().longValue());
  319. // }
  320. // }
  321. // return result;
  322. // }
  323. //
  324. // UserEntity userEntity = userService.findUserByUserName(username);
  325. // if("18750226207".equals(username)){
  326. // log.info("18750226207该账号默认超级管理员,可以操作所有场景");
  327. // }
  328. // else if(userEntity == null || sceneProEntity.getUserId() == null || userEntity.getId().longValue() != sceneProEntity.getUserId().longValue()){
  329. // log.info("user:" + userEntity.getId() + ",scene:" + sceneProEntity.getUserId());
  330. //
  331. // Condition condition = new Condition(SceneCooperationEntity.class);
  332. // condition.and().andEqualTo("sceneNum", num);
  333. // List<SceneCooperationEntity> list = sceneCooperationService.findAll(condition);
  334. // if(list != null && list.size() > 0){
  335. // if(list.get(0).getUserId().longValue() != userEntity.getId().longValue()){
  336. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  337. // }
  338. // }else {
  339. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  340. // }
  341. // }
  342. //
  343. // if(sceneProEntity.getCameraId() != null){
  344. // cameraEntity = goodsService.findCameraById(sceneProEntity.getCameraId());
  345. // if(cameraEntity != null){
  346. // CameraDetailEntity cameraDetailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
  347. // if(cameraDetailEntity.getCompanyId() != null){
  348. // if(cameraDetailEntity.getCompanyId().longValue() == 1 || cameraDetailEntity.getCompanyId().longValue() == 14){
  349. // jsonObject.put("exclude", new ArrayList<>());
  350. // jsonObject.put("company", cameraDetailEntity.getCompanyId().longValue());
  351. // }
  352. // }
  353. // }
  354. // }
  355. //
  356. // //权限控制完后判断若是协作账号,获取协作权限
  357. // SceneCooperationEntity sceneCooperationEntity = sceneCooperationService.findBySceneNum(num);
  358. // //若数据为空表示可操作全部资源
  359. // if(sceneCooperationEntity == null || sceneCooperationEntity.getUserId().longValue() != ssoUser.getId().longValue()){
  360. // return result;
  361. // }
  362. //
  363. // if(sceneProEntity != null && sceneProEntity.getUserId() == sceneCooperationEntity.getUserId().longValue()){
  364. // return result;
  365. // }
  366. //
  367. // jsonObject.put("include", sceneResourceService.findByCooperationId(sceneCooperationEntity.getId()));
  368. //
  369. // return result;
  370. //
  371. // }
  372. //
  373. // //跳转到编辑页面
  374. // @ApiOperation("跳转到编辑页面")
  375. // @PostMapping("goEditScenePage")
  376. // @ApiImplicitParams({
  377. // @ApiImplicitParam(name = "phoneNum", value = "用户名(手机号)", dataType = "String"),
  378. // @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String"),
  379. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String"),
  380. // @ApiImplicitParam(name = "lang", value = "语言", dataType = "String"),
  381. // @ApiImplicitParam(name = "vlog", value = "vlog", dataType = "String"),
  382. // @ApiImplicitParam(name = "childName", value = "相机编码", dataType = "String")
  383. // })
  384. // public void goEditScenePage(HttpServletRequest request, HttpServletResponse response) throws Exception{
  385. // String phoneNum = request.getParameter("phoneNum");
  386. // String password = request.getParameter("password");
  387. // String sceneNum = request.getParameter("sceneNum");
  388. // String childName = request.getParameter("childName");
  389. // String lang = request.getParameter("lang");
  390. // String vlog = request.getParameter("vlog");
  391. //
  392. // SceneProEntity scene = sceneProService.findBySceneNum(sceneNum);
  393. //
  394. // if(scene == null) {
  395. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  396. // }
  397. //
  398. // if(StringUtil.isNotEmpty(childName)){
  399. // CameraEntity cameraEntity = goodsService.findByChildName(childName);
  400. // if(cameraEntity != null){
  401. //
  402. // CameraDetailEntity cameraDetailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
  403. // if(cameraDetailEntity != null && cameraDetailEntity.getCooperationUser() != null){
  404. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  405. // }
  406. //
  407. // SSOUser dbUser = new SSOUser();
  408. // dbUser.setUserName(childName);
  409. //
  410. // String token = JwtUtil.createJWT(-1, childName);
  411. // SSOLoginHelper.login(token, dbUser);
  412. //
  413. // //登录成功
  414. // if(scene.getWebSite().contains(sceneProUrl)){
  415. // response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
  416. // sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
  417. // (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
  418. // }
  419. //
  420. // if(scene.getWebSite().contains(sceneProNewUrl)){
  421. // response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
  422. // sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
  423. // (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
  424. // }
  425. // return;
  426. // }
  427. // }
  428. //
  429. // if(StringUtils.isEmpty(phoneNum) || StringUtils.isEmpty(password)
  430. // || StringUtils.isEmpty(sceneNum)){
  431. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  432. // }
  433. //
  434. // if(scene.getUserId()==null)
  435. // {
  436. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
  437. // }
  438. //
  439. // Result result = userService.findByUserName(phoneNum);
  440. // SSOUser ssoUser = mapper.convertValue(result.getData(), SSOUser.class);
  441. // if(ssoUser == null){
  442. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  443. // }
  444. //
  445. // if(ssoUser.getId().longValue() != scene.getUserId().longValue()) {
  446. // SceneCooperationEntity sceneCooperationEntity = sceneCooperationService.findBySceneNum(sceneNum);
  447. // if(sceneCooperationEntity == null){
  448. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  449. // }
  450. //
  451. // if(sceneCooperationEntity.getUserId().longValue() != ssoUser.getId().longValue()){
  452. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  453. // }
  454. //
  455. // }
  456. //
  457. // if(!SecurityUtil.MD5(password).equals(ssoUser.getPassword()))
  458. // {
  459. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  460. // }
  461. //
  462. // String token = JwtUtil.createJWT(-1, ssoUser.getUserName());
  463. // SSOLoginHelper.login(token, ssoUser);
  464. // //登录成功
  465. // if(scene.getWebSite().contains(sceneProUrl)){
  466. // response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
  467. // sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
  468. // (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
  469. // }
  470. //
  471. // if(scene.getWebSite().contains(sceneProNewUrl)) {
  472. // response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
  473. // sceneNum + "&t=" + System.currentTimeMillis() + "&token=" + token + "&app" +
  474. // (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
  475. // }
  476. // }
  477. //
  478. // //跳转到官网消费页面
  479. // @ApiOperation("跳转到官网消费页面")
  480. // @PostMapping("goConsumptionPage")
  481. // @ApiImplicitParams({
  482. // @ApiImplicitParam(name = "phoneNum", value = "用户名(手机号)", dataType = "String"),
  483. // @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String"),
  484. // @ApiImplicitParam(name = "lang", value = "语言", dataType = "String")})
  485. // public void goConsumptionPage(HttpServletRequest request, HttpServletResponse response) throws Exception{
  486. // String phoneNum = request.getParameter("phoneNum");
  487. // String password = request.getParameter("password");
  488. // String lang = request.getParameter("lang");
  489. //
  490. // if(StringUtils.isEmpty(phoneNum) || StringUtils.isEmpty(password)){
  491. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  492. // }
  493. //
  494. // Result result = userService.findByUserName(phoneNum);
  495. // SSOUser ssoUser = mapper.convertValue(result.getData(), SSOUser.class);
  496. // if(ssoUser == null){
  497. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  498. // }
  499. //
  500. // if(!SecurityUtil.MD5(password).equals(ssoUser.getPassword()))
  501. // {
  502. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  503. // }
  504. //
  505. // String token = JwtUtil.createJWT(-1, ssoUser.getUserName());
  506. // SSOLoginHelper.login(token, ssoUser);
  507. // //登录成功
  508. // response.sendRedirect(mainUrl + "mobile.html?token="+ token + "&app" + (lang == null ? "" : "&lang=" + lang)+"#/consumption/0" );
  509. // }
  510. //
  511. // //跳转到官网扩容充值页面
  512. // @ApiOperation("跳转到官网扩容充值页面")
  513. // @PostMapping("goRechargePage")
  514. // @ApiImplicitParams({
  515. // @ApiImplicitParam(name = "phoneNum", value = "用户名(手机号)", dataType = "String"),
  516. // @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String"),
  517. // @ApiImplicitParam(name = "childName", value = "相机mac地址", dataType = "String"),
  518. // @ApiImplicitParam(name = "lang", value = "语言", dataType = "String")})
  519. // public void goRechargePage(HttpServletRequest request, HttpServletResponse response) throws Exception{
  520. // String phoneNum = request.getParameter("phoneNum");
  521. // String password = request.getParameter("password");
  522. // String childName = request.getParameter("childName");
  523. // String lang = request.getParameter("lang");
  524. //
  525. // if(StringUtils.isEmpty(phoneNum) || StringUtils.isEmpty(password)){
  526. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  527. // }
  528. //
  529. // Result result = userService.findByUserName(phoneNum);
  530. // SSOUser ssoUser = mapper.convertValue(result.getData(), SSOUser.class);
  531. // if(ssoUser == null){
  532. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  533. // }
  534. //
  535. // if(!SecurityUtil.MD5(password).equals(ssoUser.getPassword()))
  536. // {
  537. // throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
  538. // }
  539. //
  540. // String token = JwtUtil.createJWT(-1, ssoUser.getUserName());
  541. // SSOLoginHelper.login(token, ssoUser);
  542. // //登录成功
  543. // response.sendRedirect(mainUrl + "mobile.html#/introduce/" + childName + "?token=" + token + "&app" + (lang == null ? "" : "&lang=" + lang));
  544. // }
  545. //
  546. // /**
  547. // * app录音获取录音文件版本
  548. // */
  549. // @ApiOperation("app录音获取录音文件版本")
  550. // @PostMapping(value = "/getVoiceSound")
  551. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
  552. // public ResultData getVoiceSound(HttpServletRequest request) throws Exception {
  553. // String sceneNum = request.getParameter("num");
  554. // if(StringUtils.isEmpty(sceneNum)){
  555. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  556. // }
  557. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  558. // if(sceneProEntity == null){
  559. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  560. // }
  561. // SceneProEditEntity editEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  562. //
  563. // //更新访问数量
  564. // return Result.success(editEntity.getScreencapVoiceSoundsync());
  565. // }
  566. //
  567. // /**
  568. // * 下载模型文件
  569. // */
  570. // @ApiOperation("下载模型文件")
  571. // @PostMapping(value = "/downloadTexData")
  572. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
  573. // public ResultData downloadTexData(HttpServletRequest request, HttpServletResponse response) throws Exception {
  574. // String sceneNum = request.getParameter("num");
  575. //
  576. // if(StringUtils.isEmpty(sceneNum)){
  577. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  578. // }
  579. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  580. // if(sceneProEntity == null){
  581. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  582. // }
  583. //
  584. // String dataPath = sceneProEntity.getDataSource() + "/caches/tex";
  585. // if(new File(sceneProEntity.getDataSource() + "_edit/caches/tex").exists()){
  586. // dataPath = sceneProEntity.getDataSource() + "_edit/caches/tex";
  587. // }
  588. // File filePath = new File(dataPath);
  589. // for(String deletePath : filePath.list()){
  590. // if(deletePath.endsWith(".obj") && !deletePath.contains("output.house.obj")){
  591. // FileUtils.deleteFile(filePath.getAbsolutePath() + File.separator + deletePath);
  592. // }
  593. // }
  594. //
  595. // FileUtils.zipFile(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/tex.zip", dataPath);
  596. //
  597. // return Result.success(mainUrl + "scene/images/images" + sceneNum + "/tex.zip?t=" +System.currentTimeMillis());
  598. // }
  599. //
  600. // /**
  601. // * 生成英文版二维码
  602. // */
  603. // @ApiOperation("生成英文版二维码")
  604. // @PostMapping(value = "/createEnSceneQRcode")
  605. // public ResultData createEnSceneQRcode(HttpServletRequest request, HttpServletResponse response) throws Exception {
  606. // List<SceneProEntity> proEntityList = sceneProService.findAll();
  607. // for(SceneProEntity proEntity : proEntityList){
  608. // MatrixToImageWriterUtil.createQRCode(mainUrl + sceneProUrl + proEntity.getNum() + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+proEntity.getNum()+"_en.png", null);
  609. // }
  610. //
  611. // List<SceneEntity> entityList = sceneService.findAll();
  612. // for(SceneEntity sceneEntity : entityList){
  613. // MatrixToImageWriterUtil.createQRCode(mainUrl + sceneUrl + sceneEntity.getNum() + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneEntity.getNum()+"_en.png", null);
  614. // }
  615. // return Result.success("生成完成");
  616. // }
  617. //
  618. // /**
  619. // * 根据sn码查找所有场景连接
  620. // */
  621. // @ApiOperation("根据sn码查找所有场景连接")
  622. // @PostMapping(value = "/findSceneBySnCode")
  623. // @ApiImplicitParam(name = "snCode", value = "snCode", dataType = "String")
  624. // public ResultData findSceneBySnCode(HttpServletRequest request, HttpServletResponse response) throws Exception {
  625. // String snCode = request.getParameter("snCode");
  626. // CameraEntity cameraEntity = goodsService.findBySnCode(snCode);
  627. //
  628. // if(cameraEntity == null){
  629. // return Result.success();
  630. // }
  631. //
  632. // return Result.success(sceneProService.findByCameraId(cameraEntity.getId()));
  633. // }
  634. //
  635. // /**
  636. // * 上传ar场景数据
  637. // * @param file
  638. // * @param params
  639. // * @return
  640. // */
  641. // @ApiOperation("上传ar场景数据")
  642. // @PostMapping("uploadImgAndJson")
  643. // @ApiImplicitParams({
  644. // @ApiImplicitParam(name = "file", value = "文件流", dataType = "MultipartFile"),
  645. // @ApiImplicitParam(name = "params", value = "参数", dataType = "String"),
  646. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")})
  647. // public ResultData uploadImgAndJson(@RequestParam(value = "file",required = false) MultipartFile file,
  648. // String params, String num) throws Exception {
  649. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
  650. // if(sceneProEntity == null){
  651. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  652. // }
  653. // String path = sceneProEntity.getDataSource() + "_ar";
  654. // String filePath = path + "/extras/";
  655. //
  656. // String fileName = "ar.jpg";
  657. //
  658. // File targetFile = new File(filePath + fileName);
  659. // if(!targetFile.getParentFile().exists()){
  660. // targetFile.getParentFile().mkdirs();
  661. // }
  662. // file.transferTo(targetFile);
  663. //
  664. // JSONObject jsonObject = JSONObject.parseObject(params);
  665. // FileUtils.writeFile(filePath + "ar_in.json", jsonObject.toString());
  666. //
  667. // //创建data.json
  668. // JSONObject dataJson = new JSONObject();
  669. // dataJson.put("ar", true);
  670. // dataJson.put("split_type", "SPLIT_V1");
  671. // dataJson.put("data_describe", "double spherical");
  672. // dataJson.put("skybox_type", "SKYBOX_V5");
  673. // FileUtils.writeFile(path + "/data.json", dataJson.toString());
  674. //
  675. // if(new File(sceneProEntity.getDataSource() + File.separator + "caches").exists()){
  676. // CreateObjUtil.createSoftConnection(sceneProEntity.getDataSource() + File.separator + "caches" , path + File.separator + "caches");
  677. // }
  678. //
  679. // //调用算法
  680. // CreateObjUtil.build3dModel(path, "");
  681. //
  682. // String result = FileUtils.readFile(path + "/results/ar_out.json");
  683. // if(result == null){
  684. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5012, SceneConstant.FAILURE_MSG_5012);
  685. // }
  686. //
  687. // return Result.success(result);
  688. // }
  689. //
  690. // /**
  691. // * 正式环境与测试环境互相复制资源并且重算
  692. // */
  693. // @ApiOperation("正式环境与测试环境互相复制资源并且重算")
  694. // @PostMapping(value = "/copyDataAndBuild")
  695. // @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
  696. // public void copyDataAndBuild(HttpServletRequest request, HttpServletResponse response) throws Exception {
  697. // String num = request.getParameter("num");
  698. //
  699. // Map postData = new HashMap();
  700. // postData.put("num", num);
  701. // String dataPath = "";
  702. // if("dev".equals(environment)){
  703. // dataPath = HttpRequestorUtil.doPost("https://www.4dkankan.com/service/scene/querySceneDataSource", postData);
  704. // log.info("正式环境资源路径:" + dataPath);
  705. // }else {
  706. // dataPath = HttpRequestorUtil.doPost("https://test.4dkankan.com/service/scene/querySceneDataSource", postData);
  707. // log.info("测试环境资源路径:" + dataPath);
  708. // }
  709. //
  710. // if(dataPath.contains("/mnt/data/")){
  711. // String newPath = dataPath;
  712. //
  713. // if(!new File(newPath).exists()){
  714. // new File(newPath).mkdirs();
  715. // }
  716. //
  717. // if(!new File(newPath + "/capture").exists()){
  718. // new File(newPath + "/capture").mkdirs();
  719. // }
  720. // if("dev".equals(environment)){
  721. // //远程复制正式环境资源到测试环境;
  722. // CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + dataPath.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", dataPath + "/capture/");
  723. // log.info("数据复制完成");
  724. // }else {
  725. // //远程复制正式环境资源到测试环境;
  726. // CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + dataPath.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", dataPath + "/capture/");
  727. // log.info("数据复制完成");
  728. // }
  729. //
  730. //
  731. // String data = FileUtils.readFile(newPath + "/capture/data.fdage");
  732. // JSONObject jsonObject = JSONObject.parseObject(data);
  733. // String sceneNum = "";
  734. // if(jsonObject != null){
  735. // sceneNum = sceneNumService.generateSceneNum();
  736. //
  737. // String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
  738. // String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
  739. //
  740. // log.info("查询相机:" + cameraName);
  741. // CameraEntity cameraEntity = goodsService.findByChildName(cameraName);
  742. //
  743. // if(cameraEntity == null){
  744. // log.error("该相机不存在:" + cameraName);
  745. // //偶现data.fdage给的相机码多了或少了4DKKPRO_
  746. // if(cameraName.contains("4DKKPRO_")){
  747. // cameraEntity = goodsService.findByChildName(cameraName.replace("4DKKPRO_", ""));
  748. // }else {
  749. // cameraEntity = goodsService.findByChildName("4DKKPRO_" + cameraName);
  750. // }
  751. // if(cameraEntity == null){
  752. // throw new BaseRuntimeException(CameraConstant.FAILURE_CODE_6003, CameraConstant.FAILURE_MSG_6003);
  753. // }
  754. // }
  755. //
  756. // CameraDetailEntity detailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
  757. // if(detailEntity == null){
  758. // log.error("该相机详情不存在:" + cameraName);
  759. // throw new BaseRuntimeException(CameraConstant.FAILURE_CODE_6003, CameraConstant.FAILURE_MSG_6003);
  760. // }
  761. //
  762. // String userName = null;
  763. // if(detailEntity.getUserId() != null){
  764. // Result result2 = userService.findById(detailEntity.getUserId());
  765. // SSOUser user = mapper.convertValue(result2.getData(), SSOUser.class);
  766. // if(user != null){
  767. // userName = user.getUserName();
  768. // }
  769. // }
  770. //
  771. // JSONObject firmwareVersion = new JSONObject();
  772. // if(jsonObject.containsKey("camSoftwareVersion") && StringUtil.isNotEmpty(jsonObject.getString("camSoftwareVersion"))){
  773. // firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
  774. // }
  775. //
  776. // if(jsonObject.containsKey("version") && StringUtil.isNotEmpty(jsonObject.getString("version"))){
  777. // firmwareVersion.put("version", jsonObject.getString("version"));
  778. // }
  779. //
  780. //// String sceneUrl = mainUrl + sceneProUrl;
  781. //// String buildType = "V2";
  782. //// //根据videoVersion判断是V2还是V3版本的算法和页面
  783. //// if(jsonObject.containsKey("videoVersion") && StringUtil.isNotEmpty(jsonObject.getString("videoVersion"))){
  784. //// if(jsonObject.getIntValue("videoVersion") >= 4){
  785. //// buildType = "V3";
  786. //// sceneUrl = mainUrl + sceneProNewUrl;
  787. //// }
  788. //// }
  789. // String buildType = "V3";
  790. // String sceneUrl = mainUrl + sceneProNewUrl;
  791. //
  792. // String filePath = newPath + "/capture/";
  793. // String prefix = newPath.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/";
  794. //
  795. // String fileId = prefix.split("/")[1];
  796. //
  797. // String icon = null;
  798. // if(jsonObject.containsKey("icon") && StringUtil.isNotEmpty(jsonObject.getString("icon"))){
  799. // CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
  800. // uploadToOssUtil.upload(filePath + jsonObject.getString("icon"), "images/images" + sceneNum + "/" + jsonObject.getString("icon"));
  801. // icon = "https://4dkk.4dage.com/images/images" + sceneNum + "/" + jsonObject.getString("icon");
  802. // }
  803. //
  804. // Long cameraType = 11L;
  805. // //判断是否转台相机
  806. // if(detailEntity != null && detailEntity.getType() == 9){
  807. // cameraType = 13L;
  808. // }
  809. //
  810. // if(detailEntity != null && detailEntity.getType() == 10){
  811. // cameraType = 14L;
  812. // }
  813. //
  814. // SceneProEntity scene = ComputerUtil.createScenePro(sceneNum, cameraEntity.getId(), cameraEntity.getChildName(), jsonObject.getString("creator"),
  815. // jsonObject.getString("pwd"), unicode,
  816. // cameraType, String.valueOf(fileId), prefix, "", icon, "0", detailEntity.getUserId(), userName,
  817. // jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
  818. // jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
  819. // jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), sceneProService, sceneProEditService, 0,
  820. // producer, jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,
  821. // sceneCooperationService, sceneResourceCooperationService, sceneResourceCameraService, detailEntity.getCooperationUser(), rubberSheetingUtil);
  822. //
  823. // producer.sendMsg(scene.getMqMsg());
  824. // }
  825. //// CreateObjUtil.build3dModel(newPath, "");
  826. //
  827. // JSONObject result = new JSONObject();
  828. // result.put("proData", dataPath);
  829. // result.put("testData", newPath);
  830. // result.put("num", sceneNum);
  831. // response.getWriter().print(result);
  832. // }
  833. // }
  834. //
  835. // /**
  836. // * 调用小程序商品列表
  837. // */
  838. // @ApiOperation("调用小程序商品列表")
  839. // @PostMapping(value = "/shopGoods")
  840. // @ApiImplicitParam(name = "keyword", value = "关键词", dataType = "String")
  841. // public void shopGoods(HttpServletRequest request, HttpServletResponse response) throws Exception {
  842. // String keyword = request.getParameter("keyword");
  843. //
  844. // Map postData = new HashMap();
  845. // postData.put("keyword", keyword);
  846. // postData.put("sort", "id");
  847. // postData.put("order", "desc");
  848. // String result = HttpRequestorUtil.doPost("https://shop.4dkankan.com/platform-framework/api/goods/list", postData);
  849. // log.info("获取小程序商品列表");
  850. //
  851. // response.getWriter().print(result);
  852. // }
  853. //
  854. // /**
  855. // * 保存配置文件数据
  856. // */
  857. // @ApiOperation("保存配置文件数据")
  858. // @PostMapping(value = "/saveConfigData")
  859. // @ApiImplicitParams({
  860. // @ApiImplicitParam(name = "fileName", value = "文件名字", dataType = "MultipartFile"),
  861. // @ApiImplicitParam(name = "config", value = "config", dataType = "String")})
  862. // public ResultData saveConfigData(HttpServletRequest request) throws Exception {
  863. // String fileName = request.getParameter("fileName");
  864. // String config = request.getParameter("config");
  865. // FileUtils.writeFile(ConstantFilePath.SCENE_PATH + fileName, config);
  866. // return Result.success();
  867. // }
  868. //
  869. // /**
  870. // * 标定重算
  871. // */
  872. // @ApiOperation("标定重算")
  873. // @PostMapping(value = "/rebuildByPath")
  874. // @ApiImplicitParam(name = "path", value = "资源路径", dataType = "String")
  875. // public ResultData rebuildByPath(HttpServletRequest request) throws Exception{
  876. // String path = request.getParameter("path");
  877. // if(path.contains("color_anlysis")){
  878. // Map<String,String> map = ComputerUtil.computerCalibration(path);
  879. // uploadToOssUtil.uploadMulFiles(map);
  880. // return Result.success("开始标定计算");
  881. // }
  882. //
  883. // producer.sendMsg(path);
  884. // return Result.success("开始标定计算");
  885. // }
  886. //
  887. // /**
  888. // * 获取编辑页面的资源下载路径
  889. // */
  890. // @ApiOperation("获取编辑页面的资源下载路径")
  891. // @PostMapping(value = "/getEditDataUrl")
  892. // @ApiImplicitParam(name = "num", value = "场景吗", dataType = "String")
  893. // public ResultData getEditDataUrl(HttpServletRequest request) throws Exception{
  894. // String num = request.getParameter("num");
  895. //
  896. // if(StringUtils.isEmpty(num)){
  897. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  898. // }
  899. //
  900. // List<String> result = new ArrayList<>();
  901. // List<String> urlList = new ArrayList<>();
  902. //
  903. // urlList = FileUtils.readfilePath(ConstantFilePath.SCENE_PATH + "data/data" + num, urlList);
  904. // urlList = FileUtils.readfilePath(ConstantFilePath.SCENE_PATH + "images/images" + num, urlList);
  905. // urlList = FileUtils.readfilePath(ConstantFilePath.SCENE_PATH + "voice/voice" + num, urlList);
  906. //
  907. // if(urlList != null && urlList.size() > 0){
  908. // for(String url : urlList){
  909. // result.add(url.replace(ConstantFilePath.BASE_PATH + "/", ""));
  910. // }
  911. // }
  912. //
  913. // return Result.success(result);
  914. // }
  915. //
  916. // @ApiOperation("根据场景码生成场景")
  917. // @PostMapping("/createScene")
  918. // @ApiImplicitParam(name = "num", value = "场景吗", dataType = "String")
  919. // public ResultData createScene(@RequestBody SceneParamVO param) throws Exception{
  920. // if(StringUtils.isEmpty(param.getNum())){
  921. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  922. // }
  923. //
  924. // StringBuffer dataBuf = new StringBuffer()
  925. // .append("data").append(File.separator)
  926. // .append("data").append(param.getNum());
  927. //
  928. // StringBuffer imagesBuf = new StringBuffer()
  929. // .append("images").append(File.separator)
  930. // .append("images").append(param.getNum());
  931. //
  932. // StringBuffer dataBuffer = new StringBuffer(ConstantFilePath.SCENE_PATH).append(dataBuf.toString());
  933. // StringBuffer imagesBuffer = new StringBuffer(ConstantFilePath.SCENE_PATH).append(imagesBuf.toString());
  934. //
  935. // FileUtils.delAllFile(imagesBuffer.toString() + "/results/");
  936. // FileUtils.delAllFile(imagesBuffer.toString() + "/extras/");
  937. // //远程复制oss资源
  938. // CreateObjUtil.ossUtilCp(imagesBuf.toString() + File.separator + param.getObjName(), imagesBuffer.toString() + "/extras/");
  939. // //obj文件修改名字
  940. // FileUtils.copyFile(imagesBuffer.toString() + "/extras/" + param.getObjName(), imagesBuffer.toString() + "/extras/mesh.obj", true);
  941. // FileUtils.deleteFile(imagesBuffer.toString() + "/extras/" + param.getObjName());
  942. //
  943. // CreateObjUtil.ossUtilCp(imagesBuf.toString() + File.separator + param.getMntName(), imagesBuffer.toString() + "/extras/");
  944. // CreateObjUtil.ossUtilCp(imagesBuf.toString() + File.separator + "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1", imagesBuffer.toString() + "/extras/");
  945. // //将文件复制出去
  946. // String[] imgs = new File(imagesBuffer.toString() + "/extras/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1").list();
  947. // for(String img : imgs){
  948. // FileUtils.copyFile(imagesBuffer.toString() + "/extras/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1/" + img,
  949. // imagesBuffer.toString() + "/extras/" + img, true);
  950. // }
  951. // CreateObjUtil.ossUtilCp(imagesBuf.toString() + File.separator + "vision.txt", imagesBuffer.toString());
  952. //
  953. // //创建data.json
  954. // JSONObject dataJson = new JSONObject();
  955. // dataJson.put("obj2txt", true);
  956. // dataJson.put("split_type", "SPLIT_V6");
  957. // dataJson.put("data_describe", "double spherical");
  958. // dataJson.put("skybox_type", "SKYBOX_V5");
  959. // FileUtils.writeFile(imagesBuffer.toString() + "/data.json", dataJson.toString());
  960. //
  961. // //调用objToTxt算法
  962. // CreateObjUtil.objToTxt(imagesBuffer.toString(), "");
  963. //
  964. // String uploadData = FileUtils.readFile(imagesBuffer.toString() + File.separator + "results" +File.separator+"upload.json");
  965. // JSONObject uploadJson = null;
  966. // JSONArray array = null;
  967. // if(uploadData!=null) {
  968. // uploadJson = JSONObject.parseObject(uploadData);
  969. // array = uploadJson.getJSONArray("upload");
  970. // }
  971. // if(array == null){
  972. // log.error("upload.json数据出错");
  973. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5012, SceneConstant.FAILURE_MSG_5012);
  974. // }
  975. //
  976. // Map<String,String> map = new HashMap<String,String>();
  977. // JSONObject fileJson = null;
  978. // String fileName = "";
  979. // for(int i = 0, len = array.size(); i < len; i++) {
  980. // fileJson = array.getJSONObject(i);
  981. // fileName = fileJson.getString("file");
  982. // //文件不存在抛出异常
  983. // if (!new File(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName).exists()) {
  984. // throw new Exception(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName + "文件不存在");
  985. // }
  986. //
  987. // //tex文件夹
  988. // if (fileJson.getIntValue("clazz") == 15) {
  989. // map.put(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName, "images/images" +
  990. // param.getNum() + "/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
  991. // continue;
  992. // }
  993. // }
  994. //
  995. // CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
  996. // CreateObjUtil.convertDamToLzma(imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
  997. // CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" + File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
  998. // map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma");
  999. // map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
  1000. //
  1001. // FileUtils.deleteFile(imagesBuffer.toString() + "/vision.modeldata");
  1002. // CreateObjUtil.convertTxtToVisionmodeldata(imagesBuffer.toString() + "/vision.txt", imagesBuffer.toString() + "/vision.modeldata");
  1003. // map.put(imagesBuffer.toString() + "/vision.modeldata", "images/images"+param.getNum()+"/vision.modeldata");
  1004. //
  1005. // uploadToOssUtil.uploadMulFiles(map);
  1006. //
  1007. // SceneProEntity proEntity = sceneProService.findBySceneNum(param.getNum());
  1008. // if(proEntity == null){
  1009. // proEntity = new SceneProEntity();
  1010. // proEntity.setSceneName("四维看看");
  1011. // proEntity.setSceneDec("<p>四维看看 让空间讲故事</p>");
  1012. // proEntity.setSceneScheme(2);
  1013. // proEntity.setNum(param.getNum());
  1014. // proEntity.setUserId(param.getUserId());
  1015. // proEntity.setWebSite(mainUrl + sceneProNewUrl + param.getNum());
  1016. // proEntity.setStatus(1);
  1017. // proEntity.setPayStatus(1);
  1018. // proEntity.setBuildType("V3");
  1019. //
  1020. // if(param.getSceneSource()!=null){
  1021. // proEntity.setSceneSource(param.getSceneSource());
  1022. // }
  1023. //
  1024. // sceneProService.save(proEntity);
  1025. //
  1026. // SceneProEditEntity proEditEntity = new SceneProEditEntity();
  1027. // proEditEntity.setProId(proEntity.getId());
  1028. // sceneProEditService.save(proEditEntity);
  1029. //
  1030. // JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(proEntity));
  1031. // scenejson.put("visions", 1);
  1032. // FileUtils.writeFile(dataBuffer.toString() + File.separator+"scene.json", scenejson.toString());
  1033. // }
  1034. //
  1035. // return Result.success(mainUrl + sceneProNewUrl + param.getNum());
  1036. // }
  1037. //
  1038. // @ApiOperation("查找八目未使用过的场景吗")
  1039. // @PostMapping("/finSceneNum")
  1040. // public ResultData finSceneNum(){
  1041. // String num = sceneNumService.generateSceneNum();
  1042. // return Result.success(num);
  1043. // }
  1044. //
  1045. // @ApiOperation("查找123看房未使用过的场景吗")
  1046. // @PostMapping("/finSkSceneNum")
  1047. // public ResultData finSkSceneNum(){
  1048. // String num = sceneNumService.generateSceneNum();
  1049. // return Result.success(num);
  1050. // }
  1051. //
  1052. // @ApiOperation("根据一键换装风格码入库场景表")
  1053. // @PostMapping("/createChangeScene")
  1054. // @ApiImplicitParams({
  1055. // @ApiImplicitParam(name = "num", value = "", dataType = "String"),
  1056. // @ApiImplicitParam(name = "oldNum", value = "场景吗", dataType = "String")})
  1057. // public ResultData createChangeScene(HttpServletRequest request) throws Exception{
  1058. // String projectNum = request.getParameter("num");
  1059. // String oldNum = request.getParameter("oldNum");
  1060. // String sceneName = request.getParameter("sceneName");
  1061. // String resolution = request.getParameter("resolution");
  1062. //
  1063. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(projectNum);
  1064. //
  1065. // String floorJson = ConstantFilePath.SCENE_PATH + "data/data" + projectNum + File.separator + "floor.json";
  1066. // String floorPlan = ConstantFilePath.SCENE_PATH + "images/images" + projectNum + File.separator + "floorplan.png";
  1067. //
  1068. // int sceneScheme = 12;
  1069. // if(StringUtil.isNotEmpty(resolution)){
  1070. // if("1024".equals(resolution)){
  1071. // sceneScheme = 12;
  1072. // }
  1073. // if("2048".equals(resolution)){
  1074. // sceneScheme = 11;
  1075. // }
  1076. // if("4096".equals(resolution)){
  1077. // sceneScheme = 10;
  1078. // }
  1079. // }
  1080. //
  1081. // if(sceneProEntity != null){
  1082. // sceneProEntity.setSceneName(sceneName);
  1083. // sceneProEntity.setStatus(0);
  1084. // sceneProEntity.setSceneScheme(sceneScheme);
  1085. // sceneProService.update(sceneProEntity);
  1086. //
  1087. // if(!new File(floorJson).exists()){
  1088. // FileUtils.downLoadFromUrl(prefixAli + "data/data" + oldNum + File.separator+"floor.json?t=" + System.currentTimeMillis(),
  1089. // "floor.json", ConstantFilePath.SCENE_PATH+"data/data" + projectNum);
  1090. // uploadToOssUtil.upload(floorJson, "data/data" + projectNum + File.separator + "floor.json");
  1091. // }
  1092. //
  1093. // if(!new File(floorPlan).exists()){
  1094. // FileUtils.downLoadFromUrl(prefixAli + "images/images" + oldNum + File.separator+"floorplan.png?t=" + System.currentTimeMillis(),
  1095. // "floorplan.png", ConstantFilePath.SCENE_PATH+"images/images" + projectNum);
  1096. // uploadToOssUtil.upload(floorPlan, "images/images" + projectNum + File.separator + "floorplan.png");
  1097. // }
  1098. // JSONObject scenejson = JSON.parseObject(FileUtils.readFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json"));
  1099. // scenejson.put("sceneScheme", sceneScheme);
  1100. // scenejson.put("sceneSource", 11);
  1101. // FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", scenejson.toJSONString());
  1102. //
  1103. // SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1104. // sceneProEditEntity.setSceneKey(null);
  1105. // sceneProEditEntity.setNeedKey(0);
  1106. // sceneProEditService.update(sceneProEditEntity);
  1107. //
  1108. // return Result.success("一键换装场景存在,不重复生成");
  1109. // }
  1110. //
  1111. // //根据旧的场景生成新的vr场景
  1112. // sceneProEntity = sceneProService.findBySceneNum(oldNum);
  1113. // if(sceneProEntity == null){
  1114. // return Result.failure("场景不存在");
  1115. // }
  1116. //
  1117. // SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1118. //
  1119. // sceneProEntity.setId(null);
  1120. // sceneProEntity.setSceneType(99);
  1121. // sceneProEntity.setWebSite(sceneProEntity.getWebSite().replace(oldNum, projectNum));
  1122. // sceneProEntity.setNum(projectNum);
  1123. // sceneProEntity.setSceneName(sceneName);
  1124. // sceneProEntity.setStatus(0);
  1125. // sceneProEntity.setPayStatus(1);
  1126. // sceneProEntity.setSceneScheme(sceneScheme);
  1127. // sceneProEntity.setSceneSource(11);
  1128. // sceneProEntity.setSpace(new BigInteger("0"));
  1129. // sceneProEntity.setCreateTime(new Date());
  1130. // sceneProEntity.setVideos(null);
  1131. // sceneProService.save(sceneProEntity);
  1132. //
  1133. // sceneProEditEntity.setId(null);
  1134. // sceneProEditEntity.setProId(sceneProEntity.getId());
  1135. // sceneProEditEntity.setJumpScene(false);
  1136. // sceneProEditEntity.setHotsIds(null);
  1137. // sceneProEditEntity.setSceneKey(null);
  1138. // sceneProEditEntity.setNeedKey(0);
  1139. // sceneProEditEntity.setScreencapVoiceSrc(null);
  1140. // sceneProEditEntity.setScreencapVoiceSound(null);
  1141. // sceneProEditEntity.setScreencapVoiceSoundsync(null);
  1142. // sceneProEditEntity.setScreencapVoiceType(null);
  1143. // sceneProEditEntity.setScreencapThumb(null);
  1144. // sceneProEditEntity.setOverlay(null);
  1145. // sceneProEditEntity.setFloorPlanAngle("0");
  1146. // sceneProEditEntity.setVideosUser(null);
  1147. // sceneProEditService.save(sceneProEditEntity);
  1148. //
  1149. // FileUtils.copyFile(ConstantFilePath.SCENE_PATH+"data/data"+oldNum+File.separator+"scene.json", ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", true);
  1150. //
  1151. // JSONObject scenejson = JSON.parseObject(FileUtils.readFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json"));
  1152. // scenejson.put("jumpScene", false);
  1153. // scenejson.put("hots", 0);
  1154. // scenejson.put("screencapVoiceSrc", null);
  1155. // scenejson.put("screencapVoiceSound", null);
  1156. // scenejson.put("screencapVoiceSoundsync", null);
  1157. // scenejson.put("screencapVoiceType", null);
  1158. // scenejson.put("screencapThumb", null);
  1159. // scenejson.put("overlay", null);
  1160. // scenejson.put("sceneScheme", 12);
  1161. // scenejson.put("sceneSource", 11);
  1162. // scenejson.put("videos", null);
  1163. // scenejson.put("videosUser",null);
  1164. // FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", scenejson.toString());
  1165. //
  1166. // FileUtils.downLoadFromUrl(prefixAli + "data/data" + oldNum + File.separator+"floor.json?t=" + System.currentTimeMillis(),
  1167. // "floor.json", ConstantFilePath.SCENE_PATH+"data/data" + projectNum);
  1168. // FileUtils.downLoadFromUrl(prefixAli + "images/images" + oldNum + File.separator+"floorplan.png?t=" + System.currentTimeMillis(),
  1169. // "floorplan.png", ConstantFilePath.SCENE_PATH+"images/images" + projectNum);
  1170. //// FileUtils.copyFile(ConstantFilePath.SCENE_PATH+"data/data" + oldNum + File.separator+"floor.json",
  1171. //// ConstantFilePath.SCENE_PATH+"data/data" + projectNum + File.separator+"floor.json", true);
  1172. //
  1173. //
  1174. // uploadToOssUtil.upload(floorPlan, "images/images" + projectNum + File.separator + "floorplan.png");
  1175. // uploadToOssUtil.upload(floorJson, "data/data" + projectNum + File.separator + "floor.json");
  1176. // return Result.success();
  1177. // }
  1178. //
  1179. // @ApiOperation("获取当前mq的队列数")
  1180. // @GetMapping("/getMqNum")
  1181. // public ResultData getMqNum(){
  1182. // return Result.success(producer.getMessageCount());
  1183. // }
  1184. //
  1185. //
  1186. // @ApiOperation("根据模块名称,查询模块视频地址")
  1187. // @PostMapping("/findSceneModuleVideo")
  1188. // @ApiImplicitParams({
  1189. // @ApiImplicitParam(name = "moduleName", value = "模块名称", dataType = "String")})
  1190. // public ResultData findSceneModuleVideo(HttpServletRequest request){
  1191. // String moduleName = request.getParameter("moduleName");
  1192. // Condition condition = new Condition(SceneModuleVideoEntity.class);
  1193. // condition.and().andEqualTo("moduleName", moduleName);
  1194. // return Result.success(sceneModuleVideoService.findAll(condition));
  1195. // }
  1196. //
  1197. // /**
  1198. // * 新增或修改场景模块视频地址
  1199. // */
  1200. // @ApiOperation("新增或修改场景模块视频地址")
  1201. // @PostMapping(value = "/saveSceneModuleVideo")
  1202. // @ApiImplicitParams({
  1203. // @ApiImplicitParam(name = "id", value = "有则修改,无则新增", dataType = "String"),
  1204. // @ApiImplicitParam(name = "sceneNum", value = "场景编码", dataType = "String"),
  1205. // @ApiImplicitParam(name = "moduleName", value = "模块名称", dataType = "String"),
  1206. // @ApiImplicitParam(name = "videoUrl", value = "视频地址", dataType = "String"),
  1207. // @ApiImplicitParam(name = "images", value = "缩略图", dataType = "String")})
  1208. // private Result saveSceneModuleVideo(HttpServletRequest request) throws Exception{
  1209. // String id = request.getParameter("id");
  1210. // String sceneNum = request.getParameter("sceneNum");
  1211. // String moduleName = request.getParameter("moduleName");
  1212. // String videoUrl = request.getParameter("videoUrl");
  1213. // String images = request.getParameter("images");
  1214. //
  1215. // if(StringUtils.isEmpty(sceneNum) || StringUtils.isEmpty(moduleName) || StringUtils.isEmpty(videoUrl)){
  1216. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1217. // }
  1218. //
  1219. // SceneModuleVideoEntity entity = new SceneModuleVideoEntity();
  1220. // entity.setSceneNum(sceneNum);
  1221. // entity.setImages(images);
  1222. // entity.setModuleName(moduleName);
  1223. // entity.setVideoUrl(videoUrl);
  1224. //
  1225. // if(StringUtils.isEmpty(id)){
  1226. // sceneModuleVideoService.save(entity);
  1227. // }else {
  1228. // entity.setId(Long.valueOf(id));
  1229. // sceneModuleVideoService.update(entity);
  1230. // }
  1231. //
  1232. // return Result.success();
  1233. //
  1234. // }
  1235. //
  1236. // /**
  1237. // * 删除场景模块视频地址
  1238. // */
  1239. // @ApiOperation("删除场景模块视频地址")
  1240. // @PostMapping(value = "/deleteSceneModuleVideo")
  1241. // @ApiImplicitParams({
  1242. // @ApiImplicitParam(name = "id", value = "id", dataType = "String")})
  1243. // private Result deleteSceneModuleVideo(HttpServletRequest request) throws Exception{
  1244. // String id = request.getParameter("id");
  1245. //
  1246. // if(org.springframework.util.StringUtils.isEmpty(id)){
  1247. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1248. // }
  1249. //
  1250. // sceneModuleVideoService.deleteById(Long.valueOf(id));
  1251. // return Result.success();
  1252. // }
  1253. //
  1254. // /**
  1255. // * 下载思为的html页面
  1256. // */
  1257. // @ApiOperation("下载思为的html页面")
  1258. // @PostMapping(value = "/downloadSiWeiHtml")
  1259. // @ApiImplicitParams({
  1260. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")})
  1261. // public ResultData downloadSiWeiHtml(HttpServletRequest request) throws Exception{
  1262. // String token = getToken();
  1263. // if(StringUtils.isEmpty(token)){
  1264. // throw new BaseRuntimeException(3004, "无token参数");
  1265. // }
  1266. //
  1267. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  1268. // if(ssoUser == null){
  1269. // throw new BaseRuntimeException(3004, "token参数不正确");
  1270. // }
  1271. //
  1272. // String sceneNum = request.getParameter("sceneNum");
  1273. //
  1274. // if(StringUtils.isEmpty(sceneNum)){
  1275. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1276. // }
  1277. //
  1278. // //获取getInfo的数据
  1279. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  1280. // if(sceneProEntity == null){
  1281. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1282. // }
  1283. // if(sceneProEntity.getPayStatus() != 1){
  1284. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1285. // }
  1286. // if(sceneProEntity.getStatus() != 1 && sceneProEntity.getStatus() != -2){
  1287. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1288. // }
  1289. //
  1290. // if(ssoUser == null || ssoUser.getId().longValue() != sceneProEntity.getUserId().longValue()){
  1291. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);
  1292. // }
  1293. //
  1294. // if(isDownload.get()){
  1295. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5024, SceneConstant.FAILURE_MSG_5024);
  1296. // }
  1297. //
  1298. // isDownload.compareAndSet(false, true);
  1299. //
  1300. // try{
  1301. // ResponseScene responseScene = new ResponseScene();
  1302. // SceneProEditEntity editEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1303. //
  1304. // CreateObjUtil.callshell("bash /opt/ossutil/copy.sh " + ConstantFilePath.BASE_PATH +
  1305. // "/local/localHose" + " " + ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum);
  1306. //
  1307. // //14表示matterPro场景,需要调用命令获取切图,并且修改sceneScheme为13
  1308. // if(sceneProEntity.getSceneSource() == 14){
  1309. // sceneProEntity.setSceneScheme(13);
  1310. // CreateObjUtil.matterproCutImg(sceneProEntity.getNum(), ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum);
  1311. // }
  1312. //
  1313. // BeanUtils.copyProperties(editEntity, responseScene);
  1314. // BeanUtils.copyProperties(sceneProEntity, responseScene);
  1315. // if(StringUtil.isNotEmpty(editEntity.getEntry())){
  1316. // responseScene.setEntry(JSONObject.parseObject(editEntity.getEntry()).toJSONString());
  1317. // }
  1318. //
  1319. // if(StringUtil.isNotEmpty(sceneProEntity.getGps())){
  1320. // responseScene.setGps(JSONObject.parseObject(sceneProEntity.getGps()).toJSONString());
  1321. // }
  1322. //
  1323. // responseScene.setCreateTime(new DateTime(sceneProEntity.getCreateTime()).toString("yyyy-MM-dd"));
  1324. // responseScene.setCreateDate(sceneProEntity.getCreateTime().getTime());
  1325. // if(StringUtil.isEmpty(editEntity.getSceneKey())){
  1326. // responseScene.setIsPublic(0);
  1327. // }else {
  1328. // responseScene.setIsPublic(1);
  1329. // }
  1330. //
  1331. // //不返回场景访问密码
  1332. // responseScene.setSceneKey("");
  1333. //
  1334. // //替换index.html里面的场景码
  1335. // String indexPath = ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + File.separator + "embed.html";
  1336. // String index = FileUtils.readFile(indexPath);
  1337. // FileUtils.deleteFile(indexPath);
  1338. // FileUtils.writeFile(indexPath, index.replace("__ProjectNum__", sceneNum));
  1339. //
  1340. // //下载oss资源
  1341. // CreateObjUtil.ossUtilCp("data/data" + sceneNum, ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + "/data");
  1342. // CreateObjUtil.ossUtilCp("images/images" + sceneNum, ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + "/images");
  1343. // CreateObjUtil.ossUtilCp("video/video" + sceneNum, ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + "/video");
  1344. // CreateObjUtil.ossUtilCp("voice/voice" + sceneNum, ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + "/voice");
  1345. //
  1346. // FileUtils.writeFile(ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + "/data/data" + sceneNum + "/getInfo.json",
  1347. // JSONObject.toJSONString(responseScene));
  1348. //
  1349. // CreateObjUtil.callshell("bash /opt/ossutil/gzip.sh " + ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum +
  1350. // " " + ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum);
  1351. //
  1352. // FileUtils.deleteDirectory(ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum);
  1353. //// FileUtils.deleteFile(ConstantFilePath.BASE_PATH + "/local/localHose" + sceneNum + ".zip");
  1354. //
  1355. // isDownload.compareAndSet(true, false);
  1356. // return Result.success((Object)"local/localHose" + sceneNum + ".zip");
  1357. // }catch (Exception e){
  1358. // e.printStackTrace();
  1359. // isDownload.compareAndSet(true, false);
  1360. // return Result.failure(LoginConstant.ERROR_MSG);
  1361. // }finally {
  1362. // isDownload.compareAndSet(true, false);
  1363. // }
  1364. //
  1365. // }
  1366. //
  1367. // /**
  1368. // * 思为获取场景列表
  1369. // */
  1370. // @ApiOperation("思为获取场景列表")
  1371. // @PostMapping(value = "/siweiSceneList")
  1372. // @ApiImplicitParams({
  1373. // @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
  1374. // @ApiImplicitParam(name = "pageSize", value = "页数", dataType = "String"),
  1375. // @ApiImplicitParam(name = "snCode", value = "相机sn", dataType = "String"),
  1376. // @ApiImplicitParam(name = "sceneName", value = "场景名称", dataType = "String"),
  1377. // @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "String"),
  1378. // @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "String")})
  1379. // public Result<Page<ResponseScene>> siweiSceneList(HttpServletRequest request) throws Exception{
  1380. // String token = getToken();
  1381. // if(StringUtils.isEmpty(token)){
  1382. // throw new BaseRuntimeException(3004, "无token参数");
  1383. // }
  1384. //
  1385. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  1386. // if(ssoUser == null){
  1387. // throw new BaseRuntimeException(3004, "token参数不正确");
  1388. // }
  1389. //
  1390. // String pageNumStr = request.getParameter("pageNum");
  1391. // String pageSizeStr = request.getParameter("pageSize");
  1392. //
  1393. // String sceneName = request.getParameter("sceneName");
  1394. // String snCode = request.getParameter("snCode");
  1395. // String startDate = request.getParameter("startDate");
  1396. // String endDate = request.getParameter("endDate");
  1397. // String num = request.getParameter("num");
  1398. //
  1399. // String cameraId = null;
  1400. //
  1401. // if(StringUtils.isNotEmpty(snCode)){
  1402. // CameraEntity cameraEntity = goodsService.findBySnCode(snCode);
  1403. // if(cameraEntity == null){
  1404. // throw new BaseRuntimeException(CameraConstant.FAILURE_CODE_6003, CameraConstant.FAILURE_MSG_6003);
  1405. // }
  1406. //
  1407. // cameraId = String.valueOf(cameraEntity.getId());
  1408. // }
  1409. //
  1410. // Integer pageNum = 1;
  1411. // Integer pageSize = 10;
  1412. // if(StringUtils.isNotEmpty(pageNumStr)){
  1413. // pageNum = Integer.valueOf(pageNumStr);
  1414. // }
  1415. //
  1416. // if(StringUtils.isNotEmpty(pageSizeStr)){
  1417. // pageSize = Integer.valueOf(pageSizeStr);
  1418. // }
  1419. //
  1420. //// List<Integer> counts = sceneService.findAllSceneCount("create_time desc", null,
  1421. //// null, ssoUser.getId(), sceneName, cameraId, startDate, endDate, num);
  1422. //
  1423. // PageHelper.startPage(pageNum, pageSize);
  1424. // List<SceneProEntity> sceneEntityList = sceneService.findAllScene("create_time desc", null,
  1425. // null, pageNum, pageSize, ssoUser.getId(), sceneName, cameraId, startDate, endDate, num, null, null, null);
  1426. //
  1427. // PageInfo<SceneProEntity> data = new PageInfo<>(sceneEntityList);
  1428. //
  1429. // List<Map<String, Object>> list = new ArrayList<>();
  1430. // Map<String, Object> map = null;
  1431. // SceneProEditEntity sceneProEditEntity = null;
  1432. // CameraEntity cameraEntity = null;
  1433. // for (SceneProEntity sceneProEntity : data.getList()) {
  1434. // map = new HashMap<>();
  1435. // map.put("num", sceneProEntity.getNum());
  1436. // map.put("sceneName", sceneProEntity.getSceneName());
  1437. //
  1438. // cameraEntity = goodsService.findCameraById(sceneProEntity.getCameraId());
  1439. // if(cameraEntity != null){
  1440. // map.put("snCode", cameraEntity.getSnCode());
  1441. // }
  1442. //
  1443. // map.put("webSite", sceneProEntity.getWebSite());
  1444. // map.put("createDate", sceneProEntity.getCreateTime().getTime());
  1445. // map.put("createTime", new DateTime(sceneProEntity.getCreateTime()).toString(DateUtil.DEFAULT_DATE_FORMAT));
  1446. // map.put("thumb", sceneProEntity.getThumb());
  1447. // map.put("shootCount", sceneProEntity.getShootCount());
  1448. //
  1449. // sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1450. // map.put("version", sceneProEditEntity.getVersion());
  1451. // list.add(map);
  1452. // }
  1453. //
  1454. //// int count = 0;
  1455. //// for(Integer number : counts){
  1456. //// count += number;
  1457. //// }
  1458. ////
  1459. // Page<Map<String, Object>> a = new Page<Map<String, Object>>(pageNum, pageSize);
  1460. // a.setTotal(data.getTotal());
  1461. // PageInfo<Map<String, Object>> result = a.toPageInfo();
  1462. // result.setList(list);
  1463. //// PageInfo<Map<String, Object>> result = new PageInfo<>(list);
  1464. // return Result.success(result);
  1465. // }
  1466. //
  1467. // /**
  1468. // * 将floor.json转换成酷家乐数据
  1469. // */
  1470. // @ApiOperation("将floor.json转换成酷家乐数据")
  1471. // @PostMapping(value = "/convertCadKjl")
  1472. // @ApiImplicitParams({
  1473. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")})
  1474. // public String convertCadKjl(HttpServletRequest request) throws Exception{
  1475. // String sceneNum = request.getParameter("sceneNum");
  1476. //
  1477. // if(StringUtils.isEmpty(sceneNum)){
  1478. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1479. // }
  1480. //
  1481. // StringBuffer dataBuf = new StringBuffer()
  1482. // .append("data").append(File.separator)
  1483. // .append("data").append(sceneNum)
  1484. // .append(File.separator);
  1485. //
  1486. // StringBuffer dataBuffer = new StringBuffer(ConstantFilePath.SCENE_PATH).append(dataBuf.toString());
  1487. //
  1488. // String floorPath = dataBuffer.toString() + "floor.json";
  1489. // CreateObjUtil.ossUtilCp(dataBuf.toString() + "floor.json", dataBuffer.toString());
  1490. //
  1491. // ConvertCadKjl cad = new ConvertCadKjl();
  1492. // cad.init("指房宝", "指房宝装修房", "", "2", floorPath);
  1493. // cad.input = cad.preHandle(cad.input);
  1494. // JSONArray beams = cad.getBeams();
  1495. // JSONArray walls = cad.getWalls();
  1496. // walls = ConvertCadKjl.removeRepeat(walls);
  1497. // JSONArray rooms = cad.getRooms();
  1498. // JSONArray flues = cad.getFlues();
  1499. // JSONArray holes = cad.getHoles();
  1500. //
  1501. // cad.output.put("holes", holes);
  1502. // cad.output.put("flues", flues);
  1503. // cad.output.put("beams", beams);
  1504. // cad.output.put("rooms", rooms);
  1505. // cad.output.put("walls", walls);
  1506. // cad.output.put("needTranslate", false);
  1507. //
  1508. // return cad.output.toJSONString();
  1509. // }
  1510. //
  1511. //
  1512. // /**
  1513. // * 创建sketch场景分享二维码的logo
  1514. // */
  1515. // @ApiOperation("创建sketch场景分享二维码的logo")
  1516. // @PostMapping(value = "/createSketchQrLogo")
  1517. // @ApiImplicitParams({
  1518. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")})
  1519. // public ResultData createSketchQrLogo(HttpServletRequest request) throws Exception{
  1520. // String sceneNum = request.getParameter("sceneNum");
  1521. //
  1522. // if(StringUtils.isEmpty(sceneNum)){
  1523. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1524. // }
  1525. //
  1526. // //生成二维码
  1527. // MatrixToImageWriterUtil.createQRCode(mainUrl + sceneProNewUrl + sceneNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+".png", null);
  1528. // MatrixToImageWriterUtil.createQRCode(mainUrl + sceneProNewUrl + sceneNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+"_en.png", null);
  1529. // return Result.success();
  1530. // }
  1531. //
  1532. // /**
  1533. // * 恢复scene.json中文乱码问题
  1534. // */
  1535. // @ApiOperation("恢复scene.json中文乱码问题")
  1536. // @PostMapping(value = "/updateSceneJsonCode")
  1537. // @ApiImplicitParams({
  1538. // @ApiImplicitParam(name = "createTime", value = "该时间点之后的场景", dataType = "String")})
  1539. // public ResultData updateSceneJsonCode(HttpServletRequest request) throws Exception{
  1540. // String createTime = request.getParameter("createTime");
  1541. //
  1542. // Condition condition = new Condition(SceneProEntity.class);
  1543. // condition.and().andGreaterThanOrEqualTo("createTime", createTime);
  1544. // List<SceneProEntity> list = sceneProService.findAll(condition);
  1545. // Map<String, Object> map = new HashMap<>();
  1546. // for (SceneProEntity sceneProEntity : list) {
  1547. // map = new HashMap<>();
  1548. // map.put("sceneName", sceneProEntity.getSceneName());
  1549. // map.put("sceneDec", sceneProEntity.getSceneDec());
  1550. // FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneProEntity.getNum() + "/scene.json", map);
  1551. // }
  1552. // return Result.success("修改了:" + list.size());
  1553. // }
  1554. //
  1555. /**
  1556. * 获取数据对接下载信息
  1557. */
  1558. @PostMapping(value = "/downLoadZSData")
  1559. public ResultData downLoadZSData(@Validated BaseSceneParamVO param) throws Exception{
  1560. return sceneService.downLoadZSData(param);
  1561. }
  1562. //
  1563. // /**
  1564. // * 增加场景下载次数
  1565. // */
  1566. // @ApiOperation("增加场景下载次数")
  1567. // @PostMapping(value = "/addDownloadNum")
  1568. // @ApiImplicitParams({
  1569. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")})
  1570. // public ResultData addDownloadNum(HttpServletRequest request) throws Exception{
  1571. // String sceneNum = request.getParameter("sceneNum");
  1572. // if(StringUtil.isEmpty(sceneNum)){
  1573. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1574. // }
  1575. //
  1576. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  1577. // if(sceneProEntity == null){
  1578. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1579. // }
  1580. //
  1581. // SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1582. // if(sceneProEditEntity.getDownloadNum() == null){
  1583. // sceneProEditEntity.setDownloadNum(1);
  1584. // }else{
  1585. // sceneProEditEntity.setDownloadNum(sceneProEditEntity.getDownloadNum() + 1);
  1586. // }
  1587. //
  1588. // sceneProEditService.update(sceneProEditEntity);
  1589. //
  1590. // //操作记录log
  1591. //// TmIncrementLogEntity tmIncrementLogEntity = new TmIncrementLogEntity();
  1592. //// tmIncrementLogEntity.setSceneNum(sceneProEntity.getNum());
  1593. //// tmIncrementLogEntity.setType("1");
  1594. //// iIncrementDownloadLogService.save(tmIncrementLogEntity);
  1595. //
  1596. // return Result.success();
  1597. // }
  1598. //
  1599. // /**
  1600. // * 查询总下载次数
  1601. // */
  1602. // @ApiOperation("查询总下载次数")
  1603. // @PostMapping(value = "/findDownloadNum")
  1604. // public ResultData findDownloadNum(HttpServletRequest request) throws Exception{
  1605. //
  1606. // return Result.success(sceneProEditService.findDownloadNum());
  1607. // }
  1608. //
  1609. // /**
  1610. // * 增加imagesVersion
  1611. // */
  1612. // @ApiOperation("查询总下载次数")
  1613. // @PostMapping(value = "/addImagesVersion")
  1614. // public ResultData addImagesVersion(HttpServletRequest request) throws Exception{
  1615. // String num = request.getParameter("num");
  1616. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
  1617. // if(sceneProEntity == null){
  1618. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1619. // }
  1620. //
  1621. // SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
  1622. // sceneProEditEntity.setImagesVersion(sceneProEditEntity.getImagesVersion() + 1);
  1623. // sceneProEditService.update(sceneProEditEntity);
  1624. //
  1625. // JSONObject scenejson = JSON.parseObject(FileUtils.readFile(ConstantFilePath.SCENE_PATH+"data/data"+num+File.separator+"scene.json"));
  1626. // scenejson.put("imagesVersion", sceneProEditEntity.getImagesVersion());
  1627. // FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+num+File.separator+"scene.json", scenejson.toJSONString());
  1628. //
  1629. // return Result.success();
  1630. // }
  1631. //
  1632. // /**
  1633. // * 删除4k图
  1634. // */
  1635. // @ApiOperation("删除4k图")
  1636. // @PostMapping(value = "/remove4KImg")
  1637. // public ResultData remove4KImg() throws Exception{
  1638. //
  1639. // List<SceneProEntity> list = sceneProService.findAll();
  1640. // CameraDetailEntity cameraDetailEntity = new CameraDetailEntity();
  1641. // String path = "";
  1642. //
  1643. // for(SceneProEntity sceneProEntity : list){
  1644. // if(sceneProEntity.getPayStatus() != 1 || sceneProEntity.getId() < 10685){
  1645. // continue;
  1646. // }
  1647. // path = sceneProEntity.getDataSource();
  1648. // log.info("场景:" + sceneProEntity.getNum());
  1649. //
  1650. // String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
  1651. // JSONObject uploadJson = null;
  1652. // JSONArray array = null;
  1653. // if(uploadData!=null) {
  1654. // uploadJson = JSONObject.parseObject(uploadData);
  1655. // array = uploadJson.getJSONArray("upload");
  1656. // }
  1657. // if(array == null){
  1658. // log.info("场景计算失败:" + sceneProEntity.getNum());
  1659. // continue;
  1660. // }
  1661. // JSONObject fileJson = null;
  1662. // String fileName = "";
  1663. // Map<String, String> map = new HashMap<>();
  1664. // for(int i = 0, len = array.size(); i < len; i++){
  1665. // fileJson = array.getJSONObject(i);
  1666. // fileName = fileJson.getString("file");
  1667. // //文件不存在抛出异常
  1668. // if(!new File(path + File.separator + "results" +File.separator + fileName).exists()){
  1669. // throw new Exception(path + File.separator + "results" +File.separator + fileName+"文件不存在");
  1670. // }
  1671. //
  1672. //
  1673. // //tiles文件夹,亚马逊瓦片图
  1674. // if(fileJson.getIntValue("clazz") == 7 ){
  1675. // if(fileName.contains("/4k_")){
  1676. // map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
  1677. // sceneProEntity.getNum()+ File.separator + fileName);
  1678. // }
  1679. // }
  1680. //
  1681. // }
  1682. //
  1683. // Long space = 0L;
  1684. // File spaceFile = null;
  1685. // for (String key : map.keySet()) {
  1686. // spaceFile = new File(key);
  1687. // if(spaceFile.exists()){
  1688. // space += spaceFile.length();
  1689. // }
  1690. // }
  1691. // if(space > 0){
  1692. // if(sceneProEntity.getSpace().subtract(new BigInteger(space.toString())).compareTo(new BigInteger("0")) < 0){
  1693. // log.info("场景:" + sceneProEntity.getNum() + ",减少:" + space + "B的容量小于0不处理");
  1694. // continue;
  1695. // }
  1696. // log.info("场景:" + sceneProEntity.getNum() + ",减少:" + space + "B的容量");
  1697. // sceneProEntity.setSpace(sceneProEntity.getSpace().subtract(new BigInteger(space.toString())) );
  1698. // sceneProService.update(sceneProEntity);
  1699. //
  1700. // cameraDetailEntity = cameraDetailService.findByCameraId(sceneProEntity.getCameraId());
  1701. // cameraDetailEntity.setUsedSpace(sceneProService.findTotalSpaceByCameraId(sceneProEntity.getCameraId()));
  1702. // cameraDetailService.update(cameraDetailEntity);
  1703. // }
  1704. // }
  1705. //
  1706. //
  1707. // return Result.success();
  1708. // }
  1709. //
  1710. // /**
  1711. // *
  1712. // * 获取场景描述等信息
  1713. // */
  1714. // @ApiOperation("获取场景描述等信息")
  1715. // @PostMapping(value = "/getSceneDetail")
  1716. // @CheckCurrentUser(description = "获取场景描述等信息")
  1717. // @ApiImplicitParams({
  1718. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")})
  1719. // public ResultData getSceneDetail(String sceneNum) throws Exception{
  1720. // String token = getToken();
  1721. // if(StringUtils.isEmpty(token)){
  1722. // throw new BaseRuntimeException(3004, "无token参数");
  1723. // }
  1724. //
  1725. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  1726. // if(ssoUser == null){
  1727. // throw new BaseRuntimeException(3004, "token参数不正确");
  1728. // }
  1729. //
  1730. // if(StringUtil.isEmpty(sceneNum)){
  1731. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1732. // }
  1733. //
  1734. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  1735. // if(sceneProEntity == null){
  1736. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1737. // }
  1738. // String snCode = null;
  1739. // if(!ObjectUtils.isEmpty(sceneProEntity.getCameraId())){
  1740. // CameraEntity cameraEntity = cameraService.findById(sceneProEntity.getCameraId());
  1741. // if(ObjectUtils.isEmpty(cameraEntity)){
  1742. // throw new BaseRuntimeException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
  1743. // }
  1744. // snCode = cameraEntity.getSnCode();
  1745. // }
  1746. // Map<String, Object> map = new HashMap<>();
  1747. // map.put("webSite", sceneProEntity.getWebSite());
  1748. // map.put("thumb", sceneProEntity.getThumb());
  1749. // map.put("num", sceneProEntity.getNum());
  1750. // map.put("sceneName", sceneProEntity.getSceneName());
  1751. // map.put("sceneDec", sceneProEntity.getSceneDec());
  1752. // map.put("snCode", snCode);
  1753. // map.put("createDate", sceneProEntity.getCreateTime().getTime());
  1754. // map.put("createTime", DateUtil.date2String(sceneProEntity.getCreateTime(), DateUtil.YYYY_MM_DD_DATE_FORMAT));
  1755. //
  1756. // return Result.success(map);
  1757. // }
  1758. //
  1759. //
  1760. // /**
  1761. // *
  1762. // * 随心装场景码同步
  1763. // */
  1764. // @ApiOperation("随心装场景码同步")
  1765. // @PostMapping(value = "/synsencecode")
  1766. // @CheckCurrentUser(description = "随心装场景码同步")
  1767. // @ApiImplicitParams({
  1768. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String"),
  1769. // @ApiImplicitParam(name = "vrsceneNum", value = "随心装场景码", dataType = "String")})
  1770. // public ResultData synsencecode(String sceneNum,String vrsceneNum) throws Exception{
  1771. // String token = getToken();
  1772. // if(StringUtils.isEmpty(token)){
  1773. // throw new BaseRuntimeException(3004, "无token参数");
  1774. // }
  1775. //
  1776. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  1777. // if(ssoUser == null){
  1778. // throw new BaseRuntimeException(3004, "token参数不正确");
  1779. // }
  1780. //
  1781. // if(StringUtil.isEmpty(sceneNum)){
  1782. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1783. // }
  1784. //
  1785. // if(StringUtil.isEmpty(vrsceneNum)){
  1786. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1787. // }
  1788. //
  1789. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  1790. //
  1791. //
  1792. // if(sceneProEntity == null){
  1793. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1794. // }
  1795. //
  1796. // //dsx 这里使用com.fdkankan.scene.service.impl.SceneProEditExtServiceImpl#findEdit
  1797. // SceneProEditEntity editEntity = sceneProService.findEdit(sceneProEntity);
  1798. //
  1799. // if(editEntity == null){
  1800. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1801. // }
  1802. // editEntity.setVrNum(vrsceneNum);
  1803. // sceneProService.updateEdit(editEntity);
  1804. //
  1805. // return Result.success();
  1806. // }
  1807. //
  1808. // /**
  1809. // *
  1810. // * 三维家 拉取场景数据,压缩zip包
  1811. // */
  1812. // @ApiOperation("三维家 拉取场景数据,压缩zip包")
  1813. // @PostMapping(value = "/scenecpzip")
  1814. // @CheckCurrentUser(description = "随心装场景码同步")
  1815. // @ApiImplicitParams({
  1816. // @ApiImplicitParam(name = "sceneNum", value = "场景码", dataType = "String")
  1817. // })
  1818. // public ResultData scenecpzip(String sceneNum) throws Exception{
  1819. // String token = getToken();
  1820. // if(StringUtils.isEmpty(token)){
  1821. // throw new BaseRuntimeException(3004, "无token参数");
  1822. // }
  1823. //
  1824. // SSOUser ssoUser = SSOLoginHelper.loginCheck(token);
  1825. // if(ssoUser == null){
  1826. // throw new BaseRuntimeException(3004, "token参数不正确");
  1827. // }
  1828. //
  1829. // if(StringUtil.isEmpty(sceneNum)){
  1830. // throw new BaseRuntimeException(LoginConstant.PARAM_REQUIRED, LoginConstant.FAILURE_MSG_3001);
  1831. // }
  1832. //
  1833. //
  1834. // SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
  1835. //
  1836. //
  1837. // if(sceneProEntity == null){
  1838. // throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  1839. // }
  1840. //
  1841. //
  1842. // return Result.success();
  1843. // }
  1844. }