diff --git a/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/enums/AllocDetailResultEnum.java b/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/enums/AllocDetailResultEnum.java index 46360a84..93d2368a 100644 --- a/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/enums/AllocDetailResultEnum.java +++ b/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/enums/AllocDetailResultEnum.java @@ -5,6 +5,7 @@ import lombok.Getter; /** * 分账明细处理结果 + * 字典: alloc_detail_result * @author xxm * @since 2024/4/16 */ diff --git a/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/result/allocation/order/AllocDetailResult.java b/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/result/allocation/order/AllocDetailResult.java index ec3b7c79..8809c4bb 100644 --- a/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/result/allocation/order/AllocDetailResult.java +++ b/daxpay-single/daxpay-single-core/src/main/java/org/dromara/daxpay/core/result/allocation/order/AllocDetailResult.java @@ -6,6 +6,7 @@ import lombok.experimental.Accessors; import org.dromara.daxpay.core.enums.AllocDetailResultEnum; import org.dromara.daxpay.core.enums.AllocReceiverTypeEnum; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -23,11 +24,11 @@ public class AllocDetailResult { /** 分账金额 */ @Schema(description = "分账金额") - private Integer amount; + private BigDecimal amount; /** 分账比例 */ - @Schema(description = "分账比例(万分之多少)") - private Integer rate; + @Schema(description = "分账比例(百分之多少)") + private BigDecimal rate; /** * 分账接收方类型 diff --git a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/controller/allocation/AllocOrderController.java b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/controller/allocation/AllocOrderController.java index c31705da..9548e80b 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/controller/allocation/AllocOrderController.java +++ b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/controller/allocation/AllocOrderController.java @@ -5,6 +5,7 @@ import cn.bootx.platform.core.rest.Res; import cn.bootx.platform.core.rest.param.PageParam; import cn.bootx.platform.core.rest.result.PageResult; import cn.bootx.platform.core.rest.result.Result; +import com.fhs.core.trans.anno.TransMethodResult; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -43,6 +44,7 @@ public class AllocOrderController { return Res.ok(queryService.page(pageParam,param)); } + @TransMethodResult @Operation(summary = "分账明细列表") @GetMapping("/detail/findAll") public Result> findDetailsByOrderId(Long orderId){ @@ -55,6 +57,7 @@ public class AllocOrderController { return Res.ok(queryService.findById(id)); } + @TransMethodResult @Operation(summary = "查询明细详情") @GetMapping("/detail/findById") public Result findDetailById(Long id){ diff --git a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/entity/allocation/receiver/AllocReceiver.java b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/entity/allocation/receiver/AllocReceiver.java index 8b6f3295..727600f9 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/entity/allocation/receiver/AllocReceiver.java +++ b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/entity/allocation/receiver/AllocReceiver.java @@ -2,6 +2,7 @@ package org.dromara.daxpay.service.entity.allocation.receiver; import cn.bootx.platform.common.mybatisplus.function.ToResult; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.experimental.FieldNameConstants; import org.dromara.daxpay.core.enums.AllocReceiverTypeEnum; import org.dromara.daxpay.core.enums.AllocRelationTypeEnum; import org.dromara.daxpay.core.enums.ChannelEnum; @@ -21,6 +22,7 @@ import org.dromara.daxpay.service.result.allocation.receiver.AllocReceiverVo; */ @EqualsAndHashCode(callSuper = true) @Data +@FieldNameConstants @Accessors(chain = true) @TableName("pay_alloc_receiver") public class AllocReceiver extends MchAppBaseEntity implements ToResult { diff --git a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocDetailVo.java b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocDetailVo.java index 23355f49..95e08aea 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocDetailVo.java +++ b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocDetailVo.java @@ -1,13 +1,19 @@ package org.dromara.daxpay.service.result.allocation.order; +import com.fhs.core.trans.anno.Trans; +import com.fhs.core.trans.constant.TransType; +import com.fhs.core.trans.vo.TransPojo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import lombok.experimental.FieldNameConstants; import org.dromara.daxpay.core.enums.AllocDetailResultEnum; import org.dromara.daxpay.core.enums.AllocReceiverTypeEnum; import org.dromara.daxpay.core.result.MchAppResult; +import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -17,20 +23,32 @@ import java.time.LocalDateTime; */ @EqualsAndHashCode(callSuper = true) @Data +@FieldNameConstants @Accessors(chain = true) @Schema(title = "分账订单明细") -public class AllocDetailVo extends MchAppResult { +public class AllocDetailVo extends MchAppResult implements TransPojo { + + /** 分账订单ID */ + @Schema(description = "分账订单ID") + private Long allocationId; @Schema(description = "分账接收方编号") private String receiverNo; + @Trans(type = TransType.SIMPLE, target = AllocReceiver.class, fields = AllocReceiver.Fields.name, ref = AllocDetailVo.Fields.name) + @Schema(description = "分账接收方Id") + private Long receiverId; + + @Schema(description = "名称") + private String name; + /** 分账金额 */ @Schema(description = "分账金额") - private Integer amount; + private BigDecimal amount; /** 分账比例 */ - @Schema(description = "分账比例(万分之多少)") - private Integer rate; + @Schema(description = "分账比例(百分之多少)") + private BigDecimal rate; /** * 分账接收方类型 diff --git a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocOrderVo.java b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocOrderVo.java index b4749571..1181e60c 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocOrderVo.java +++ b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/result/allocation/order/AllocOrderVo.java @@ -9,8 +9,8 @@ import org.dromara.daxpay.core.enums.AllocationStatusEnum; import org.dromara.daxpay.core.enums.ChannelEnum; import org.dromara.daxpay.core.result.MchAppResult; +import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.List; /** * 分账订单 @@ -66,7 +66,7 @@ public class AllocOrderVo extends MchAppResult { * 总分账金额 */ @Schema(description = "总分账金额") - private Integer amount; + private BigDecimal amount; /** * 分账描述 @@ -104,8 +104,4 @@ public class AllocOrderVo extends MchAppResult { @Schema(description = "分账订单完成时间") private LocalDateTime finishTime; - /** 分账明细 */ - @Schema(description = "分账明细") - private List details; - } diff --git a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/service/allocation/order/AllocOrderService.java b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/service/allocation/order/AllocOrderService.java index c0ecfcf5..4a191e58 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/service/allocation/order/AllocOrderService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/org/dromara/daxpay/service/service/allocation/order/AllocOrderService.java @@ -65,10 +65,10 @@ public class AllocOrderService { AllocDetail detail = new AllocDetail() .setReceiverNo(o.getReceiverNo()) - .setReceiverId(o.getId()) + .setReceiverId(o.getReceiverId()) .setAmount(amount) .setResult(AllocDetailResultEnum.PENDING.getCode()) - .setRate(amount) + .setRate(o.getRate()) .setReceiverType(o.getReceiverType()) .setReceiverName(o.getReceiverName()) .setReceiverAccount(o.getReceiverAccount());