云函数数据查询

This commit is contained in:
DB 2024-01-10 11:57:34 +08:00
parent 3ef12d64fc
commit 0508482e0c
12 changed files with 826 additions and 39 deletions

View File

@ -96,24 +96,6 @@ public class CloudCourseStudentDto {
@SerializedName("_periodid")
private String cardId;
/**
* 总余额
*/
@SerializedName("allAmount")
private BigDecimal deductionTotalBalance;
/**
* 总课时
*/
@SerializedName("allNumber")
private Long deductionTotalPeriod;
/**
* 总课消
*/
@SerializedName("number")
private Long classTotalDepletion;
/**
* 状态操作时间
*/

View File

@ -0,0 +1,40 @@
package com.cpop.api.cloudDb.core.dto;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author DB
* @version 1.0.0
* @since 2024-01-09 18:26
*/
@Data
public class CloudCourseStudentListDto {
/**
* 课程学员列表
*/
@SerializedName("list")
List<CloudCourseStudentDto> records;
/**
* 总余额
*/
@SerializedName("allAmount")
private BigDecimal deductionTotalBalance;
/**
* 总课时
*/
@SerializedName("allNumber")
private Long deductionTotalPeriod;
/**
* 总课消
*/
@SerializedName("allPeriodIncome")
private Long classTotalDepletion;
}

View File

@ -31,6 +31,23 @@ public class CloudCustomerDto {
@SerializedName("name")
private String customerName;
/**
* 学员名
*/
private String studentName;
/**
* 顾问
*/
@SerializedName("staffName")
private String counselor;
/**
* 生效课卡数
*/
@SerializedName("periodNum")
private String activeCardNum;
/**
* 手机号
*/
@ -51,5 +68,5 @@ public class CloudCustomerDto {
* 顾问id
*/
@SerializedName("_staffId")
private String counselor;
private String counselorId;
}

View File

@ -26,7 +26,8 @@ public class CloudStudentDto {
/**
* 学员名
*/
private String name;
@SerializedName("name")
private String studentName;
/**
* 生日

View File

@ -0,0 +1,134 @@
package com.cpop.api.cloudDb.handler;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
import com.cpop.api.cloudDb.core.dto.CloudClassCardDto;
import com.cpop.api.cloudDb.core.dto.CloudClassCardRecordDto;
import com.cpop.api.cloudDb.core.dto.CloudClassStudentDto;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.exception.UtilException;
import com.mybatisflex.core.paginate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.List;
/**
* 云课卡工具类
* @author DB
* @version 1.0.0
* @since 2024-01-10 11:08
*/
@Component
public class CloudClassCardHandler {
@Autowired
private RestTemplate restTemplate;
/**
* 获取课卡分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param customerId 客户id
* @param cardId 课卡id
* @param cardType 课卡类型
* @param cardStatus 课卡状态
* @return Page<CloudCustomerDto>
*/
public Page<CloudClassCardDto> getClassCardPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String customerId, String cardId, String cardType, Integer cardStatus) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "period");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(customerId)) {
jsonBody.put("customerId", customerId);
}
if (StringUtils.isNotBlank(cardId)) {
jsonBody.put("cardId", cardId);
}
if (StringUtils.isNotBlank(cardType)) {
jsonBody.put("cardType", cardType);
}
if (cardStatus != null) {
jsonBody.put("cardStatus", cardStatus);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
Page<CloudClassCardDto> page = Page.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudClassCardDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudClassCardDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
/**
* 获取课卡记录分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param customerId 客户id
* @param cardId 课卡id
* @return Page<CloudCustomerDto>
*/
public Page<CloudClassCardRecordDto> getClassCardRecordPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String customerId, String cardId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "periodLog");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(customerId)) {
jsonBody.put("customerId", customerId);
}
if (StringUtils.isNotBlank(cardId)) {
jsonBody.put("cardId", cardId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
Page<CloudClassCardRecordDto> page = Page.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudClassCardRecordDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudClassCardRecordDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
}

View File

@ -0,0 +1,118 @@
package com.cpop.api.cloudDb.handler;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
import com.cpop.api.cloudDb.core.dto.CloudClassDto;
import com.cpop.api.cloudDb.core.dto.CloudClassStudentDto;
import com.cpop.api.cloudDb.core.dto.CloudCourseDto;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.exception.UtilException;
import com.mybatisflex.core.paginate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.List;
/**
* 云班级工具类
* @author DB
* @version 1.0.0
* @since 2024-01-10 10:05
*/
@Component
public class CloudClassHandler {
@Autowired
private RestTemplate restTemplate;
/**
* 获取班级分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param classId 云班级id
* @return Page<CloudCustomerDto>
*/
public Page<CloudClassDto> getClassPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String classId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "classes");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(classId)){
jsonBody.put("classId", classId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
Page<CloudClassDto> page = Page.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudClassDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudClassDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
/**
* 获取班级学员分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param classId 云班级id
* @return Page<CloudCustomerDto>
*/
public Page<CloudClassStudentDto> getClassStudentPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String classId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "classesStudent");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(classId)){
jsonBody.put("classId", classId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
Page<CloudClassStudentDto> page = Page.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudClassStudentDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudClassStudentDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
}

View File

@ -3,14 +3,18 @@ package com.cpop.api.cloudDb.handler;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
import com.cpop.api.cloudDb.core.dto.CloudCourseDto;
import com.cpop.api.cloudDb.core.dto.CloudCourseStudentDto;
import com.cpop.api.cloudDb.core.dto.CloudCourseStudentListDto;
import com.cpop.api.cloudDb.core.dto.CloudCustomerDto;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.exception.UtilException;
import com.mybatisflex.core.paginate.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
/**
@ -20,6 +24,7 @@ import java.util.List;
* @since 2024-01-09 15:29
*/
@Component
@Slf4j
public class CloudCourseHandler {
@Autowired
@ -37,7 +42,7 @@ public class CloudCourseHandler {
* @param courseId 云课程id
* @return Page<CloudCustomerDto>
*/
public Page<CloudCourseDto> getCustomerPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String courseId) {
public Page<CloudCourseDto> getCoursePage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String courseId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "courseContent");
//分页参数
@ -69,4 +74,55 @@ public class CloudCourseHandler {
return page;
}
}
/**
* 上课情况
* @author DB
* @since 2024/1/9
* @param customerId 客户id
* @param studentId 学员id
* @param cardId 课卡id
* @param classId 班级id
* @param startDate 开始时间
* @param endDate 接受时间
* @param storeId 校区id
* @param courseId 课程id
* @return List<CloudCourseStudentDto>
*/
public CloudCourseStudentListDto getCourseStudentList(String customerId, String studentId, String cardId, String classId, String startDate, String endDate, String storeId, String courseId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "courseStudent");
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(courseId)){
jsonBody.put("courseId", courseId);
}
if (StringUtils.isNotBlank(customerId)){
jsonBody.put("customerId", customerId);
}
if (StringUtils.isNotBlank(studentId)){
jsonBody.put("studentId", studentId);
}
if (StringUtils.isNotBlank(cardId)){
jsonBody.put("cardId", cardId);
}
if (StringUtils.isNotBlank(classId)){
jsonBody.put("classId", classId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
return jsonObject.toJavaObject(CloudCourseStudentListDto.class);
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return new CloudCourseStudentListDto();
}
}
}

View File

@ -0,0 +1,86 @@
package com.cpop.api.cloudDb.handler;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
import com.cpop.api.cloudDb.core.dto.CloudOrderDto;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.entity.ExtendPage;
import com.cpop.core.base.exception.UtilException;
import com.mybatisflex.core.paginate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 云账单工具类
* @author DB
* @version 1.0.0
* @since 2024-01-10 10:32
*/
@Component
public class CloudOrderHandler {
@Autowired
private RestTemplate restTemplate;
/**
* 获取班级学员分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param customerId 云客户id
* @param cardId 云课卡id
* @param orderId 云订单id
* @return Page<CloudCustomerDto>
*/
public Page<CloudOrderDto> getOrderPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String customerId, String cardId, String orderId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "daybook");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(customerId)) {
jsonBody.put("customerId", customerId);
}
if (StringUtils.isNotBlank(cardId)) {
jsonBody.put("cardId", cardId);
}
if (StringUtils.isNotBlank(orderId)) {
jsonBody.put("ticketId", orderId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
ExtendPage<CloudOrderDto> page = ExtendPage.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudOrderDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudOrderDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
Map<String, Object> extendParams = new HashMap<>();
extendParams.put("totalRevenue", jsonObject.getString("totalRevenue"));
extendParams.put("totalExpenditure", jsonObject.getString("totalExpenditure"));
page.setExtendParams(extendParams);
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
}

View File

@ -0,0 +1,72 @@
package com.cpop.api.cloudDb.handler;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.constant.CloudDbUrl;
import com.cpop.api.cloudDb.core.dto.CloudClassDto;
import com.cpop.api.cloudDb.core.dto.CloudStaffDto;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.exception.UtilException;
import com.mybatisflex.core.paginate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.List;
/**
* 云员工工具类
* @author DB
* @version 1.0.0
* @since 2024-01-10 11:29
*/
@Component
public class CloudStaffHandler {
@Autowired
private RestTemplate restTemplate;
/**
* 获取班级分页
* @author DB
* @since 2024/1/9
* @param pageNum 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 云校区id
* @param staffId 员工id
* @return Page<CloudCustomerDto>
*/
public Page<CloudStaffDto> getStoreStaffPage(Integer pageNum, Integer pageSize, String startDate, String endDate, String storeId, String staffId) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "staff");
//分页参数
jsonBody.put("page", pageNum);
jsonBody.put("limit", pageSize);
//开始日期结束日期
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
jsonBody.put("startTime", startDate);
jsonBody.put("endTime", endDate);
}
if (StringUtils.isNotBlank(staffId)){
jsonBody.put("staffId", staffId);
}
//校区id
jsonBody.put("storeId", storeId);
JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.DATA_CLOUD, jsonBody, JSONObject.class);
Page<CloudStaffDto> page = Page.of(pageNum, pageSize);
if (jsonObject != null) {
if (jsonObject.getBoolean("success")) {
List<CloudStaffDto> courseDtoList = jsonObject.getJSONArray("list").toJavaList(CloudStaffDto.class);
page.setRecords(courseDtoList);
page.setTotalPage(jsonObject.getInteger("total"));
page.setTotalRow(jsonObject.getInteger("total"));
return page;
} else {
throw new UtilException(jsonObject.getString("error"));
}
} else {
return page;
}
}
}

View File

@ -0,0 +1,31 @@
package com.cpop.core.base.entity;
import com.mybatisflex.core.paginate.Page;
import lombok.Getter;
import lombok.Setter;
import java.util.HashMap;
import java.util.Map;
/**
* @author DB
* @version 1.0.0
* @since 2024-01-10 10:37
*/
@Getter
@Setter
public class ExtendPage<T> extends Page<T> {
/**
* 额外拓展参数
*/
private Map<String,Object> extendParams;
public ExtendPage(Number pageNumber, Number pageSize) {
super(pageNumber, pageSize);
}
public static <T> ExtendPage<T> of(Number pageNumber, Number pageSize) {
return new ExtendPage<>(pageNumber, pageSize);
}
}

View File

@ -1,12 +1,21 @@
package com.cpop.oam.web;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.cloudDb.core.dto.CloudCourseStudentDto;
import com.cpop.api.cloudDb.core.dto.CloudCourseStudentListDto;
import com.cpop.api.cloudDb.core.dto.CloudCustomerDto;
import com.cpop.api.cloudDb.core.dto.CloudOrderDto;
import com.cpop.api.cloudDb.handler.CloudCourseHandler;
import com.cpop.api.cloudDb.handler.CloudCustomerStudentHandler;
import com.cpop.api.cloudDb.handler.CloudOrderHandler;
import com.cpop.core.utils.SpringUtils;
import com.google.gson.JsonObject;
import com.mybatisflex.core.paginate.Page;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
/**
* @author DB
* @version 1.0.0
@ -26,4 +35,24 @@ public class CpopCloudDbTests {
"f4a7f4c892934490a7550ed1e2f0opiu", null);
System.out.println(page);
}
/**
* 获取课程学员
*/
@Test
public void getCourseStudentList(){
CloudCourseStudentListDto studentListDto = SpringUtils.getBean(CloudCourseHandler.class).getCourseStudentList(null, null, null,
null, null, null, "f4a7f4c892934490a7550ed1e2f0opiu", "382dd55065937692003606af55d38c6f");
System.out.println(JSONObject.toJSONString(studentListDto));
}
/**
* 获取云订单分页
*/
@Test
public void getOrderPageTest() {
Page<CloudOrderDto> orderPage = SpringUtils.getBean(CloudOrderHandler.class).getOrderPage(1, 10, null,
null, "f4a7f4c892934490a7550ed1e2f0opiu", null, null, null);
System.out.println(JSONObject.toJSONString(orderPage));
}
}

View File

@ -1,17 +1,13 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.api.cloudDb.core.dto.CloudCustomerDto;
import com.cpop.api.cloudDb.core.dto.CloudStudentDto;
import com.cpop.api.cloudDb.handler.CloudCustomerStudentHandler;
import com.cpop.api.cloudDb.core.dto.*;
import com.cpop.api.cloudDb.handler.*;
import com.cpop.core.base.R;
import com.cpop.oam.business.bo.BrandManagerPageBo;
import com.cpop.oam.business.vo.BrandManagePageVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -23,13 +19,28 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2024-01-09 16:01
*/
@RestController
@Api(tags = "数据导入接口")
@Api(tags = "云数据查询接口")
@RequestMapping("/cloudData")
public class CloudDataController {
@Autowired
private CloudCustomerStudentHandler cloudCustomerStudentHandler;
@Autowired
private CloudCourseHandler cloudCourseHandler;
@Autowired
private CloudClassHandler cloudClassHandler;
@Autowired
private CloudOrderHandler cloudOrderHandler;
@Autowired
private CloudClassCardHandler cloudClassCardHandler;
@Autowired
private CloudStaffHandler cloudStaffHandler;
/**
* 获取客户分页
* @author DB
@ -78,4 +89,214 @@ public class CloudDataController {
Page<CloudStudentDto> studentPage = cloudCustomerStudentHandler.getStudentPage(page, pageSize, startDate, endDate, storeId, customerId, studentId);
return R.ok(studentPage);
}
/**
* 获取课程分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param courseId 课程id
* @return R<Page<CloudCourseDto>>
*/
@ApiOperation("获取课程分页")
@GetMapping("/getCoursePage")
public R<Page<CloudCourseDto>> getCoursePage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("课程id") @RequestParam(value = "courseId", required = false) String courseId) {
Page<CloudCourseDto> coursePage = cloudCourseHandler.getCoursePage(page, pageSize, startDate, endDate, storeId, courseId);
return R.ok(coursePage);
}
/**
* 获取学员上课
* @author DB
* @since 2024/1/10
* @param customerId 客户id
* @param studentId 学员id
* @param cardId 课卡id
* @param classId 教室id
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param courseId 课程id
* @return R<CloudCourseStudentListDto>
*/
@ApiOperation("获取学员上课")
@GetMapping("/getCourseStudentList")
public R<CloudCourseStudentListDto> getCourseStudentList(@ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId,
@ApiParam("学员id") @RequestParam(value = "studentId", required = false) String studentId,
@ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId,
@ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("课程id") @RequestParam(value = "courseId", required = false) String courseId) {
CloudCourseStudentListDto studentListDto = cloudCourseHandler.getCourseStudentList(customerId, studentId, cardId, classId, startDate, endDate, storeId, courseId);
return R.ok(studentListDto);
}
/**
* 获取班级分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param classId 教室id
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取班级分页")
@GetMapping("/getClassPage")
public R<Page<CloudClassDto>> getClassPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId) {
Page<CloudClassDto> classPage = cloudClassHandler.getClassPage(page, pageSize, startDate, endDate, storeId, classId);
return R.ok(classPage);
}
/**
* 获取班级学员分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param classId 教室id
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取班级学员分页")
@GetMapping("/getClassStudentPage")
public R<Page<CloudClassStudentDto>> getClassStudentPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("教室id") @RequestParam(value = "classId", required = false) String classId) {
Page<CloudClassStudentDto> classStudentPage = cloudClassHandler.getClassStudentPage(page, pageSize, startDate, endDate, storeId, classId);
return R.ok(classStudentPage);
}
/**
* 获取订单分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param customerId 客户id
* @param cardId 课卡id
* @param orderId 订单id
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取订单分页")
@GetMapping("/getOrderPage")
public R<Page<CloudOrderDto>> getOrderPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId,
@ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId,
@ApiParam("订单id") @RequestParam(value = "orderId", required = false) String orderId) {
Page<CloudOrderDto> orderPage = cloudOrderHandler.getOrderPage(page, pageSize, startDate, endDate, storeId, customerId, cardId, orderId);
return R.ok(orderPage);
}
/**
* 获取订单分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param customerId 客户id
* @param cardId 课卡id
* @param cardType 课卡类型
* @param cardStatus 课卡状态
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取课卡分页")
@GetMapping("/getClassCardPage")
public R<Page<CloudClassCardDto>> getClassCardPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId,
@ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId,
@ApiParam("课卡类型") @RequestParam(value = "cardType", required = false) String cardType,
@ApiParam("课卡状态") @RequestParam(value = "cardStatus", required = false) Integer cardStatus) {
Page<CloudClassCardDto> classCardPage = cloudClassCardHandler.getClassCardPage(page, pageSize, startDate, endDate, storeId, customerId, cardId, cardType, cardStatus);
return R.ok(classCardPage);
}
/**
* 获取订单分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param customerId 客户id
* @param cardId 课卡id
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取课卡记录分页")
@GetMapping("/getClassCardRecordPage")
public R<Page<CloudClassCardRecordDto>> getClassCardRecordPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("客户id") @RequestParam(value = "customerId", required = false) String customerId,
@ApiParam("课卡id") @RequestParam(value = "cardId", required = false) String cardId) {
Page<CloudClassCardRecordDto> classCardRecordPage = cloudClassCardHandler.getClassCardRecordPage(page, pageSize, startDate, endDate, storeId, customerId, cardId);
return R.ok(classCardRecordPage);
}
/**
* 获取订单分页
* @author DB
* @since 2024/1/10
* @param page 分页参数
* @param pageSize 分页参数
* @param startDate 开始日期
* @param endDate 结束日期
* @param storeId 校区Id
* @param staffId 员工id
* @return R<Page<CloudClassDto>>
*/
@ApiOperation("获取班级分页")
@GetMapping("/getStoreStaffPage")
public R<Page<CloudStaffDto>> getStoreStaffPage(@ApiParam("分页参数") @RequestParam("page") Integer page,
@ApiParam("分页参数") @RequestParam("pageSize") Integer pageSize,
@ApiParam("开始日期") @RequestParam(value = "startDate", required = false) String startDate,
@ApiParam("结束日期") @RequestParam(value = "endDate", required = false) String endDate,
@ApiParam("校区Id") @RequestParam("storeId") String storeId,
@ApiParam("员工id") @RequestParam(value = "staffId", required = false) String staffId) {
Page<CloudStaffDto> storeStaffPage = cloudStaffHandler.getStoreStaffPage(page, pageSize, startDate, endDate, storeId, staffId);
return R.ok(storeStaffPage);
}
}