Bläddra i källkod

http://192.168.0.21/index.php?m=bug&f=view&bugID=25752

lyhzzz 3 år sedan
förälder
incheckning
b1c6fd34e4

+ 1 - 0
platform-shop/src/main/java/com/platform/controller/SceneController.java

@@ -45,6 +45,7 @@ public class SceneController extends AbstractController{
 
             BrandEntity brand = brandService.queryByScene(sceneNum);
             if (!ObjectUtils.isEmpty(brand)) {
+                zhiHouseService.generateDefaultLiveRoom(sceneNum);
                 return Result.failure("直播间已存在!");
             }
 

+ 22 - 6
platform-common/src/main/java/com/platform/controller/ZfbController.java

@@ -1,22 +1,19 @@
 package com.platform.controller;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.platform.entity.BrandEntity;
 import com.platform.entity.Result;
 import com.platform.entity.SysUserBrand;
+import com.platform.service.BrandService;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.impl.ZhiHouseService;
-import com.platform.vos.TbUser;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.bytedeco.javacpp.presets.opencv_core;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
-import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/zfb")
@@ -26,6 +23,9 @@ public class ZfbController {
     private MySysUserBrandService mySysUserBrandService;
 
     @Autowired
+    private BrandService brandService;
+
+    @Autowired
     private ZhiHouseService zhiHouseService;
 
     @PostMapping("/deleteStaff")
@@ -54,6 +54,22 @@ public class ZfbController {
         }
         return Result.success(resultMap);
     }
+    @PostMapping("/queryBrandBySceneNums")
+    public Result queryBrandBySceneNums(@RequestBody JSONObject param) {
+        Object nums = param.get("nums");
+        List<String> jsonArray = (List<String>) nums;
+
+        HashMap<String,Integer> resultMap = new HashMap<>();
+        for (String sceneNum : jsonArray) {
+            BrandEntity brand = brandService.queryByScene(sceneNum);
+            Integer lived = 0;
+            if(brand != null){
+                lived = 1;
+            }
+            resultMap.put(sceneNum,lived);
+        }
+        return Result.success(resultMap);
+    }