mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-13 21:30:25 +00:00
feat: 分账订单创建问题修复和返回字段优化
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 分账明细处理结果
|
||||
* 字典: alloc_detail_result
|
||||
* @author xxm
|
||||
* @since 2024/4/16
|
||||
*/
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
* 分账接收方类型
|
||||
|
@@ -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<List<AllocDetailVo>> findDetailsByOrderId(Long orderId){
|
||||
@@ -55,6 +57,7 @@ public class AllocOrderController {
|
||||
return Res.ok(queryService.findById(id));
|
||||
}
|
||||
|
||||
@TransMethodResult
|
||||
@Operation(summary = "查询明细详情")
|
||||
@GetMapping("/detail/findById")
|
||||
public Result<AllocDetailVo> findDetailById(Long id){
|
||||
|
@@ -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<AllocReceiverVo> {
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
* 分账接收方类型
|
||||
|
@@ -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<AllocDetailVo> details;
|
||||
|
||||
}
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user