From 854e951894deaa54b26590f8575474ed7a5f5b88 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 02 七月 2024 10:32:30 +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 | 108 ++++++++++++++++++++++--------------------------------
1 files changed, 44 insertions(+), 64 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 404e0c2..7ff5012 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
@@ -38,7 +38,6 @@
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
-import java.time.format.DateTimeFormatter;
import java.util.*;
/**
@@ -311,15 +310,6 @@
* @param bindingResult
* @return
*/
- @Operation(summary = "鍏呭��", description = "鍏呭��")
- @ApiResponses(value = {
- @ApiResponse(
- responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
- description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
- content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = Boolean.class))}
- )
- })
@PostMapping(path = "recharge", consumes = MediaType.APPLICATION_JSON_VALUE)
@Transactional(rollbackFor = Exception.class)
@SsoAop()
@@ -336,20 +326,10 @@
* @param bindingResult
* @return
*/
- @Operation(summary = "娣诲姞娉ㄩ攢璁板綍", description = "娣诲姞娉ㄩ攢璁板綍")
- @ApiResponses(value = {
- @ApiResponse(
- responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
- description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
- content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = Boolean.class))}
- )
- })
@PostMapping(path = "cancel", consumes = MediaType.APPLICATION_JSON_VALUE)
@Transactional(rollbackFor = Exception.class)
@SsoAop()
public BaseResponse<Boolean> add_cancel(@RequestBody @Valid DtoCancel po, BindingResult bindingResult){
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(bindingResult != null && bindingResult.hasErrors()){
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
@@ -373,10 +353,17 @@
Long operator = po.getOperator();
Date cancelTime = new Date();
+ // 濡傛灉浼犲叆鐨勬槸10浣嶇殑姘村崱缂栧彿锛屽崌涓�17浣嶆按鍗$紪鍙�
+ String cardNumS = String.valueOf(cardNum).trim();
+ if(cardNumS.length() == 10) {
+ cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
+ }
+ cardNum = Long.valueOf(cardNumS);
+
// 楠岃瘉姘村崱鐘舵�佹槸鍚︽敮鎸佸綋鍓嶆搷浣�
String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(cardNum)).orElse("");
if(stateName.length() == 0 || !stateName.equals("姝e父")) {
- return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
+ return BaseResponseUtils.buildErrorMsg(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
}
/**
@@ -384,7 +371,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientId = Long.parseLong(map.get("clientId").toString());
@@ -402,7 +389,7 @@
seClientCard.setLastoper(LastOperateENUM.CANCEL.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -421,7 +408,7 @@
Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CANCELL_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CANCEL_FAIL_WRITE_CANCELL_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
@@ -529,15 +516,6 @@
* @param bindingResult
* @return
*/
- @Operation(summary = "娣诲姞鍐叉璁板綍", description = "娣诲姞鍐叉璁板綍")
- @ApiResponses(value = {
- @ApiResponse(
- responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
- description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
- content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = Boolean.class))}
- )
- })
@PostMapping(path = "reversal", consumes = MediaType.APPLICATION_JSON_VALUE)
@Transactional(rollbackFor = Exception.class)
@SsoAop()
@@ -565,10 +543,17 @@
Long operator = po.getOperator();
Date reversalTime = new Date();
+ // 濡傛灉浼犲叆鐨勬槸10浣嶇殑姘村崱缂栧彿锛屽崌涓�17浣嶆按鍗$紪鍙�
+ String cardNumS = String.valueOf(cardNum).trim();
+ if(cardNumS.length() == 10) {
+ cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
+ }
+ cardNum = Long.valueOf(cardNumS);
+
// 楠岃瘉姘村崱鐘舵�佹槸鍚︽敮鎸佸綋鍓嶆搷浣�
String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(cardNum)).orElse("");
if(stateName.length() == 0 || !stateName.equals("姝e父")) {
- return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
+ return BaseResponseUtils.buildErrorMsg(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
}
/**
@@ -576,7 +561,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientId = Long.parseLong(map.get("clientId").toString());
@@ -593,7 +578,7 @@
seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -610,7 +595,7 @@
seCardOperate.setOperateDt(reversalTime);
Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.REVERSAL_FAIL_WRITE_REVERSAL_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.REVERSAL_FAIL_WRITE_REVERSAL_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
@@ -622,15 +607,6 @@
* @param bindingResult
* @return
*/
- @Operation(summary = "琛ユ墸", description = "琛ユ墸")
- @ApiResponses(value = {
- @ApiResponse(
- responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
- description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
- content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = Boolean.class))}
- )
- })
@PostMapping(path = "refund", consumes = MediaType.APPLICATION_JSON_VALUE)
@Transactional(rollbackFor = Exception.class)
@SsoAop()
@@ -658,10 +634,17 @@
Long operator = po.getOperator();
Date refundTime = new Date();
+ // 濡傛灉浼犲叆鐨勬槸10浣嶇殑姘村崱缂栧彿锛屽崌涓�17浣嶆按鍗$紪鍙�
+ String cardNumS = String.valueOf(cardNum).trim();
+ if(cardNumS.length() == 10) {
+ cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
+ }
+ cardNum = Long.valueOf(cardNumS);
+
// 楠岃瘉姘村崱鐘舵�佹槸鍚︽敮鎸佸綋鍓嶆搷浣�
String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(cardNum)).orElse("");
if(stateName.length() == 0 || !stateName.equals("姝e父")) {
- return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
+ return BaseResponseUtils.buildErrorMsg(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
}
/**
@@ -669,7 +652,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientId = Long.parseLong(map.get("clientId").toString());
@@ -686,7 +669,7 @@
seClientCard.setLastoper(LastOperateENUM.REFUND.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -704,7 +687,7 @@
seCardOperate.setOperateDt(refundTime);
Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.REFUND_FAIL_WRITE_REFUND_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.REFUND_FAIL_WRITE_REFUND_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
@@ -716,20 +699,10 @@
* @param bindingResult
* @return
*/
- @Operation(summary = "娣诲姞瑙i攣璁板綍", description = "娣诲姞瑙i攣璁板綍")
- @ApiResponses(value = {
- @ApiResponse(
- responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
- description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
- content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = Boolean.class))}
- )
- })
@PostMapping(path = "unlock", consumes = MediaType.APPLICATION_JSON_VALUE)
@Transactional(rollbackFor = Exception.class)
@SsoAop()
public BaseResponse<Boolean> add_unlock(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult){
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(bindingResult != null && bindingResult.hasErrors()){
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
@@ -751,9 +724,16 @@
Long operator = po.getOperator();
Date unlockTime = new Date();
+ // 濡傛灉浼犲叆鐨勬槸10浣嶇殑姘村崱缂栧彿锛屽崌涓�17浣嶆按鍗$紪鍙�
+ String cardNumS = String.valueOf(cardNum).trim();
+ if(cardNumS.length() == 10) {
+ cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
+ }
+ cardNum = Long.valueOf(cardNumS);
+
// 鍒ゆ柇褰撳墠姘村崱鏄惁涓烘寕澶辩姸鎬佷笖鏈ˉ鍗★紝浠呭凡缁忔寕澶卞叾鏈ˉ鍗$殑鍙互瑙i攣
if(!cardOperateSv.isLostAndUnreplaced(cardNum)) {
- return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage());
}
/**
@@ -761,7 +741,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientId = Long.parseLong(map.get("clientId").toString());
@@ -779,7 +759,7 @@
seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -795,7 +775,7 @@
seCardOperate.setOperateDt(unlockTime);
Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_UNLOCK_ERROR.getMessage());
+ return BaseResponseUtils.buildErrorMsg(SellResultCode.UNLOCK_FAIL_WRITE_UNLOCK_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
--
Gitblit v1.8.0