Quellcode durchsuchen

修改活动列表代码

zhangchen vor 4 Tagen
Ursprung
Commit
4f1175bee8

+ 2 - 2
alien-store/src/main/java/shop/alien/store/controller/OperationalActivityController.java

@@ -73,8 +73,8 @@ public class OperationalActivityController {
     @ApiOperationSupport(order = 6)
     @PostMapping("/audit")
     public R<String> auditActivity(
-            @RequestParam("id") Integer id,
-            @RequestParam("status") Integer status,
+            @RequestParam(value = "id", required = true) Integer id,
+            @RequestParam(value = "status", required = true) Integer status,
             @RequestParam(value = "approvalComments", required = false) String approvalComments) {
         log.info("OperationalActivityController.auditActivity: id={}, status={}, approvalComments={}", id, status, approvalComments);
         if (id == null) {

+ 11 - 7
alien-store/src/main/java/shop/alien/store/service/impl/OperationalActivityServiceImpl.java

@@ -82,9 +82,9 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
     public IPage<StoreOperationalActivityVO> pageActivityDetail(Integer storeId, String storeName, Integer pageNum, Integer pageSize) {
         log.info("OperationalActivityServiceImpl.pageActivityDetail: storeId={}, storeName={}, pageNum={}, pageSize={}", storeId, storeName, pageNum, pageSize);
 
-        if (storeId == null && StringUtils.isBlank(storeName)) {
-            throw new IllegalArgumentException("请至少提供商户ID或商户名称");
-        }
+//        if (storeId == null && StringUtils.isBlank(storeName)) {
+//            throw new IllegalArgumentException("请至少提供商户ID或商户名称");
+//        }
 
         int current = (pageNum == null || pageNum <= 0) ? 1 : pageNum;
         int size = (pageSize == null || pageSize <= 0) ? 10 : pageSize;
@@ -107,12 +107,16 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
             }
         }
 
-        if (storeIds.isEmpty()) {
-            return new Page<>(current, size, 0);
-        }
+//        if (storeIds.isEmpty()) {
+//            return new Page<>(current, size, 0);
+//        }
 
         LambdaQueryWrapper<StoreOperationalActivity> wrapper = new LambdaQueryWrapper<>();
-        wrapper.in(StoreOperationalActivity::getStoreId, storeIds);
+
+
+        if (!storeIds.isEmpty()) {
+            wrapper.in(StoreOperationalActivity::getStoreId, storeIds);
+        }
         wrapper.eq(StoreOperationalActivity::getDeleteFlag, 0);
         wrapper.orderByDesc(StoreOperationalActivity::getCreatedTime);