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.domain.resp.CustomerResp;
|
||||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||||
import com.muyu.common.core.domain.Result;
|
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.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -47,7 +53,9 @@ public class OrderPayCustomerController {
|
||||||
public Result<List<CustomerResp>> 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));
|
||||||
};
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有客户的
|
* 获取所有客户的
|
||||||
|
@ -68,6 +76,7 @@ public class OrderPayCustomerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加客户
|
* 添加客户
|
||||||
|
*
|
||||||
* @param orderCustomerAddReq 客户信息
|
* @param orderCustomerAddReq 客户信息
|
||||||
* @return 添加结果
|
* @return 添加结果
|
||||||
*/
|
*/
|
||||||
|
@ -77,12 +86,16 @@ public class OrderPayCustomerController {
|
||||||
|
|
||||||
orderPayCustomerService.save(OrderPayCustomer.addBuild(orderCustomerAddReq));
|
orderPayCustomerService.save(OrderPayCustomer.addBuild(orderCustomerAddReq));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改客户
|
* 修改客户
|
||||||
|
*
|
||||||
* @param orderCustomerId 修改客户请求信息
|
* @param orderCustomerId 修改客户请求信息
|
||||||
* @param orderCustomerUpdReq
|
* @param orderCustomerUpdReq
|
||||||
* @return 修改结果
|
* @return 修改结果
|
||||||
|
@ -97,11 +110,16 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
|
|
||||||
|
|
||||||
orderPayCustomerService.updateById(OrderPayCustomer.updBuild(orderCustomerUpdReq, () -> orderCustomerId));
|
orderPayCustomerService.updateById(OrderPayCustomer.updBuild(orderCustomerUpdReq, () -> orderCustomerId));
|
||||||
|
|
||||||
|
|
||||||
return Result.success(null, "操作成功");
|
return Result.success(null, "操作成功");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除客户
|
* 删除客户
|
||||||
|
*
|
||||||
* @param orderCustomerId 删除客户请求信息
|
* @param orderCustomerId 删除客户请求信息
|
||||||
* @return 删除结果
|
* @return 删除结果
|
||||||
*/
|
*/
|
||||||
|
@ -115,6 +133,7 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID获取客户
|
* 通过ID获取客户
|
||||||
|
*
|
||||||
* @param orderCustomerId ID
|
* @param orderCustomerId ID
|
||||||
* @return 客户信息
|
* @return 客户信息
|
||||||
*/
|
*/
|
||||||
|
@ -129,6 +148,7 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID禁用客户
|
* 通过ID禁用客户
|
||||||
|
*
|
||||||
* @param orderCustomerId ID
|
* @param orderCustomerId ID
|
||||||
* @return 禁用结果
|
* @return 禁用结果
|
||||||
*/
|
*/
|
||||||
|
@ -141,9 +161,9 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID启动客户
|
* 通过ID启动客户
|
||||||
|
*
|
||||||
* @param orderCustomerId ID
|
* @param orderCustomerId ID
|
||||||
* @return 启动结果
|
* @return 启动结果
|
||||||
*/
|
*/
|
||||||
|
@ -156,5 +176,16 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@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<>();
|
LambdaQueryWrapper<OrderPayInfo> orderPayInfoQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
orderPayInfoQueryWrapper.eq(OrderPayInfo::getAppCode,appCode);
|
orderPayInfoQueryWrapper.eq(OrderPayInfo::getAppCode,appCode);
|
||||||
|
|
||||||
orderPayInfoQueryWrapper.orderBy(true, false, OrderPayInfo::getCreateTime);
|
orderPayInfoQueryWrapper.orderBy(true, false, OrderPayInfo::getCreateTime);
|
||||||
orderPayInfoQueryWrapper.last("limit "+limit);
|
orderPayInfoQueryWrapper.last("limit "+limit);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue