Selaa lähdekoodia

驼峰转下划线

lyhzzz 3 vuotta sitten
vanhempi
commit
412190a85b

+ 3 - 3
platform-shop/src/main/java/com/platform/controller/GoodsController.java

@@ -22,6 +22,7 @@ import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.client.RestTemplate;
+import sun.rmi.runtime.Log;
 
 import java.math.BigDecimal;
 import java.util.*;
@@ -72,15 +73,14 @@ public class GoodsController extends AbstractController{
         List<Long> roleIdList = getUser().getRoleIdList();
         if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
             // 获取用户角色
-            Long roleId = getUser().getRoleId();
             HashMap<String, Object> brandQuery = new HashMap<>();
             // 公司管理员能获取改公司下面所有的直播间的数据
-            if (roleId == 6) {
+            if (roleIdList.contains(6L)) {
                 if (null == getDeptId()) {
                     return Result.success(pageUtil);
                 }
                 brandQuery.put("deptIdList", getDeptId());
-            } else if (roleId == 8) {
+            } else if (roleIdList.contains(8L) || roleIdList.contains(2L)) {
                 // 公司员工只能获取当前绑定当前用户直播间的商品数据
                 List<Long> brandIds = mySysUserBrandService.queryBrandIdList(getUserId());
                 if(ObjectUtils.isEmpty(brandIds)){

+ 3 - 0
platform-shop/src/main/resources/com/platform/dao/GoodsDao.xml

@@ -105,6 +105,9 @@
         <if test="name != null and name != ''">
             AND nideshop_goods.name LIKE concat('%',#{name},'%')
         </if>
+        <if test="brandName != null and brandName != ''">
+            AND nideshop_brand.name LIKE concat('%',#{brandName},'%')
+        </if>
         <if test="brandId != null and brandId.trim() != ''">
             AND nideshop_goods.brand_id = #{brandId}
         </if>