Просмотр исходного кода

更新:
保存模型时,停供错误码

wuweihao 4 лет назад
Родитель
Сommit
460f8d7389

+ 37 - 0
cms_pano_fcb/gis_common/src/main/java/com/gis/common/constant/MsgCode.java

@@ -0,0 +1,37 @@
+package com.gis.common.constant;
+
+/**
+ * Created by owen on 2021/3/19 0019 10:13
+ *
+ * 错误码
+ */
+public class MsgCode {
+
+    public final static Integer e3001 = 3001;
+    public final static String m3001 = "场景已使用";
+
+    /** 户型重复 */
+    public final static Integer e3002 = 3002;
+//
+//    public final static Integer e3002 = 3002;
+//    public final static String m3002 = "请至少保留一个场景";
+//
+//    /** 文件过大 */
+//    public final static Integer e3004 = 3004;
+//
+//    /** 不是该用户作品 */
+//    public final static Integer e3005 = 3005;
+//
+//    /** 作品已被删除,无法编辑 */
+//    public final static Integer e3006 = 3006;
+//
+//    /** 素材已使用 */
+//    public final static Integer e3007 = 3007;
+//
+//
+//    public final static Integer e5003 = 5003;
+//    public final static String m5003 = "不支持此图片";
+//
+//    public final static Integer e5004 = 5004;
+//    public final static String m5004 = "密码错误";
+}

+ 11 - 7
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.gis.common.constant.CmdConstant;
 import com.gis.common.constant.ConfigConstant;
+import com.gis.common.constant.MsgCode;
 import com.gis.common.constant.RabbitConfig;
 import com.gis.common.exception.BaseRuntimeException;
 import com.gis.common.task.AsyncTask;
@@ -689,21 +690,24 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         @NotBlank(message = "恒大id不能为空") String hengdaId = param.getHengdaId();
         String webSite = "/hengda.html?m="+ sceneCode + "&prodId=" + hengdaId + "&houseId=" + houseId;
 
+
+
         if ( id == null) {
-             entity = entityMapper.findByVrModelIdAndHouseId(param.getVrModelId(), houseId);
-            if (entity != null){
-                log.error("VrModelId已存在");
-                return Result.failure(3001, "场景码已存在, 不能重复添加");
-            }
 
             // 一个VR项目不能有相同的户型
             List<SceneEntity> sceneEntities = entityMapper.findByHouseIdAndRoomId(houseId, roomId);
             if (sceneEntities.size() > 0) {
-                return Result.failure("户型已存在,不能重复添加");
+                return Result.failure(MsgCode.e3002,"户型已存在,不能重复添加");
             }
 
-            entity = new SceneEntity();
+            // 一个VR项目不能有相同的模型
+             entity = entityMapper.findByVrModelIdAndHouseId(param.getVrModelId(), houseId);
+            if (entity != null){
+                log.error("VrModelId已存在");
+                return Result.failure(MsgCode.e3001, "场景码已存在, 不能重复添加");
+            }
 
+            entity = new SceneEntity();
 
             BeanUtils.copyProperties(param, entity);