feat: 获取购物车信息增加selected状态选择

This commit is contained in:
wst 2024-11-06 21:01:12 +08:00
parent 426517a0ff
commit 9152701784
2 changed files with 4 additions and 0 deletions

View file

@ -38,6 +38,8 @@ public class ShopTradeCartController {
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "queryShopTradeCartList", value = "获取购物车信息", method = "POST", allUse = "2")
@ApiImplicitParams({
@ApiImplicitParam(id = "selected", name = "selected", value = "选中状态0未选中1选中")})
@RequestMapping("/post/ShopTradeCartController/queryShopTradeCartList")
public void queryShopTradeCartList(InputObject inputObject, OutputObject outputObject) {
shopTradeCartService.queryShopTradeCartList(inputObject, outputObject);

View file

@ -71,10 +71,12 @@ public class ShopTradeCartServiceImpl extends SkyeyeBusinessServiceImpl<ShopTrad
@Override
public void queryShopTradeCartList(InputObject inputObject, OutputObject outputObject) {
String selected = inputObject.getParams().get("selected").toString();
String userId = InputObject.getLogParamsStatic().get("id").toString();
// 查询用户购物车列表
QueryWrapper<ShopTradeCart> wrapper = new QueryWrapper<>();
wrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getCreateId), userId);
wrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getSelected), selected);
wrapper.orderByDesc(MybatisPlusUtil.toColumns(ShopTradeCart::getCreateTime));
List<ShopTradeCart> beans = list(wrapper);
iMaterialNormsService.setDataMation(beans, ShopTradeCart::getNormsId);