houweiyu 4 tahun lalu
induk
melakukan
f82d8d9b6c

+ 3 - 0
src/main/java/fcb/project/manager/base/entity/TmHouse.java

@@ -148,4 +148,7 @@ public class TmHouse implements Serializable {
     @ApiModelProperty(value = "当前房源的审核记录条数-仅仅用于返回给前端用")
     private Long countNum;
 
+    @ApiModelProperty(value = "分享二维码url")
+    private String qrCode;
+
 }

+ 5 - 4
src/main/java/fcb/project/manager/core/controller/AuditController.java

@@ -99,9 +99,7 @@ public class AuditController extends BaseController{
         if(null == tmAudit){
             return Result.failure("审核记录不存在");
         }
-        if(null != tmAudit.getAuditStatus() && tmAudit.getAuditStatus().equals(auditStatus)){
-            return Result.failure("已经处理过了,无需重复处理");
-        }
+
         if(StringUtils.isBlank(tmAudit.getVrId())){
             return Result.failure("该审核记录未绑定房源,无需处理");
         }
@@ -119,6 +117,10 @@ public class AuditController extends BaseController{
             log.info("更新审核状态环节,审核记录[{}]抢锁失败" , id);
             return Result.failure("抢锁失败");
         }
+        if(HouseStatus.AUDITED.getCode().compareTo(dbHouse.getStatus()) == 0 &&
+                AuditStatus.AUDITED.getCode().compareTo(tmAudit.getAuditStatus()) == 0){
+            return Result.failure("已经审通批过了,无需重复处理");
+        }
         tmAudit.setAuditStatus(auditStatus);
         tmAudit.setAuditRemark(auditRemark);
         tmAudit.setAuditorId(tokenMap.getId());
@@ -156,7 +158,6 @@ public class AuditController extends BaseController{
         }catch (Exception e){
             log.info("调用四维看看微服务出现异常:{}" , e);
         }
-        dbHouse.setStatus(auditStatus);
         dbHouse.setAuditId(tmAudit.getId());
         dbHouse.setAuditTime(LocalDateTime.now());
         if(null != tokenMap){

+ 30 - 16
src/main/java/fcb/project/manager/core/controller/HouseManagerController.java

@@ -151,21 +151,31 @@ public class HouseManagerController extends BaseController{
         if(StringUtils.isBlank(tmHouse.getSceneNum())){
             return Result.failure("该房源未生成场景码");
         }
-        String totalVrUrl = innerSceneVrHost + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
+        String totalOssQueryPath = "";
+        String totalVrUrl = innerSceneVrHost + sceneVrLink  + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
                 + "&houseId=" + tmHouse.getId();
-        String localPath = imageLocalPath + "logo.png";
-        String outPutImageName = System.currentTimeMillis() + ".jpg";
-        String outPutImageResultPath = imageLocalPath + outPutImageName;
-        try {
-            DataUtils.createQRCode(totalVrUrl ,  outPutImageResultPath , localPath);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.info("生成分享二维码出现异常");
-            return Result.failure("生成分享二维码出现异常");
+
+        if(StringUtils.isBlank(tmHouse.getQrCode())){
+            String localPath = imageLocalPath + "logo.png";
+            String outPutImageName = System.currentTimeMillis() + ".jpg";
+            String outPutImageResultPath = imageLocalPath + outPutImageName;
+            try {
+                DataUtils.createQRCode(totalVrUrl ,  outPutImageResultPath , localPath);
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.info("生成分享二维码出现异常");
+                return Result.failure("生成分享二维码出现异常");
+            }
+            String resultOssPath = ossPath + outPutImageName;
+            alibabaOssHelper.doUploadThenDelete(outPutImageResultPath , resultOssPath);
+            totalOssQueryPath = ossQueryUrl + resultOssPath;
+
+            tmHouse.setQrCode(totalOssQueryPath);
+            tmHouse.setUpdateTime(LocalDateTime.now());
+            tmHouseService.updateHouse(tmHouse);
+        }else{
+            totalOssQueryPath = tmHouse.getQrCode();
         }
-        String resultOssPath = ossPath + outPutImageName;
-        alibabaOssHelper.doUploadThenDelete(outPutImageResultPath , resultOssPath);
-        String totalOssQueryPath = ossQueryUrl + resultOssPath;
 
         Map<String , Object> resultMap = new HashMap<>();
         resultMap.put("QrCode" , totalOssQueryPath);
@@ -201,7 +211,7 @@ public class HouseManagerController extends BaseController{
         String downLoanVideoPath = FileUtils.parseFile(file, imageLocalPath  , newFileName);
         log.info("照片文件已经下载到本地:{}", downLoanVideoPath);
 
-        String totalVrUrl = outerSceneVrHost + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
+        String totalVrUrl = outerSceneVrHost + sceneVrLink + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
                 + "&houseId=" + tmHouse.getId();
         String outPutImageName = System.currentTimeMillis() + ".jpg";
         String outPutImageResultPath = imageLocalPath + outPutImageName;
@@ -216,6 +226,10 @@ public class HouseManagerController extends BaseController{
         alibabaOssHelper.doUploadThenDelete(outPutImageResultPath , resultOssPath);
         String totalOssQueryPath = ossQueryUrl + resultOssPath;
 
+        tmHouse.setQrCode(totalOssQueryPath);
+        tmHouse.setUpdateTime(LocalDateTime.now());
+        tmHouseService.updateHouse(tmHouse);
+
         Map<String , Object> resultMap = new HashMap<>();
         resultMap.put("QrCode" , totalOssQueryPath);
         resultMap.put("vrLink" , totalVrUrl);
@@ -358,9 +372,9 @@ public class HouseManagerController extends BaseController{
             if(StringUtils.isBlank(tmHouse.getFcbHouseId())){
                 return Result.failure("更新场景码必须上送房车宝的房源ID");
             }
-            String innerHostVrLink = innerSceneVrHost + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
+            String innerHostVrLink = innerSceneVrHost + sceneVrLink + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
                     + "&houseId=" + tmHouse.getId();
-            String outerHostVrLink = outerSceneVrHost + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
+            String outerHostVrLink = outerSceneVrHost + sceneVrLink + tmHouse.getSceneNum() + "&prodId=" + tmHouse.getFcbHouseId()
                     + "&houseId=" + tmHouse.getId();
             tmHouse.setVrLink(outerHostVrLink);
             tmHouse.setInnerVrLink(innerHostVrLink);

+ 2 - 2
src/main/resources/application.properties

@@ -1,8 +1,8 @@
 
 
-spring.profiles.active=prod
+#spring.profiles.active=prod
 #spring.profiles.active=dev
-#spring.profiles.active=test
+spring.profiles.active=test
 
 #应用名
 spring.application.name=fbc-project-manager