| | |
| | | import com.ruoyi.common.core.utils.OrderCodeUtil; |
| | | import com.ruoyi.other.api.feignClient.CouponClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.Api; |
| | |
| | | private GoodsClient goodsClient; |
| | | @Resource |
| | | private CouponClient couponClient; |
| | | |
| | | |
| | | @PostMapping("/getExchangeOrderList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-兑换订单"}) |
| | |
| | | public AjaxResult cancelShoppingOrder(String id) { |
| | | TExchangeOrder byId = exchangeOrderService.getById(id); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | // todo 根据支付方式 取消订单 |
| | | byId.setCancellationId(userid); |
| | | byId.setCancellationTime(LocalDateTime.now()); |
| | | byId.setStatus(4); |
| | | exchangeOrderService.updateById(byId); |
| | | // 回退积分 |
| | | Integer points = byId.getPoints(); |
| | | appUserClient.refundPoints(byId.getAppUserId()+"-"+points); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/consignerShoppingOrder") |
| | |
| | | String[] split = goodsIds.split("-"); |
| | | // 取出最后一位字符 类型1查询现金购买 类型2查询积分兑换 |
| | | String s = split[split.length - 1]; |
| | | String[] split1 = split[0].split(","); |
| | | List<Integer> res = new ArrayList<>(); |
| | | switch (Integer.parseInt(s)){ |
| | | case 1: |
| | | for (int i = 0; i < split.length-1; i++) { |
| | | for (int i = 0; i < split1.length; i++) { |
| | | Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type",1) |
| | | .eq("goods_id", split[i]) |
| | |
| | | } |
| | | break; |
| | | case 2: |
| | | for (int i = 0; i < split.length-1; i++) { |
| | | for (int i = 0; i < split1.length; i++) { |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>() |
| | | .eq("order_type",1) |
| | | .ne("status",4) |