|
@@ -12,15 +12,20 @@ package com.qs.mp.web.controller.api.channel;
|
|
|
|
|
|
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.qs.mp.channel.domain.ChannelAddr;
|
|
|
import com.qs.mp.channel.domain.param.AddrParam;
|
|
|
import com.qs.mp.channel.service.IChannelAddrService;
|
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
|
+import com.qs.mp.common.enums.TicketBoxStatusEnum;
|
|
|
+import com.qs.mp.common.utils.StringUtils;
|
|
|
import com.qs.mp.utils.SecurityUtils;
|
|
|
+import com.qs.mp.web.controller.common.BaseApiController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import javax.validation.Valid;
|
|
@@ -37,7 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/api/v1/mp/channel/mall")
|
|
|
@Api(tags = "渠道盲票商城接口")
|
|
|
@AllArgsConstructor
|
|
|
-public class ChannelTicketController {
|
|
|
+public class ChannelTicketController extends BaseApiController {
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -52,29 +57,28 @@ public class ChannelTicketController {
|
|
|
@PostMapping("/ticket/list")
|
|
|
@ApiOperation(value = "盲票组列表" , notes = "获取所有盲票信息")
|
|
|
public AjaxResult list(@RequestBody TicketBoxParam param) {
|
|
|
+ // TODO 根据标签过滤
|
|
|
+ startPage();
|
|
|
List<TicketBox> ticketBoxes = ticketBoxService.list(
|
|
|
new LambdaQueryWrapper<TicketBox>().eq(TicketBox::getType, param.getType())
|
|
|
- .eq(null != param.getCategoryId() && 0 != param.getCategoryId(), TicketBox::getCategoryId, param.getCategoryId()));
|
|
|
-// .eq()
|
|
|
-// .orderByDesc(ChannelAddr::getCommonAddr).orderByDesc(ChannelAddr::getUpdateTime));
|
|
|
-
|
|
|
- return AjaxResult.success(ticketBoxes);
|
|
|
+ .eq(null != param.getCategoryId() && 0 != param.getCategoryId(), TicketBox::getCategoryId, param.getCategoryId())
|
|
|
+ .eq(TicketBox::getStatus, TicketBoxStatusEnum.PUT_ON));
|
|
|
+ List<TicketBoxListVO> ticketBoxListVOList = mapperFacade.mapAsList(ticketBoxes, TicketBoxListVO.class);
|
|
|
+ return AjaxResult.success(ticketBoxListVOList);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 获取地址信息订单配送地址
|
|
|
+ * 查看盲票详情
|
|
|
*/
|
|
|
- @PostMapping("/address/query")
|
|
|
- @ApiOperation(value = "获取地址信息" , notes = "根据地址id,获取地址信息")
|
|
|
- public AjaxResult getInfo(@RequestBody AddrParam addrParam) {
|
|
|
- if (addrParam.getAddrId() == null || addrParam.getAddrId() == 0) {
|
|
|
- return AjaxResult.error("参数异常,地址ID缺失");
|
|
|
+ @PostMapping("/ticket/detail")
|
|
|
+ @ApiOperation(value = "查看盲票详情" , notes = "根据盲票组ID,获取盲票信息")
|
|
|
+ public AjaxResult getInfo(@RequestBody TicketBoxParam param) {
|
|
|
+ if (StringUtils.isBlank(param.getBoxId())) {
|
|
|
+ return AjaxResult.error("参数异常,盲票组ID缺失");
|
|
|
}
|
|
|
- Long channelId = SecurityUtils.getLoginUser().getChannelId();
|
|
|
-// ChannelAddr channelAddr = channelAddrService.getChannelAddrByUserId(addrParam.getAddrId(),
|
|
|
-// channelId);
|
|
|
- return AjaxResult.success();
|
|
|
+ TicketBox ticketBox = ticketBoxService.getById(param.getBoxId());
|
|
|
+ return AjaxResult.success(ticketBox);
|
|
|
}
|
|
|
|
|
|
}
|