From 027317737976773e87b0e2a3bdf2030d4946ec48 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 21 十二月 2023 14:55:36 +0800 Subject: [PATCH] 用户登录后,返回用户值对象中增加用户id --- pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java | 20 +++++++------------- 1 files changed, 7 insertions(+), 13 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java index 0066355..fe123c5 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java @@ -11,6 +11,7 @@ import com.dy.pipIrrGlobal.voSe.VoRecharge; import com.dy.pipIrrSell.clientCard.ClientCardSv; import com.dy.pipIrrSell.clientCard.LastOperateENUM; +import com.dy.pipIrrSell.result.SellResultCode; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -47,7 +48,7 @@ ) }) @GetMapping(path = "/getRecharges", consumes = MediaType.APPLICATION_JSON_VALUE) - @SsoAop("-1") + @SsoAop() public BaseResponse<QueryResultVo<List<VoRecharge>>> get(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟json鏁版嵁", required = true) QueryVo vo){ try { QueryResultVo<List<VoRecharge>> res = rechargeSv.getRecharges(vo); @@ -69,7 +70,7 @@ }) @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) - @SsoAop("-1")//@SsoAop(power = "-1") + @SsoAop() public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid DtoRecharge po, @Parameter(hidden = true) BindingResult bindingResult){ if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); @@ -98,10 +99,7 @@ * rechargeTime 鍏呭�兼椂闂� */ Long cardId = 0L; - //String cardAddr = po.getCardAddr(); - //Long clientId = po.getClientId(); String cardNum = po.getCardNum(); - //String clientNum = po.getClientNum(); String clientNum = ""; Float money = po.getMoney(); Float amount = po.getAmount(); @@ -118,7 +116,7 @@ */ Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); if(map == null || map.size() <= 0) { - return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪"); + return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); } cardId = Long.parseLong(map.get("cardId").toString()); clientNum = map.get("clientNum").toString(); @@ -134,7 +132,7 @@ seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ()); Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); if(rec_updateClientCard == 0) { - return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍐滄埛鍗′慨鏀瑰紓甯�"); + return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); } /** @@ -145,8 +143,6 @@ * 娣诲姞鍏呭�艰褰� */ SeRecharge seRecharge = new SeRecharge(); - //seRecharge.setCardid(cardId); - //seRecharge.setClientid(clientId); seRecharge.setCardnum(cardNum); seRecharge.setClientnum(clientNum); seRecharge.setMoney(money); @@ -160,15 +156,13 @@ seRecharge.setOperatedt(rechargeTime); Long rec = Optional.ofNullable(rechargeSv.add(seRecharge)).orElse(0L); if(rec == 0) { - return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍏呭�艰褰曞啓鍏ュ紓甯�"); + return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage()); } /** * 娣诲姞琛ュ崱鍘嗗彶璁板綍 */ SeRechargeHistory seRechargeHistory = new SeRechargeHistory(); - //seRechargeHistory.setCardid(cardId); - //seRechargeHistory.setClientid(clientId); seRechargeHistory.setCardnum(cardNum); seRechargeHistory.setClientnum(clientNum); seRechargeHistory.setMoney(money); @@ -183,7 +177,7 @@ Long rec_history = Optional.ofNullable(rechargeSv.addHistory(seRechargeHistory)).orElse(0L); if(rec_history == 0) { - return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍏呭�煎巻鍙茶褰曞啓鍏ュ紓甯�"); + return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_RECHARGE_HISTORY_ERROR.getMessage()); } return BaseResponseUtils.buildSuccess(true) ; -- Gitblit v1.8.0