| | |
| | | */ |
| | | @PostMapping(path = "termActiveCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, BindingResult bindingResult) { |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.activeOrReissueTermCard(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termRecharge(@RequestBody @Valid DtoRecharge po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.addRecharge(po, null); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termReportLoss(@RequestBody @Valid DtoLoss po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reportLoss(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termUnlock(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.unlock(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termReissue(@RequestBody @Valid DtoReissue po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reissue(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termCancel(@RequestBody @Valid DtoCancel po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.cancel(po); |
| | |
| | | |
| | | /** |
| | | * 补扣 |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "termRepay", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getRepayMorny() == null || po.getRepayMorny() <= 0) { |
| | |
| | | |
| | | /** |
| | | * 返还 |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "supplement", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getSupplementMoney() == null || po.getSupplementMoney() <= 0) { |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termCallBack(@RequestBody @Valid DtoCallBack po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.callBack(po); |
| | |
| | | |
| | | /** |
| | | * 读取卡信息 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表,终端应用程序使用 |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页水卡记录", description = "返回一页水卡数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页水卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回一页水卡数据(BaseResponse.content:QueryResultVo[{}])", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * 获取已挂失的水卡列表,终端应用程序使用 |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页已挂失水卡记录", description = "返回一页已挂失水卡数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页已挂失水卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回一页已挂失水卡数据(BaseResponse.content:QueryResultVo[{}])", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getlostcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取卡信息 |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "根据水卡编号获取卡信息", description = "根据水卡编号获取对应的卡信息") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回卡信息(BaseResponse.content:VoCardByClientNum)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCardByClientNum.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回卡信息(BaseResponse.content:VoCardByClientNum)", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCardByClientNum.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcardbycardnum") |
| | | @SsoAop() |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建管理卡 |
| | | * |
| | | * @param dto 创建管理卡参数 |
| | | * @param bindingResult 参数验证结果 |
| | | * @return 创建结果 |
| | | */ |
| | | @Operation(summary = "创建管理卡", description = "创建充值机用管理卡") |
| | | @ApiResponses(value = { |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "创建成功,返回订单号", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE) }) |
| | | }) |
| | | @PostMapping(path = "createManagementCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<String> createManagementCard(@RequestBody @Valid CreateManagementCardDto dto, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 验证卡片类型是否在允许范围内 |
| | | if (dto.getCardType() < 2 || dto.getCardType() > 10) { |
| | | return BaseResponseUtils.buildErrorMsg("卡片类型必须在2-10之间"); |
| | | } |
| | | |
| | | // 检查卡片地址是否已存在 |
| | | if (cardSv.isCardAddrExists(dto.getCardAddr())) { |
| | | return BaseResponseUtils.buildErrorMsg("该卡片地址已存在,请使用其他地址"); |
| | | } |
| | | |
| | | Map<String, Object> result = cardSv.createManagementCard(dto); |
| | | if ((Boolean) result.get("success")) { |
| | | return BaseResponseUtils.buildSuccess((String) result.get("content")); |
| | | } else { |
| | | return BaseResponseUtils.buildErrorMsg(result.get("msg").toString()); |
| | | } |
| | | } |
| | | } |