| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.constant.ExpressCompanyMap; |
| | |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.util.payment.model.RefundCallbackResult; |
| | | import com.ruoyi.order.util.payment.model.UniPayCallbackResult; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | |
| | | return R.ok(confirmOrderVo); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/orderPayment") |
| | | @ApiOperation(value = "订单支付", tags = {"商城-订单支付-小程序"}) |
| | | public R orderPayment(@RequestBody OrderPayment orderPayment){ |
| | | return orderService.orderPayment(orderPayment); |
| | | } |
| | | |
| | | /** |
| | | * 订单支付回调通知 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/orderPaymentCallback") |
| | | public void orderPaymentCallback(UniPayCallbackResult uniPayCallbackResult, HttpServletResponse response){ |
| | | String jsonString = JSONObject.toJSONString(uniPayCallbackResult); |
| | | System.out.println("1111111111111111111111"); |
| | | System.out.println(jsonString); |
| | | R callback = orderService.orderPaymentCallback(uniPayCallbackResult); |
| | | if(callback.getCode() == 200){ |
| | | response.setStatus(200); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | out.println("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 我的订单列表 |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"), |
| | | }) |
| | | @GetMapping("/writeOff") |
| | | public R<Void> writeOff(String code, Integer shopId, String technicianId) { |
| | | orderService.writeOff(code, shopId, technicianId); |
| | | public R<Void> writeOff(String code, Integer shopId) { |
| | | orderService.writeOff(code, 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) { |
| | | return R.ok(orderService.getShopOrderList(content,status,shopId,pageNum,pageSize)); |
| | | } |
| | | |
| | | @PutMapping("/shopCancelOrder/{orderId}") |
| | | @ApiOperation(value = "取消订单", tags = {"门店后台-订单管理"}) |
| | | public R shopCancelOrder(@PathVariable("orderId") Long orderId) { |
| | | return orderService.shopCancelOrder(orderId); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 取消订单 |
| | |
| | | |
| | | |
| | | @GetMapping("/getOrderPageList") |
| | | // @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", "门店后台-订单管理"}) |
| | | @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", }) |
| | | public R<PageInfo<OrderPageListVo>> getOrderPageList(OrderPageList orderPageList) { |
| | | return R.ok(orderService.getOrderPageList(orderPageList)); |
| | | } |
| | |
| | | /** |
| | | * 订单统计 |
| | | */ |
| | | @GetMapping("/getOrderStatistics") |
| | | /* @GetMapping("/getOrderStatistics") |
| | | @ApiOperation(value = "订单统计", tags = {"管理后台-首页统计"}) |
| | | public R<OrderStatistics> getOrderStatistics(@RequestParam("startTime") String startTime, |
| | | @RequestParam("endTime") String endTime) { |
| | |
| | | return R.ok(orderStatistics); |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 订单取消支付回退 |
| | | * |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | /* *//** |
| | | * 获取订单快递明细 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | *//* |
| | | @GetMapping("/getOrderExpress/{id}") |
| | | @ApiOperation(value = "获取订单快递明细", tags = {"小程序-订单管理"}) |
| | | public R<MapTrackKD100Vo> getOrderExpress(@PathVariable("id") Long id) { |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | */ |
| | | |
| | | /** |
| | | * 根据id获取订单详情 |
| | |
| | | if (StringUtils.isNotEmpty(goodJson) && !"NULL".equals(goodJson)) { |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | orderExport.setGoodsName(goods.getName()); |
| | | orderExport.setCompanyCostPrice(goods.getOperatingCost()); |
| | | orderExport.setSupplierCostPrice(goods.getShopCost()); |
| | | /* orderExport.setCompanyCostPrice(goods.getOperatingCost()); |
| | | orderExport.setSupplierCostPrice(goods.getShopCost());*/ |
| | | } |
| | | |
| | | String expressJson = orderExport.getExpressJson(); |