|
@@ -11,18 +11,13 @@
|
|
package com.qs.mp.web.controller.api.channel.mall;
|
|
package com.qs.mp.web.controller.api.channel.mall;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
-import com.qs.mp.admin.domain.TicketBox;
|
|
|
|
-import com.qs.mp.admin.domain.param.TicketBoxListVO;
|
|
|
|
-import com.qs.mp.admin.domain.param.TicketBoxParam;
|
|
|
|
-import com.qs.mp.admin.service.ITicketBoxService;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.qs.mp.channel.domain.ChannelCart;
|
|
import com.qs.mp.channel.domain.ChannelCart;
|
|
import com.qs.mp.channel.domain.param.ChannelCartParam;
|
|
import com.qs.mp.channel.domain.param.ChannelCartParam;
|
|
import com.qs.mp.channel.domain.vo.ChannelCartVO;
|
|
import com.qs.mp.channel.domain.vo.ChannelCartVO;
|
|
import com.qs.mp.channel.service.IChannelCartService;
|
|
import com.qs.mp.channel.service.IChannelCartService;
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
import com.qs.mp.common.domain.param.BatchLongIdsParam;
|
|
import com.qs.mp.common.domain.param.BatchLongIdsParam;
|
|
-import com.qs.mp.common.enums.TicketBoxStatusEnum;
|
|
|
|
-import com.qs.mp.common.utils.StringUtils;
|
|
|
|
import com.qs.mp.utils.SecurityUtils;
|
|
import com.qs.mp.utils.SecurityUtils;
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -66,16 +61,33 @@ public class ChannelCartController extends BaseApiController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 添加/修改购物车数量
|
|
|
|
|
|
+ * 盲票列表页面点加购
|
|
*/
|
|
*/
|
|
@PostMapping("/cart/add")
|
|
@PostMapping("/cart/add")
|
|
@ApiOperation(value = "加购物车" , notes = "渠道经销商加购物车")
|
|
@ApiOperation(value = "加购物车" , notes = "渠道经销商加购物车")
|
|
public AjaxResult add(@RequestBody ChannelCartParam param) {
|
|
public AjaxResult add(@RequestBody ChannelCartParam param) {
|
|
boolean rtn = channelCartService.addToCart(param);
|
|
boolean rtn = channelCartService.addToCart(param);
|
|
if (!rtn) {
|
|
if (!rtn) {
|
|
- return AjaxResult.success("操作失败");
|
|
|
|
|
|
+ return AjaxResult.error("操作失败");
|
|
}
|
|
}
|
|
- return AjaxResult.error("操作成功");
|
|
|
|
|
|
+ return AjaxResult.success("操作成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改购物车数量
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/cart/update")
|
|
|
|
+ @ApiOperation(value = "修改购物车数量" , notes = "渠道经销商购物车列表页面直接修改")
|
|
|
|
+ public AjaxResult update(@RequestBody ChannelCartParam param) {
|
|
|
|
+ Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
|
+ boolean rtn = channelCartService.update(new LambdaUpdateWrapper<ChannelCart>()
|
|
|
|
+ .set(ChannelCart::getOrderNum, param.getOrderNum())
|
|
|
|
+ .eq(ChannelCart::getChannelId, channelId)
|
|
|
|
+ .eq(ChannelCart::getCartId, param.getCartId()));
|
|
|
|
+ if (!rtn) {
|
|
|
|
+ return AjaxResult.error("更新失败");
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success("更新成功");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -86,9 +98,9 @@ public class ChannelCartController extends BaseApiController {
|
|
public AjaxResult remove(@RequestBody BatchLongIdsParam param) {
|
|
public AjaxResult remove(@RequestBody BatchLongIdsParam param) {
|
|
boolean rtn = channelCartService.removeByIds(param.getIds());
|
|
boolean rtn = channelCartService.removeByIds(param.getIds());
|
|
if (!rtn) {
|
|
if (!rtn) {
|
|
- return AjaxResult.success("操作失败");
|
|
|
|
|
|
+ return AjaxResult.error("操作失败");
|
|
}
|
|
}
|
|
- return AjaxResult.error("操作成功");
|
|
|
|
|
|
+ return AjaxResult.success("操作成功");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|