From d591b33e521f4a086862489ac7d8317c1802cf9f Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 31 May 2023 10:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/v1/LedgerController.java | 3 +- .../v1/TradeProfitSharingController.java | 8 ++--- .../model/request/RequestSeparateModel.java | 18 ++++++++++-- .../request/RequestSeparateRecvDataModel.java | 29 ------------------- 4 files changed, 21 insertions(+), 37 deletions(-) delete mode 100644 service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateRecvDataModel.java diff --git a/open-api/src/main/java/com/api/controller/v1/LedgerController.java b/open-api/src/main/java/com/api/controller/v1/LedgerController.java index e2f0b3c..0efaace 100644 --- a/open-api/src/main/java/com/api/controller/v1/LedgerController.java +++ b/open-api/src/main/java/com/api/controller/v1/LedgerController.java @@ -13,7 +13,6 @@ import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrderProfitSharing; import com.hfkj.model.ResponseData; import com.hfkj.openapi.v1.model.request.RequestSeparateModel; -import com.hfkj.openapi.v1.model.request.RequestSeparateRecvDataModel; import com.hfkj.openapi.v1.model.request.RequestTradePreorderModel; import com.hfkj.openapi.v1.service.OpenApiTradeOrderService; import com.hfkj.openapi.v1.utils.SignatureUtil; @@ -94,4 +93,6 @@ public class LedgerController { } } + + } diff --git a/open-api/src/main/java/com/api/controller/v1/TradeProfitSharingController.java b/open-api/src/main/java/com/api/controller/v1/TradeProfitSharingController.java index 9244915..fdacbc8 100644 --- a/open-api/src/main/java/com/api/controller/v1/TradeProfitSharingController.java +++ b/open-api/src/main/java/com/api/controller/v1/TradeProfitSharingController.java @@ -67,9 +67,9 @@ public class TradeProfitSharingController { /* if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) { throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, ""); }*/ -/* if (body.getRecvDatas() == null || body.getRecvDatas().size() == 0) { + if (body.getRecvDatas() == null || body.getRecvDatas().size() == 0) { throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未填写分账接收方"); - }*/ + } // 分账流水号重复校验 if (tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(body.getOutSeparateNo()) != null) { throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "分账流水号重复"); @@ -93,7 +93,7 @@ public class TradeProfitSharingController { if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) { throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "商户分账权限未开通"); } -/* for (RequestSeparateRecvDataModel recvData : body.getRecvDatas()) { + for (RequestSeparateModel.RequestSeparateRecvDataModel recvData : body.getRecvDatas()) { // 查询接收方信息 BsMer recvMer = merService.getMer(recvData.getRecvMerchantNo()); if (recvMer == null) { @@ -102,7 +102,7 @@ public class TradeProfitSharingController { if (!recvMer.getMerStatus().equals(MerStatusEnum.status1.getNumber())) { throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "接收方状态异常"); } - }*/ + } diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateModel.java index 7ce1d63..83c58c4 100644 --- a/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateModel.java +++ b/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateModel.java @@ -7,7 +7,7 @@ import javax.validation.Valid; import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMin; import javax.validation.constraints.NotBlank; -import java.math.BigDecimal; +import javax.validation.constraints.NotNull; import java.util.List; /** @@ -50,9 +50,9 @@ public class RequestSeparateModel { /** * 分账接收方 */ - @NotBlank(message = "分账接收方必填项") + @NotNull(message = "分账接收方必填项") @Valid - private RequestSeparateRecvDataModel recvDatas; + private List recvDatas; /** * 签名参数 @@ -61,4 +61,16 @@ public class RequestSeparateModel { private String sign; + @Data + public static class RequestSeparateRecvDataModel { + @NotBlank(message = "分账接收方商户号必填项") + private String recvMerchantNo; + + + @NotBlank(message = "分账接收方金额必填项") + @DecimalMin(value = "0.01", message = "分账总金额最小0.01") + @DecimalMax(value = "9999999", message = "分账总金额最大9999999") + private String separateAmount; + + } } diff --git a/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateRecvDataModel.java b/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateRecvDataModel.java deleted file mode 100644 index 4935d82..0000000 --- a/service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateRecvDataModel.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hfkj.openapi.v1.model.request; - -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotBlank; -import java.math.BigDecimal; - -/** - * 请求分账接收方 - * @className: RequestSeparateModel - * @author: HuRui - * @date: 2023/5/26 - **/ -@Data -public class RequestSeparateRecvDataModel { - - @NotBlank(message = "分账接收方商户号必填项") - private String recvMerchantNo; - - - @NotBlank(message = "分账接收方金额必填项") - @DecimalMin(value = "0.01", message = "分账总金额最小0.01") - @DecimalMax(value = "9999999", message = "分账总金额最大9999999") - private String separateAmount; - -}