yangdamao 3 anni fa
parent
commit
fb03d475f5

+ 6 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/ProfileTpController.java

@@ -2,6 +2,7 @@ package com.zhongzheng.controller.base;
 
 import java.util.List;
 import java.util.Arrays;
+import java.util.stream.Collectors;
 
 import com.zhongzheng.modules.base.bo.ProfileTpAddBo;
 import com.zhongzheng.modules.base.bo.ProfileTpEditBo;
@@ -9,6 +10,7 @@ import com.zhongzheng.modules.base.bo.ProfileTpQueryBo;
 import com.zhongzheng.modules.base.service.IProfileTpService;
 import com.zhongzheng.modules.base.vo.ProfileTpVo;
 import lombok.RequiredArgsConstructor;
+import net.polyv.common.v1.util.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -50,6 +52,10 @@ public class ProfileTpController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<ProfileTpVo> list(ProfileTpQueryBo bo) {
         startPage();
+        if (StringUtils.isNotBlank(bo.getStatus())){
+            List<Integer> collect = Arrays.asList(bo.getStatus().split(",")).stream().map(x -> Integer.valueOf(x)).collect(Collectors.toList());
+            bo.setStatusList(collect);
+        }
         List<ProfileTpVo> list = iProfileTpService.selectList(bo);
         return getDataTable(list);
     }

+ 14 - 9
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -216,11 +216,11 @@ public class CourseController extends BaseController {
     }
 
     @ApiOperation("批量查询用户拥有的商品进度")
-    @GetMapping("/goodsBatchList")
-    public AjaxResult<List<GoodsBatchListVo>> goodsBatchList(CourseQueryBo bo) {
+    @PostMapping("/goodsBatchList")
+    public AjaxResult<List<GoodsBatchListVo>> goodsBatchList(@RequestBody CourseQueryBo bo) {
         List<GoodsBatchListVo> listVos = new ArrayList<>();
         if (CollectionUtils.isEmpty(bo.getTelphoneList())){
-            return null;
+            return  AjaxResult.success(listVos);
         }
         for(CourseProgressQueryBo queryBo : bo.getTelphoneList()){
             User user = iUserService.getOne(new LambdaQueryWrapper<User>()
@@ -228,15 +228,20 @@ public class CourseController extends BaseController {
             if(Validator.isEmpty(user)){
                 continue;
             }
-            GoodsBatchListVo vo = new GoodsBatchListVo();
-            vo.setUserId(user.getUserId());
-            vo.setGoodsId(queryBo.getGoodsId());
-            vo.setTelphone(queryBo.getTelphone());
+            bo.setUserId(user.getUserId());
+            bo.setGoodsId(queryBo.getGoodsId());
             List<GoodsUserVo> list = iCourseService.goodsProgressList(bo);
-            vo.setList(list);
+            if (CollectionUtils.isNotEmpty(list)){
+                GoodsBatchListVo vo = new GoodsBatchListVo();
+                vo.setUserId(user.getUserId());
+                vo.setGoodsId(queryBo.getGoodsId());
+                vo.setTelphone(queryBo.getTelphone());
+                vo.setList(list);
+                listVos.add(vo);
+            }
         }
         if (CollectionUtils.isEmpty(listVos)){
-            return null;
+            return AjaxResult.success(listVos);
         }
         return AjaxResult.success(listVos);
     }

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/ProfileTpController.java

@@ -16,12 +16,15 @@ import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
+import net.polyv.common.v1.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 /**
  * 资料模板Controller
@@ -52,6 +55,10 @@ public class ProfileTpController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<ProfileTpVo> list(ProfileTpQueryBo bo) {
         startPage();
+        if (StringUtils.isNotBlank(bo.getStatus())){
+            List<Integer> collect = Arrays.asList(bo.getStatus().split(",")).stream().map(x -> Integer.valueOf(x)).collect(Collectors.toList());
+            bo.setStatusList(collect);
+        }
         List<ProfileTpVo> list = iProfileTpService.selectList(bo);
         return getDataTable(list);
     }

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ProfileTpQueryBo.java

@@ -48,5 +48,8 @@ public class ProfileTpQueryBo extends BaseEntity {
 	private Long goodsId;
 	/** 0 禁用 1启用 */
 	@ApiModelProperty("0 禁用 1启用")
-	private List<Integer> status;
+	private List<Integer> statusList;
+
+	@ApiModelProperty("0 禁用 1启用")
+	private String status;
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpServiceImpl.java

@@ -50,7 +50,7 @@ public class ProfileTpServiceImpl extends ServiceImpl<ProfileTpMapper, ProfileTp
         LambdaQueryWrapper<ProfileTp> lqw = Wrappers.lambdaQuery();
         lqw.like(StrUtil.isNotBlank(bo.getName()), ProfileTp::getName, bo.getName());
         lqw.eq(StrUtil.isNotBlank(bo.getCode()), ProfileTp::getCode, bo.getCode());
-        lqw.in(bo.getStatus() != null, ProfileTp::getStatus, bo.getStatus());
+        lqw.in(bo.getStatusList() != null, ProfileTp::getStatus, bo.getStatusList());
         return entity2Vo(this.list(lqw));
     }
 
@@ -156,7 +156,7 @@ public class ProfileTpServiceImpl extends ServiceImpl<ProfileTpMapper, ProfileTp
         //查询该商品的资料模板字段
         ProfileTpQueryBo profileTpQueryBo = new ProfileTpQueryBo();
         profileTpQueryBo.setGoodsId(goodsId);
-        profileTpQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        profileTpQueryBo.setStatusList(new ArrayList<Integer>(Arrays.asList(1)));
         List<ProfileTpVo> profileTpVos = baseMapper.selectListByBo(profileTpQueryBo);
         if (!CollectionUtils.isEmpty(profileTpVos)){
             return profileTpVos.get(0);