提交代码

yy_dev
胡锐 2 years ago
parent bace495d9c
commit d591b33e52
  1. 3
      open-api/src/main/java/com/api/controller/v1/LedgerController.java
  2. 8
      open-api/src/main/java/com/api/controller/v1/TradeProfitSharingController.java
  3. 18
      service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateModel.java
  4. 29
      service/src/main/java/com/hfkj/openapi/v1/model/request/RequestSeparateRecvDataModel.java

@ -13,7 +13,6 @@ import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderProfitSharing; import com.hfkj.entity.BsTradeOrderProfitSharing;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.openapi.v1.model.request.RequestSeparateModel; 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.model.request.RequestTradePreorderModel;
import com.hfkj.openapi.v1.service.OpenApiTradeOrderService; import com.hfkj.openapi.v1.service.OpenApiTradeOrderService;
import com.hfkj.openapi.v1.utils.SignatureUtil; import com.hfkj.openapi.v1.utils.SignatureUtil;
@ -94,4 +93,6 @@ public class LedgerController {
} }
} }
} }

@ -67,9 +67,9 @@ public class TradeProfitSharingController {
/* if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) { /* if (!SignatureUtil.checkSign(body.getSign(), body, merKeyService.getKeyByMerNo(body.getMerchantNo()))) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, ""); 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, "未填写分账接收方"); throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "未填写分账接收方");
}*/ }
// 分账流水号重复校验 // 分账流水号重复校验
if (tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(body.getOutSeparateNo()) != null) { if (tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(body.getOutSeparateNo()) != null) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "分账流水号重复"); throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "分账流水号重复");
@ -93,7 +93,7 @@ public class TradeProfitSharingController {
if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) { if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "商户分账权限未开通"); 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()); BsMer recvMer = merService.getMer(recvData.getRecvMerchantNo());
if (recvMer == null) { if (recvMer == null) {
@ -102,7 +102,7 @@ public class TradeProfitSharingController {
if (!recvMer.getMerStatus().equals(MerStatusEnum.status1.getNumber())) { if (!recvMer.getMerStatus().equals(MerStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "接收方状态异常"); throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_COMMON, "接收方状态异常");
} }
}*/ }

@ -7,7 +7,7 @@ import javax.validation.Valid;
import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin; import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.math.BigDecimal; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
/** /**
@ -50,9 +50,9 @@ public class RequestSeparateModel {
/** /**
* 分账接收方 * 分账接收方
*/ */
@NotBlank(message = "分账接收方必填项") @NotNull(message = "分账接收方必填项")
@Valid @Valid
private RequestSeparateRecvDataModel recvDatas; private List<RequestSeparateRecvDataModel> recvDatas;
/** /**
* 签名参数 * 签名参数
@ -61,4 +61,16 @@ public class RequestSeparateModel {
private String sign; 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;
}
} }

@ -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;
}
Loading…
Cancel
Save