| | |
| | | package com.ruoyi.order.controller.miniapp; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.domain.dto.*; |
| | | import com.ruoyi.order.domain.vo.*; |
| | | import com.ruoyi.order.service.order.OrderService; |
| | | import com.ruoyi.system.api.RemoteMemberService; |
| | | import com.ruoyi.system.api.domain.dto.AppBaseGetDto; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | |
| | | @RequestMapping("/app/order") |
| | | public class AppOrderController extends BaseController { |
| | | |
| | | @Autowired |
| | | private RemoteMemberService memberService; |
| | | |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | |
| | | @RequestMapping(value = "/buyGoods", method = RequestMethod.POST) |
| | | /*@RequestMapping(value = "/buyGoods", method = RequestMethod.POST) |
| | | @ApiOperation(value = "购买商品") |
| | | public R<AppSureOrderVo> buyGoods(@RequestBody AppSureOrderDto appSureOrderDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | |
| | | if(member!=null&&member.getRelationShopId()!=null){ |
| | | appPlaceOrderDto.setShopId(member.getRelationShopId()); |
| | | } |
| | | if(member.getBindingFlag()!=1){ |
| | | //绑定商户 |
| | | AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto(); |
| | | appMemberBindingDto.setShopId(appPlaceOrderDto.getShopId()); |
| | | appMemberBindingDto.setUserId(userId); |
| | | appMemberBindingDto.setBindingFlag(1); |
| | | memberService.updateMemberBinding(appMemberBindingDto); |
| | | } |
| | | } |
| | | AppPlaceOrderVo appPlaceOrderVo = orderService.placeOrder(appPlaceOrderDto); |
| | | return R.ok(appPlaceOrderVo); |
| | |
| | | appUserOrderPageDto.setShopId(member.getRelationShopId()); |
| | | } |
| | | } |
| | | logger.info("appUserOrderPageDto:"+appUserOrderPageDto.toString()); |
| | | Page<AppUserOrderPageVo> page = new Page<>(); |
| | | page.setSize(appUserOrderPageDto.getPageSize()); |
| | | page.setCurrent(appUserOrderPageDto.getPageNum()); |
| | |
| | | @ApiOperation(value = "支付订单(临时)") |
| | | public R<AppPlaceOrderVo> placeOrder(@RequestBody AppBaseGetDto appBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | AppPlaceOrderVo appPlaceOrderVo = null; |
| | | AppPlaceOrderVo appPlaceOrderVo = new AppPlaceOrderVo(); |
| | | Order order = orderService.getById(appBaseGetDto.getId()); |
| | | appPlaceOrderVo.setOrderId(order.getOrderId()); |
| | | appPlaceOrderVo.setOrderNo(order.getOrderNo()); |
| | | appPlaceOrderVo.setPayMoney(order.getPayMoney()); |
| | | appPlaceOrderVo.setUnpaidMoney(order.getReceivableMoney().subtract(order.getPayMoney())); |
| | | return R.ok(appPlaceOrderVo); |
| | | } |
| | | |
| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | orderService.cancelOrder(appBaseGetDto.getId()); |
| | | return R.ok(); |
| | | } |
| | | }*/ |
| | | |
| | | } |