|
|
|
@@ -17,7 +17,7 @@ import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxOrder") |
|
|
|
@RequestMapping("/order") |
|
|
|
public class WxOrderController extends BaseController { |
|
|
|
private Logger logger = Logger.getLogger(WxOrderController.class); |
|
|
|
|
|
|
|
@@ -29,98 +29,36 @@ public class WxOrderController extends BaseController { |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "bUserId", value = "B端用户ID", dataType = "Long", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "status", value = "订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败", defaultValue = "0", required = false, dataType = "Integer") |
|
|
|
}) |
|
|
|
public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { |
|
|
|
public ResultData list(@ModelAttribute WxOrder wxOrder, Long bUserId, Integer pageNum, Integer pageSize) { |
|
|
|
if (null == wxOrder) wxOrder = new WxOrder(); |
|
|
|
final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrder, pageNum, pageSize); |
|
|
|
final PageInfo<WxOrder> page = wxOrderService.blistAsPage(wxOrder, bUserId, pageNum, pageSize); |
|
|
|
return new ResultData(page); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("提交订单") |
|
|
|
@PostMapping("save") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "couponId", value = "券ID", required = true, dataType = "Long"), |
|
|
|
@ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long"), |
|
|
|
@ApiImplicitParam(name = "payment", value = "支付金额", required = true, dataType = "BigDecimal"), |
|
|
|
@ApiImplicitParam(name = "status", value = "订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败", defaultValue = "0", required = false, dataType = "Integer") |
|
|
|
}) |
|
|
|
public ResultData saveOrder(@RequestBody WxOrder wxOrder) { |
|
|
|
//Assert.notNull(wxOrders.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxOrderService.saveOrder(wxOrder); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("取消订单") |
|
|
|
@PostMapping("cancel") |
|
|
|
@ApiOperation("订单详情") |
|
|
|
@PostMapping("expired") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
|
|
|
@ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") |
|
|
|
@ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long") |
|
|
|
}) |
|
|
|
public ResultData cancelOrder(@RequestBody WxOrder wxOrder) { |
|
|
|
public ResultData orderDetail(@RequestBody WxOrder wxOrder) { |
|
|
|
//Assert.notNull(wxOrders.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("订单过期") |
|
|
|
@PostMapping("expiring") |
|
|
|
@ApiOperation("手工退款") |
|
|
|
@PostMapping("refund") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
|
|
|
@ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") |
|
|
|
@ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long") |
|
|
|
}) |
|
|
|
public ResultData expiringOrder(@RequestBody WxOrder wxOrder) { |
|
|
|
//Assert.notNull(wxOrders.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_PENDING_REFUND); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("订单已过期") |
|
|
|
@PostMapping("expired") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
|
|
|
@ApiImplicitParam(name = "cUserId", value = "用户ID", required = true, dataType = "Long") |
|
|
|
}) |
|
|
|
public ResultData expiredOrder(@RequestBody WxOrder wxOrder) { |
|
|
|
//Assert.notNull(wxOrders.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("新增接口") |
|
|
|
@PostMapping("add") |
|
|
|
public ResultData add(@RequestBody WxOrder wxOrder) { |
|
|
|
//Assert.notNull(wxOrder.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxOrderService.saveOrUpdate(wxOrder); |
|
|
|
// 1. |
|
|
|
//wxOrderService.updateOrderStatus(wxOrder.getId(), EnumOrderStatus.ORDER_STATUS_PENDING_REFUND); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据id更新接口") |
|
|
|
@PostMapping("update") |
|
|
|
public ResultData update(@RequestBody WxOrder wxOrder) { |
|
|
|
wxOrderService.saveOrUpdate(wxOrder); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据id删除接口") |
|
|
|
@GetMapping("/del") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData delete(Long id) { |
|
|
|
wxOrderService.deleteById(id); |
|
|
|
return new ResultData(Result.SUCCESS, "删除成功", null); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据id查询接口") |
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findById(Long id) { |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxOrderService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |