| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Api(tags = "公司额度分配记录") |
| | | @RestController |
| | |
| | | public R<IPage<TCompanyAllocateRecord>> page(@RequestBody CompanyAllocateRecordQueryDTO query) { |
| | | return R.ok(companyAllocateRecordService.selectRecordPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 内部接口:写入消费流水(VIN码充电结算调用,按订单号+变更类型幂等) |
| | | */ |
| | | @ApiOperation(value = "内部-写入消费流水", tags = {"内部调用"}) |
| | | @PostMapping("/inner/record-consume") |
| | | public R<Boolean> recordConsume(@RequestParam("companyId") Integer companyId, |
| | | @RequestParam("userType") Integer userType, |
| | | @RequestParam("userInfo") String userInfo, |
| | | @RequestParam(value = "userName", required = false) String userName, |
| | | @RequestParam("beforeBalance") BigDecimal beforeBalance, |
| | | @RequestParam("amount") BigDecimal amount, |
| | | @RequestParam("chargingOrderCode") String chargingOrderCode, |
| | | @RequestParam(value = "remark", required = false) String remark) { |
| | | try { |
| | | return R.ok(companyAllocateRecordService.recordConsume(companyId, userType, userInfo, userName, |
| | | beforeBalance, amount, chargingOrderCode, remark)); |
| | | } catch (RuntimeException ex) { |
| | | logger.error("写入消费流水失败:orderCode={}", chargingOrderCode, ex); |
| | | return R.fail("写入消费流水失败:" + ex.getMessage()); |
| | | } |
| | | } |
| | | } |