| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | |
| | | private TVipOrderService vipOrderService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder"}, logical = Logical.OR) |
| | | @PostMapping("/getVipOrderList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-会员订单"}) |
| | | public AjaxResult<PageInfo<TVipOrder>> getVipOrderList(@RequestBody VipShoppingOrderQuery query) { |
| | |
| | | PageInfo<TVipOrder> res = vipOrderService.pageList(query); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder/add"}, logical = Logical.OR) |
| | | @PostMapping("/addVipOrder") |
| | | @ApiOperation(value = "添加会员订单", tags = {"管理后台-会员订单"}) |
| | | public R<Long> addVipOrder(@RequestBody TVipOrder dto) { |
| | |
| | | vipOrderService.saveOrUpdate(dto); |
| | | return R.ok(dto.getId()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addVipOrder1") |
| | | public R<Long> addVipOrder1(@RequestBody TVipOrder dto) { |
| | | if (dto.getId()!=null){ |
| | | List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()) |
| | | .ne(TVipOrder::getId, dto.getId()).list(); |
| | | if (!list.isEmpty())return R.fail("订单编号已存在"); |
| | | }else{ |
| | | List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()).list(); |
| | | if (!list.isEmpty())return R.fail("订单编号已存在"); |
| | | } |
| | | vipOrderService.saveOrUpdate(dto); |
| | | return R.ok(dto.getId()); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder/del"}, logical = Logical.OR) |
| | | @GetMapping("/deleteVipOrder") |
| | | @ApiOperation(value = "批量删除会员订单", tags = {"管理后台-会员订单"}) |
| | | public AjaxResult deleteVipOrder(String id) { |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/callBack") |
| | | public R callBack(@RequestParam("code")String code,@RequestParam("outTradeNo")String outTradeNo){ |
| | | |
| | | TVipOrder one = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, code).one(); |
| | | one.setSerialNumber(outTradeNo); |
| | | one.setPaymentStatus(2); |
| | |
| | | giveVipDto.setVipId(one.getVipId()); |
| | | giveVipDto.setType(one.getVipType()); |
| | | giveVipDto.setUserIds(one.getAppUserId().toString()); |
| | | |
| | | |
| | | |
| | | appUserClient.giveVip(giveVipDto); |
| | | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "导出") |
| | | @PutMapping(value = "/export") |