mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-14 05:40:25 +00:00
style(allocation): 分账接口联调和优化
This commit is contained in:
@@ -9,9 +9,9 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.core.param.allocation.transaction.AllocFinishParam;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocDetailResult;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocOrderResult;
|
||||
import org.dromara.daxpay.service.param.order.allocation.AllocOrderQuery;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocDetailVo;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocOrderVo;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocationService;
|
||||
import org.dromara.daxpay.service.service.allocation.order.AllocOrderQueryService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -39,25 +39,25 @@ public class AllocOrderController {
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@GetMapping("/page")
|
||||
public Result<PageResult<AllocOrderResult>> page(PageParam pageParam, AllocOrderQuery param){
|
||||
public Result<PageResult<AllocOrderVo>> page(PageParam pageParam, AllocOrderQuery param){
|
||||
return Res.ok(queryService.page(pageParam,param));
|
||||
}
|
||||
|
||||
@Operation(summary = "分账明细列表")
|
||||
@GetMapping("/detail/findAll")
|
||||
public Result<List<AllocDetailResult>> findDetailsByOrderId(Long orderId){
|
||||
public Result<List<AllocDetailVo>> findDetailsByOrderId(Long orderId){
|
||||
return Res.ok(queryService.findDetailsByOrderId(orderId));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询详情")
|
||||
@GetMapping("/findById")
|
||||
public Result<AllocOrderResult> findById(Long id){
|
||||
public Result<AllocOrderVo> findById(Long id){
|
||||
return Res.ok(queryService.findById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询明细详情")
|
||||
@GetMapping("/detail/findById")
|
||||
public Result<AllocDetailResult> findDetailById(Long id){
|
||||
public Result<AllocDetailVo> findDetailById(Long id){
|
||||
return Res.ok(queryService.findDetailById(id));
|
||||
}
|
||||
|
||||
|
@@ -7,9 +7,9 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.AllocDetailResultEnum;
|
||||
import org.dromara.daxpay.core.enums.AllocReceiverTypeEnum;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocDetailResult;
|
||||
import org.dromara.daxpay.service.common.entity.MchAppBaseEntity;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocOrderConvert;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocDetailVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -23,7 +23,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("pay_alloc_detail")
|
||||
public class AllocDetail extends MchAppBaseEntity implements ToResult<AllocDetailResult> {
|
||||
public class AllocDetail extends MchAppBaseEntity implements ToResult<AllocDetailVo> {
|
||||
|
||||
/** 分账订单ID */
|
||||
private Long allocationId;
|
||||
@@ -71,7 +71,7 @@ public class AllocDetail extends MchAppBaseEntity implements ToResult<AllocDetai
|
||||
* 转换
|
||||
*/
|
||||
@Override
|
||||
public AllocDetailResult toResult() {
|
||||
return AllocOrderConvert.CONVERT.toResult(this);
|
||||
public AllocDetailVo toResult() {
|
||||
return AllocOrderConvert.CONVERT.toVo(this);
|
||||
}
|
||||
}
|
||||
|
@@ -10,9 +10,9 @@ import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.AllocationResultEnum;
|
||||
import org.dromara.daxpay.core.enums.AllocationStatusEnum;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocOrderResult;
|
||||
import org.dromara.daxpay.service.common.entity.MchAppBaseEntity;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocOrderConvert;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocOrderVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("pay_alloc_order")
|
||||
public class AllocOrder extends MchAppBaseEntity implements ToResult<AllocOrderResult> {
|
||||
public class AllocOrder extends MchAppBaseEntity implements ToResult<AllocOrderVo> {
|
||||
|
||||
/** 分账单号 */
|
||||
private String allocNo;
|
||||
@@ -106,7 +106,7 @@ public class AllocOrder extends MchAppBaseEntity implements ToResult<AllocOrderR
|
||||
* 转换
|
||||
*/
|
||||
@Override
|
||||
public AllocOrderResult toResult() {
|
||||
return AllocOrderConvert.CONVERT.toResult(this);
|
||||
public AllocOrderVo toResult() {
|
||||
return AllocOrderConvert.CONVERT.toVo(this);
|
||||
}
|
||||
}
|
||||
|
@@ -6,13 +6,13 @@ import cn.bootx.platform.core.rest.param.PageParam;
|
||||
import cn.bootx.platform.core.rest.result.PageResult;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocDetailResult;
|
||||
import org.dromara.daxpay.core.result.allocation.order.AllocOrderResult;
|
||||
import org.dromara.daxpay.service.dao.allocation.transaction.AllocDetailManager;
|
||||
import org.dromara.daxpay.service.dao.allocation.transaction.AllocOrderManager;
|
||||
import org.dromara.daxpay.service.entity.allocation.transaction.AllocDetail;
|
||||
import org.dromara.daxpay.service.entity.allocation.transaction.AllocOrder;
|
||||
import org.dromara.daxpay.service.param.order.allocation.AllocOrderQuery;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocDetailVo;
|
||||
import org.dromara.daxpay.service.result.allocation.order.AllocOrderVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -34,28 +34,28 @@ public class AllocOrderQueryService {
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public PageResult<AllocOrderResult> page(PageParam pageParam, AllocOrderQuery param){
|
||||
public PageResult<AllocOrderVo> page(PageParam pageParam, AllocOrderQuery param){
|
||||
return MpUtil.toPageResult(allocationOrderManager.page(pageParam, param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
public AllocOrderResult findById(Long id) {
|
||||
public AllocOrderVo findById(Long id) {
|
||||
return allocationOrderManager.findById(id).map(AllocOrder::toResult).orElseThrow(() -> new DataNotExistException("分账订单不存在"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单明细列表
|
||||
*/
|
||||
public List<AllocDetailResult> findDetailsByOrderId(Long orderId){
|
||||
public List<AllocDetailVo> findDetailsByOrderId(Long orderId){
|
||||
return MpUtil.toListResult(allocOrderDetailManager.findAllByOrderId(orderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单明细详情
|
||||
*/
|
||||
public AllocDetailResult findDetailById(Long id){
|
||||
public AllocDetailVo findDetailById(Long id){
|
||||
return allocOrderDetailManager.findById(id).map(AllocDetail::toResult).orElseThrow(() -> new DataNotExistException("分账订单明细不存在"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user