master
parent
e97158962c
commit
2719a27415
|
@ -26,6 +26,9 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
//import io.swagger.v3.oas.annotations.media.Schema;
|
||||
//import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
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 jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
@Data
|
||||
//@Tag(name = "客户列表")
|
||||
@Tag(name = "客户列表")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
@ -19,18 +23,21 @@ public class CustomerListReq {
|
|||
/**
|
||||
* 服务/客户名称
|
||||
*/
|
||||
// @Schema(name = "服务/客户名称",type = "String" , description = "客户的名称")
|
||||
@Schema(name = "服务/客户名称",type = "String" , description = "客户的名称")
|
||||
private String appName;
|
||||
|
||||
/**
|
||||
* 服务/客户编号
|
||||
*/
|
||||
@Schema(name = "服务/客户编码",type = "String" , description = "客户的编码")
|
||||
private String appCode;
|
||||
|
||||
/**
|
||||
* 是否开启
|
||||
*/
|
||||
private Integer status;
|
||||
@Schema(name = "是否开启",type = "String" , description = "客户状态,Y是对,N关闭")
|
||||
@IsSystemYesNo
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,41 @@
|
|||
package com.muyu.pay.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.OrderPayCustomer;
|
||||
import com.muyu.domain.req.CustomerListReq;
|
||||
import com.muyu.pay.service.OrderPayCustomerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/customer")
|
||||
@Log4j2
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "客户控制层",description = "进行客户管理,查看等相关操作")
|
||||
public class OrderPayCustomerController {
|
||||
|
||||
private final OrderPayCustomerService orderPayCustomerService;
|
||||
|
||||
/**
|
||||
* 查询所有用户
|
||||
*/
|
||||
@RequestMapping(path = "/list",method = RequestMethod.POST)
|
||||
@Operation(summary = "查看客户" , description = "根据客户的名称,编码,是否开启等可以镜像客户的筛选")
|
||||
public Result<List<OrderPayCustomer>> selectList(@Validated @RequestBody CustomerListReq customerListReq){
|
||||
return Result.success(
|
||||
orderPayCustomerService.selectList(customerListReq)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,14 @@ package com.muyu.pay.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.OrderPayCustomer;
|
||||
import com.muyu.domain.req.CustomerListReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
|
||||
|
||||
/**
|
||||
* 客户列表
|
||||
*/
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,40 @@
|
|||
package com.muyu.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.domain.OrderPayCustomer;
|
||||
import com.muyu.domain.req.CustomerListReq;
|
||||
import com.muyu.pay.controller.OrderPayCustomerController;
|
||||
import com.muyu.pay.mapper.OrderPayCustomerMapper;
|
||||
import com.muyu.pay.service.OrderPayCustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMapper ,OrderPayCustomer>
|
||||
implements OrderPayCustomerService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq) {
|
||||
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppCode()),
|
||||
OrderPayCustomer::getAppCode, customerListReq.getAppCode()
|
||||
);
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppName()),
|
||||
OrderPayCustomer::getAppName, customerListReq.getAppName()
|
||||
);
|
||||
queryWrapper.eq(
|
||||
StringUtils.isNotEmpty(customerListReq.getStatus()),
|
||||
OrderPayCustomer::getStatus, customerListReq.getStatus()
|
||||
);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue