mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:VO支持以及bug修复
This commit is contained in:
@@ -7,6 +7,7 @@ import com.orange.demo.common.core.upload.UpDownloaderFactory;
|
||||
import com.orange.demo.common.core.upload.UploadResponseInfo;
|
||||
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -133,7 +134,7 @@ public class CourseController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<Course>> list(
|
||||
public ResponseResult<MyPageData<CourseVo>> list(
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -141,8 +142,8 @@ public class CourseController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> resultList = courseService.getCourseListWithRelation(courseFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<Course> courseList = courseService.getCourseListWithRelation(courseFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +153,7 @@ public class CourseController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<Course> view(@RequestParam Long courseId) {
|
||||
public ResponseResult<CourseVo> view(@RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -160,7 +161,8 @@ public class CourseController {
|
||||
if (course == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(course);
|
||||
CourseVo courseVo = Course.INSTANCE.fromModel(course);
|
||||
return ResponseResult.success(courseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orange.demo.app.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -36,7 +37,7 @@ public class CourseTransStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<CourseTransStats>> list(
|
||||
public ResponseResult<MyPageData<CourseTransStatsVo>> list(
|
||||
@MyRequestBody CourseTransStats courseTransStatsFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -44,8 +45,8 @@ public class CourseTransStatsController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
|
||||
List<CourseTransStats> resultList = courseTransStatsService.getCourseTransStatsListWithRelation(courseTransStatsFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<CourseTransStats> courseTransStatsList = courseTransStatsService.getCourseTransStatsListWithRelation(courseTransStatsFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseTransStatsList, CourseTransStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +59,7 @@ public class CourseTransStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<CourseTransStats>> listWithGroup(
|
||||
public ResponseResult<MyPageData<CourseTransStatsVo>> listWithGroup(
|
||||
@MyRequestBody CourseTransStats courseTransStatsFilter,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -75,7 +76,8 @@ public class CourseTransStatsController {
|
||||
MyGroupCriteria criteria = groupParam.getGroupCriteria();
|
||||
List<CourseTransStats> resultList = courseTransStatsService.getGroupedCourseTransStatsListWithRelation(
|
||||
courseTransStatsFilter, criteria.getGroupSelect(), criteria.getGroupBy(), orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList, CourseTransStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +87,7 @@ public class CourseTransStatsController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<CourseTransStats> view(@RequestParam Long statsId) {
|
||||
public ResponseResult<CourseTransStatsVo> view(@RequestParam Long statsId) {
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -93,6 +95,7 @@ public class CourseTransStatsController {
|
||||
if (courseTransStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(courseTransStats);
|
||||
CourseTransStatsVo courseTransStatsVo = CourseTransStats.INSTANCE.fromModel(courseTransStats);
|
||||
return ResponseResult.success(courseTransStatsVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.orange.demo.app.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -118,7 +119,7 @@ public class SchoolInfoController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SchoolInfo>> list(
|
||||
public ResponseResult<MyPageData<SchoolInfoVo>> list(
|
||||
@MyRequestBody SchoolInfo schoolInfoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -126,8 +127,8 @@ public class SchoolInfoController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SchoolInfo.class);
|
||||
List<SchoolInfo> resultList = schoolInfoService.getSchoolInfoListWithRelation(schoolInfoFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<SchoolInfo> schoolInfoList = schoolInfoService.getSchoolInfoListWithRelation(schoolInfoFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(schoolInfoList, SchoolInfo.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +138,7 @@ public class SchoolInfoController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SchoolInfo> view(@RequestParam Long schoolId) {
|
||||
public ResponseResult<SchoolInfoVo> view(@RequestParam Long schoolId) {
|
||||
if (MyCommonUtil.existBlankArgument(schoolId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -145,7 +146,8 @@ public class SchoolInfoController {
|
||||
if (schoolInfo == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(schoolInfo);
|
||||
SchoolInfoVo schoolInfoVo = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
||||
return ResponseResult.success(schoolInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orange.demo.app.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -36,7 +37,7 @@ public class StudentActionStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentActionStats>> list(
|
||||
public ResponseResult<MyPageData<StudentActionStatsVo>> list(
|
||||
@MyRequestBody StudentActionStats studentActionStatsFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -44,8 +45,8 @@ public class StudentActionStatsController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
|
||||
List<StudentActionStats> resultList = studentActionStatsService.getStudentActionStatsListWithRelation(studentActionStatsFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<StudentActionStats> studentActionStatsList = studentActionStatsService.getStudentActionStatsListWithRelation(studentActionStatsFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionStatsList, StudentActionStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +59,7 @@ public class StudentActionStatsController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<StudentActionStats>> listWithGroup(
|
||||
public ResponseResult<MyPageData<StudentActionStatsVo>> listWithGroup(
|
||||
@MyRequestBody StudentActionStats studentActionStatsFilter,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -75,7 +76,8 @@ public class StudentActionStatsController {
|
||||
MyGroupCriteria criteria = groupParam.getGroupCriteria();
|
||||
List<StudentActionStats> resultList = studentActionStatsService.getGroupedStudentActionStatsListWithRelation(
|
||||
studentActionStatsFilter, criteria.getGroupSelect(), criteria.getGroupBy(), orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList, StudentActionStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +87,7 @@ public class StudentActionStatsController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentActionStats> view(@RequestParam Long statsId) {
|
||||
public ResponseResult<StudentActionStatsVo> view(@RequestParam Long statsId) {
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -93,6 +95,7 @@ public class StudentActionStatsController {
|
||||
if (studentActionStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(studentActionStats);
|
||||
StudentActionStatsVo studentActionStatsVo = StudentActionStats.INSTANCE.fromModel(studentActionStats);
|
||||
return ResponseResult.success(studentActionStatsVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orange.demo.app.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -117,7 +118,7 @@ public class StudentActionTransController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentActionTrans>> list(
|
||||
public ResponseResult<MyPageData<StudentActionTransVo>> list(
|
||||
@MyRequestBody StudentActionTrans studentActionTransFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -125,8 +126,8 @@ public class StudentActionTransController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionTrans.class);
|
||||
List<StudentActionTrans> resultList = studentActionTransService.getStudentActionTransListWithRelation(studentActionTransFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<StudentActionTrans> studentActionTransList = studentActionTransService.getStudentActionTransListWithRelation(studentActionTransFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionTransList, StudentActionTrans.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +137,7 @@ public class StudentActionTransController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentActionTrans> view(@RequestParam Long transId) {
|
||||
public ResponseResult<StudentActionTransVo> view(@RequestParam Long transId) {
|
||||
if (MyCommonUtil.existBlankArgument(transId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -144,6 +145,7 @@ public class StudentActionTransController {
|
||||
if (studentActionTrans == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(studentActionTrans);
|
||||
StudentActionTransVo studentActionTransVo = StudentActionTrans.INSTANCE.fromModel(studentActionTrans);
|
||||
return ResponseResult.success(studentActionTransVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orange.demo.app.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -122,7 +123,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentClass>> list(
|
||||
public ResponseResult<MyPageData<StudentClassVo>> list(
|
||||
@MyRequestBody StudentClass studentClassFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -130,8 +131,8 @@ public class StudentClassController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentClass.class);
|
||||
List<StudentClass> resultList = studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<StudentClass> studentClassList = studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentClassList, StudentClass.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +142,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentClass> view(@RequestParam Long classId) {
|
||||
public ResponseResult<StudentClassVo> view(@RequestParam Long classId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -149,7 +150,8 @@ public class StudentClassController {
|
||||
if (studentClass == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(studentClass);
|
||||
StudentClassVo studentClassVo = StudentClass.INSTANCE.fromModel(studentClass);
|
||||
return ResponseResult.success(studentClassVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +164,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassCourse")
|
||||
public ResponseResult<MyPageData<Course>> listNotInClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listNotInClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -175,9 +177,9 @@ public class StudentClassController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> resultList =
|
||||
List<Course> courseList =
|
||||
courseService.getNotInCourseListByClassId(classId, courseFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +192,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassCourse")
|
||||
public ResponseResult<MyPageData<Course>> listClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Course courseFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -203,9 +205,9 @@ public class StudentClassController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> resultList =
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListByClassId(classId, courseFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doClassCourseVerify(Long classId) {
|
||||
@@ -274,7 +276,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,包括中间表详情。
|
||||
*/
|
||||
@GetMapping("/viewClassCourse")
|
||||
public ResponseResult<ClassCourse> viewClassCourse(
|
||||
public ResponseResult<ClassCourseVo> viewClassCourse(
|
||||
@RequestParam Long classId, @RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId, courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
@@ -283,7 +285,8 @@ public class StudentClassController {
|
||||
if (classCourse == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(classCourse);
|
||||
ClassCourseVo classCourseVo = MyModelUtil.copyTo(classCourse, ClassCourseVo.class);
|
||||
return ResponseResult.success(classCourseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,7 +318,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassStudent")
|
||||
public ResponseResult<MyPageData<Student>> listNotInClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listNotInClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -328,9 +331,9 @@ public class StudentClassController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> resultList =
|
||||
List<Student> studentList =
|
||||
studentService.getNotInStudentListByClassId(classId, studentFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -343,7 +346,7 @@ public class StudentClassController {
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassStudent")
|
||||
public ResponseResult<MyPageData<Student>> listClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -356,9 +359,9 @@ public class StudentClassController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> resultList =
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListByClassId(classId, studentFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doClassStudentVerify(Long classId) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.orange.demo.app.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.app.vo.*;
|
||||
import com.orange.demo.app.model.*;
|
||||
import com.orange.demo.app.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -118,7 +119,7 @@ public class StudentController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<Student>> list(
|
||||
public ResponseResult<MyPageData<StudentVo>> list(
|
||||
@MyRequestBody Student studentFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -126,8 +127,8 @@ public class StudentController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> resultList = studentService.getStudentListWithRelation(studentFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<Student> studentList = studentService.getStudentListWithRelation(studentFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +138,7 @@ public class StudentController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<Student> view(@RequestParam Long studentId) {
|
||||
public ResponseResult<StudentVo> view(@RequestParam Long studentId) {
|
||||
if (MyCommonUtil.existBlankArgument(studentId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -145,7 +146,8 @@ public class StudentController {
|
||||
if (student == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(student);
|
||||
StudentVo studentVo = Student.INSTANCE.fromModel(student);
|
||||
return ResponseResult.success(studentVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,13 @@
|
||||
<association property="classCourse" column="course_id" foreignColumn="course_id"
|
||||
notNullColumn="course_id" resultMap="com.orange.demo.app.dao.ClassCourseMapper.BaseResultMap" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.CourseMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="courseFilter != null">
|
||||
<if test="courseFilter.courseName != null and courseFilter.courseName != ''">
|
||||
<bind name = "safeCourseName" value = "'%' + courseFilter.courseName + '%'" />
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
<result column="student_flower_amount" jdbcType="INTEGER" property="studentFlowerAmount"/>
|
||||
<result column="student_flower_count" jdbcType="INTEGER" property="studentFlowerCount"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.CourseTransStatsMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="courseTransStatsFilter != null">
|
||||
<if test="courseTransStatsFilter.statsDateStart != null and courseTransStatsFilter.statsDateStart != ''">
|
||||
AND zz_course_trans_stats.stats_date >= #{courseTransStatsFilter.statsDateStart}
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
<result column="province_id" jdbcType="BIGINT" property="provinceId"/>
|
||||
<result column="city_id" jdbcType="BIGINT" property="cityId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.SchoolInfoMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="schoolInfoFilter != null">
|
||||
<if test="schoolInfoFilter.schoolName != null and schoolInfoFilter.schoolName != ''">
|
||||
<bind name = "safeSchoolName" value = "'%' + schoolInfoFilter.schoolName + '%'" />
|
||||
|
||||
@@ -24,8 +24,13 @@
|
||||
<result column="do_exercise_count" jdbcType="INTEGER" property="doExerciseCount"/>
|
||||
<result column="do_exercise_correct_count" jdbcType="INTEGER" property="doExerciseCorrectCount"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.StudentActionStatsMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentActionStatsFilter != null">
|
||||
<if test="studentActionStatsFilter.statsDateStart != null and studentActionStatsFilter.statsDateStart != ''">
|
||||
AND zz_student_action_stats.stats_date >= #{studentActionStatsFilter.statsDateStart}
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
<result column="exercise_correct_flag" jdbcType="TINYINT" property="exerciseCorrectFlag"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.StudentActionTransMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentActionTransFilter != null">
|
||||
<if test="studentActionTransFilter.studentId != null">
|
||||
AND zz_student_action_trans.student_id = #{studentActionTransFilter.studentId}
|
||||
|
||||
@@ -12,8 +12,14 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.StudentClassMapper.inputFilterRef"/>
|
||||
AND zz_class.status = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentClassFilter != null">
|
||||
<if test="studentClassFilter.className != null and studentClassFilter.className != ''">
|
||||
AND zz_class.class_name = #{studentClassFilter.className}
|
||||
@@ -25,7 +31,6 @@
|
||||
AND zz_class.class_level = #{studentClassFilter.classLevel}
|
||||
</if>
|
||||
</if>
|
||||
AND zz_class.status = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getStudentClassList" resultMap="BaseResultMap" parameterType="com.orange.demo.app.model.StudentClass">
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
<result column="register_time" jdbcType="TIMESTAMP" property="registerTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.app.dao.StudentMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentFilter != null">
|
||||
<if test="studentFilter.provinceId != null">
|
||||
AND zz_student.province_id = #{studentFilter.provinceId}
|
||||
|
||||
@@ -6,9 +6,13 @@ import com.orange.demo.common.core.upload.UploadStoreTypeEnum;
|
||||
import com.orange.demo.common.core.annotation.UploadFlagColumn;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.app.vo.CourseVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -169,4 +173,27 @@ public class Course {
|
||||
constantDictClass = Subject.class)
|
||||
@Transient
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface CourseModelMapper extends BaseModelMapper<CourseVo, Course> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param courseVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(mapToBean(courseVo.getClassCourse(), com.orange.demo.app.model.ClassCourse.class))")
|
||||
@Override
|
||||
Course toModel(CourseVo courseVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param course 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(beanToMap(course.getClassCourse(), false))")
|
||||
@Override
|
||||
CourseVo fromModel(Course course);
|
||||
}
|
||||
public static final CourseModelMapper INSTANCE = Mappers.getMapper(CourseModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@ package com.orange.demo.app.model;
|
||||
import com.orange.demo.application.common.constant.Subject;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.app.vo.CourseTransStatsVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -119,4 +123,25 @@ public class CourseTransStats {
|
||||
constantDictClass = Subject.class)
|
||||
@Transient
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface CourseTransStatsModelMapper extends BaseModelMapper<CourseTransStatsVo, CourseTransStats> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param courseTransStatsVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
CourseTransStats toModel(CourseTransStatsVo courseTransStatsVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param courseTransStats 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
CourseTransStatsVo fromModel(CourseTransStats courseTransStats);
|
||||
}
|
||||
public static final CourseTransStatsModelMapper INSTANCE = Mappers.getMapper(CourseTransStatsModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.app.vo.SchoolInfoVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -64,4 +68,25 @@ public class SchoolInfo {
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface SchoolInfoModelMapper extends BaseModelMapper<SchoolInfoVo, SchoolInfo> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param schoolInfoVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfo toModel(SchoolInfoVo schoolInfoVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param schoolInfo 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfoVo fromModel(SchoolInfo schoolInfo);
|
||||
}
|
||||
public static final SchoolInfoModelMapper INSTANCE = Mappers.getMapper(SchoolInfoModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,13 @@ import com.orange.demo.application.common.constant.ExpLevel;
|
||||
import com.orange.demo.application.common.constant.StudentStatus;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.app.vo.StudentVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -221,4 +225,25 @@ public class Student {
|
||||
constantDictClass = StudentStatus.class)
|
||||
@Transient
|
||||
private Map<String, Object> statusDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentModelMapper extends BaseModelMapper<StudentVo, Student> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
Student toModel(StudentVo studentVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param student 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentVo fromModel(Student student);
|
||||
}
|
||||
public static final StudentModelMapper INSTANCE = Mappers.getMapper(StudentModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.orange.demo.app.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.app.vo.StudentActionStatsVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -204,4 +208,25 @@ public class StudentActionStats {
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentActionStatsModelMapper extends BaseModelMapper<StudentActionStatsVo, StudentActionStats> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentActionStatsVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionStats toModel(StudentActionStatsVo studentActionStatsVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentActionStats 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionStatsVo fromModel(StudentActionStats studentActionStats);
|
||||
}
|
||||
public static final StudentActionStatsModelMapper INSTANCE = Mappers.getMapper(StudentActionStatsModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,13 @@ import com.orange.demo.application.common.constant.StudentActionType;
|
||||
import com.orange.demo.application.common.constant.DeviceType;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.app.vo.StudentActionTransVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -165,4 +169,25 @@ public class StudentActionTrans {
|
||||
constantDictClass = DeviceType.class)
|
||||
@Transient
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentActionTransModelMapper extends BaseModelMapper<StudentActionTransVo, StudentActionTrans> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentActionTransVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionTrans toModel(StudentActionTransVo studentActionTransVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentActionTrans 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionTransVo fromModel(StudentActionTrans studentActionTrans);
|
||||
}
|
||||
public static final StudentActionTransModelMapper INSTANCE = Mappers.getMapper(StudentActionTransModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.app.model.constant.ClassLevel;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.app.vo.StudentClassVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -110,4 +114,25 @@ public class StudentClass {
|
||||
constantDictClass = ClassLevel.class)
|
||||
@Transient
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentClassModelMapper extends BaseModelMapper<StudentClassVo, StudentClass> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentClassVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClass toModel(StudentClassVo studentClassVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentClass 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClassVo fromModel(StudentClass studentClass);
|
||||
}
|
||||
public static final StudentClassModelMapper INSTANCE = Mappers.getMapper(StudentClassModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 行政区划DomainVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class AreaCodeVo {
|
||||
|
||||
/**
|
||||
* 行政区划主键Id
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||
*/
|
||||
private Integer areaLevel;
|
||||
|
||||
/**
|
||||
* 父级行政区划Id
|
||||
*/
|
||||
private Long parentId;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassCourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class ClassCourseVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程顺序(数值越小越靠前)。
|
||||
*/
|
||||
private Integer courseOrder;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassStudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class ClassStudentVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseTransStatsVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class CourseTransStatsVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 科目Id。
|
||||
*/
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
private String gradeName;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 学生上课次数。
|
||||
*/
|
||||
private Integer studentAttendCount;
|
||||
|
||||
/**
|
||||
* 学生献花数量。
|
||||
*/
|
||||
private Integer studentFlowerAmount;
|
||||
|
||||
/**
|
||||
* 学生献花次数。
|
||||
*/
|
||||
private Integer studentFlowerCount;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class CourseVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 课程价格。
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 课程描述。
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||
*/
|
||||
private Integer difficulty;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学科Id。
|
||||
*/
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 课时数量。
|
||||
*/
|
||||
private Integer classHour;
|
||||
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
private String pictureUrl;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最后修改时间。
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo。
|
||||
*/
|
||||
private Map<String, Object> classCourse;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* difficulty 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* GradeVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class GradeVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
private String gradeName;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SchoolInfoVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class SchoolInfoVo {
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学校名称。
|
||||
*/
|
||||
private String schoolName;
|
||||
|
||||
/**
|
||||
* 所在省Id。
|
||||
*/
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionStatsVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class StudentActionStatsVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 统计小时。
|
||||
*/
|
||||
private Date statsMonth;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学生所在省Id。
|
||||
*/
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 学生所在城市Id。
|
||||
*/
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 购课学币数量。
|
||||
*/
|
||||
private Integer buyCourseAmount;
|
||||
|
||||
/**
|
||||
* 购买课程次数。
|
||||
*/
|
||||
private Integer buyCourseCount;
|
||||
|
||||
/**
|
||||
* 购买视频学币数量。
|
||||
*/
|
||||
private Integer buyVideoAmount;
|
||||
|
||||
/**
|
||||
* 购买视频次数。
|
||||
*/
|
||||
private Integer buyVideoCount;
|
||||
|
||||
/**
|
||||
* 购买作业学币数量。
|
||||
*/
|
||||
private Integer buyPaperAmount;
|
||||
|
||||
/**
|
||||
* 购买作业次数。
|
||||
*/
|
||||
private Integer buyPaperCount;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
private Integer buyFlowerAmount;
|
||||
|
||||
/**
|
||||
* 购买献花次数。
|
||||
*/
|
||||
private Integer buyFlowerCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
private Integer rechargeCoinAmount;
|
||||
|
||||
/**
|
||||
* 充值学币次数。
|
||||
*/
|
||||
private Integer rechargeCoinCount;
|
||||
|
||||
/**
|
||||
* 线下课程上课次数。
|
||||
*/
|
||||
private Integer doCourseCount;
|
||||
|
||||
/**
|
||||
* 观看视频次数。
|
||||
*/
|
||||
private Integer watchVideoCount;
|
||||
|
||||
/**
|
||||
* 购买献花消费学币数量。
|
||||
*/
|
||||
private Integer watchVideoTotalSecond;
|
||||
|
||||
/**
|
||||
* 做题数量。
|
||||
*/
|
||||
private Integer doExerciseCount;
|
||||
|
||||
/**
|
||||
* 做题正确的数量。
|
||||
*/
|
||||
private Integer doExerciseCorrectCount;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionTransVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class StudentActionTransVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
private Long transId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生名称。
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学生校区。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||
*/
|
||||
private Integer actionType;
|
||||
|
||||
/**
|
||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||
*/
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 看视频秒数。
|
||||
*/
|
||||
private Integer watchVideoSeconds;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
private Integer flowerCount;
|
||||
|
||||
/**
|
||||
* 购买作业数量。
|
||||
*/
|
||||
private Integer paperCount;
|
||||
|
||||
/**
|
||||
* 购买视频数量。
|
||||
*/
|
||||
private Integer videoCount;
|
||||
|
||||
/**
|
||||
* 购买课程数量。
|
||||
*/
|
||||
private Integer courseCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
private Integer coinCount;
|
||||
|
||||
/**
|
||||
* 做题是否正确标记。
|
||||
*/
|
||||
private Integer exerciseCorrectFlag;
|
||||
|
||||
/**
|
||||
* 发生时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* actionType 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> actionTypeDictMap;
|
||||
|
||||
/**
|
||||
* deviceType 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentClassVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class StudentClassVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称。
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学生班长Id。
|
||||
*/
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 已完成课时数量。
|
||||
*/
|
||||
private Integer finishClassHour;
|
||||
|
||||
/**
|
||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||
*/
|
||||
private Integer classLevel;
|
||||
|
||||
/**
|
||||
* 创建用户。
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 班级创建时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* leaderId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
/**
|
||||
* classLevel 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.orange.demo.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class StudentVo {
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 登录手机。
|
||||
*/
|
||||
private String loginMobile;
|
||||
|
||||
/**
|
||||
* 学生姓名。
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 所在省份Id。
|
||||
*/
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 区县Id。
|
||||
*/
|
||||
private Long districtId;
|
||||
|
||||
/**
|
||||
* 学生性别 (0: 女生 1: 男生)。
|
||||
*/
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 生日。
|
||||
*/
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||
*/
|
||||
private Integer experienceLevel;
|
||||
|
||||
/**
|
||||
* 总共充值学币数量。
|
||||
*/
|
||||
private Integer totalCoin;
|
||||
|
||||
/**
|
||||
* 可用学币数量。
|
||||
*/
|
||||
private Integer leftCoin;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 校区Id。
|
||||
*/
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 注册时间。
|
||||
*/
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
/**
|
||||
* districtId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gender 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
/**
|
||||
* experienceLevel 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
/**
|
||||
* status 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> statusDictMap;
|
||||
}
|
||||
@@ -95,7 +95,8 @@ public class LoginController {
|
||||
*/
|
||||
@PostMapping("/doLogout")
|
||||
public ResponseResult<Void> doLogout() {
|
||||
cacheHelper.removeAllSessionCache();
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
cacheHelper.removeAllSessionCache(tokenData.getSessionId());
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orange.demo.upms.controller;
|
||||
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.upms.vo.*;
|
||||
import com.orange.demo.upms.model.*;
|
||||
import com.orange.demo.upms.service.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
@@ -134,7 +135,7 @@ public class SysUserController {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysUser>> list(
|
||||
public ResponseResult<MyPageData<SysUserVo>> list(
|
||||
@MyRequestBody SysUser sysUserFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -142,8 +143,8 @@ public class SysUserController {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> resultList = sysUserService.getSysUserListWithRelation(sysUserFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
List<SysUser> sysUserList = sysUserService.getSysUserListWithRelation(sysUserFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(sysUserList, SysUser.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,7 +154,7 @@ public class SysUserController {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysUser> view(@RequestParam Long userId) {
|
||||
public ResponseResult<SysUserVo> view(@RequestParam Long userId) {
|
||||
if (MyCommonUtil.existBlankArgument(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -162,6 +163,7 @@ public class SysUserController {
|
||||
if (sysUser == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUser);
|
||||
SysUserVo sysUserVo = SysUser.INSTANCE.fromModel(sysUser);
|
||||
return ResponseResult.success(sysUserVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.upms.dao.SysUserMapper.inputFilterRef"/>
|
||||
AND zz_sys_user.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="sysUserFilter != null">
|
||||
<if test="sysUserFilter.loginName != null and sysUserFilter.loginName != ''">
|
||||
<bind name = "safeLoginName" value = "'%' + sysUserFilter.loginName + '%'" />
|
||||
@@ -36,7 +42,6 @@
|
||||
AND zz_sys_user.create_time <= #{sysUserFilter.createTimeEnd}
|
||||
</if>
|
||||
</if>
|
||||
AND zz_sys_user.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getSysUserList" resultMap="BaseResultMap" parameterType="com.orange.demo.upms.model.SysUser">
|
||||
|
||||
@@ -4,11 +4,15 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.upms.model.constant.SysUserType;
|
||||
import com.orange.demo.upms.model.constant.SysUserStatus;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.AddGroup;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.upms.vo.SysUserVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -130,4 +134,25 @@ public class SysUser {
|
||||
constantDictClass = SysUserStatus.class)
|
||||
@Transient
|
||||
private Map<String, Object> userStatusDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface SysUserModelMapper extends BaseModelMapper<SysUserVo, SysUser> {
|
||||
/**
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param sysUserVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
SysUser toModel(SysUserVo sysUserVo);
|
||||
/**
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param sysUser 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
SysUserVo fromModel(SysUser sysUser);
|
||||
}
|
||||
public static final SysUserModelMapper INSTANCE = Mappers.getMapper(SysUserModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -109,8 +109,9 @@ public class SysUserService extends BaseService<SysUser, Long> {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changePassword(Long userId, String newPass) {
|
||||
Example e = new Example(SysUser.class);
|
||||
e.createCriteria().andEqualTo(super.idFieldName, userId);
|
||||
e.createCriteria().andEqualTo(super.deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
|
||||
e.createCriteria()
|
||||
.andEqualTo(super.idFieldName, userId)
|
||||
.andEqualTo(super.deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
|
||||
SysUser updatedUser = new SysUser();
|
||||
updatedUser.setPassword(passwordEncoder.encode(newPass));
|
||||
return sysUserMapper.updateByExampleSelective(updatedUser, e) == 1;
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.orange.demo.upms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SysUserVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Data
|
||||
public class SysUserVo {
|
||||
|
||||
/**
|
||||
* 用户Id。
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 登录用户名。
|
||||
*/
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 用户密码。
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)。
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 用户头像的Url。
|
||||
*/
|
||||
private String headImageUrl;
|
||||
|
||||
/**
|
||||
* 用户状态(0: 正常 1: 锁定)。
|
||||
*/
|
||||
private Integer userStatus;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建用户名。
|
||||
*/
|
||||
private String createUsername;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间。
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* userType 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> userTypeDictMap;
|
||||
|
||||
/**
|
||||
* userStatus 常量字典关联数据。
|
||||
*/
|
||||
private Map<String, Object> userStatusDictMap;
|
||||
}
|
||||
@@ -7,9 +7,9 @@
|
||||
<!--日志变量 -->
|
||||
<properties>
|
||||
<!-- 日志主目录 ,需要保存到文件时请自己配置-->
|
||||
<property name="LOG_HOME">./zzlogs</property>
|
||||
<property name="LOG_HOME">./zzlogs/application</property>
|
||||
<!-- 日志备份目录 -->
|
||||
<property name="BACKUP_HOME">./zzlogs/backup</property>
|
||||
<property name="BACKUP_HOME">./zzlogs/application/backup</property>
|
||||
<!-- 日志输出级别 -->
|
||||
<property name="OUTPUT_LOG_LEVEL">info</property>
|
||||
<!-- 日志输出格式 -->
|
||||
@@ -37,8 +37,8 @@
|
||||
</console>
|
||||
<!-- console_log级别日志文件 -->
|
||||
<!--每次大小超过size,则这size大小的日志会自动进行压缩,作为存档 -->
|
||||
<rollingFile name="file_log" fileName="${LOG_HOME}/server/server.log"
|
||||
filePattern="${LOG_HOME}/server/server-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<rollingFile name="file_log" fileName="${LOG_HOME}/application.log"
|
||||
filePattern="${LOG_HOME}/application-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout charset="UTF-8" pattern="${LOG_PATTERN_EX}"/>
|
||||
<!-- 日志切割的最小单位 -->
|
||||
<SizeBasedTriggeringPolicy size="${EVERY_FILE_SIZE}"/>
|
||||
|
||||
Reference in New Issue
Block a user