From d2f5964f2286f45a3dd9a8b05d325b29d9a0a8ab Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期四, 25 一月 2024 14:30:10 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 113 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java index 94f9336..b412230 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java @@ -3,13 +3,22 @@ import com.dy.common.aop.SsoAop; import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoBa.BaClient; import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; import com.dy.pipIrrGlobal.pojoSe.SeClientCard; import com.dy.pipIrrGlobal.util.Constant; +import com.dy.pipIrrGlobal.voSe.VoActiveCard; +import com.dy.pipIrrGlobal.voSe.VoActiveCardNew; +import com.dy.pipIrrGlobal.voSe.VoRecharge; import com.dy.pipIrrSell.cardOperate.converter.RechargeDtoMapper; import com.dy.pipIrrSell.cardOperate.dto.*; import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; +import com.dy.pipIrrSell.cardOperate.qo.QoActiveCard; +import com.dy.pipIrrSell.cardOperate.qo.QoRecharge; +import com.dy.pipIrrSell.cardOperate.qo.QoTransaction; +import com.dy.pipIrrSell.cardOperate.qo.QoTransactionStatistics; import com.dy.pipIrrSell.clientCard.CardStateENUM; import com.dy.pipIrrSell.clientCard.ClientCardSv; import com.dy.pipIrrSell.clientCard.LastOperateENUM; @@ -26,10 +35,7 @@ import org.springframework.http.MediaType; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.BindingResult; -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.RestController; +import org.springframework.web.bind.annotation.*; import java.time.format.DateTimeFormatter; import java.util.*; @@ -364,11 +370,13 @@ /** * 娣诲姞娉ㄩ攢璁板綍 + * 鏀粯鏂瑰紡涓虹幇閲� */ SeCardOperate seCardOperate = new SeCardOperate(); seCardOperate.setCardId(cardId); seCardOperate.setClientId(clientId); seCardOperate.setTradeAmount(-refund); + seCardOperate.setPaymentId(1L); seCardOperate.setOperateType(OperateTypeENUM.CANCEL.getCode()); seCardOperate.setRemarks(remarks); seCardOperate.setOperator(operator); @@ -729,4 +737,105 @@ return BaseResponseUtils.buildSuccess(true) ; } + + @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 = VoRecharge.class))} + ) + }) + @GetMapping(path = "/getRecharges") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){ + try { + QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(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 = BaClient.class))} + ) + }) + @GetMapping(path = "getTransactions") + @SsoAop() + public BaseResponse<Map> getOperates(QoTransaction vo){ + try { + Map res = cardOperateSv.getTransactions(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鏌ヨ浜ゆ槗璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + + @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 = BaClient.class))} + ) + }) + @GetMapping(path = "getStatistics") + @SsoAop() + public BaseResponse<Map> getStatistics(QoTransactionStatistics vo){ + try { + Map res = cardOperateSv.getTransactionStatistics(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 = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getActiveCards") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoActiveCardNew>>> get(QoActiveCard vo){ + try { + QueryResultVo<List<VoActiveCardNew>> res = cardOperateSv.getActiveCards(vo); + if(res.itemTotal == 0) { + return BaseResponseUtils.buildFail(SellResultCode.No_ActiveCards.getMessage()); + } + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇寮�鍗¤褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + } -- Gitblit v1.8.0