Explorar el Código

Merge branch 'dev/2024/0418/update-admin' of Harper/feifan-backend-zx-admin into master

添加查询售后分页条件
Yangzw hace 10 meses
padre
commit
140f73900d

+ 4 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/controller/admin/aftersale/vo/AfterSalePageReqVO.java

@@ -12,6 +12,7 @@ import lombok.ToString;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.time.LocalDateTime;
+import java.util.List;
 
 import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
 
@@ -52,6 +53,9 @@ public class AfterSalePageReqVO extends PageParam {
     @Schema(description = "店铺id", example = "17019")
     private Long shopId;
 
+    @Schema(description = "店铺编号集")
+    private List<Long> shopIds;
+
     @Schema(description = "商户id", example = "27067")
     private Long merchantId;
 

+ 1 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/mysql/aftersale/AfterSaleMapper.java

@@ -24,6 +24,7 @@ public interface AfterSaleMapper extends BaseMapperX<AfterSaleDO> {
                 .eqIfPresent(AfterSaleDO::getMerchantId,reqVO.getMerchantId())
                 .eqIfPresent(AfterSaleDO::getWay, reqVO.getWay())
                 .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId())
+                .inIfPresent(AfterSaleDO::getShopId, reqVO.getShopIds())
                 .likeIfPresent(AfterSaleDO::getOrderNo, reqVO.getOrderNo())
                 .likeIfPresent(AfterSaleDO::getSpuName, reqVO.getSpuName())
                 .betweenIfPresent(AfterSaleDO::getCreateTime, reqVO.getCreateTime())

+ 9 - 6
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/shop/ShopController.java

@@ -1,13 +1,9 @@
 package cn.newfeifan.mall.sale.controller.admin.shop;
 
-import cn.newfeifan.mall.module.enums.ErrorCodeConstants;
-import cn.newfeifan.mall.module.system.api.user.dto.AdminUserRespDTO;
 import cn.newfeifan.mall.module.system.controller.admin.user.vo.user.UserRespVO;
-import cn.newfeifan.mall.sale.controller.admin.merchant.vo.MerchantRespVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopPageReqVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopRespVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopSaveReqVO;
-import cn.newfeifan.mall.sale.dal.dataobject.merchant.MerchantDO;
 import cn.newfeifan.mall.sale.dal.redis.ShopMessage;
 import cn.newfeifan.mall.sale.service.merchant.MerchantService;
 import cn.newfeifan.mall.sale.service.shop.ShopService;
@@ -32,7 +28,6 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.pojo.CommonResult;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 
-import static cn.newfeifan.mall.framework.common.pojo.CommonResult.error;
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 
 import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
@@ -41,7 +36,6 @@ import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
 
 import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
 import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
-import static cn.newfeifan.mall.module.enums.ErrorCodeConstants.MERCHANT_NOT_EXISTS;
 
 import cn.newfeifan.mall.sale.dal.dataobject.shop.ShopDO;
 
@@ -177,5 +171,14 @@ public class ShopController {
         return success(shops);
     }
 
+    @GetMapping("/getIdsByName")
+    @Operation(summary = "根据店铺名称获取店铺ids")
+    @Parameter(name = "shopName", description = "店铺名称", required = true, example = "XX")
+    @PreAuthorize("@ss.hasPermission('sale:merchant:query')")
+    public CommonResult<List<Long>> getIdsByName(@RequestParam("shopName") String shopName) {
+        // 获取所有店铺
+        List<Long> ids = shopService.getShopByName(shopName);
+        return success(ids);
+    }
 
 }

+ 10 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/dal/mysql/shop/ShopMapper.java

@@ -5,8 +5,12 @@ import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
 import cn.newfeifan.mall.sale.dal.dataobject.shop.ShopDO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopPageReqVO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * 店铺 Mapper
  *
@@ -25,4 +29,10 @@ public interface ShopMapper extends BaseMapperX<ShopDO> {
                 .orderByDesc(ShopDO::getId));
     }
 
+    default List<Long> selectShopIds(String shopName){
+        List<ShopDO> shopDOS = selectList(new LambdaQueryWrapper<ShopDO>()
+                .like(ShopDO::getName, shopName)
+        );
+        return shopDOS.stream().map(ShopDO::getId).collect(Collectors.toList());
+    }
 }

+ 2 - 1
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/shop/ShopService.java

@@ -3,7 +3,6 @@ package cn.newfeifan.mall.sale.service.shop;
 import javax.validation.*;
 
 import cn.newfeifan.mall.module.system.controller.admin.user.vo.user.UserRespVO;
-import cn.newfeifan.mall.sale.controller.admin.merchant.vo.MerchantSaveReqVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopRespVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopSaveReqVO;
 import cn.newfeifan.mall.sale.dal.dataobject.merchant.MerchantDO;
@@ -103,4 +102,6 @@ public interface ShopService {
     ShopMessage getCurrentShop(Long loginUserId);
 
     List<ShopRespVO> getAllShopByUserId(Long loginUserId);
+
+    List<Long> getShopByName(String shopName);
 }

+ 5 - 1
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/shop/ShopServiceImpl.java

@@ -7,7 +7,6 @@ import cn.newfeifan.mall.module.system.dal.dataobject.user.AdminUserDO;
 import cn.newfeifan.mall.module.system.dal.mysql.user.AdminUserMapper;
 import cn.newfeifan.mall.module.system.dal.redis.oauth2.OAuth2AccessTokenRedisDAO;
 import cn.newfeifan.mall.module.system.service.user.AdminUserService;
-import cn.newfeifan.mall.sale.controller.admin.merchant.vo.MerchantSaveReqVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopPageReqVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopRespVO;
 import cn.newfeifan.mall.sale.controller.admin.shop.vo.ShopSaveReqVO;
@@ -161,4 +160,9 @@ public class ShopServiceImpl implements ShopService {
         return getMerchantAllShop(adminUserDO.getMerchantId());
     }
 
+    @Override
+    public List<Long> getShopByName(String shopName) {
+        return shopMapper.selectShopIds(shopName);
+    }
+
 }