|
@@ -13,6 +13,7 @@ import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.course.bo.*;
|
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
+import com.zhongzheng.modules.course.vo.GoodsBatchListVo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
|
|
|
import com.zhongzheng.modules.goods.vo.ExportLiveGoodsVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
@@ -216,20 +217,28 @@ public class CourseController extends BaseController {
|
|
|
|
|
|
@ApiOperation("批量查询用户拥有的商品进度")
|
|
|
@GetMapping("/goodsBatchList")
|
|
|
- public AjaxResult<Map<String,Object>> goodsBatchList(CourseQueryBo bo) {
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+ public AjaxResult<List<GoodsBatchListVo>> goodsBatchList(CourseQueryBo bo) {
|
|
|
+ List<GoodsBatchListVo> listVos = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isEmpty(bo.getTelphoneList())){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
for(CourseProgressQueryBo queryBo : bo.getTelphoneList()){
|
|
|
User user = iUserService.getOne(new LambdaQueryWrapper<User>()
|
|
|
.eq(User::getTelphone, queryBo.getTelphone()).last("limit 1"));
|
|
|
if(Validator.isEmpty(user)){
|
|
|
- throw new CustomException("该用户不存在");
|
|
|
+ continue;
|
|
|
}
|
|
|
- bo.setUserId(user.getUserId());
|
|
|
- bo.setGoodsId(queryBo.getGoodsId());
|
|
|
+ GoodsBatchListVo vo = new GoodsBatchListVo();
|
|
|
+ vo.setUserId(user.getUserId());
|
|
|
+ vo.setGoodsId(queryBo.getGoodsId());
|
|
|
+ vo.setTelphone(queryBo.getTelphone());
|
|
|
List<GoodsUserVo> list = iCourseService.goodsProgressList(bo);
|
|
|
- map.put(bo.getTelphone()+"-"+bo.getGoodsId(),list);
|
|
|
+ vo.setList(list);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(listVos)){
|
|
|
+ return null;
|
|
|
}
|
|
|
- return AjaxResult.success(map);
|
|
|
+ return AjaxResult.success(listVos);
|
|
|
}
|
|
|
|
|
|
}
|