|  |  | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoTermActiveCard; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoTermCard; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoTermClient; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoTermCommon; | 
 |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.*; | 
 |  |  | import com.dy.pipIrrTerminal.card.dto.*; | 
 |  |  | import com.dy.pipIrrTerminal.card.qo.QoCards; | 
 |  |  | import com.dy.pipIrrTerminal.card.qo.QoLostCards; | 
 |  |  | import io.swagger.v3.oas.annotations.Operation; | 
 |  |  | import io.swagger.v3.oas.annotations.media.Content; | 
 |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
 |  |  | import io.swagger.v3.oas.annotations.responses.ApiResponse; | 
 |  |  | import io.swagger.v3.oas.annotations.responses.ApiResponses; | 
 |  |  | import jakarta.validation.Valid; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 补扣 | 
 |  |  |      * @param po | 
 |  |  |      * @param bindingResult | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "termRepay", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { | 
 |  |  |         if (bindingResult != null && bindingResult.hasErrors()) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if(po.getRepayMorny()  == null || po.getRepayMorny() <= 0) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("补扣金额不能为空且需大于0"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if(po.getRepayMorny() > po.getBalance()) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("补扣金额不能大于补扣前余额"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Map map_result = cardSv.repay(po); | 
 |  |  |         if (map_result.get("success").equals(false)) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString()); | 
 |  |  |         } | 
 |  |  |         return BaseResponseUtils.buildSuccess(map_result.get("content")); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 返还 | 
 |  |  |      * @param po | 
 |  |  |      * @param bindingResult | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "supplement", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { | 
 |  |  |         if (bindingResult != null && bindingResult.hasErrors()) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if(po.getSupplementMoney() == null || po.getSupplementMoney() <= 0) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("返还金额不能为空且需大于0"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Map map_result = cardSv.supplement(po); | 
 |  |  |         if (map_result.get("success").equals(false)) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString()); | 
 |  |  |         } | 
 |  |  |         return BaseResponseUtils.buildSuccess(map_result.get("content")); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 操作执行回调 | 
 |  |  |      * | 
 |  |  |      * @param po | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据指定条件获取水卡列表,终端应用程序使用 | 
 |  |  |      * @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))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @GetMapping(path = "getcards") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){ | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoCards>> res = cardSv.getCards(vo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("查询水卡异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()) ; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取已挂失的水卡列表,终端应用程序使用 | 
 |  |  |      * @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))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @GetMapping(path = "getlostcards") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoCards>>> getLostCards(QoLostCards vo){ | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoCards>> res = cardSv.getLostCards(vo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("查询已挂失水卡异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()) ; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |