SelfCarController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package com.jkcredit.invoice.controller.localBussiness;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.jkcredit.invoice.annotation.LoginRequired;
  4. import com.jkcredit.invoice.model.entity.Calculate.NoCarCalculateInfor;
  5. import com.jkcredit.invoice.model.entity.Calculate.SelfCarCalculateInfor;
  6. import com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice;
  7. import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
  8. import com.jkcredit.invoice.model.entity.waybill.SelfCarTrade;
  9. import com.jkcredit.invoice.service.CalculateInfor.SelfCarCalculateInfoService;
  10. import com.jkcredit.invoice.service.selfCar.SelfCarInvoiceService;
  11. import com.jkcredit.invoice.service.selfCar.SelfCarService;
  12. import com.jkcredit.invoice.service.selfCar.SelfCarTradeService;
  13. import com.jkcredit.invoice.util.RespR;
  14. import io.swagger.annotations.Api;
  15. import io.swagger.annotations.ApiOperation;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.web.bind.annotation.PostMapping;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RestController;
  20. @Api(tags = "自有车操作")
  21. @RestController
  22. @RequestMapping(value = {"/selfCar"})
  23. public class SelfCarController {
  24. @Autowired
  25. SelfCarService selfCarService;
  26. @Autowired
  27. SelfCarTradeService selfCarTradeService;
  28. @Autowired
  29. SelfCarInvoiceService selfCarInvoiceService;
  30. @Autowired
  31. SelfCarCalculateInfoService selfCarCalculateInfoService;
  32. /**
  33. * 解绑etc卡
  34. * @param etcNum 参数集
  35. * @return 用户集合
  36. */
  37. @PostMapping("/selfCarUnBind")
  38. @ApiOperation(value="解绑etc卡", notes="解绑etc卡")
  39. @LoginRequired
  40. public RespR selfCarUnBind(String etcNum) {
  41. try {
  42. RespR respR = selfCarService.selfCarUnBind(etcNum);
  43. return respR;
  44. }catch (Exception e){
  45. e.printStackTrace();
  46. return new RespR(false,e.getMessage());
  47. }
  48. }
  49. /**
  50. * 分页查询自有车交易信息
  51. *
  52. * @param page 参数集
  53. * @return 交易信息
  54. */
  55. @PostMapping("/findTrades")
  56. @ApiOperation(value="分页查询自有车交易信息", notes="分页查询自有车交易信息")
  57. @LoginRequired
  58. public RespR findTrades(Page page, SelfCarTrade selfCarTrade) {
  59. try {
  60. RespR respR = new RespR(selfCarTradeService.findByPageAndTrade(page, selfCarTrade));
  61. return respR;
  62. }catch (Exception e){
  63. e.printStackTrace();
  64. return new RespR(false,e.getMessage());
  65. }
  66. }
  67. /**
  68. * 分页查询所有发票信息
  69. *
  70. * @param page 参数集
  71. * @return 交易信息
  72. */
  73. @PostMapping("/findSelfCarInvoices")
  74. @ApiOperation(value="分页查询自有车发票信息", notes="分页查询自有车发票信息")
  75. @LoginRequired
  76. public RespR findSelfCarInvoices(Page page, SelfCarInvoice selfCarInvoice) {
  77. try {
  78. RespR respR = new RespR(selfCarInvoiceService.findByPageAndInvoice(page, selfCarInvoice));
  79. return respR;
  80. }catch (Exception e){
  81. e.printStackTrace();
  82. return new RespR(false,e.getMessage());
  83. }
  84. }
  85. /**
  86. * 分页查询自有车计费信息
  87. *
  88. * @param page 参数集
  89. * @return 用户集合
  90. */
  91. @PostMapping("/findSelfcarCalculateInfo")
  92. @ApiOperation(value="分页查询自有车计费信息", notes="分页查询自有车计费信息")
  93. @LoginRequired
  94. public RespR findSelfcarCalculateInfo(Page page, SelfCarCalculateInfor carCalculateInfor) {
  95. try {
  96. RespR respR = new RespR(selfCarCalculateInfoService.findByPageAndCalculateInfor(page, carCalculateInfor));
  97. return respR;
  98. }catch (Exception e){
  99. e.printStackTrace();
  100. return new RespR(false,e.getMessage());
  101. }
  102. }
  103. }