feat():增加了客户接口

master
Cui YongXing 2024-08-01 10:08:59 +08:00
parent 9e2e415f75
commit 2f356008f8
6 changed files with 134 additions and 7 deletions

View File

@ -17,19 +17,19 @@ public class CustomerListReq {
/**
* /
*/
@Schema(description = "客户名称 为微服务名称",type = "Long")
@Schema( defaultValue ="客户名称1", description = "客户名称 为微服务名称",type = "Long")
private String appName;
/**
* /
*/
@Schema(description = "客户编吗 为微服务名称",type = "String")
@Schema(defaultValue = "customer_code",description = "客户编吗 为微服务名称",type = "String")
private String appCode;
/**
*
*
*/
@Schema(description = "客户状态 Y是开启 N是关闭",type = "String")
@Schema(defaultValue = "Y",description = "客户状态 Y是开启 N是关闭",type = "String")
@IsSystemYesNo
private String status;

View File

@ -0,0 +1,71 @@
package com.muyu.pay.common.domain.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.pay.common.domain.OrderPayCustomer;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Tag(name = "客户信息响应对象",description = "负责客户信息查询的响应结果")
public class CustomerResp {
@Schema(description = "客户ID",defaultValue = "1",type = "Long")
private Long id;
/**
* /
*/
@Schema(description = "客户名称",defaultValue = "商品服务",type = "String")
private String appName;
/**
* /
*/
@Schema(description = "客户编号",defaultValue = "cloud_order",type = "String")
private String appCode;
/**
*
*/
@Schema(description = "客户描述",defaultValue = "------",type = "String")
private String appDesc;
/**
*
*/
@Schema(description = "客户状态:同数据字典",defaultValue = "Y",type = "String")
private String status;
@Schema(description = "创建人",defaultValue = "大壮",type = "String")
private String createBy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间",defaultValue = "2024-7-31 21:16:45",type = "Date")
private Date createTime;
public static CustomerResp customerBuild(OrderPayCustomer orderPayCustomer){
return CustomerResp.builder()
.id(orderPayCustomer.getId())
.appName(orderPayCustomer.getAppCode())
.appCode(orderPayCustomer.getAppCode())
.appDesc(orderPayCustomer.getAppDesc())
.status(orderPayCustomer.getStatus())
.createBy(orderPayCustomer.getCreateBy())
.createTime(orderPayCustomer.getCreateTime())
.build();
}
}

View File

@ -3,6 +3,7 @@ package com.muyu.pay.server.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.pay.common.domain.OrderPayCustomer;
import com.muyu.pay.common.domain.req.CustomerListReq;
import com.muyu.pay.common.domain.resp.CustomerResp;
import com.muyu.pay.server.service.OrderPayCustomerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -28,7 +29,7 @@ public class OrderPayCustomerController {
@PostMapping("/list")
@Operation(summary = "查看客户",description = "根据客户名称 编号 状态 查询")
public Result<List<OrderPayCustomer>> selectList(
public Result<List<CustomerResp>> selectList(
@Validated @RequestBody CustomerListReq req){
return Result.success(orderPayCustomerService.selectList(req));
}

View File

@ -3,12 +3,13 @@ package com.muyu.pay.server.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.pay.common.domain.OrderPayCustomer;
import com.muyu.pay.common.domain.req.CustomerListReq;
import com.muyu.pay.common.domain.resp.CustomerResp;
import java.util.List;
public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
public List<OrderPayCustomer> selectList(CustomerListReq req);
public List<CustomerResp> selectList(CustomerListReq req);
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.pay.common.domain.OrderPayCustomer;
import com.muyu.pay.common.domain.req.CustomerListReq;
import com.muyu.pay.common.domain.resp.CustomerResp;
import com.muyu.pay.server.mapper.OrderPayCustomerMapper;
import com.muyu.pay.server.service.OrderPayCustomerService;
import lombok.extern.log4j.Log4j2;
@ -19,7 +20,7 @@ public class OrderPayCustomerServiceImpl
implements OrderPayCustomerService {
@Override
public List<OrderPayCustomer> selectList(CustomerListReq req) {
public List<CustomerResp> selectList(CustomerListReq req) {
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(
StringUtils.isNotEmpty(req.getAppName()),
@ -36,6 +37,8 @@ public class OrderPayCustomerServiceImpl
OrderPayCustomer::getStatus,
req.getStatus()
);
return this.list(queryWrapper);
return this.list(queryWrapper).stream().map(CustomerResp::customerBuild).toList();
}
}

View File

@ -0,0 +1,51 @@
CREATE TABLE order_pay_info(
`id` INT AUTO_INCREMENT COMMENT '主键' ,
`app_name` VARCHAR(16) NOT NULL COMMENT '客户名称' ,
`app_code` VARCHAR(16) COMMENT '客户编号' ,
`cus_order_number` VARCHAR(32) COMMENT '客户单号' ,
`pay_order_number` VARCHAR(32) COMMENT '支付单号' ,
`channel_type` VARCHAR(64) COMMENT '渠道商类型' ,
`channel_order_number` VARCHAR(32) COMMENT '渠道商单号' ,
`status` VARCHAR(32) COMMENT '支付单状态;0 新建 1 待支付 2. 支付中 3 支付成功 4 支付失败 5 支付超时' ,
`price` DECIMAL(24,6) COMMENT '价格' ,
`update_time` DATETIME COMMENT '更新时间' ,
`create_by` bigint COMMENT '创建人' ,
`create_time` DATETIME COMMENT '创建时间' ,
`update_by` bigint COMMENT '更新人' ,
`remark` VARCHAR(64) COMMENT '备注' ,
PRIMARY KEY (id)
) COMMENT = '订单支付信息';
CREATE TABLE order_pay_customer(
`id` INT AUTO_INCREMENT COMMENT '主键' ,
`app_name` VARCHAR(16) NOT NULL COMMENT '服务/客户名称' ,
`app_code` VARCHAR(16) COMMENT '服务/客户编号' ,
`app_desc` TEXT COMMENT '客户描述' ,
`status` VARCHAR(32) COMMENT '是否开启' ,
`create_by` bigint COMMENT '创建人' ,
`create_time` DATETIME COMMENT '创建时间' ,
`update_by` bigint COMMENT '更新人' ,
`update_time` DATETIME COMMENT '更新时间' ,
`remark` VARCHAR(64) COMMENT '备注' ,
PRIMARY KEY (id)
) COMMENT = '支付单客户';
CREATE TABLE order_pay_refund(
`id` INT AUTO_INCREMENT COMMENT '主键' ,
`cus_order_number` VARCHAR(32) NOT NULL COMMENT '客户退单号' ,
`pay_order_number` VARCHAR(32) NOT NULL COMMENT '支付退单号' ,
`channel_order_number` VARCHAR(64) NOT NULL COMMENT '渠道商退单号' ,
`price` DECIMAL(24,6) NOT NULL COMMENT '退款金额' ,
`pay_info_number` VARCHAR(32) COMMENT '支付单号' ,
`to_account_time` DATETIME COMMENT '到账时间' ,
`status` VARCHAR(32) COMMENT '状态' ,
`create_by` bigint COMMENT '创建人' ,
`create_time` DATETIME COMMENT '创建时间' ,
`update_by` bigint COMMENT '更新人' ,
`update_time` DATETIME COMMENT '更新时间' ,
`remark` VARCHAR(64) COMMENT '备注' ,
PRIMARY KEY (id)
) COMMENT = '订单退款';