|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.controller.app.order;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
|
|
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
|
|
|
|
import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
|
|
|
|
|
import cn.iocoder.yudao.module.trade.controller.app.order.vo.*;
|
|
|
|
@ -17,6 +18,7 @@ import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService;
|
|
|
|
|
import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService;
|
|
|
|
|
import cn.iocoder.yudao.module.trade.service.order.TradeOrderQueryService;
|
|
|
|
|
import cn.iocoder.yudao.module.trade.service.order.TradeOrderUpdateService;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
@ -32,6 +34,7 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
|
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
|
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
|
|
|
|
|
|
|
@Tag(name = "用户 App - 交易订单")
|
|
|
|
@ -65,6 +68,9 @@ public class AppTradeOrderController {
|
|
|
|
|
@Operation(summary = "创建订单")
|
|
|
|
|
@PreAuthenticated
|
|
|
|
|
public CommonResult<AppTradeOrderCreateRespVO> createOrder(@Valid @RequestBody AppTradeOrderCreateReqVO createReqVO) {
|
|
|
|
|
LoginUser loginUser = getLoginUser();
|
|
|
|
|
createReqVO.setReceiverName(loginUser.getInfo().getOrDefault("nickname",""));
|
|
|
|
|
createReqVO.setReceiverMobile(loginUser.getInfo().getOrDefault("mobile",""));
|
|
|
|
|
TradeOrderDO order = tradeOrderUpdateService.createOrder(getLoginUserId(), createReqVO);
|
|
|
|
|
return success(new AppTradeOrderCreateRespVO().setId(order.getId()).setPayOrderId(order.getPayOrderId()));
|
|
|
|
|
}
|
|
|
|
@ -116,6 +122,13 @@ public class AppTradeOrderController {
|
|
|
|
|
return success(TradeOrderConvert.INSTANCE.convertPage02(pageResult, orderItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getPickUpVerifyCode")
|
|
|
|
|
@Operation(summary = "根据订单id获取自提核销码")
|
|
|
|
|
public CommonResult<String> getPickUpVerifyCode(String id) {
|
|
|
|
|
String pickUpVerifyCode = tradeOrderQueryService.getPickUpVerifyCode(id);
|
|
|
|
|
return success(pickUpVerifyCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/get-count")
|
|
|
|
|
@Operation(summary = "获得交易订单数量")
|
|
|
|
|
public CommonResult<Map<String, Long>> getOrderCount() {
|
|
|
|
|