新增返回结果集对象
parent
47760cc94c
commit
3b632641d7
|
@ -43,4 +43,6 @@ public class OrderPayCustomer extends BaseEntity {
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.bwie.cloud.pay.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:zhangzhihao
|
||||||
|
* @name:CustomerListResp
|
||||||
|
* @Date:2024/8/1 9:57
|
||||||
|
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "客户信息相应对象",description = "负责客户信息查询的结果")
|
||||||
|
public class CustomerResp {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Schema(description = "客户ID",defaultValue = "1",type = "Long")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务/客户名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "客户名称",defaultValue = "1",type = "String")
|
||||||
|
private String appName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务/客户编码
|
||||||
|
*/
|
||||||
|
@Schema(description = "客户编码",defaultValue = "1",type = "String")
|
||||||
|
private String appCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "客户状态,同数据字典-系统是否",defaultValue = "Y",type = "String")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建人",defaultValue = "zzh",type = "String")
|
||||||
|
private String createBy;
|
||||||
|
@JsonFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "创建时间",defaultValue = "2024-8-1 10:04:23",type = "Date")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库对象构建返回结果对象
|
||||||
|
* @param orderPayCustomer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static CustomerResp customerBuild(OrderPayCustomer orderPayCustomer) {
|
||||||
|
return CustomerResp.builder()
|
||||||
|
.id(orderPayCustomer.getId())
|
||||||
|
.appName(orderPayCustomer.getAppName())
|
||||||
|
.appCode(orderPayCustomer.getAppCode())
|
||||||
|
.status(orderPayCustomer.getStatus())
|
||||||
|
.createBy(orderPayCustomer.getCreateBy())
|
||||||
|
.createTime(orderPayCustomer.getCreateTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.bwie.cloud.pay.controller;
|
||||||
|
|
||||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||||
|
import com.bwie.cloud.pay.domain.resp.CustomerResp;
|
||||||
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
@ -39,7 +40,7 @@ public class OrderPayCustomerController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@Operation(summary = "查看看护",description = "根据客户的名称,编码,是否开启等可以运行客户的筛选")
|
@Operation(summary = "查看看护",description = "根据客户的名称,编码,是否开启等可以运行客户的筛选")
|
||||||
public Result<List<OrderPayCustomer>> selectList(@Validated @RequestBody CustomerListReq customerListReq){
|
public Result<List<CustomerResp>> selectList(@Validated @RequestBody CustomerListReq customerListReq){
|
||||||
|
|
||||||
return Result.success(orderPayCustomerService.selectList(customerListReq));
|
return Result.success(orderPayCustomerService.selectList(customerListReq));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.bwie.cloud.pay.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||||
|
import com.bwie.cloud.pay.domain.resp.CustomerResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -19,5 +20,5 @@ public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
|
||||||
* @param customerListReq
|
* @param customerListReq
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq);
|
public List<CustomerResp> selectList(CustomerListReq customerListReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||||
|
import com.bwie.cloud.pay.domain.resp.CustomerResp;
|
||||||
import com.bwie.cloud.pay.mapper.OrderPayCustomerMapper;
|
import com.bwie.cloud.pay.mapper.OrderPayCustomerMapper;
|
||||||
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +27,7 @@ public class OrderPayCustomerServiceImpl
|
||||||
extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer>
|
extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer>
|
||||||
implements OrderPayCustomerService {
|
implements OrderPayCustomerService {
|
||||||
@Override
|
@Override
|
||||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq) {
|
public List<CustomerResp> selectList(CustomerListReq customerListReq) {
|
||||||
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(
|
queryWrapper.like(
|
||||||
StringUtils.isNotEmpty(customerListReq.getAppName()),
|
StringUtils.isNotEmpty(customerListReq.getAppName()),
|
||||||
|
@ -39,7 +42,13 @@ public class OrderPayCustomerServiceImpl
|
||||||
OrderPayCustomer::getStatus,customerListReq.getStatus()
|
OrderPayCustomer::getStatus,customerListReq.getStatus()
|
||||||
);
|
);
|
||||||
|
|
||||||
return this.list(queryWrapper);
|
List<OrderPayCustomer> orderPayCustomerList = this.list(queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return orderPayCustomerList.stream()
|
||||||
|
.map(CustomerResp::customerBuild)
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue