feat(): 增加客户列表接口
parent
1b72299ce0
commit
f454280017
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.cloud.pay.domain.req;
|
||||
|
||||
import com.muyu.common.core.validation.custom.IsSystemYesNo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -36,6 +37,7 @@ public class CustomerListReq {
|
|||
* 是否开启
|
||||
*/
|
||||
@Schema(name = "是否开启",type = "String",description = "客户状态,Y是开启,N是关闭")
|
||||
@IsSystemYesNo
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
package com.muyu.cloud.pay.controller;
|
||||
|
||||
import com.muyu.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.muyu.cloud.pay.domain.req.CustomerListReq;
|
||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
|
@ -14,9 +25,27 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/customer")
|
||||
@RequiredArgsConstructor //只有参数为空或者是not null才会生成
|
||||
@Tag(name = "客户控制层",description = "进行客户管理,查看等相关操作")
|
||||
public class OrderPayCustomerServiceController {
|
||||
|
||||
/**
|
||||
* 客户业务层
|
||||
*/
|
||||
private final OrderPayCustomerService orderPayCustomerService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的客户
|
||||
* @param customerListReq 客户列表请求参数
|
||||
* @return 客户列表
|
||||
*/
|
||||
@RequestMapping(path = "/list",method = RequestMethod.POST)
|
||||
@Operation(summary = "查看客户",description = "根据客户的名称,编码,是否开启等可以进行客户的筛选")
|
||||
public Result<List<OrderPayCustomer>> selectList(
|
||||
@Valid @RequestBody CustomerListReq customerListReq){
|
||||
return Result.success(orderPayCustomerService.selectList(customerListReq));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@ package com.muyu.cloud.pay.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.muyu.cloud.pay.domain.req.CustomerListReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
|
@ -11,4 +14,12 @@ import com.muyu.cloud.pay.domain.OrderPayCustomer;
|
|||
* @Date:2024/7/31 20:01
|
||||
*/
|
||||
public interface OrderPayCustomerService extends IService<OrderPayCustomer>{
|
||||
|
||||
/**
|
||||
* 查询客户集合
|
||||
* @param customerListReq 请求参数
|
||||
* @return 客户集合
|
||||
*/
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package com.muyu.cloud.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.muyu.cloud.pay.domain.req.CustomerListReq;
|
||||
import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
|
||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* @Author:liuxinyue
|
||||
* @Package:com.muyu.cloud.pay.service.impl
|
||||
|
@ -18,8 +20,33 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class OrderPayCustomerServiceImpl
|
||||
extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer>
|
||||
implements OrderPayCustomerService {
|
||||
implements OrderPayCustomerService{
|
||||
|
||||
/**
|
||||
* 查询客户集合
|
||||
* @param customerListReq 请求参数
|
||||
* @return 客户集合
|
||||
*/
|
||||
@Override
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq) {
|
||||
|
||||
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppName()),
|
||||
OrderPayCustomer::getAppName,customerListReq.getAppName()
|
||||
);
|
||||
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppCode()),
|
||||
OrderPayCustomer::getAppCode,customerListReq.getAppCode()
|
||||
);
|
||||
|
||||
queryWrapper.eq(
|
||||
StringUtils.isNotEmpty(customerListReq.getStatus()),
|
||||
OrderPayCustomer::getStatus,customerListReq.getStatus()
|
||||
);
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue