| | |
| | | List<OrderInvoiceList> myOrderInvoiceList = orderInvoiceService.getMyOrderInvoiceList(query); |
| | | return AjaxResult.success(myOrderInvoiceList); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/cancelMyOrderInvoice/{id}") |
| | | @ApiOperation(value = "取消我的开票申请", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<String> cancelMyOrderInvoice(@PathVariable Long id){ |
| | | TOrderInvoice orderInvoice = orderInvoiceService.getById(id); |
| | | if (orderInvoice == null) { |
| | | return AjaxResult.error("开票申请不存在"); |
| | | } |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderInvoice.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | if (!Integer.valueOf(1).equals(orderInvoice.getStatus())) { |
| | | return AjaxResult.error("当前开票申请不能取消"); |
| | | } |
| | | orderInvoice.setStatus(4); |
| | | orderInvoice.setCancelTime(LocalDateTime.now()); |
| | | orderInvoiceService.updateById(orderInvoice); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "获取开票记录详情", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<MyOrderInvoiceInfo> getMyOrderInvoiceInfo(@PathVariable String id){ |
| | | TOrderInvoice orderInvoice = orderInvoiceService.getById(id); |
| | | if (orderInvoice == null) { |
| | | return AjaxResult.error("开票申请不存在"); |
| | | } |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderInvoice.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |