OrderController.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package com.ym.mec.collectfee.controller;
  2. import com.ym.mec.collectfee.common.web.BaseController;
  3. import com.ym.mec.collectfee.service.OrderService;
  4. import com.ym.mec.collectfee.utils.Constants;
  5. import org.apache.commons.lang3.StringUtils;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @RestController()
  11. @RequestMapping("order")
  12. public class OrderController extends BaseController {
  13. @Autowired
  14. private OrderService orderService;
  15. /**
  16. * 获取订单列表
  17. * @param userId
  18. * @return
  19. */
  20. @PostMapping("/getOrderList")
  21. // @ApiOperation(value = "根据学生编号,获取订单列表")
  22. // @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "学生编号", required = true, dataType = "Integer")})
  23. public Object getOrders(Integer userId){
  24. if(userId == null){
  25. return failed(Constants.PARAM_VERIFY_ERROR_MSG);
  26. }
  27. return succeed(orderService.getOrderByUserId(userId));
  28. }
  29. @PostMapping("/checkOrderList")
  30. // @ApiOperation(value = "根据学生编号,获取订单列表")
  31. // @ApiImplicitParams({ @ApiImplicitParam(name = "classId", value = "乐团编号", required = true, dataType = "Integer")})
  32. public Object checkOrders(Integer classId, Integer type, String voicyPart, String startTime, String endTime, Integer branchId){
  33. return succeed(orderService.getOrderByClassId(classId,type,voicyPart,startTime,endTime,branchId));
  34. }
  35. /**
  36. * 查询报名人数
  37. * @param poName
  38. * @param voicePart
  39. * @return
  40. */
  41. @PostMapping("/applyNum")
  42. // @ApiOperation(value = "根据乐团名称、声部名称,查询报名人数")
  43. // @ApiImplicitParams({ @ApiImplicitParam(name = "poName", value = "乐团名称", required = true, dataType = "String"),
  44. // @ApiImplicitParam(name = "voicePart", value = "声部名称", required = true, dataType = "String")})
  45. public Object queryNum(String poName,String voicePart){
  46. if(StringUtils.isEmpty(voicePart) || StringUtils.isEmpty(poName)){
  47. return failed(Constants.PARAM_VERIFY_ERROR_MSG);
  48. }
  49. return succeed(orderService.countOrder(poName, voicePart));
  50. }
  51. /**
  52. * 推送订单
  53. * @param batchNum
  54. * @return
  55. */
  56. // @PostMapping("/pushOrder")
  57. // public String pushOrder(String batchNum){
  58. // return orderService.pushOrder(batchNum);
  59. // }
  60. }