Browse Source

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

lyhzzz 3 năm trước cách đây
mục cha
commit
f43254ca33

+ 7 - 1
platform-shop/src/main/java/com/platform/controller/BrandController.java

@@ -112,6 +112,7 @@ public class BrandController extends AbstractController{
     public Result brandBindList(@RequestParam(name = "page") long page,@RequestHeader String token,
                            @RequestParam(name = "limit") long limit,String order,String sidx,
                            String sceneName,String brandName,Integer type,Integer livestreamStatus) {
+        log.info("开始刷新列表..........."+System.currentTimeMillis());
         Long userId = null;
         //如果不是超级管理员,则只能查询本部门及子部门数据
         List<Long> roleIdList = getUser().getRoleIdList();
@@ -153,7 +154,7 @@ public class BrandController extends AbstractController{
             return brandRspVo;
         }).collect(Collectors.toList());
 
-
+        log.info("结束刷新列表..........."+System.currentTimeMillis());
         return Result.success(PageUtilsPlus.page(rspBrandList,resultPage));
     }
 
@@ -288,6 +289,7 @@ public class BrandController extends AbstractController{
     @RequiresPermissions("brand:delete")
     @Transactional(rollbackFor = Exception.class)
     public Result delete(@RequestBody Integer[] ids,@RequestHeader String token) {
+        log.info("开始删除..........."+System.currentTimeMillis());
         if(ObjectUtils.isEmpty(ids)){
             return Result.success();
         }
@@ -322,6 +324,7 @@ public class BrandController extends AbstractController{
         }
 
         brandService.deleteBatch(ids);
+        log.info("结束删除..........."+System.currentTimeMillis());
         return Result.success();
     }
 
@@ -337,6 +340,9 @@ public class BrandController extends AbstractController{
                 return Result.success(new ArrayList<>());
             }
             params.put("deptIdList", getDeptId());
+            if(roleIds.contains(8L)){
+                params.put("createUserId",getUser().getId());
+            }
         }
 
         List<BrandEntity> list = brandService.queryList(params);

+ 10 - 0
platform-shop/src/main/java/com/platform/entity/SceneEntity.java

@@ -29,6 +29,8 @@ public class SceneEntity extends BaseEntity{
 
     private String token;
 
+    private String companyId;
+
     public String getName() {
         return name;
     }
@@ -76,4 +78,12 @@ public class SceneEntity extends BaseEntity{
     public void setToken(String token) {
         this.token = token;
     }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
 }

+ 3 - 1
platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java

@@ -347,7 +347,9 @@ public class BrandServiceImpl implements BrandService {
         brandEntity.setPicList(sceneEntity.getAppListPicUrl());
         brandEntity.setCreateUserId(userEntity.getId());
         brandEntity.setSortOrder(100);
-        brandEntity.setCreateUserDeptId(userEntity.getCompanyId());
+        if(StringUtils.isNotBlank(sceneEntity.getCompanyId())){
+            brandEntity.setCreateUserDeptId(Long.valueOf(sceneEntity.getCompanyId()));
+        }
         brandEntity.setAddress("浙江省,杭州市,萧山区 山阴路688号恒隆广场B座1217");
         brandEntity.setLongitude(new BigDecimal(120.262421));
         brandEntity.setLatitude(new BigDecimal(30.178317));

+ 4 - 4
platform-shop/src/main/java/com/platform/service/impl/GoodsServiceImpl.java

@@ -409,10 +409,10 @@ public class GoodsServiceImpl implements GoodsService {
         CurrentUserLoginVo user = ShiroUtils.getUserEntity();
         GoodsEntity goodsEntity = queryObject(id);
         if(goodsEntity == null){
-            throw new RRException("此商品不存在!");
+            throw new RRException("上架商品失败!");
         }
         if (goodsEntity.getIsOnSale()!=null && 1 == goodsEntity.getIsOnSale()) {
-            throw new RRException("此商品已处于上架状态!");
+            throw new RRException("上架商品失败!");
         }
         goodsEntity.setIsOnSale(1);
         goodsEntity.setUpdateUserId(user.getId());
@@ -425,10 +425,10 @@ public class GoodsServiceImpl implements GoodsService {
         CurrentUserLoginVo user = ShiroUtils.getUserEntity();
         GoodsEntity goodsEntity = queryObject(id);
         if(goodsEntity == null){
-            throw new RRException("此商品不存在!");
+            throw new RRException("下架商品失败!");
         }
         if (goodsEntity.getIsOnSale()!=null && 0 == goodsEntity.getIsOnSale()) {
-            throw new RRException("此商品已处于下架状态!");
+            throw new RRException("下架商品失败!");
         }
         goodsEntity.setIsOnSale(0);
         goodsEntity.setUpdateUserId(user.getId());

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

@@ -59,6 +59,9 @@
         <if test="isLiveRoom != null">
             AND is_live_room = #{isLiveRoom}
         </if>
+        <if test="userId != null">
+            AND create_user_id = #{createUserId}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}