| | |
| | | |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.ChargeOrder; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.service.ChargeOrderService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.util.payment.model.RefundCallbackResult; |
| | | import com.ruoyi.order.util.payment.model.UniPayCallbackResult; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | public class OrderController extends BaseController { |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private ChargeOrderService chargeOrderService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | |
| | | @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/getMyOrderList") |
| | | public TableDataInfo<OrderVO> getMyOrderList(@ApiParam("订单状态") Integer status) { |
| | | public TableDataInfo<OrderVO> getMyOrderList(@RequestParam("订单状态") Integer status) { |
| | | startPage(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | return getDataTable(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid())); |
| | |
| | | */ |
| | | @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理"}) |
| | | @GetMapping("/writeOff") |
| | | public R<Void> writeOff(@ApiParam("id") String id, @ApiParam("shopId") Integer shopId) { |
| | | public R<Void> writeOff(@RequestParam("id") String id, @RequestParam("shopId") Integer shopId) { |
| | | orderService.writeOff(id, shopId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getShopOrderList") |
| | | @ApiOperation(value = "获取订单列表", tags = {"门店后台-订单管理", }) |
| | | public R<IPage<OrderPageListVo>> getShopOrderList(@ApiParam("模糊查询:订单编号/商品名/手机号 ") String content , |
| | | @ApiParam("订单状态") Integer status, |
| | | @ApiParam("门店id") Integer shopId, |
| | | @ApiParam("页码") @RequestParam("pageNum") Integer pageNum, |
| | | @ApiParam("每一页数据大小") @RequestParam("pageSize") Integer pageSize) { |
| | | public R<IPage<OrderPageListVo>> getShopOrderList(@RequestParam("content") String content , |
| | | @RequestParam("status") Integer status, |
| | | @RequestParam("shopId") Integer shopId, |
| | | @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize) { |
| | | return R.ok(orderService.getShopOrderList(content,status,shopId,pageNum,pageSize)); |
| | | } |
| | | @PostMapping("/importExpress") |
| | | @ApiOperation(value = "2.0新增导入订单", tags = {"门店后台-订单管理"}) |
| | | public R importExpress(@RequestParam("file") MultipartFile file) { |
| | | /* JSONObject jsonObject = JSONObject.parseObject(url); |
| | | String url2 = jsonObject.getString("url");*/ |
| | | if (file.isEmpty()) { |
| | | return R.fail("请选择要上传的文件"); |
| | | } |
| | | |
| | | return orderService.importExpress(file); |
| | | } |
| | | |
| | | @PutMapping("/shopCancelOrder/{orderId}") |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取商品销售数量 |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/getList") |
| | | R<List<ChargeOrder>> getList(@RequestParam("siteId") Integer siteId) { |
| | | List<ChargeOrder> list = chargeOrderService.lambdaQuery().eq(ChargeOrder::getPowerStationId, siteId).list(); |
| | | return R.ok(list); |
| | | } |
| | | /** |
| | | * 获取商品销售数量 |
| | | * |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @PostMapping("/getGoodsSaleNum") |
| | | public R<Integer> getGoodsSaleNum(@RequestParam("goodsId") Integer goodsId, @RequestParam("type") Integer type) { |
| | | Integer goodsSaleNum = orderService.getGoodsSaleNum(goodsId, type, null); |