feat():添加导出接口
parent
b2c38d4c11
commit
13b2163d57
|
@ -7,9 +7,15 @@ import com.muyu.cloud.pay.domain.req.OrderCustomerUpdReq;
|
|||
import com.muyu.cloud.pay.domain.resp.CustomerResp;
|
||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.system.domain.SysRole;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -47,7 +53,9 @@ public class OrderPayCustomerController {
|
|||
public Result<List<CustomerResp>> selectList(@Validated @RequestBody CustomerListReq customerListReq) {
|
||||
|
||||
return Result.success(orderPayCustomerService.selectList(customerListReq));
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 获取所有客户的
|
||||
|
@ -68,93 +76,116 @@ public class OrderPayCustomerController {
|
|||
|
||||
/**
|
||||
* 添加客户
|
||||
*
|
||||
* @param orderCustomerAddReq 客户信息
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "客户信息添加",description = "添加支付平台客户信息,添加成功后才可以使用支付类的产品")
|
||||
public Result<String> save(@Validated @RequestBody OrderCustomerAddReq orderCustomerAddReq){
|
||||
@Operation(summary = "客户信息添加", description = "添加支付平台客户信息,添加成功后才可以使用支付类的产品")
|
||||
public Result<String> save(@Validated @RequestBody OrderCustomerAddReq orderCustomerAddReq) {
|
||||
|
||||
orderPayCustomerService.save(OrderPayCustomer.addBuild(orderCustomerAddReq));
|
||||
|
||||
|
||||
orderPayCustomerService.save(OrderPayCustomer.addBuild(orderCustomerAddReq));
|
||||
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
* @param orderCustomerId 修改客户请求信息
|
||||
*
|
||||
* @param orderCustomerId 修改客户请求信息
|
||||
* @param orderCustomerUpdReq
|
||||
* @return 修改结果
|
||||
* @return 修改结果
|
||||
*/
|
||||
|
||||
|
||||
@PutMapping("/{orderCustomerId}")
|
||||
@Operation(summary = "客户信息修改",description = "通过ID修改客户信息")
|
||||
public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultValue = "1",description = "修改客户信息需要依据的唯一条件")
|
||||
@PathVariable("orderCustomerId") Long orderCustomerId,
|
||||
@RequestBody @Validated OrderCustomerUpdReq orderCustomerUpdReq){
|
||||
@PutMapping("/{orderCustomerId}")
|
||||
@Operation(summary = "客户信息修改", description = "通过ID修改客户信息")
|
||||
public Result<String> update(@Schema(title = "客户ID", type = "Long", defaultValue = "1", description = "修改客户信息需要依据的唯一条件")
|
||||
@PathVariable("orderCustomerId") Long orderCustomerId,
|
||||
@RequestBody @Validated OrderCustomerUpdReq orderCustomerUpdReq) {
|
||||
|
||||
|
||||
orderPayCustomerService.updateById( OrderPayCustomer.updBuild(orderCustomerUpdReq,() -> orderCustomerId));
|
||||
return Result.success(null,"操作成功");
|
||||
}
|
||||
orderPayCustomerService.updateById(OrderPayCustomer.updBuild(orderCustomerUpdReq, () -> orderCustomerId));
|
||||
|
||||
|
||||
return Result.success(null, "操作成功");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
*
|
||||
* @param orderCustomerId 删除客户请求信息
|
||||
* @return 删除结果
|
||||
*/
|
||||
|
||||
@DeleteMapping("/{orderCustomerId}")
|
||||
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息,七天内有支付支付记录的客户,不可进行删除")
|
||||
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||
@Operation(summary = "客户信息删除", description = "通过ID删除客户信息,七天内有支付支付记录的客户,不可进行删除")
|
||||
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId) {
|
||||
orderPayCustomerService.removeById(orderCustomerId);
|
||||
return Result.success(null,"操作成功");
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID获取客户
|
||||
*
|
||||
* @param orderCustomerId ID
|
||||
* @return 客户信息
|
||||
*/
|
||||
|
||||
@GetMapping("/{orderCustomerId}")
|
||||
@Operation(summary = "通过ID获取客户信息",description = "通过ID获取客户信息")
|
||||
public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||
log.info("");
|
||||
return Result.success(orderPayCustomerService.getById(orderCustomerId),"操作成功");
|
||||
@Operation(summary = "通过ID获取客户信息", description = "通过ID获取客户信息")
|
||||
public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId) {
|
||||
log.info("");
|
||||
return Result.success(orderPayCustomerService.getById(orderCustomerId), "操作成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过ID禁用客户
|
||||
*
|
||||
* @param orderCustomerId ID
|
||||
* @return 禁用结果
|
||||
*/
|
||||
|
||||
@GetMapping("/disable/{orderCustomerId}")
|
||||
@Operation(summary = "通过ID禁用客户",description = "通过ID禁用客户,禁用之后禁止调用支付相关接口")
|
||||
public Result<OrderPayCustomer> disable(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||
this.orderPayCustomerService.disable(orderCustomerId);
|
||||
return Result.success(null,"操作成功");
|
||||
@Operation(summary = "通过ID禁用客户", description = "通过ID禁用客户,禁用之后禁止调用支付相关接口")
|
||||
public Result<OrderPayCustomer> disable(@PathVariable("orderCustomerId") Long orderCustomerId) {
|
||||
this.orderPayCustomerService.disable(orderCustomerId);
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过ID启动客户
|
||||
*
|
||||
* @param orderCustomerId ID
|
||||
* @return 启动结果
|
||||
*/
|
||||
|
||||
@GetMapping("/enable/{orderCustomerId}")
|
||||
@Operation(summary = "通过ID启动客户",description = "通过ID启用被禁止的客户,启用后可以调用支付相关的接口")
|
||||
public Result<OrderPayCustomer> enable(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||
this.orderPayCustomerService.enable(orderCustomerId);
|
||||
return Result.success(null,"操作成功");
|
||||
@Operation(summary = "通过ID启动客户", description = "通过ID启用被禁止的客户,启用后可以调用支付相关的接口")
|
||||
public Result<OrderPayCustomer> enable(@PathVariable("orderCustomerId") Long orderCustomerId) {
|
||||
this.orderPayCustomerService.enable(orderCustomerId);
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("pay:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export (HttpServletResponse response, @Validated @RequestBody CustomerListReq customerListReq) {
|
||||
List<CustomerResp> customerRespList = orderPayCustomerService.selectList(customerListReq);
|
||||
ExcelUtil<CustomerResp> util = new ExcelUtil<CustomerResp>(CustomerResp.class);
|
||||
util.exportExcel(response, customerRespList, "角色数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public class OrderPayInfoServiceImpl extends ServiceImpl<OrderPayInfoMapper, Ord
|
|||
|
||||
LambdaQueryWrapper<OrderPayInfo> orderPayInfoQueryWrapper = new LambdaQueryWrapper<>();
|
||||
orderPayInfoQueryWrapper.eq(OrderPayInfo::getAppCode,appCode);
|
||||
|
||||
orderPayInfoQueryWrapper.orderBy(true, false, OrderPayInfo::getCreateTime);
|
||||
orderPayInfoQueryWrapper.last("limit "+limit);
|
||||
|
||||
|
|
Loading…
Reference in New Issue