mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.0版本
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
### 服务接口文档
|
### 服务接口文档
|
||||||
---
|
---
|
||||||
- Knife4j
|
|
||||||
- 服务启动后,Knife4j的文档入口地址 [http://localhost:8082/doc.html#/plus](http://localhost:8082/doc.html#/plus)
|
|
||||||
- Postman
|
- Postman
|
||||||
- 无需启动服务,即可将当前工程的接口导出成Postman格式。在工程的common/common-tools/模块下,找到ExportApiApp文件,并执行main函数。
|
- 无需启动服务,即可将当前工程的接口导出成Postman格式。在工程的common/common-tools/模块下,找到ExportApiApp文件,并执行main函数。
|
||||||
|
|
||||||
@@ -15,4 +13,3 @@
|
|||||||
- 版本:4
|
- 版本:4
|
||||||
- 端口: 6379
|
- 端口: 6379
|
||||||
- 推荐客户端工具 [AnotherRedisDesktopManager](https://github.com/qishibo/AnotherRedisDesktopManager)
|
- 推荐客户端工具 [AnotherRedisDesktopManager](https://github.com/qishibo/AnotherRedisDesktopManager)
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,11 @@
|
|||||||
<artifactId>common-redis</artifactId>
|
<artifactId>common-redis</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.orange.demo</groupId>
|
||||||
|
<artifactId>common-log</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.orange.demo</groupId>
|
<groupId>com.orange.demo</groupId>
|
||||||
<artifactId>common-sequence</artifactId>
|
<artifactId>common-sequence</artifactId>
|
||||||
@@ -27,12 +32,12 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.orange.demo</groupId>
|
<groupId>com.orange.demo</groupId>
|
||||||
<artifactId>application-common</artifactId>
|
<artifactId>common-datafilter</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.orange.demo</groupId>
|
<groupId>com.orange.demo</groupId>
|
||||||
<artifactId>common-swagger</artifactId>
|
<artifactId>application-common</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.orange.demo.webadmin.app.controller;
|
package com.orange.demo.webadmin.app.controller;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import cn.jimmyshi.beanquery.BeanQuery;
|
import cn.jimmyshi.beanquery.BeanQuery;
|
||||||
import com.orange.demo.webadmin.app.model.AreaCode;
|
import com.orange.demo.webadmin.app.model.AreaCode;
|
||||||
import com.orange.demo.webadmin.app.service.AreaCodeService;
|
import com.orange.demo.webadmin.app.service.AreaCodeService;
|
||||||
@@ -22,7 +21,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "行政区划数据访问接口")
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/areaCode")
|
@RequestMapping("/admin/app/areaCode")
|
||||||
public class AreaCodeController {
|
public class AreaCodeController {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.orange.demo.common.core.upload.BaseUpDownloader;
|
|||||||
import com.orange.demo.common.core.upload.UpDownloaderFactory;
|
import com.orange.demo.common.core.upload.UpDownloaderFactory;
|
||||||
import com.orange.demo.common.core.upload.UploadResponseInfo;
|
import com.orange.demo.common.core.upload.UploadResponseInfo;
|
||||||
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import com.orange.demo.webadmin.app.vo.*;
|
import com.orange.demo.webadmin.app.vo.*;
|
||||||
import com.orange.demo.webadmin.app.dto.*;
|
import com.orange.demo.webadmin.app.dto.*;
|
||||||
@@ -15,11 +17,8 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.orange.demo.common.redis.cache.SessionCacheHelper;
|
import com.orange.demo.common.redis.cache.SessionCacheHelper;
|
||||||
import com.orange.demo.webadmin.config.ApplicationConfig;
|
import com.orange.demo.webadmin.config.ApplicationConfig;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -27,7 +26,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.groups.Default;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程数据操作控制器类。
|
* 课程数据操作控制器类。
|
||||||
@@ -35,7 +33,6 @@ import javax.validation.groups.Default;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "课程数据管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/course")
|
@RequestMapping("/admin/app/course")
|
||||||
@@ -56,17 +53,10 @@ public class CourseController {
|
|||||||
* @param courseDto 新增对象。
|
* @param courseDto 新增对象。
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
"courseDto.courseId",
|
|
||||||
"courseDto.priceStart",
|
|
||||||
"courseDto.priceEnd",
|
|
||||||
"courseDto.classHourStart",
|
|
||||||
"courseDto.classHourEnd",
|
|
||||||
"courseDto.createTimeStart",
|
|
||||||
"courseDto.createTimeEnd"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody CourseDto courseDto) {
|
public ResponseResult<Long> add(@MyRequestBody CourseDto courseDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, false);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -87,16 +77,10 @@ public class CourseController {
|
|||||||
* @param courseDto 更新对象。
|
* @param courseDto 更新对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
"courseDto.priceStart",
|
|
||||||
"courseDto.priceEnd",
|
|
||||||
"courseDto.classHourStart",
|
|
||||||
"courseDto.classHourEnd",
|
|
||||||
"courseDto.createTimeStart",
|
|
||||||
"courseDto.createTimeEnd"})
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody CourseDto courseDto) {
|
public ResponseResult<Void> update(@MyRequestBody CourseDto courseDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(courseDto, true);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -125,6 +109,7 @@ public class CourseController {
|
|||||||
* @param courseId 删除对象主键Id。
|
* @param courseId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long courseId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long courseId) {
|
||||||
String errorMessage;
|
String errorMessage;
|
||||||
@@ -196,6 +181,7 @@ public class CourseController {
|
|||||||
* @param asImage 下载文件是否为图片。
|
* @param asImage 下载文件是否为图片。
|
||||||
* @param response Http 应答对象。
|
* @param response Http 应答对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DOWNLOAD, saveResponse = false)
|
||||||
@GetMapping("/download")
|
@GetMapping("/download")
|
||||||
public void download(
|
public void download(
|
||||||
@RequestParam(required = false) Long courseId,
|
@RequestParam(required = false) Long courseId,
|
||||||
@@ -254,6 +240,7 @@ public class CourseController {
|
|||||||
* @param asImage 是否作为图片上传。如果是图片,今后下载的时候无需权限验证。否则就是附件上传,下载时需要权限验证。
|
* @param asImage 是否作为图片上传。如果是图片,今后下载的时候无需权限验证。否则就是附件上传,下载时需要权限验证。
|
||||||
* @param uploadFile 上传文件对象。
|
* @param uploadFile 上传文件对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPLOAD, saveResponse = false)
|
||||||
@PostMapping("/upload")
|
@PostMapping("/upload")
|
||||||
public void upload(
|
public void upload(
|
||||||
@RequestParam String fieldName,
|
@RequestParam String fieldName,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -22,7 +21,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "课程统计管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/courseTransStats")
|
@RequestMapping("/admin/app/courseTransStats")
|
||||||
@@ -49,7 +47,8 @@ public class CourseTransStatsController {
|
|||||||
}
|
}
|
||||||
CourseTransStats courseTransStatsFilter = MyModelUtil.copyTo(courseTransStatsDtoFilter, CourseTransStats.class);
|
CourseTransStats courseTransStatsFilter = MyModelUtil.copyTo(courseTransStatsDtoFilter, CourseTransStats.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
|
||||||
List<CourseTransStats> courseTransStatsList = courseTransStatsService.getCourseTransStatsListWithRelation(courseTransStatsFilter, orderBy);
|
List<CourseTransStats> courseTransStatsList =
|
||||||
|
courseTransStatsService.getCourseTransStatsListWithRelation(courseTransStatsFilter, orderBy);
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseTransStatsList, CourseTransStats.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(courseTransStatsList, CourseTransStats.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import com.orange.demo.common.core.util.MyCommonUtil;
|
|||||||
import com.orange.demo.common.core.object.ResponseResult;
|
import com.orange.demo.common.core.object.ResponseResult;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
import io.swagger.annotations.Api;
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -27,7 +27,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "年级管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/grade")
|
@RequestMapping("/admin/app/grade")
|
||||||
@@ -42,7 +41,7 @@ public class GradeController {
|
|||||||
* @param gradeDto 新增对象。
|
* @param gradeDto 新增对象。
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {"gradeDto.gradeId"})
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Integer> add(@MyRequestBody GradeDto gradeDto) {
|
public ResponseResult<Integer> add(@MyRequestBody GradeDto gradeDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto);
|
||||||
@@ -60,6 +59,7 @@ public class GradeController {
|
|||||||
* @param gradeDto 更新对象。
|
* @param gradeDto 更新对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody GradeDto gradeDto) {
|
public ResponseResult<Void> update(@MyRequestBody GradeDto gradeDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(gradeDto, Default.class, UpdateGroup.class);
|
||||||
@@ -83,6 +83,7 @@ public class GradeController {
|
|||||||
* @param gradeId 删除对象主键Id。
|
* @param gradeId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Integer gradeId) {
|
public ResponseResult<Void> delete(@MyRequestBody Integer gradeId) {
|
||||||
if (MyCommonUtil.existBlankArgument(gradeId)) {
|
if (MyCommonUtil.existBlankArgument(gradeId)) {
|
||||||
@@ -146,6 +147,7 @@ public class GradeController {
|
|||||||
* 由于缓存的数据更新,在add/update/delete等接口均有同步处理。因此该接口仅当同步过程中出现问题时,
|
* 由于缓存的数据更新,在add/update/delete等接口均有同步处理。因此该接口仅当同步过程中出现问题时,
|
||||||
* 可手工调用,或者每天晚上定时同步一次。
|
* 可手工调用,或者每天晚上定时同步一次。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.RELOAD_CACHE)
|
||||||
@GetMapping("/reloadCachedData")
|
@GetMapping("/reloadCachedData")
|
||||||
public ResponseResult<Boolean> reloadCachedData() {
|
public ResponseResult<Boolean> reloadCachedData() {
|
||||||
gradeService.reloadCachedData(true);
|
gradeService.reloadCachedData(true);
|
||||||
|
|||||||
@@ -1,187 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.controller;
|
|
||||||
|
|
||||||
import cn.jimmyshi.beanquery.BeanQuery;
|
|
||||||
import com.github.pagehelper.page.PageMethod;
|
|
||||||
import com.orange.demo.webadmin.app.vo.*;
|
|
||||||
import com.orange.demo.webadmin.app.dto.*;
|
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
|
||||||
import com.orange.demo.common.core.object.*;
|
|
||||||
import com.orange.demo.common.core.util.*;
|
|
||||||
import com.orange.demo.common.core.constant.*;
|
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.groups.Default;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校区数据操作控制器类。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
@Api(tags = "校区数据管理接口")
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/admin/app/schoolInfo")
|
|
||||||
public class SchoolInfoController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SchoolInfoService schoolInfoService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增校区数据数据。
|
|
||||||
*
|
|
||||||
* @param schoolInfoDto 新增对象。
|
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
|
||||||
*/
|
|
||||||
@ApiOperationSupport(ignoreParameters = {"schoolInfoDto.schoolId"})
|
|
||||||
@PostMapping("/add")
|
|
||||||
public ResponseResult<Long> add(@MyRequestBody SchoolInfoDto schoolInfoDto) {
|
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto);
|
|
||||||
if (errorMessage != null) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
|
||||||
}
|
|
||||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
|
||||||
// 验证关联Id的数据合法性
|
|
||||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, null);
|
|
||||||
if (!callResult.isSuccess()) {
|
|
||||||
errorMessage = callResult.getErrorMessage();
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
|
||||||
}
|
|
||||||
schoolInfo = schoolInfoService.saveNew(schoolInfo);
|
|
||||||
return ResponseResult.success(schoolInfo.getSchoolId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新校区数据数据。
|
|
||||||
*
|
|
||||||
* @param schoolInfoDto 更新对象。
|
|
||||||
* @return 应答结果对象。
|
|
||||||
*/
|
|
||||||
@PostMapping("/update")
|
|
||||||
public ResponseResult<Void> update(@MyRequestBody SchoolInfoDto schoolInfoDto) {
|
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(schoolInfoDto, Default.class, UpdateGroup.class);
|
|
||||||
if (errorMessage != null) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
|
||||||
}
|
|
||||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
|
||||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolInfo.getSchoolId());
|
|
||||||
if (originalSchoolInfo == null) {
|
|
||||||
// NOTE: 修改下面方括号中的话述
|
|
||||||
errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
|
||||||
}
|
|
||||||
// 验证关联Id的数据合法性
|
|
||||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, originalSchoolInfo);
|
|
||||||
if (!callResult.isSuccess()) {
|
|
||||||
errorMessage = callResult.getErrorMessage();
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
|
||||||
}
|
|
||||||
if (!schoolInfoService.update(schoolInfo, originalSchoolInfo)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
|
||||||
}
|
|
||||||
return ResponseResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除校区数据数据。
|
|
||||||
*
|
|
||||||
* @param schoolId 删除对象主键Id。
|
|
||||||
* @return 应答结果对象。
|
|
||||||
*/
|
|
||||||
@PostMapping("/delete")
|
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long schoolId) {
|
|
||||||
String errorMessage;
|
|
||||||
if (MyCommonUtil.existBlankArgument(schoolId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
|
||||||
}
|
|
||||||
// 验证关联Id的数据合法性
|
|
||||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolId);
|
|
||||||
if (originalSchoolInfo == null) {
|
|
||||||
// NOTE: 修改下面方括号中的话述
|
|
||||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
|
||||||
}
|
|
||||||
if (!schoolInfoService.remove(schoolId)) {
|
|
||||||
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
|
||||||
}
|
|
||||||
return ResponseResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列出符合过滤条件的校区数据列表。
|
|
||||||
*
|
|
||||||
* @param schoolInfoDtoFilter 过滤对象。
|
|
||||||
* @param orderParam 排序参数。
|
|
||||||
* @param pageParam 分页参数。
|
|
||||||
* @return 应答结果对象,包含查询结果集。
|
|
||||||
*/
|
|
||||||
@PostMapping("/list")
|
|
||||||
public ResponseResult<MyPageData<SchoolInfoVo>> list(
|
|
||||||
@MyRequestBody SchoolInfoDto schoolInfoDtoFilter,
|
|
||||||
@MyRequestBody MyOrderParam orderParam,
|
|
||||||
@MyRequestBody MyPageParam pageParam) {
|
|
||||||
if (pageParam != null) {
|
|
||||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
|
||||||
}
|
|
||||||
SchoolInfo schoolInfoFilter = MyModelUtil.copyTo(schoolInfoDtoFilter, SchoolInfo.class);
|
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SchoolInfo.class);
|
|
||||||
List<SchoolInfo> schoolInfoList = schoolInfoService.getSchoolInfoListWithRelation(schoolInfoFilter, orderBy);
|
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(schoolInfoList, SchoolInfo.INSTANCE));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看指定校区数据对象详情。
|
|
||||||
*
|
|
||||||
* @param schoolId 指定对象主键Id。
|
|
||||||
* @return 应答结果对象,包含对象详情。
|
|
||||||
*/
|
|
||||||
@GetMapping("/view")
|
|
||||||
public ResponseResult<SchoolInfoVo> view(@RequestParam Long schoolId) {
|
|
||||||
if (MyCommonUtil.existBlankArgument(schoolId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
|
||||||
}
|
|
||||||
SchoolInfo schoolInfo = schoolInfoService.getByIdWithRelation(schoolId, MyRelationParam.full());
|
|
||||||
if (schoolInfo == null) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
|
||||||
}
|
|
||||||
SchoolInfoVo schoolInfoVo = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
|
||||||
return ResponseResult.success(schoolInfoVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 以字典形式返回全部校区数据数据集合。字典的键值为[schoolId, schoolName]。
|
|
||||||
* 白名单接口,登录用户均可访问。
|
|
||||||
*
|
|
||||||
* @param filter 过滤对象。
|
|
||||||
* @return 应答结果对象,包含的数据为 List<Map<String, String>>,map中包含两条记录,key的值分别是id和name,value对应具体数据。
|
|
||||||
*/
|
|
||||||
@GetMapping("/listDict")
|
|
||||||
public ResponseResult<List<Map<String, Object>>> listDict(SchoolInfo filter) {
|
|
||||||
List<SchoolInfo> resultList = schoolInfoService.getListByFilter(filter);
|
|
||||||
return ResponseResult.success(BeanQuery.select(
|
|
||||||
"schoolId as id", "schoolName as name").executeFrom(resultList));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典Id集合,获取查询后的字典数据。
|
|
||||||
*
|
|
||||||
* @param dictIds 字典Id集合。
|
|
||||||
* @return 应答结果对象,包含字典形式的数据集合。
|
|
||||||
*/
|
|
||||||
@PostMapping("/listDictByIds")
|
|
||||||
public ResponseResult<List<Map<String, Object>>> listDictByIds(
|
|
||||||
@MyRequestBody(elementType = Long.class) List<Long> dictIds) {
|
|
||||||
List<SchoolInfo> resultList = schoolInfoService.getInList(new HashSet<>(dictIds));
|
|
||||||
return ResponseResult.success(BeanQuery.select(
|
|
||||||
"schoolId as id", "schoolName as name").executeFrom(resultList));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,6 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -22,7 +21,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "学生行为统计管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/studentActionStats")
|
@RequestMapping("/admin/app/studentActionStats")
|
||||||
@@ -49,7 +47,8 @@ public class StudentActionStatsController {
|
|||||||
}
|
}
|
||||||
StudentActionStats studentActionStatsFilter = MyModelUtil.copyTo(studentActionStatsDtoFilter, StudentActionStats.class);
|
StudentActionStats studentActionStatsFilter = MyModelUtil.copyTo(studentActionStatsDtoFilter, StudentActionStats.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
|
||||||
List<StudentActionStats> studentActionStatsList = studentActionStatsService.getStudentActionStatsListWithRelation(studentActionStatsFilter, orderBy);
|
List<StudentActionStats> studentActionStatsList =
|
||||||
|
studentActionStatsService.getStudentActionStatsListWithRelation(studentActionStatsFilter, orderBy);
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionStatsList, StudentActionStats.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionStatsList, StudentActionStats.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.controller;
|
package com.orange.demo.webadmin.app.controller;
|
||||||
|
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import com.orange.demo.webadmin.app.vo.*;
|
import com.orange.demo.webadmin.app.vo.*;
|
||||||
import com.orange.demo.webadmin.app.dto.*;
|
import com.orange.demo.webadmin.app.dto.*;
|
||||||
@@ -9,15 +11,11 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.groups.Default;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生行为流水操作控制器类。
|
* 学生行为流水操作控制器类。
|
||||||
@@ -25,7 +23,6 @@ import javax.validation.groups.Default;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "学生行为流水管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/studentActionTrans")
|
@RequestMapping("/admin/app/studentActionTrans")
|
||||||
@@ -40,13 +37,10 @@ public class StudentActionTransController {
|
|||||||
* @param studentActionTransDto 新增对象。
|
* @param studentActionTransDto 新增对象。
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
"studentActionTransDto.transId",
|
|
||||||
"studentActionTransDto.createTimeStart",
|
|
||||||
"studentActionTransDto.createTimeEnd"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
public ResponseResult<Long> add(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, false);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -67,12 +61,10 @@ public class StudentActionTransController {
|
|||||||
* @param studentActionTransDto 更新对象。
|
* @param studentActionTransDto 更新对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
"studentActionTransDto.createTimeStart",
|
|
||||||
"studentActionTransDto.createTimeEnd"})
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
public ResponseResult<Void> update(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, true);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -101,6 +93,7 @@ public class StudentActionTransController {
|
|||||||
* @param transId 删除对象主键Id。
|
* @param transId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long transId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long transId) {
|
||||||
String errorMessage;
|
String errorMessage;
|
||||||
@@ -139,7 +132,8 @@ public class StudentActionTransController {
|
|||||||
}
|
}
|
||||||
StudentActionTrans studentActionTransFilter = MyModelUtil.copyTo(studentActionTransDtoFilter, StudentActionTrans.class);
|
StudentActionTrans studentActionTransFilter = MyModelUtil.copyTo(studentActionTransDtoFilter, StudentActionTrans.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionTrans.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionTrans.class);
|
||||||
List<StudentActionTrans> studentActionTransList = studentActionTransService.getStudentActionTransListWithRelation(studentActionTransFilter, orderBy);
|
List<StudentActionTrans> studentActionTransList =
|
||||||
|
studentActionTransService.getStudentActionTransListWithRelation(studentActionTransFilter, orderBy);
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionTransList, StudentActionTrans.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionTransList, StudentActionTrans.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.controller;
|
package com.orange.demo.webadmin.app.controller;
|
||||||
|
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import com.orange.demo.webadmin.app.vo.*;
|
import com.orange.demo.webadmin.app.vo.*;
|
||||||
import com.orange.demo.webadmin.app.dto.*;
|
import com.orange.demo.webadmin.app.dto.*;
|
||||||
@@ -9,15 +11,11 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.groups.Default;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +24,6 @@ import java.util.stream.Collectors;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "班级数据管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/studentClass")
|
@RequestMapping("/admin/app/studentClass")
|
||||||
@@ -45,10 +42,10 @@ public class StudentClassController {
|
|||||||
* @param studentClassDto 新增对象。
|
* @param studentClassDto 新增对象。
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {"studentClassDto.classId"})
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody StudentClassDto studentClassDto) {
|
public ResponseResult<Long> add(@MyRequestBody StudentClassDto studentClassDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto, false);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -69,9 +66,10 @@ public class StudentClassController {
|
|||||||
* @param studentClassDto 更新对象。
|
* @param studentClassDto 更新对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody StudentClassDto studentClassDto) {
|
public ResponseResult<Void> update(@MyRequestBody StudentClassDto studentClassDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto, true);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -100,6 +98,7 @@ public class StudentClassController {
|
|||||||
* @param classId 删除对象主键Id。
|
* @param classId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long classId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long classId) {
|
||||||
String errorMessage;
|
String errorMessage;
|
||||||
@@ -138,7 +137,8 @@ public class StudentClassController {
|
|||||||
}
|
}
|
||||||
StudentClass studentClassFilter = MyModelUtil.copyTo(studentClassDtoFilter, StudentClass.class);
|
StudentClass studentClassFilter = MyModelUtil.copyTo(studentClassDtoFilter, StudentClass.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentClass.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentClass.class);
|
||||||
List<StudentClass> studentClassList = studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
List<StudentClass> studentClassList =
|
||||||
|
studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentClassList, StudentClass.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(studentClassList, StudentClass.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,17 +176,20 @@ public class StudentClassController {
|
|||||||
@MyRequestBody CourseDto courseDtoFilter,
|
@MyRequestBody CourseDto courseDtoFilter,
|
||||||
@MyRequestBody MyOrderParam orderParam,
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
@MyRequestBody MyPageParam pageParam) {
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
ResponseResult<Void> verifyResult = this.doClassCourseVerify(classId);
|
if (MyCommonUtil.isNotBlankOrNull(classId) && !studentClassService.existId(classId)) {
|
||||||
if (!verifyResult.isSuccess()) {
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
return ResponseResult.errorFrom(verifyResult);
|
|
||||||
}
|
}
|
||||||
if (pageParam != null) {
|
if (pageParam != null) {
|
||||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
}
|
}
|
||||||
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||||
List<Course> courseList =
|
List<Course> courseList;
|
||||||
courseService.getNotInCourseListByClassId(classId, filter, orderBy);
|
if (MyCommonUtil.isNotBlankOrNull(classId)) {
|
||||||
|
courseList = courseService.getNotInCourseListByClassId(classId, filter, orderBy);
|
||||||
|
} else {
|
||||||
|
courseList = courseService.getCourseList(filter, orderBy);
|
||||||
|
}
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,13 +204,12 @@ public class StudentClassController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/listClassCourse")
|
@PostMapping("/listClassCourse")
|
||||||
public ResponseResult<MyPageData<CourseVo>> listClassCourse(
|
public ResponseResult<MyPageData<CourseVo>> listClassCourse(
|
||||||
@MyRequestBody Long classId,
|
@MyRequestBody(required = true) Long classId,
|
||||||
@MyRequestBody CourseDto courseDtoFilter,
|
@MyRequestBody CourseDto courseDtoFilter,
|
||||||
@MyRequestBody MyOrderParam orderParam,
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
@MyRequestBody MyPageParam pageParam) {
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
ResponseResult<Void> verifyResult = this.doClassCourseVerify(classId);
|
if (!studentClassService.existId(classId)) {
|
||||||
if (!verifyResult.isSuccess()) {
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
return ResponseResult.errorFrom(verifyResult);
|
|
||||||
}
|
}
|
||||||
if (pageParam != null) {
|
if (pageParam != null) {
|
||||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
@@ -219,16 +221,6 @@ public class StudentClassController {
|
|||||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResponseResult<Void> doClassCourseVerify(Long classId) {
|
|
||||||
if (MyCommonUtil.existBlankArgument(classId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
|
||||||
}
|
|
||||||
if (!studentClassService.existId(classId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
|
||||||
}
|
|
||||||
return ResponseResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量添加班级数据和 [课程数据] 对象的多对多关联关系数据。
|
* 批量添加班级数据和 [课程数据] 对象的多对多关联关系数据。
|
||||||
*
|
*
|
||||||
@@ -236,6 +228,7 @@ public class StudentClassController {
|
|||||||
* @param classCourseDtoList 关联对象列表。
|
* @param classCourseDtoList 关联对象列表。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD_M2M)
|
||||||
@PostMapping("/addClassCourse")
|
@PostMapping("/addClassCourse")
|
||||||
public ResponseResult<Void> addClassCourse(
|
public ResponseResult<Void> addClassCourse(
|
||||||
@MyRequestBody Long classId,
|
@MyRequestBody Long classId,
|
||||||
@@ -243,12 +236,10 @@ public class StudentClassController {
|
|||||||
if (MyCommonUtil.existBlankArgument(classId, classCourseDtoList)) {
|
if (MyCommonUtil.existBlankArgument(classId, classCourseDtoList)) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
}
|
}
|
||||||
for (ClassCourseDto classCourse : classCourseDtoList) {
|
String errorMessage = MyCommonUtil.getModelValidationError(classCourseDtoList);
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(classCourse);
|
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Set<Long> courseIdSet =
|
Set<Long> courseIdSet =
|
||||||
classCourseDtoList.stream().map(ClassCourseDto::getCourseId).collect(Collectors.toSet());
|
classCourseDtoList.stream().map(ClassCourseDto::getCourseId).collect(Collectors.toSet());
|
||||||
if (!studentClassService.existId(classId)
|
if (!studentClassService.existId(classId)
|
||||||
@@ -267,6 +258,7 @@ public class StudentClassController {
|
|||||||
* @param classCourseDto 对多对中间表对象。
|
* @param classCourseDto 对多对中间表对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/updateClassCourse")
|
@PostMapping("/updateClassCourse")
|
||||||
public ResponseResult<Void> updateClassCourse(
|
public ResponseResult<Void> updateClassCourse(
|
||||||
@MyRequestBody ClassCourseDto classCourseDto) {
|
@MyRequestBody ClassCourseDto classCourseDto) {
|
||||||
@@ -309,6 +301,7 @@ public class StudentClassController {
|
|||||||
* @param courseId 从表主键Id。
|
* @param courseId 从表主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE_M2M)
|
||||||
@PostMapping("/deleteClassCourse")
|
@PostMapping("/deleteClassCourse")
|
||||||
public ResponseResult<Void> deleteClassCourse(
|
public ResponseResult<Void> deleteClassCourse(
|
||||||
@MyRequestBody Long classId, @MyRequestBody Long courseId) {
|
@MyRequestBody Long classId, @MyRequestBody Long courseId) {
|
||||||
@@ -336,17 +329,20 @@ public class StudentClassController {
|
|||||||
@MyRequestBody StudentDto studentDtoFilter,
|
@MyRequestBody StudentDto studentDtoFilter,
|
||||||
@MyRequestBody MyOrderParam orderParam,
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
@MyRequestBody MyPageParam pageParam) {
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
ResponseResult<Void> verifyResult = this.doClassStudentVerify(classId);
|
if (MyCommonUtil.isNotBlankOrNull(classId) && !studentClassService.existId(classId)) {
|
||||||
if (!verifyResult.isSuccess()) {
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
return ResponseResult.errorFrom(verifyResult);
|
|
||||||
}
|
}
|
||||||
if (pageParam != null) {
|
if (pageParam != null) {
|
||||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
}
|
}
|
||||||
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||||
List<Student> studentList =
|
List<Student> studentList;
|
||||||
studentService.getNotInStudentListByClassId(classId, filter, orderBy);
|
if (MyCommonUtil.isNotBlankOrNull(classId)) {
|
||||||
|
studentList = studentService.getNotInStudentListByClassId(classId, filter, orderBy);
|
||||||
|
} else {
|
||||||
|
studentList = studentService.getStudentList(filter, orderBy);
|
||||||
|
}
|
||||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,13 +357,12 @@ public class StudentClassController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/listClassStudent")
|
@PostMapping("/listClassStudent")
|
||||||
public ResponseResult<MyPageData<StudentVo>> listClassStudent(
|
public ResponseResult<MyPageData<StudentVo>> listClassStudent(
|
||||||
@MyRequestBody Long classId,
|
@MyRequestBody(required = true) Long classId,
|
||||||
@MyRequestBody StudentDto studentDtoFilter,
|
@MyRequestBody StudentDto studentDtoFilter,
|
||||||
@MyRequestBody MyOrderParam orderParam,
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
@MyRequestBody MyPageParam pageParam) {
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
ResponseResult<Void> verifyResult = this.doClassStudentVerify(classId);
|
if (!studentClassService.existId(classId)) {
|
||||||
if (!verifyResult.isSuccess()) {
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
return ResponseResult.errorFrom(verifyResult);
|
|
||||||
}
|
}
|
||||||
if (pageParam != null) {
|
if (pageParam != null) {
|
||||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
@@ -379,16 +374,6 @@ public class StudentClassController {
|
|||||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResponseResult<Void> doClassStudentVerify(Long classId) {
|
|
||||||
if (MyCommonUtil.existBlankArgument(classId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
|
||||||
}
|
|
||||||
if (!studentClassService.existId(classId)) {
|
|
||||||
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
|
||||||
}
|
|
||||||
return ResponseResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量添加班级数据和 [学生数据] 对象的多对多关联关系数据。
|
* 批量添加班级数据和 [学生数据] 对象的多对多关联关系数据。
|
||||||
*
|
*
|
||||||
@@ -396,6 +381,7 @@ public class StudentClassController {
|
|||||||
* @param classStudentDtoList 关联对象列表。
|
* @param classStudentDtoList 关联对象列表。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD_M2M)
|
||||||
@PostMapping("/addClassStudent")
|
@PostMapping("/addClassStudent")
|
||||||
public ResponseResult<Void> addClassStudent(
|
public ResponseResult<Void> addClassStudent(
|
||||||
@MyRequestBody Long classId,
|
@MyRequestBody Long classId,
|
||||||
@@ -403,12 +389,10 @@ public class StudentClassController {
|
|||||||
if (MyCommonUtil.existBlankArgument(classId, classStudentDtoList)) {
|
if (MyCommonUtil.existBlankArgument(classId, classStudentDtoList)) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
}
|
}
|
||||||
for (ClassStudentDto classStudent : classStudentDtoList) {
|
String errorMessage = MyCommonUtil.getModelValidationError(classStudentDtoList);
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(classStudent);
|
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Set<Long> studentIdSet =
|
Set<Long> studentIdSet =
|
||||||
classStudentDtoList.stream().map(ClassStudentDto::getStudentId).collect(Collectors.toSet());
|
classStudentDtoList.stream().map(ClassStudentDto::getStudentId).collect(Collectors.toSet());
|
||||||
if (!studentClassService.existId(classId)
|
if (!studentClassService.existId(classId)
|
||||||
@@ -428,6 +412,7 @@ public class StudentClassController {
|
|||||||
* @param studentId 从表主键Id。
|
* @param studentId 从表主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE_M2M)
|
||||||
@PostMapping("/deleteClassStudent")
|
@PostMapping("/deleteClassStudent")
|
||||||
public ResponseResult<Void> deleteClassStudent(
|
public ResponseResult<Void> deleteClassStudent(
|
||||||
@MyRequestBody Long classId, @MyRequestBody Long studentId) {
|
@MyRequestBody Long classId, @MyRequestBody Long studentId) {
|
||||||
@@ -439,4 +424,24 @@ public class StudentClassController {
|
|||||||
}
|
}
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String doBusinessDataVerify(
|
||||||
|
StudentClassDto studentClassDto,
|
||||||
|
boolean forUpdate,
|
||||||
|
List<ClassCourseDto> classCourseDtoList,
|
||||||
|
List<ClassStudentDto> classStudentDtoList) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(studentClassDto, forUpdate);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
errorMessage = MyCommonUtil.getModelValidationError(classCourseDtoList);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return "参数 [classCourseDtoList] 数据验证失败" + errorMessage;
|
||||||
|
}
|
||||||
|
errorMessage = MyCommonUtil.getModelValidationError(classStudentDtoList);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return "参数 [classStudentDtoList] 数据验证失败" + errorMessage;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.orange.demo.webadmin.app.controller;
|
package com.orange.demo.webadmin.app.controller;
|
||||||
|
|
||||||
import cn.jimmyshi.beanquery.BeanQuery;
|
import cn.jimmyshi.beanquery.BeanQuery;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import com.orange.demo.webadmin.app.vo.*;
|
import com.orange.demo.webadmin.app.vo.*;
|
||||||
import com.orange.demo.webadmin.app.dto.*;
|
import com.orange.demo.webadmin.app.dto.*;
|
||||||
@@ -10,15 +12,11 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.groups.Default;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生数据操作控制器类。
|
* 学生数据操作控制器类。
|
||||||
@@ -26,7 +24,6 @@ import javax.validation.groups.Default;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "学生数据管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/app/student")
|
@RequestMapping("/admin/app/student")
|
||||||
@@ -41,16 +38,10 @@ public class StudentController {
|
|||||||
* @param studentDto 新增对象。
|
* @param studentDto 新增对象。
|
||||||
* @return 应答结果对象,包含新增对象主键Id。
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
"studentDto.studentId",
|
|
||||||
"studentDto.searchString",
|
|
||||||
"studentDto.birthdayStart",
|
|
||||||
"studentDto.birthdayEnd",
|
|
||||||
"studentDto.registerTimeStart",
|
|
||||||
"studentDto.registerTimeEnd"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody StudentDto studentDto) {
|
public ResponseResult<Long> add(@MyRequestBody StudentDto studentDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, false);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -71,15 +62,10 @@ public class StudentController {
|
|||||||
* @param studentDto 更新对象。
|
* @param studentDto 更新对象。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
"studentDto.searchString",
|
|
||||||
"studentDto.birthdayStart",
|
|
||||||
"studentDto.birthdayEnd",
|
|
||||||
"studentDto.registerTimeStart",
|
|
||||||
"studentDto.registerTimeEnd"})
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody StudentDto studentDto) {
|
public ResponseResult<Void> update(@MyRequestBody StudentDto studentDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(studentDto, true);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -108,6 +94,7 @@ public class StudentController {
|
|||||||
* @param studentId 删除对象主键Id。
|
* @param studentId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long studentId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long studentId) {
|
||||||
String errorMessage;
|
String errorMessage;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.orange.demo.webadmin.app.dao;
|
|||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.webadmin.app.model.ClassCourse;
|
import com.orange.demo.webadmin.app.model.ClassCourse;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据操作访问接口。
|
* 数据操作访问接口。
|
||||||
*
|
*
|
||||||
@@ -10,4 +12,11 @@ import com.orange.demo.webadmin.app.model.ClassCourse;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
public interface ClassCourseMapper extends BaseDaoMapper<ClassCourse> {
|
public interface ClassCourseMapper extends BaseDaoMapper<ClassCourse> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param classCourseList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<ClassCourse> classCourseList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.orange.demo.webadmin.app.dao;
|
|||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.webadmin.app.model.ClassStudent;
|
import com.orange.demo.webadmin.app.model.ClassStudent;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据操作访问接口。
|
* 数据操作访问接口。
|
||||||
*
|
*
|
||||||
@@ -10,4 +12,11 @@ import com.orange.demo.webadmin.app.model.ClassStudent;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
public interface ClassStudentMapper extends BaseDaoMapper<ClassStudent> {
|
public interface ClassStudentMapper extends BaseDaoMapper<ClassStudent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param classStudentList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<ClassStudent> classStudentList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface CourseMapper extends BaseDaoMapper<Course> {
|
public interface CourseMapper extends BaseDaoMapper<Course> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param courseList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<Course> courseList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取过滤后的对象列表。
|
* 获取过滤后的对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface CourseTransStatsMapper extends BaseDaoMapper<CourseTransStats> {
|
public interface CourseTransStatsMapper extends BaseDaoMapper<CourseTransStats> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param courseTransStatsList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<CourseTransStats> courseTransStatsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分组计算后的数据对象列表。
|
* 获取分组计算后的数据对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.orange.demo.webadmin.app.dao;
|
|||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.webadmin.app.model.Grade;
|
import com.orange.demo.webadmin.app.model.Grade;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级数据操作访问接口。
|
* 年级数据操作访问接口。
|
||||||
*
|
*
|
||||||
@@ -10,4 +12,11 @@ import com.orange.demo.webadmin.app.model.Grade;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
public interface GradeMapper extends BaseDaoMapper<Grade> {
|
public interface GradeMapper extends BaseDaoMapper<Grade> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param gradeList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<Grade> gradeList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.orange.demo.webadmin.app.dao;
|
|||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.webadmin.app.model.MaterialEdition;
|
import com.orange.demo.webadmin.app.model.MaterialEdition;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据操作访问接口。
|
* 数据操作访问接口。
|
||||||
*
|
*
|
||||||
@@ -10,4 +12,11 @@ import com.orange.demo.webadmin.app.model.MaterialEdition;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
public interface MaterialEditionMapper extends BaseDaoMapper<MaterialEdition> {
|
public interface MaterialEditionMapper extends BaseDaoMapper<MaterialEdition> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param materialEditionList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<MaterialEdition> materialEditionList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.dao;
|
|
||||||
|
|
||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
|
||||||
import com.orange.demo.webadmin.app.model.SchoolInfo;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校区数据数据操作访问接口。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
public interface SchoolInfoMapper extends BaseDaoMapper<SchoolInfo> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取过滤后的对象列表。
|
|
||||||
*
|
|
||||||
* @param schoolInfoFilter 主表过滤对象。
|
|
||||||
* @param orderBy 排序字符串,order by从句的参数。
|
|
||||||
* @return 对象列表。
|
|
||||||
*/
|
|
||||||
List<SchoolInfo> getSchoolInfoList(
|
|
||||||
@Param("schoolInfoFilter") SchoolInfo schoolInfoFilter, @Param("orderBy") String orderBy);
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface StudentActionStatsMapper extends BaseDaoMapper<StudentActionStats> {
|
public interface StudentActionStatsMapper extends BaseDaoMapper<StudentActionStats> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentActionStatsList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<StudentActionStats> studentActionStatsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分组计算后的数据对象列表。
|
* 获取分组计算后的数据对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface StudentActionTransMapper extends BaseDaoMapper<StudentActionTrans> {
|
public interface StudentActionTransMapper extends BaseDaoMapper<StudentActionTrans> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentActionTransList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<StudentActionTrans> studentActionTransList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取过滤后的对象列表。
|
* 获取过滤后的对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface StudentClassMapper extends BaseDaoMapper<StudentClass> {
|
public interface StudentClassMapper extends BaseDaoMapper<StudentClass> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentClassList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<StudentClass> studentClassList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取过滤后的对象列表。
|
* 获取过滤后的对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface StudentMapper extends BaseDaoMapper<Student> {
|
public interface StudentMapper extends BaseDaoMapper<Student> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<Student> studentList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取过滤后的对象列表。
|
* 获取过滤后的对象列表。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -6,4 +6,17 @@
|
|||||||
<id column="course_id" jdbcType="BIGINT" property="courseId"/>
|
<id column="course_id" jdbcType="BIGINT" property="courseId"/>
|
||||||
<result column="course_order" jdbcType="TINYINT" property="courseOrder"/>
|
<result column="course_order" jdbcType="TINYINT" property="courseOrder"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_class_course
|
||||||
|
(class_id,
|
||||||
|
course_id,
|
||||||
|
course_order)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.classId},
|
||||||
|
#{item.courseId},
|
||||||
|
#{item.courseOrder})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -5,4 +5,15 @@
|
|||||||
<id column="class_id" jdbcType="BIGINT" property="classId"/>
|
<id column="class_id" jdbcType="BIGINT" property="classId"/>
|
||||||
<id column="student_id" jdbcType="BIGINT" property="studentId"/>
|
<id column="student_id" jdbcType="BIGINT" property="studentId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_class_student
|
||||||
|
(class_id,
|
||||||
|
student_id)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.classId},
|
||||||
|
#{item.studentId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -21,6 +21,37 @@
|
|||||||
notNullColumn="course_id" resultMap="com.orange.demo.webadmin.app.dao.ClassCourseMapper.BaseResultMap" />
|
notNullColumn="course_id" resultMap="com.orange.demo.webadmin.app.dao.ClassCourseMapper.BaseResultMap" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_course
|
||||||
|
(course_id,
|
||||||
|
course_name,
|
||||||
|
price,
|
||||||
|
description,
|
||||||
|
difficulty,
|
||||||
|
grade_id,
|
||||||
|
subject_id,
|
||||||
|
class_hour,
|
||||||
|
picture_url,
|
||||||
|
create_user_id,
|
||||||
|
create_time,
|
||||||
|
update_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.courseId},
|
||||||
|
#{item.courseName},
|
||||||
|
#{item.price},
|
||||||
|
#{item.description},
|
||||||
|
#{item.difficulty},
|
||||||
|
#{item.gradeId},
|
||||||
|
#{item.subjectId},
|
||||||
|
#{item.classHour},
|
||||||
|
#{item.pictureUrl},
|
||||||
|
#{item.createUserId},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -14,6 +14,33 @@
|
|||||||
<result column="student_flower_count" jdbcType="INTEGER" property="studentFlowerCount"/>
|
<result column="student_flower_count" jdbcType="INTEGER" property="studentFlowerCount"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_course_trans_stats
|
||||||
|
(stats_id,
|
||||||
|
stats_date,
|
||||||
|
subject_id,
|
||||||
|
grade_id,
|
||||||
|
grade_name,
|
||||||
|
course_id,
|
||||||
|
course_name,
|
||||||
|
student_attend_count,
|
||||||
|
student_flower_amount,
|
||||||
|
student_flower_count)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.statsId},
|
||||||
|
#{item.statsDate},
|
||||||
|
#{item.subjectId},
|
||||||
|
#{item.gradeId},
|
||||||
|
#{item.gradeName},
|
||||||
|
#{item.courseId},
|
||||||
|
#{item.courseName},
|
||||||
|
#{item.studentAttendCount},
|
||||||
|
#{item.studentFlowerAmount},
|
||||||
|
#{item.studentFlowerCount})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -6,4 +6,17 @@
|
|||||||
<result column="grade_name" jdbcType="VARCHAR" property="gradeName"/>
|
<result column="grade_name" jdbcType="VARCHAR" property="gradeName"/>
|
||||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_grade
|
||||||
|
(grade_id,
|
||||||
|
grade_name,
|
||||||
|
status)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.gradeId},
|
||||||
|
#{item.gradeName},
|
||||||
|
#{item.status})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,4 +6,17 @@
|
|||||||
<result column="edition_name" jdbcType="VARCHAR" property="editionName"/>
|
<result column="edition_name" jdbcType="VARCHAR" property="editionName"/>
|
||||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_material_edition
|
||||||
|
(edition_id,
|
||||||
|
edition_name,
|
||||||
|
status)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.editionId},
|
||||||
|
#{item.editionName},
|
||||||
|
#{item.status})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.orange.demo.webadmin.app.dao.SchoolInfoMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.app.model.SchoolInfo">
|
|
||||||
<id column="school_id" jdbcType="BIGINT" property="schoolId"/>
|
|
||||||
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
|
|
||||||
<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.webadmin.app.dao.SchoolInfoMapper.inputFilterRef"/>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
|
||||||
<sql id="inputFilterRef">
|
|
||||||
<if test="schoolInfoFilter != null">
|
|
||||||
<if test="schoolInfoFilter.schoolName != null and schoolInfoFilter.schoolName != ''">
|
|
||||||
<bind name = "safeSchoolInfoSchoolName" value = "'%' + schoolInfoFilter.schoolName + '%'" />
|
|
||||||
AND zz_school_info.school_name LIKE #{safeSchoolInfoSchoolName}
|
|
||||||
</if>
|
|
||||||
<if test="schoolInfoFilter.provinceId != null">
|
|
||||||
AND zz_school_info.province_id = #{schoolInfoFilter.provinceId}
|
|
||||||
</if>
|
|
||||||
<if test="schoolInfoFilter.cityId != null">
|
|
||||||
AND zz_school_info.city_id = #{schoolInfoFilter.cityId}
|
|
||||||
</if>
|
|
||||||
</if>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="getSchoolInfoList" resultMap="BaseResultMap" parameterType="com.orange.demo.webadmin.app.model.SchoolInfo">
|
|
||||||
SELECT * FROM zz_school_info
|
|
||||||
<where>
|
|
||||||
<include refid="filterRef"/>
|
|
||||||
</where>
|
|
||||||
<if test="orderBy != null and orderBy != ''">
|
|
||||||
ORDER BY ${orderBy}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -25,6 +25,55 @@
|
|||||||
<result column="do_exercise_correct_count" jdbcType="INTEGER" property="doExerciseCorrectCount"/>
|
<result column="do_exercise_correct_count" jdbcType="INTEGER" property="doExerciseCorrectCount"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_student_action_stats
|
||||||
|
(stats_id,
|
||||||
|
stats_date,
|
||||||
|
stats_month,
|
||||||
|
grade_id,
|
||||||
|
province_id,
|
||||||
|
city_id,
|
||||||
|
buy_course_amount,
|
||||||
|
buy_course_count,
|
||||||
|
buy_video_amount,
|
||||||
|
buy_video_count,
|
||||||
|
buy_paper_amount,
|
||||||
|
buy_paper_count,
|
||||||
|
buy_flower_amount,
|
||||||
|
buy_flower_count,
|
||||||
|
recharge_coin_amount,
|
||||||
|
recharge_coin_count,
|
||||||
|
do_course_count,
|
||||||
|
watch_video_count,
|
||||||
|
watch_video_total_second,
|
||||||
|
do_exercise_count,
|
||||||
|
do_exercise_correct_count)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.statsId},
|
||||||
|
#{item.statsDate},
|
||||||
|
#{item.statsMonth},
|
||||||
|
#{item.gradeId},
|
||||||
|
#{item.provinceId},
|
||||||
|
#{item.cityId},
|
||||||
|
#{item.buyCourseAmount},
|
||||||
|
#{item.buyCourseCount},
|
||||||
|
#{item.buyVideoAmount},
|
||||||
|
#{item.buyVideoCount},
|
||||||
|
#{item.buyPaperAmount},
|
||||||
|
#{item.buyPaperCount},
|
||||||
|
#{item.buyFlowerAmount},
|
||||||
|
#{item.buyFlowerCount},
|
||||||
|
#{item.rechargeCoinAmount},
|
||||||
|
#{item.rechargeCoinCount},
|
||||||
|
#{item.doCourseCount},
|
||||||
|
#{item.watchVideoCount},
|
||||||
|
#{item.watchVideoTotalSecond},
|
||||||
|
#{item.doExerciseCount},
|
||||||
|
#{item.doExerciseCorrectCount})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -19,6 +19,43 @@
|
|||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_student_action_trans
|
||||||
|
(trans_id,
|
||||||
|
student_id,
|
||||||
|
student_name,
|
||||||
|
school_id,
|
||||||
|
grade_id,
|
||||||
|
action_type,
|
||||||
|
device_type,
|
||||||
|
watch_video_seconds,
|
||||||
|
flower_count,
|
||||||
|
paper_count,
|
||||||
|
video_count,
|
||||||
|
course_count,
|
||||||
|
coin_count,
|
||||||
|
exercise_correct_flag,
|
||||||
|
create_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.transId},
|
||||||
|
#{item.studentId},
|
||||||
|
#{item.studentName},
|
||||||
|
#{item.schoolId},
|
||||||
|
#{item.gradeId},
|
||||||
|
#{item.actionType},
|
||||||
|
#{item.deviceType},
|
||||||
|
#{item.watchVideoSeconds},
|
||||||
|
#{item.flowerCount},
|
||||||
|
#{item.paperCount},
|
||||||
|
#{item.videoCount},
|
||||||
|
#{item.courseCount},
|
||||||
|
#{item.coinCount},
|
||||||
|
#{item.exerciseCorrectFlag},
|
||||||
|
#{item.createTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -13,6 +13,31 @@
|
|||||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_class
|
||||||
|
(class_id,
|
||||||
|
class_name,
|
||||||
|
school_id,
|
||||||
|
leader_id,
|
||||||
|
finish_class_hour,
|
||||||
|
class_level,
|
||||||
|
create_user_id,
|
||||||
|
create_time,
|
||||||
|
status)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.classId},
|
||||||
|
#{item.className},
|
||||||
|
#{item.schoolId},
|
||||||
|
#{item.leaderId},
|
||||||
|
#{item.finishClassHour},
|
||||||
|
#{item.classLevel},
|
||||||
|
#{item.createUserId},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.status})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -19,6 +19,43 @@
|
|||||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_student
|
||||||
|
(student_id,
|
||||||
|
login_mobile,
|
||||||
|
student_name,
|
||||||
|
province_id,
|
||||||
|
city_id,
|
||||||
|
district_id,
|
||||||
|
gender,
|
||||||
|
birthday,
|
||||||
|
experience_level,
|
||||||
|
total_coin,
|
||||||
|
left_coin,
|
||||||
|
grade_id,
|
||||||
|
school_id,
|
||||||
|
register_time,
|
||||||
|
status)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.studentId},
|
||||||
|
#{item.loginMobile},
|
||||||
|
#{item.studentName},
|
||||||
|
#{item.provinceId},
|
||||||
|
#{item.cityId},
|
||||||
|
#{item.districtId},
|
||||||
|
#{item.gender},
|
||||||
|
#{item.birthday},
|
||||||
|
#{item.experienceLevel},
|
||||||
|
#{item.totalCoin},
|
||||||
|
#{item.leftCoin},
|
||||||
|
#{item.gradeId},
|
||||||
|
#{item.schoolId},
|
||||||
|
#{item.registerTime},
|
||||||
|
#{item.status})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.orange.demo.webadmin.app.dto;
|
|||||||
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -14,28 +12,24 @@ import javax.validation.constraints.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("ClassCourseDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class ClassCourseDto {
|
public class ClassCourseDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课程Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,课程Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程顺序(数值越小越靠前)。
|
* 课程顺序(数值越小越靠前)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程顺序(数值越小越靠前)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,课程顺序(数值越小越靠前)不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer courseOrder;
|
private Integer courseOrder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.orange.demo.webadmin.app.dto;
|
|||||||
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -14,21 +12,18 @@ import javax.validation.constraints.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("ClassStudentDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class ClassStudentDto {
|
public class ClassStudentDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import com.orange.demo.common.core.validator.ConstDictRef;
|
|||||||
import com.orange.demo.webadmin.app.model.constant.CourseDifficult;
|
import com.orange.demo.webadmin.app.model.constant.CourseDifficult;
|
||||||
import com.orange.demo.application.common.constant.Subject;
|
import com.orange.demo.application.common.constant.Subject;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -19,41 +17,35 @@ import java.math.BigDecimal;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("CourseDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class CourseDto {
|
public class CourseDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程名称", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,课程名称不能为空!")
|
@NotBlank(message = "数据验证失败,课程名称不能为空!")
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程价格。
|
* 课程价格。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程价格", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课程价格不能为空!")
|
@NotNull(message = "数据验证失败,课程价格不能为空!")
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程描述。
|
* 课程描述。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程描述")
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课程难度不能为空!")
|
@NotNull(message = "数据验证失败,课程难度不能为空!")
|
||||||
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
|
@ConstDictRef(constDictClass = CourseDifficult.class, message = "数据验证失败,课程难度为无效值!")
|
||||||
private Integer difficulty;
|
private Integer difficulty;
|
||||||
@@ -61,14 +53,12 @@ public class CourseDto {
|
|||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学科Id。
|
* 学科Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学科Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属学科不能为空!")
|
@NotNull(message = "数据验证失败,所属学科不能为空!")
|
||||||
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
|
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属学科为无效值!")
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
@@ -76,50 +66,42 @@ public class CourseDto {
|
|||||||
/**
|
/**
|
||||||
* 课时数量。
|
* 课时数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课时数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课时数量不能为空!")
|
@NotNull(message = "数据验证失败,课时数量不能为空!")
|
||||||
private Integer classHour;
|
private Integer classHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多张课程图片地址。
|
* 多张课程图片地址。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "多张课程图片地址", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,课程图片不能为空!")
|
@NotBlank(message = "数据验证失败,课程图片不能为空!")
|
||||||
private String pictureUrl;
|
private String pictureUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* price 范围过滤起始值(>=)。
|
* price 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "price 范围过滤起始值(>=)")
|
|
||||||
private BigDecimal priceStart;
|
private BigDecimal priceStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* price 范围过滤结束值(<=)。
|
* price 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "price 范围过滤结束值(<=)")
|
|
||||||
private BigDecimal priceEnd;
|
private BigDecimal priceEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* classHour 范围过滤起始值(>=)。
|
* classHour 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "classHour 范围过滤起始值(>=)")
|
|
||||||
private Integer classHourStart;
|
private Integer classHourStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* classHour 范围过滤结束值(<=)。
|
* classHour 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "classHour 范围过滤结束值(<=)")
|
|
||||||
private Integer classHourEnd;
|
private Integer classHourEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤起始值(>=)。
|
* createTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
|
|
||||||
private String createTimeStart;
|
private String createTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤结束值(<=)。
|
* createTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
|
||||||
private String createTimeEnd;
|
private String createTimeEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import com.orange.demo.common.core.validator.UpdateGroup;
|
|||||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||||
import com.orange.demo.application.common.constant.Subject;
|
import com.orange.demo.application.common.constant.Subject;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -18,28 +16,24 @@ import java.util.Date;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("CourseTransStatsDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class CourseTransStatsDto {
|
public class CourseTransStatsDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计日期", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 科目Id。
|
* 科目Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "科目Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属科目不能为空!")
|
@NotNull(message = "数据验证失败,所属科目不能为空!")
|
||||||
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
|
@ConstDictRef(constDictClass = Subject.class, message = "数据验证失败,所属科目为无效值!")
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
@@ -47,59 +41,50 @@ public class CourseTransStatsDto {
|
|||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级名称")
|
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,课程Id不能为空!")
|
@NotNull(message = "数据验证失败,课程Id不能为空!")
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程名称")
|
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生上课次数。
|
* 学生上课次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生上课次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,上课次数不能为空!")
|
@NotNull(message = "数据验证失败,上课次数不能为空!")
|
||||||
private Integer studentAttendCount;
|
private Integer studentAttendCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花数量。
|
* 学生献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生献花数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,献花数量不能为空!")
|
@NotNull(message = "数据验证失败,献花数量不能为空!")
|
||||||
private Integer studentFlowerAmount;
|
private Integer studentFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花次数。
|
* 学生献花次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生献花次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,献花次数不能为空!")
|
@NotNull(message = "数据验证失败,献花次数不能为空!")
|
||||||
private Integer studentFlowerCount;
|
private Integer studentFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤起始值(>=)。
|
* statsDate 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
|
|
||||||
private String statsDateStart;
|
private String statsDateStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤结束值(<=)。
|
* statsDate 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
|
||||||
private String statsDateEnd;
|
private String statsDateEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.orange.demo.webadmin.app.dto;
|
|||||||
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -14,21 +12,18 @@ import javax.validation.constraints.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("GradeDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class GradeDto {
|
public class GradeDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级名称", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,年级名称不能为空!")
|
@NotBlank(message = "数据验证失败,年级名称不能为空!")
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.dto;
|
|
||||||
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SchoolInfoDto对象。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
@ApiModel("SchoolInfoDto对象")
|
|
||||||
@Data
|
|
||||||
public class SchoolInfoDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "学校Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学校Id不能为空!", groups = {UpdateGroup.class})
|
|
||||||
private Long schoolId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校名称。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "学校名称", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,学校名称不能为空!")
|
|
||||||
private String schoolName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在省Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "所在省Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
|
||||||
private Long provinceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在城市Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
|
||||||
private Long cityId;
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,6 @@ package com.orange.demo.webadmin.app.dto;
|
|||||||
|
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -16,165 +14,141 @@ import java.util.Date;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentActionStatsDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentActionStatsDto {
|
public class StudentActionStatsDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计日期", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
@NotNull(message = "数据验证失败,统计日期不能为空!")
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计小时。
|
* 统计小时。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计小时")
|
|
||||||
private Date statsMonth;
|
private Date statsMonth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
@NotNull(message = "数据验证失败,所属年级不能为空!")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在省Id。
|
* 学生所在省Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生所在省Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在城市Id。
|
* 学生所在城市Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生所在城市Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在城市不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,所在城市不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购课学币数量。
|
* 购课学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购课学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购课学币数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购课学币数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyCourseAmount;
|
private Integer buyCourseAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程次数。
|
* 购买课程次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买课程次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买课程次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买课程次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyCourseCount;
|
private Integer buyCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频学币数量。
|
* 购买视频学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买视频学币数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买视频学币数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyVideoAmount;
|
private Integer buyVideoAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频次数。
|
* 购买视频次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买视频次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买视频次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyVideoCount;
|
private Integer buyVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业学币数量。
|
* 购买作业学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买作业学币数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买作业学币数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyPaperAmount;
|
private Integer buyPaperAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业次数。
|
* 购买作业次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买作业次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买作业次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyPaperCount;
|
private Integer buyPaperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买献花数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买献花数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyFlowerAmount;
|
private Integer buyFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花次数。
|
* 购买献花次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买献花次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,购买献花次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer buyFlowerCount;
|
private Integer buyFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,充值学币数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,充值学币数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer rechargeCoinAmount;
|
private Integer rechargeCoinAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币次数。
|
* 充值学币次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,充值学币次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,充值学币次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer rechargeCoinCount;
|
private Integer rechargeCoinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线下课程上课次数。
|
* 线下课程上课次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "线下课程上课次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,线下课程上课次数不能为空!")
|
@NotNull(message = "数据验证失败,线下课程上课次数不能为空!")
|
||||||
private Integer doCourseCount;
|
private Integer doCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 观看视频次数。
|
* 观看视频次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "观看视频次数", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,观看视频次数不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,观看视频次数不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer watchVideoCount;
|
private Integer watchVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花消费学币数量。
|
* 购买献花消费学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花消费学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!")
|
@NotNull(message = "数据验证失败,购买献花消费学币数量不能为空!")
|
||||||
private Integer watchVideoTotalSecond;
|
private Integer watchVideoTotalSecond;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题数量。
|
* 做题数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,做题数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,做题数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer doExerciseCount;
|
private Integer doExerciseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题正确的数量。
|
* 做题正确的数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题正确的数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,做题正确的数量不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,做题正确的数量不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer doExerciseCorrectCount;
|
private Integer doExerciseCorrectCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤起始值(>=)。
|
* statsDate 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "statsDate 范围过滤起始值(>=)")
|
|
||||||
private String statsDateStart;
|
private String statsDateStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤结束值(<=)。
|
* statsDate 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
|
||||||
private String statsDateEnd;
|
private String statsDateEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import com.orange.demo.common.core.validator.ConstDictRef;
|
|||||||
import com.orange.demo.application.common.constant.StudentActionType;
|
import com.orange.demo.application.common.constant.StudentActionType;
|
||||||
import com.orange.demo.application.common.constant.DeviceType;
|
import com.orange.demo.application.common.constant.DeviceType;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -19,49 +17,42 @@ import java.util.Date;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentActionTransDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentActionTransDto {
|
public class StudentActionTransDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long transId;
|
private Long transId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生Id不能为空!")
|
@NotNull(message = "数据验证失败,学生Id不能为空!")
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生名称。
|
* 学生名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生名称", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,学生名称不能为空!")
|
@NotBlank(message = "数据验证失败,学生名称不能为空!")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生校区。
|
* 学生校区。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生校区", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生校区不能为空!")
|
@NotNull(message = "数据验证失败,学生校区不能为空!")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生年级不能为空!")
|
@NotNull(message = "数据验证失败,学生年级不能为空!")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,行为类型不能为空!")
|
@NotNull(message = "数据验证失败,行为类型不能为空!")
|
||||||
@ConstDictRef(constDictClass = StudentActionType.class, message = "数据验证失败,行为类型为无效值!")
|
@ConstDictRef(constDictClass = StudentActionType.class, message = "数据验证失败,行为类型为无效值!")
|
||||||
private Integer actionType;
|
private Integer actionType;
|
||||||
@@ -69,7 +60,6 @@ public class StudentActionTransDto {
|
|||||||
/**
|
/**
|
||||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,设备类型不能为空!")
|
@NotNull(message = "数据验证失败,设备类型不能为空!")
|
||||||
@ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!")
|
@ConstDictRef(constDictClass = DeviceType.class, message = "数据验证失败,设备类型为无效值!")
|
||||||
private Integer deviceType;
|
private Integer deviceType;
|
||||||
@@ -77,61 +67,51 @@ public class StudentActionTransDto {
|
|||||||
/**
|
/**
|
||||||
* 看视频秒数。
|
* 看视频秒数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "看视频秒数")
|
|
||||||
private Integer watchVideoSeconds;
|
private Integer watchVideoSeconds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花数量")
|
|
||||||
private Integer flowerCount;
|
private Integer flowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业数量。
|
* 购买作业数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业数量")
|
|
||||||
private Integer paperCount;
|
private Integer paperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频数量。
|
* 购买视频数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频数量")
|
|
||||||
private Integer videoCount;
|
private Integer videoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程数量。
|
* 购买课程数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买课程数量")
|
|
||||||
private Integer courseCount;
|
private Integer courseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币数量")
|
|
||||||
private Integer coinCount;
|
private Integer coinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题是否正确标记。
|
* 做题是否正确标记。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题是否正确标记")
|
|
||||||
private Integer exerciseCorrectFlag;
|
private Integer exerciseCorrectFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发生时间。
|
* 发生时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "发生时间", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,发生时间不能为空!")
|
@NotNull(message = "数据验证失败,发生时间不能为空!")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤起始值(>=)。
|
* createTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "createTime 范围过滤起始值(>=)")
|
|
||||||
private String createTimeStart;
|
private String createTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤结束值(<=)。
|
* createTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
|
||||||
private String createTimeEnd;
|
private String createTimeEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import com.orange.demo.common.core.validator.UpdateGroup;
|
|||||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||||
import com.orange.demo.webadmin.app.model.constant.ClassLevel;
|
import com.orange.demo.webadmin.app.model.constant.ClassLevel;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -16,49 +14,42 @@ import javax.validation.constraints.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentClassDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentClassDto {
|
public class StudentClassDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,班级Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级名称。
|
* 班级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级名称", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,班级名称不能为空!")
|
@NotBlank(message = "数据验证失败,班级名称不能为空!")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校Id。
|
* 学校Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学校Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生班长Id。
|
* 学生班长Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生班长Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生班长不能为空!")
|
@NotNull(message = "数据验证失败,学生班长不能为空!")
|
||||||
private Long leaderId;
|
private Long leaderId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已完成课时数量。
|
* 已完成课时数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "已完成课时数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,已完成课时不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,已完成课时不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer finishClassHour;
|
private Integer finishClassHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,班级级别不能为空!")
|
@NotNull(message = "数据验证失败,班级级别不能为空!")
|
||||||
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
|
@ConstDictRef(constDictClass = ClassLevel.class, message = "数据验证失败,班级级别为无效值!")
|
||||||
private Integer classLevel;
|
private Integer classLevel;
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import com.orange.demo.application.common.constant.Gender;
|
|||||||
import com.orange.demo.application.common.constant.ExpLevel;
|
import com.orange.demo.application.common.constant.ExpLevel;
|
||||||
import com.orange.demo.application.common.constant.StudentStatus;
|
import com.orange.demo.application.common.constant.StudentStatus;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -20,56 +18,48 @@ import java.util.Date;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentDto对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentDto {
|
public class StudentDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,学生Id不能为空!", groups = {UpdateGroup.class})
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录手机。
|
* 登录手机。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "登录手机", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,手机号码不能为空!")
|
@NotBlank(message = "数据验证失败,手机号码不能为空!")
|
||||||
private String loginMobile;
|
private String loginMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生姓名。
|
* 学生姓名。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生姓名", required = true)
|
|
||||||
@NotBlank(message = "数据验证失败,学生姓名不能为空!")
|
@NotBlank(message = "数据验证失败,学生姓名不能为空!")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在省份Id。
|
* 所在省份Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "所在省份Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
@NotNull(message = "数据验证失败,所在省份不能为空!")
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在城市Id。
|
* 所在城市Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区县Id。
|
* 区县Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "区县Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所在区县不能为空!")
|
@NotNull(message = "数据验证失败,所在区县不能为空!")
|
||||||
private Long districtId;
|
private Long districtId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生性别 (0: 女生 1: 男生)。
|
* 学生性别 (0: 女生 1: 男生)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生性别不能为空!")
|
@NotNull(message = "数据验证失败,学生性别不能为空!")
|
||||||
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,学生性别为无效值!")
|
@ConstDictRef(constDictClass = Gender.class, message = "数据验证失败,学生性别为无效值!")
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
@@ -77,14 +67,12 @@ public class StudentDto {
|
|||||||
/**
|
/**
|
||||||
* 生日。
|
* 生日。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "生日", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,出生日期不能为空!")
|
@NotNull(message = "数据验证失败,出生日期不能为空!")
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,经验等级不能为空!")
|
@NotNull(message = "数据验证失败,经验等级不能为空!")
|
||||||
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
|
@ConstDictRef(constDictClass = ExpLevel.class, message = "数据验证失败,经验等级为无效值!")
|
||||||
private Integer experienceLevel;
|
private Integer experienceLevel;
|
||||||
@@ -92,34 +80,29 @@ public class StudentDto {
|
|||||||
/**
|
/**
|
||||||
* 总共充值学币数量。
|
* 总共充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "总共充值学币数量", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,充值学币不能为空!", groups = {UpdateGroup.class})
|
||||||
private Integer totalCoin;
|
private Integer totalCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可用学币数量。
|
* 可用学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "可用学币数量")
|
|
||||||
private Integer leftCoin;
|
private Integer leftCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,年级不能为空!")
|
@NotNull(message = "数据验证失败,年级不能为空!")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校区Id。
|
* 校区Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "校区Id", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
@NotNull(message = "数据验证失败,所属校区不能为空!")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)", required = true)
|
|
||||||
@NotNull(message = "数据验证失败,学生状态不能为空!", groups = {UpdateGroup.class})
|
@NotNull(message = "数据验证失败,学生状态不能为空!", groups = {UpdateGroup.class})
|
||||||
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,学生状态为无效值!")
|
@ConstDictRef(constDictClass = StudentStatus.class, message = "数据验证失败,学生状态为无效值!")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
@@ -127,30 +110,25 @@ public class StudentDto {
|
|||||||
/**
|
/**
|
||||||
* birthday 范围过滤起始值(>=)。
|
* birthday 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "birthday 范围过滤起始值(>=)")
|
|
||||||
private String birthdayStart;
|
private String birthdayStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* birthday 范围过滤结束值(<=)。
|
* birthday 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "birthday 范围过滤结束值(<=)")
|
|
||||||
private String birthdayEnd;
|
private String birthdayEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* registerTime 范围过滤起始值(>=)。
|
* registerTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "registerTime 范围过滤起始值(>=)")
|
|
||||||
private String registerTimeStart;
|
private String registerTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* registerTime 范围过滤结束值(<=)。
|
* registerTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "registerTime 范围过滤结束值(<=)")
|
|
||||||
private String registerTimeEnd;
|
private String registerTimeEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* login_mobile / student_name LIKE搜索字符串。
|
* login_mobile / student_name LIKE搜索字符串。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "LIKE模糊搜索字符串")
|
|
||||||
private String searchString;
|
private String searchString;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划实体对象。
|
* 行政区划实体对象。
|
||||||
*
|
*
|
||||||
@@ -11,31 +10,30 @@ import javax.persistence.*;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_area_code")
|
@TableName(value = "zz_area_code")
|
||||||
public class AreaCode {
|
public class AreaCode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划主键Id
|
* 行政区划主键Id
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "area_id")
|
||||||
@Column(name = "area_id")
|
|
||||||
private Long areaId;
|
private Long areaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划名称
|
* 行政区划名称
|
||||||
*/
|
*/
|
||||||
@Column(name = "area_name")
|
@TableField(value = "area_name")
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||||
*/
|
*/
|
||||||
@Column(name = "area_level")
|
@TableField(value = "area_level")
|
||||||
private Integer areaLevel;
|
private Integer areaLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父级行政区划Id
|
* 父级行政区划Id
|
||||||
*/
|
*/
|
||||||
@Column(name = "parent_id")
|
@TableField(value = "parent_id")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassCourse实体对象。
|
* ClassCourse实体对象。
|
||||||
@@ -10,26 +10,24 @@ import javax.persistence.*;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_class_course")
|
@TableName(value = "zz_class_course")
|
||||||
public class ClassCourse {
|
public class ClassCourse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableField(value = "class_id")
|
||||||
@Column(name = "class_id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableField(value = "course_id")
|
||||||
@Column(name = "course_id")
|
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程顺序(数值越小越靠前)。
|
* 课程顺序(数值越小越靠前)。
|
||||||
*/
|
*/
|
||||||
@Column(name = "course_order")
|
@TableField(value = "course_order")
|
||||||
private Integer courseOrder;
|
private Integer courseOrder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassStudent实体对象。
|
* ClassStudent实体对象。
|
||||||
@@ -10,20 +10,18 @@ import javax.persistence.*;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_class_student")
|
@TableName(value = "zz_class_student")
|
||||||
public class ClassStudent {
|
public class ClassStudent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableField(value = "class_id")
|
||||||
@Column(name = "class_id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableField(value = "student_id")
|
||||||
@Column(name = "student_id")
|
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.orange.demo.webadmin.app.model.constant.CourseDifficult;
|
import com.orange.demo.webadmin.app.model.constant.CourseDifficult;
|
||||||
import com.orange.demo.application.common.constant.Subject;
|
import com.orange.demo.application.common.constant.Subject;
|
||||||
import com.orange.demo.common.core.upload.UploadStoreTypeEnum;
|
import com.orange.demo.common.core.upload.UploadStoreTypeEnum;
|
||||||
@@ -11,7 +12,6 @@ import com.orange.demo.webadmin.app.vo.CourseVo;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -24,20 +24,19 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_course")
|
@TableName(value = "zz_course")
|
||||||
public class Course {
|
public class Course {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "course_id")
|
||||||
@Column(name = "course_id")
|
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "course_name")
|
@TableField(value = "course_name")
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,86 +57,86 @@ public class Course {
|
|||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_id")
|
@TableField(value = "grade_id")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学科Id。
|
* 学科Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "subject_id")
|
@TableField(value = "subject_id")
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课时数量。
|
* 课时数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "class_hour")
|
@TableField(value = "class_hour")
|
||||||
private Integer classHour;
|
private Integer classHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多张课程图片地址。
|
* 多张课程图片地址。
|
||||||
*/
|
*/
|
||||||
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
|
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
|
||||||
@Column(name = "picture_url")
|
@TableField(value = "picture_url")
|
||||||
private String pictureUrl;
|
private String pictureUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建用户Id。
|
* 创建用户Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "create_user_id")
|
@TableField(value = "create_user_id")
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间。
|
* 创建时间。
|
||||||
*/
|
*/
|
||||||
@Column(name = "create_time")
|
@TableField(value = "create_time")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后修改时间。
|
* 最后修改时间。
|
||||||
*/
|
*/
|
||||||
@Column(name = "update_time")
|
@TableField(value = "update_time")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* price 范围过滤起始值(>=)。
|
* price 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private BigDecimal priceStart;
|
private BigDecimal priceStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* price 范围过滤结束值(<=)。
|
* price 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private BigDecimal priceEnd;
|
private BigDecimal priceEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* classHour 范围过滤起始值(>=)。
|
* classHour 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Integer classHourStart;
|
private Integer classHourStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* classHour 范围过滤结束值(<=)。
|
* classHour 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Integer classHourEnd;
|
private Integer classHourEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤起始值(>=)。
|
* createTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String createTimeStart;
|
private String createTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤结束值(<=)。
|
* createTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String createTimeEnd;
|
private String createTimeEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* courseId 的多对多关联表数据对象。
|
* courseId 的多对多关联表数据对象。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private ClassCourse classCourse;
|
private ClassCourse classCourse;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -146,19 +145,19 @@ public class Course {
|
|||||||
slaveModelClass = Grade.class,
|
slaveModelClass = Grade.class,
|
||||||
slaveIdField = "gradeId",
|
slaveIdField = "gradeId",
|
||||||
slaveNameField = "gradeName")
|
slaveNameField = "gradeName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "difficulty",
|
masterIdField = "difficulty",
|
||||||
constantDictClass = CourseDifficult.class)
|
constantDictClass = CourseDifficult.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> difficultyDictMap;
|
private Map<String, Object> difficultyDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "subjectId",
|
masterIdField = "subjectId",
|
||||||
constantDictClass = Subject.class)
|
constantDictClass = Subject.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> subjectIdDictMap;
|
private Map<String, Object> subjectIdDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.orange.demo.application.common.constant.Subject;
|
import com.orange.demo.application.common.constant.Subject;
|
||||||
import com.orange.demo.common.core.annotation.RelationDict;
|
import com.orange.demo.common.core.annotation.RelationDict;
|
||||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||||
@@ -8,7 +9,6 @@ import com.orange.demo.webadmin.app.vo.CourseTransStatsVo;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -20,81 +20,79 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_course_trans_stats")
|
@TableName(value = "zz_course_trans_stats")
|
||||||
public class CourseTransStats {
|
public class CourseTransStats {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "stats_id", type = IdType.AUTO)
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "stats_id")
|
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@Column(name = "stats_date")
|
@TableField(value = "stats_date")
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 科目Id。
|
* 科目Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "subject_id")
|
@TableField(value = "subject_id")
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_id")
|
@TableField(value = "grade_id")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_name")
|
@TableField(value = "grade_name")
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "course_id")
|
@TableField(value = "course_id")
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "course_name")
|
@TableField(value = "course_name")
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生上课次数。
|
* 学生上课次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_attend_count")
|
@TableField(value = "student_attend_count")
|
||||||
private Integer studentAttendCount;
|
private Integer studentAttendCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花数量。
|
* 学生献花数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_flower_amount")
|
@TableField(value = "student_flower_amount")
|
||||||
private Integer studentFlowerAmount;
|
private Integer studentFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花次数。
|
* 学生献花次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_flower_count")
|
@TableField(value = "student_flower_count")
|
||||||
private Integer studentFlowerCount;
|
private Integer studentFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤起始值(>=)。
|
* statsDate 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String statsDateStart;
|
private String statsDateStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤结束值(<=)。
|
* statsDate 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String statsDateEnd;
|
private String statsDateEnd;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -103,13 +101,13 @@ public class CourseTransStats {
|
|||||||
slaveModelClass = Grade.class,
|
slaveModelClass = Grade.class,
|
||||||
slaveIdField = "gradeId",
|
slaveIdField = "gradeId",
|
||||||
slaveNameField = "gradeName")
|
slaveNameField = "gradeName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "subjectId",
|
masterIdField = "subjectId",
|
||||||
constantDictClass = Subject.class)
|
constantDictClass = Subject.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> subjectIdDictMap;
|
private Map<String, Object> subjectIdDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grade实体对象。
|
* Grade实体对象。
|
||||||
@@ -11,26 +10,24 @@ import javax.persistence.*;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_grade")
|
@TableName(value = "zz_grade")
|
||||||
public class Grade {
|
public class Grade {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "grade_id", type = IdType.AUTO)
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "grade_id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_name")
|
@TableField(value = "grade_name")
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||||
*/
|
*/
|
||||||
@DeletedFlagColumn
|
@TableLogic
|
||||||
private Integer status;
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MaterialEdition实体对象。
|
* MaterialEdition实体对象。
|
||||||
@@ -10,21 +10,19 @@ import javax.persistence.*;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_material_edition")
|
@TableName(value = "zz_material_edition")
|
||||||
public class MaterialEdition {
|
public class MaterialEdition {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "edition_id", type = IdType.AUTO)
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "edition_id")
|
|
||||||
private Integer editionId;
|
private Integer editionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 教材版本名称。
|
* 教材版本名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "edition_name")
|
@TableField(value = "edition_name")
|
||||||
private String editionName;
|
private String editionName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
|
||||||
|
|
||||||
import com.orange.demo.common.core.annotation.RelationDict;
|
|
||||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
|
||||||
import com.orange.demo.webadmin.app.vo.SchoolInfoVo;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.mapstruct.*;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SchoolInfo实体对象。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Table(name = "zz_school_info")
|
|
||||||
public class SchoolInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校Id。
|
|
||||||
*/
|
|
||||||
@Id
|
|
||||||
@Column(name = "school_id")
|
|
||||||
private Long schoolId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校名称。
|
|
||||||
*/
|
|
||||||
@Column(name = "school_name")
|
|
||||||
private String schoolName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在省Id。
|
|
||||||
*/
|
|
||||||
@Column(name = "province_id")
|
|
||||||
private Long provinceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在城市Id。
|
|
||||||
*/
|
|
||||||
@Column(name = "city_id")
|
|
||||||
private Long cityId;
|
|
||||||
|
|
||||||
@RelationDict(
|
|
||||||
masterIdField = "provinceId",
|
|
||||||
slaveServiceName = "areaCodeService",
|
|
||||||
slaveModelClass = AreaCode.class,
|
|
||||||
slaveIdField = "areaId",
|
|
||||||
slaveNameField = "areaName")
|
|
||||||
@Transient
|
|
||||||
private Map<String, Object> provinceIdDictMap;
|
|
||||||
|
|
||||||
@RelationDict(
|
|
||||||
masterIdField = "cityId",
|
|
||||||
slaveServiceName = "areaCodeService",
|
|
||||||
slaveModelClass = AreaCode.class,
|
|
||||||
slaveIdField = "areaId",
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDept;
|
||||||
import com.orange.demo.application.common.constant.Gender;
|
import com.orange.demo.application.common.constant.Gender;
|
||||||
import com.orange.demo.application.common.constant.ExpLevel;
|
import com.orange.demo.application.common.constant.ExpLevel;
|
||||||
import com.orange.demo.application.common.constant.StudentStatus;
|
import com.orange.demo.application.common.constant.StudentStatus;
|
||||||
@@ -11,7 +13,6 @@ import com.orange.demo.webadmin.app.vo.StudentVo;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -23,44 +24,43 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_student")
|
@TableName(value = "zz_student")
|
||||||
public class Student {
|
public class Student {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "student_id")
|
||||||
@Column(name = "student_id")
|
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录手机。
|
* 登录手机。
|
||||||
*/
|
*/
|
||||||
@Column(name = "login_mobile")
|
@TableField(value = "login_mobile")
|
||||||
private String loginMobile;
|
private String loginMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生姓名。
|
* 学生姓名。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_name")
|
@TableField(value = "student_name")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在省份Id。
|
* 所在省份Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "province_id")
|
@TableField(value = "province_id")
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在城市Id。
|
* 所在城市Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "city_id")
|
@TableField(value = "city_id")
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区县Id。
|
* 区县Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "district_id")
|
@TableField(value = "district_id")
|
||||||
private Long districtId;
|
private Long districtId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,37 +76,37 @@ public class Student {
|
|||||||
/**
|
/**
|
||||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||||
*/
|
*/
|
||||||
@Column(name = "experience_level")
|
@TableField(value = "experience_level")
|
||||||
private Integer experienceLevel;
|
private Integer experienceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总共充值学币数量。
|
* 总共充值学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "total_coin")
|
@TableField(value = "total_coin")
|
||||||
private Integer totalCoin;
|
private Integer totalCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可用学币数量。
|
* 可用学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "left_coin")
|
@TableField(value = "left_coin")
|
||||||
private Integer leftCoin;
|
private Integer leftCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_id")
|
@TableField(value = "grade_id")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校区Id。
|
* 校区Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "school_id")
|
@TableField(value = "school_id")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册时间。
|
* 注册时间。
|
||||||
*/
|
*/
|
||||||
@Column(name = "register_time")
|
@TableField(value = "register_time")
|
||||||
private Date registerTime;
|
private Date registerTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,31 +117,31 @@ public class Student {
|
|||||||
/**
|
/**
|
||||||
* birthday 范围过滤起始值(>=)。
|
* birthday 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String birthdayStart;
|
private String birthdayStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* birthday 范围过滤结束值(<=)。
|
* birthday 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String birthdayEnd;
|
private String birthdayEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* registerTime 范围过滤起始值(>=)。
|
* registerTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String registerTimeStart;
|
private String registerTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* registerTime 范围过滤结束值(<=)。
|
* registerTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String registerTimeEnd;
|
private String registerTimeEnd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* login_mobile / student_name LIKE搜索字符串。
|
* login_mobile / student_name LIKE搜索字符串。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String searchString;
|
private String searchString;
|
||||||
|
|
||||||
public void setSearchString(String searchString) {
|
public void setSearchString(String searchString) {
|
||||||
@@ -154,7 +154,7 @@ public class Student {
|
|||||||
slaveModelClass = AreaCode.class,
|
slaveModelClass = AreaCode.class,
|
||||||
slaveIdField = "areaId",
|
slaveIdField = "areaId",
|
||||||
slaveNameField = "areaName")
|
slaveNameField = "areaName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> provinceIdDictMap;
|
private Map<String, Object> provinceIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -163,7 +163,7 @@ public class Student {
|
|||||||
slaveModelClass = AreaCode.class,
|
slaveModelClass = AreaCode.class,
|
||||||
slaveIdField = "areaId",
|
slaveIdField = "areaId",
|
||||||
slaveNameField = "areaName")
|
slaveNameField = "areaName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> cityIdDictMap;
|
private Map<String, Object> cityIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -172,7 +172,7 @@ public class Student {
|
|||||||
slaveModelClass = AreaCode.class,
|
slaveModelClass = AreaCode.class,
|
||||||
slaveIdField = "areaId",
|
slaveIdField = "areaId",
|
||||||
slaveNameField = "areaName")
|
slaveNameField = "areaName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> districtIdDictMap;
|
private Map<String, Object> districtIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -181,34 +181,34 @@ public class Student {
|
|||||||
slaveModelClass = Grade.class,
|
slaveModelClass = Grade.class,
|
||||||
slaveIdField = "gradeId",
|
slaveIdField = "gradeId",
|
||||||
slaveNameField = "gradeName")
|
slaveNameField = "gradeName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
masterIdField = "schoolId",
|
masterIdField = "schoolId",
|
||||||
slaveServiceName = "schoolInfoService",
|
slaveServiceName = "sysDeptService",
|
||||||
slaveModelClass = SchoolInfo.class,
|
slaveModelClass = SysDept.class,
|
||||||
slaveIdField = "schoolId",
|
slaveIdField = "deptId",
|
||||||
slaveNameField = "schoolName")
|
slaveNameField = "deptName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "gender",
|
masterIdField = "gender",
|
||||||
constantDictClass = Gender.class)
|
constantDictClass = Gender.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> genderDictMap;
|
private Map<String, Object> genderDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "experienceLevel",
|
masterIdField = "experienceLevel",
|
||||||
constantDictClass = ExpLevel.class)
|
constantDictClass = ExpLevel.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> experienceLevelDictMap;
|
private Map<String, Object> experienceLevelDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "status",
|
masterIdField = "status",
|
||||||
constantDictClass = StudentStatus.class)
|
constantDictClass = StudentStatus.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> statusDictMap;
|
private Map<String, Object> statusDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.orange.demo.common.core.annotation.RelationDict;
|
import com.orange.demo.common.core.annotation.RelationDict;
|
||||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||||
import com.orange.demo.webadmin.app.vo.StudentActionStatsVo;
|
import com.orange.demo.webadmin.app.vo.StudentActionStatsVo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -18,146 +18,145 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_student_action_stats")
|
@TableName(value = "zz_student_action_stats")
|
||||||
public class StudentActionStats {
|
public class StudentActionStats {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "stats_id")
|
||||||
@Column(name = "stats_id")
|
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@Column(name = "stats_date")
|
@TableField(value = "stats_date")
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计小时。
|
* 统计小时。
|
||||||
*/
|
*/
|
||||||
@Column(name = "stats_month")
|
@TableField(value = "stats_month")
|
||||||
private Date statsMonth;
|
private Date statsMonth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_id")
|
@TableField(value = "grade_id")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在省Id。
|
* 学生所在省Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "province_id")
|
@TableField(value = "province_id")
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在城市Id。
|
* 学生所在城市Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "city_id")
|
@TableField(value = "city_id")
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购课学币数量。
|
* 购课学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_course_amount")
|
@TableField(value = "buy_course_amount")
|
||||||
private Integer buyCourseAmount;
|
private Integer buyCourseAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程次数。
|
* 购买课程次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_course_count")
|
@TableField(value = "buy_course_count")
|
||||||
private Integer buyCourseCount;
|
private Integer buyCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频学币数量。
|
* 购买视频学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_video_amount")
|
@TableField(value = "buy_video_amount")
|
||||||
private Integer buyVideoAmount;
|
private Integer buyVideoAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频次数。
|
* 购买视频次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_video_count")
|
@TableField(value = "buy_video_count")
|
||||||
private Integer buyVideoCount;
|
private Integer buyVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业学币数量。
|
* 购买作业学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_paper_amount")
|
@TableField(value = "buy_paper_amount")
|
||||||
private Integer buyPaperAmount;
|
private Integer buyPaperAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业次数。
|
* 购买作业次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_paper_count")
|
@TableField(value = "buy_paper_count")
|
||||||
private Integer buyPaperCount;
|
private Integer buyPaperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_flower_amount")
|
@TableField(value = "buy_flower_amount")
|
||||||
private Integer buyFlowerAmount;
|
private Integer buyFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花次数。
|
* 购买献花次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "buy_flower_count")
|
@TableField(value = "buy_flower_count")
|
||||||
private Integer buyFlowerCount;
|
private Integer buyFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "recharge_coin_amount")
|
@TableField(value = "recharge_coin_amount")
|
||||||
private Integer rechargeCoinAmount;
|
private Integer rechargeCoinAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币次数。
|
* 充值学币次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "recharge_coin_count")
|
@TableField(value = "recharge_coin_count")
|
||||||
private Integer rechargeCoinCount;
|
private Integer rechargeCoinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线下课程上课次数。
|
* 线下课程上课次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "do_course_count")
|
@TableField(value = "do_course_count")
|
||||||
private Integer doCourseCount;
|
private Integer doCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 观看视频次数。
|
* 观看视频次数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "watch_video_count")
|
@TableField(value = "watch_video_count")
|
||||||
private Integer watchVideoCount;
|
private Integer watchVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花消费学币数量。
|
* 购买献花消费学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "watch_video_total_second")
|
@TableField(value = "watch_video_total_second")
|
||||||
private Integer watchVideoTotalSecond;
|
private Integer watchVideoTotalSecond;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题数量。
|
* 做题数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "do_exercise_count")
|
@TableField(value = "do_exercise_count")
|
||||||
private Integer doExerciseCount;
|
private Integer doExerciseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题正确的数量。
|
* 做题正确的数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "do_exercise_correct_count")
|
@TableField(value = "do_exercise_correct_count")
|
||||||
private Integer doExerciseCorrectCount;
|
private Integer doExerciseCorrectCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤起始值(>=)。
|
* statsDate 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String statsDateStart;
|
private String statsDateStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* statsDate 范围过滤结束值(<=)。
|
* statsDate 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String statsDateEnd;
|
private String statsDateEnd;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -166,7 +165,7 @@ public class StudentActionStats {
|
|||||||
slaveModelClass = Grade.class,
|
slaveModelClass = Grade.class,
|
||||||
slaveIdField = "gradeId",
|
slaveIdField = "gradeId",
|
||||||
slaveNameField = "gradeName")
|
slaveNameField = "gradeName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -175,7 +174,7 @@ public class StudentActionStats {
|
|||||||
slaveModelClass = AreaCode.class,
|
slaveModelClass = AreaCode.class,
|
||||||
slaveIdField = "areaId",
|
slaveIdField = "areaId",
|
||||||
slaveNameField = "areaName")
|
slaveNameField = "areaName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> provinceIdDictMap;
|
private Map<String, Object> provinceIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -184,7 +183,7 @@ public class StudentActionStats {
|
|||||||
slaveModelClass = AreaCode.class,
|
slaveModelClass = AreaCode.class,
|
||||||
slaveIdField = "areaId",
|
slaveIdField = "areaId",
|
||||||
slaveNameField = "areaName")
|
slaveNameField = "areaName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> cityIdDictMap;
|
private Map<String, Object> cityIdDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDept;
|
||||||
import com.orange.demo.application.common.constant.StudentActionType;
|
import com.orange.demo.application.common.constant.StudentActionType;
|
||||||
import com.orange.demo.application.common.constant.DeviceType;
|
import com.orange.demo.application.common.constant.DeviceType;
|
||||||
import com.orange.demo.common.core.annotation.RelationDict;
|
import com.orange.demo.common.core.annotation.RelationDict;
|
||||||
@@ -9,7 +11,6 @@ import com.orange.demo.webadmin.app.vo.StudentActionTransVo;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -21,119 +22,118 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_student_action_trans")
|
@TableName(value = "zz_student_action_trans")
|
||||||
public class StudentActionTrans {
|
public class StudentActionTrans {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "trans_id")
|
||||||
@Column(name = "trans_id")
|
|
||||||
private Long transId;
|
private Long transId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_id")
|
@TableField(value = "student_id")
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生名称。
|
* 学生名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "student_name")
|
@TableField(value = "student_name")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生校区。
|
* 学生校区。
|
||||||
*/
|
*/
|
||||||
@Column(name = "school_id")
|
@TableField(value = "school_id")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "grade_id")
|
@TableField(value = "grade_id")
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||||
*/
|
*/
|
||||||
@Column(name = "action_type")
|
@TableField(value = "action_type")
|
||||||
private Integer actionType;
|
private Integer actionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||||
*/
|
*/
|
||||||
@Column(name = "device_type")
|
@TableField(value = "device_type")
|
||||||
private Integer deviceType;
|
private Integer deviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 看视频秒数。
|
* 看视频秒数。
|
||||||
*/
|
*/
|
||||||
@Column(name = "watch_video_seconds")
|
@TableField(value = "watch_video_seconds")
|
||||||
private Integer watchVideoSeconds;
|
private Integer watchVideoSeconds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "flower_count")
|
@TableField(value = "flower_count")
|
||||||
private Integer flowerCount;
|
private Integer flowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业数量。
|
* 购买作业数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "paper_count")
|
@TableField(value = "paper_count")
|
||||||
private Integer paperCount;
|
private Integer paperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频数量。
|
* 购买视频数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "video_count")
|
@TableField(value = "video_count")
|
||||||
private Integer videoCount;
|
private Integer videoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程数量。
|
* 购买课程数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "course_count")
|
@TableField(value = "course_count")
|
||||||
private Integer courseCount;
|
private Integer courseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "coin_count")
|
@TableField(value = "coin_count")
|
||||||
private Integer coinCount;
|
private Integer coinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题是否正确标记。
|
* 做题是否正确标记。
|
||||||
*/
|
*/
|
||||||
@Column(name = "exercise_correct_flag")
|
@TableField(value = "exercise_correct_flag")
|
||||||
private Integer exerciseCorrectFlag;
|
private Integer exerciseCorrectFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发生时间。
|
* 发生时间。
|
||||||
*/
|
*/
|
||||||
@Column(name = "create_time")
|
@TableField(value = "create_time")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤起始值(>=)。
|
* createTime 范围过滤起始值(>=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String createTimeStart;
|
private String createTimeStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createTime 范围过滤结束值(<=)。
|
* createTime 范围过滤结束值(<=)。
|
||||||
*/
|
*/
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private String createTimeEnd;
|
private String createTimeEnd;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
masterIdField = "schoolId",
|
masterIdField = "schoolId",
|
||||||
slaveServiceName = "schoolInfoService",
|
slaveServiceName = "sysDeptService",
|
||||||
slaveModelClass = SchoolInfo.class,
|
slaveModelClass = SysDept.class,
|
||||||
slaveIdField = "schoolId",
|
slaveIdField = "deptId",
|
||||||
slaveNameField = "schoolName")
|
slaveNameField = "deptName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -142,19 +142,19 @@ public class StudentActionTrans {
|
|||||||
slaveModelClass = Grade.class,
|
slaveModelClass = Grade.class,
|
||||||
slaveIdField = "gradeId",
|
slaveIdField = "gradeId",
|
||||||
slaveNameField = "gradeName")
|
slaveNameField = "gradeName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "actionType",
|
masterIdField = "actionType",
|
||||||
constantDictClass = StudentActionType.class)
|
constantDictClass = StudentActionType.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> actionTypeDictMap;
|
private Map<String, Object> actionTypeDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "deviceType",
|
masterIdField = "deviceType",
|
||||||
constantDictClass = DeviceType.class)
|
constantDictClass = DeviceType.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> deviceTypeDictMap;
|
private Map<String, Object> deviceTypeDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.orange.demo.webadmin.app.model;
|
package com.orange.demo.webadmin.app.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDept;
|
||||||
import com.orange.demo.webadmin.app.model.constant.ClassLevel;
|
import com.orange.demo.webadmin.app.model.constant.ClassLevel;
|
||||||
import com.orange.demo.common.core.annotation.RelationDict;
|
import com.orange.demo.common.core.annotation.RelationDict;
|
||||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
|
||||||
import com.orange.demo.webadmin.app.vo.StudentClassVo;
|
import com.orange.demo.webadmin.app.vo.StudentClassVo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.mapstruct.*;
|
import org.mapstruct.*;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -21,71 +21,70 @@ import java.util.Map;
|
|||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "zz_class")
|
@TableName(value = "zz_class")
|
||||||
public class StudentClass {
|
public class StudentClass {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@Id
|
@TableId(value = "class_id")
|
||||||
@Column(name = "class_id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级名称。
|
* 班级名称。
|
||||||
*/
|
*/
|
||||||
@Column(name = "class_name")
|
@TableField(value = "class_name")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校Id。
|
* 学校Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "school_id")
|
@TableField(value = "school_id")
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生班长Id。
|
* 学生班长Id。
|
||||||
*/
|
*/
|
||||||
@Column(name = "leader_id")
|
@TableField(value = "leader_id")
|
||||||
private Long leaderId;
|
private Long leaderId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已完成课时数量。
|
* 已完成课时数量。
|
||||||
*/
|
*/
|
||||||
@Column(name = "finish_class_hour")
|
@TableField(value = "finish_class_hour")
|
||||||
private Integer finishClassHour;
|
private Integer finishClassHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||||
*/
|
*/
|
||||||
@Column(name = "class_level")
|
@TableField(value = "class_level")
|
||||||
private Integer classLevel;
|
private Integer classLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建用户。
|
* 创建用户。
|
||||||
*/
|
*/
|
||||||
@Column(name = "create_user_id")
|
@TableField(value = "create_user_id")
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级创建时间。
|
* 班级创建时间。
|
||||||
*/
|
*/
|
||||||
@Column(name = "create_time")
|
@TableField(value = "create_time")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||||
*/
|
*/
|
||||||
@DeletedFlagColumn
|
@TableLogic
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
masterIdField = "schoolId",
|
masterIdField = "schoolId",
|
||||||
slaveServiceName = "schoolInfoService",
|
slaveServiceName = "sysDeptService",
|
||||||
slaveModelClass = SchoolInfo.class,
|
slaveModelClass = SysDept.class,
|
||||||
slaveIdField = "schoolId",
|
slaveIdField = "deptId",
|
||||||
slaveNameField = "schoolName")
|
slaveNameField = "deptName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
@RelationDict(
|
@RelationDict(
|
||||||
@@ -94,13 +93,13 @@ public class StudentClass {
|
|||||||
slaveModelClass = Student.class,
|
slaveModelClass = Student.class,
|
||||||
slaveIdField = "studentId",
|
slaveIdField = "studentId",
|
||||||
slaveNameField = "studentName")
|
slaveNameField = "studentName")
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> leaderIdDictMap;
|
private Map<String, Object> leaderIdDictMap;
|
||||||
|
|
||||||
@RelationConstDict(
|
@RelationConstDict(
|
||||||
masterIdField = "classLevel",
|
masterIdField = "classLevel",
|
||||||
constantDictClass = ClassLevel.class)
|
constantDictClass = ClassLevel.class)
|
||||||
@Transient
|
@TableField(exist = false)
|
||||||
private Map<String, Object> classLevelDictMap;
|
private Map<String, Object> classLevelDictMap;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ public interface CourseService extends IBaseService<Course, Long> {
|
|||||||
*/
|
*/
|
||||||
Course saveNew(Course course);
|
Course saveNew(Course course);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param courseList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void saveNewBatch(List<Course> courseList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.service;
|
|
||||||
|
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
|
||||||
import com.orange.demo.common.core.object.CallResult;
|
|
||||||
import com.orange.demo.common.core.base.service.IBaseService;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校区数据数据操作服务接口。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
public interface SchoolInfoService extends IBaseService<SchoolInfo, Long> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存新增对象。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 新增对象。
|
|
||||||
* @return 返回新增对象。
|
|
||||||
*/
|
|
||||||
SchoolInfo saveNew(SchoolInfo schoolInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新数据对象。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 更新的对象。
|
|
||||||
* @param originalSchoolInfo 原有数据对象。
|
|
||||||
* @return 成功返回true,否则false。
|
|
||||||
*/
|
|
||||||
boolean update(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除指定数据。
|
|
||||||
*
|
|
||||||
* @param schoolId 主键Id。
|
|
||||||
* @return 成功返回true,否则false。
|
|
||||||
*/
|
|
||||||
boolean remove(Long schoolId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
|
||||||
* 如果需要同时获取关联数据,请移步(getSchoolInfoListWithRelation)方法。
|
|
||||||
*
|
|
||||||
* @param filter 过滤对象。
|
|
||||||
* @param orderBy 排序参数。
|
|
||||||
* @return 查询结果集。
|
|
||||||
*/
|
|
||||||
List<SchoolInfo> getSchoolInfoList(SchoolInfo filter, String orderBy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
|
||||||
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
|
|
||||||
* 如果仅仅需要获取主表数据,请移步(getSchoolInfoList),以便获取更好的查询性能。
|
|
||||||
*
|
|
||||||
* @param filter 主表过滤对象。
|
|
||||||
* @param orderBy 排序参数。
|
|
||||||
* @return 查询结果集。
|
|
||||||
*/
|
|
||||||
List<SchoolInfo> getSchoolInfoListWithRelation(SchoolInfo filter, String orderBy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 最新数据对象。
|
|
||||||
* @param originalSchoolInfo 原有数据对象。
|
|
||||||
* @return 数据全部正确返回true,否则false。
|
|
||||||
*/
|
|
||||||
CallResult verifyRelatedData(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo);
|
|
||||||
}
|
|
||||||
@@ -22,6 +22,13 @@ public interface StudentActionTransService extends IBaseService<StudentActionTra
|
|||||||
*/
|
*/
|
||||||
StudentActionTrans saveNew(StudentActionTrans studentActionTrans);
|
StudentActionTrans saveNew(StudentActionTrans studentActionTrans);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentActionTransList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void saveNewBatch(List<StudentActionTrans> studentActionTransList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ public interface StudentClassService extends IBaseService<StudentClass, Long> {
|
|||||||
*/
|
*/
|
||||||
StudentClass saveNew(StudentClass studentClass);
|
StudentClass saveNew(StudentClass studentClass);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentClassList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void saveNewBatch(List<StudentClass> studentClassList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ public interface StudentService extends IBaseService<Student, Long> {
|
|||||||
*/
|
*/
|
||||||
Student saveNew(Student student);
|
Student saveNew(Student student);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void saveNewBatch(List<Student> studentList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.orange.demo.webadmin.app.service.impl;
|
package com.orange.demo.webadmin.app.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
import com.orange.demo.webadmin.app.service.*;
|
||||||
import com.orange.demo.webadmin.app.dao.*;
|
import com.orange.demo.webadmin.app.dao.*;
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
import com.orange.demo.webadmin.app.model.*;
|
||||||
@@ -55,16 +58,24 @@ public class CourseServiceImpl extends BaseService<Course, Long> implements Cour
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Course saveNew(Course course) {
|
public Course saveNew(Course course) {
|
||||||
course.setCourseId(idGenerator.nextLongId());
|
courseMapper.insert(this.buildDefaultValue(course));
|
||||||
TokenData tokenData = TokenData.takeFromRequest();
|
|
||||||
course.setCreateUserId(tokenData.getUserId());
|
|
||||||
Date now = new Date();
|
|
||||||
course.setCreateTime(now);
|
|
||||||
course.setUpdateTime(now);
|
|
||||||
courseMapper.insert(course);
|
|
||||||
return course;
|
return course;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param courseList 新增对象列表。
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void saveNewBatch(List<Course> courseList) {
|
||||||
|
if (CollUtil.isNotEmpty(courseList)) {
|
||||||
|
courseList.forEach(this::buildDefaultValue);
|
||||||
|
courseMapper.insertList(courseList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
@@ -79,7 +90,8 @@ public class CourseServiceImpl extends BaseService<Course, Long> implements Cour
|
|||||||
course.setCreateTime(originalCourse.getCreateTime());
|
course.setCreateTime(originalCourse.getCreateTime());
|
||||||
course.setUpdateTime(new Date());
|
course.setUpdateTime(new Date());
|
||||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
||||||
return courseMapper.updateByPrimaryKey(course) == 1;
|
UpdateWrapper<Course> uw = this.createUpdateQueryForNullValue(course, course.getCourseId());
|
||||||
|
return courseMapper.update(course, uw) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,14 +103,13 @@ public class CourseServiceImpl extends BaseService<Course, Long> implements Cour
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(Long courseId) {
|
public boolean remove(Long courseId) {
|
||||||
// 这里先删除主数据
|
if (courseMapper.deleteById(courseId) == 0) {
|
||||||
if (!this.removeById(courseId)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 开始删除多对多父表的关联
|
// 开始删除多对多父表的关联
|
||||||
ClassCourse classCourse = new ClassCourse();
|
ClassCourse classCourse = new ClassCourse();
|
||||||
classCourse.setCourseId(courseId);
|
classCourse.setCourseId(courseId);
|
||||||
classCourseMapper.delete(classCourse);
|
classCourseMapper.delete(new QueryWrapper<>(classCourse));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,4 +194,14 @@ public class CourseServiceImpl extends BaseService<Course, Long> implements Cour
|
|||||||
}
|
}
|
||||||
return CallResult.ok();
|
return CallResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Course buildDefaultValue(Course course) {
|
||||||
|
course.setCourseId(idGenerator.nextLongId());
|
||||||
|
TokenData tokenData = TokenData.takeFromRequest();
|
||||||
|
course.setCreateUserId(tokenData.getUserId());
|
||||||
|
Date now = new Date();
|
||||||
|
course.setCreateTime(now);
|
||||||
|
course.setUpdateTime(now);
|
||||||
|
return course;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,141 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.service.impl;
|
|
||||||
|
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
|
||||||
import com.orange.demo.webadmin.app.dao.*;
|
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
|
||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
|
||||||
import com.orange.demo.common.core.object.MyRelationParam;
|
|
||||||
import com.orange.demo.common.core.object.CallResult;
|
|
||||||
import com.orange.demo.common.core.base.service.BaseService;
|
|
||||||
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
|
|
||||||
import com.github.pagehelper.Page;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校区数据数据操作服务类。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service("schoolInfoService")
|
|
||||||
public class SchoolInfoServiceImpl extends BaseService<SchoolInfo, Long> implements SchoolInfoService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SchoolInfoMapper schoolInfoMapper;
|
|
||||||
@Autowired
|
|
||||||
private AreaCodeService areaCodeService;
|
|
||||||
@Autowired
|
|
||||||
private IdGeneratorWrapper idGenerator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回当前Service的主表Mapper对象。
|
|
||||||
*
|
|
||||||
* @return 主表Mapper对象。
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected BaseDaoMapper<SchoolInfo> mapper() {
|
|
||||||
return schoolInfoMapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存新增对象。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 新增对象。
|
|
||||||
* @return 返回新增对象。
|
|
||||||
*/
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
|
||||||
public SchoolInfo saveNew(SchoolInfo schoolInfo) {
|
|
||||||
schoolInfo.setSchoolId(idGenerator.nextLongId());
|
|
||||||
schoolInfoMapper.insert(schoolInfo);
|
|
||||||
return schoolInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新数据对象。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 更新的对象。
|
|
||||||
* @param originalSchoolInfo 原有数据对象。
|
|
||||||
* @return 成功返回true,否则false。
|
|
||||||
*/
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
|
||||||
public boolean update(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) {
|
|
||||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
|
||||||
return schoolInfoMapper.updateByPrimaryKey(schoolInfo) == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除指定数据。
|
|
||||||
*
|
|
||||||
* @param schoolId 主键Id。
|
|
||||||
* @return 成功返回true,否则false。
|
|
||||||
*/
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
|
||||||
public boolean remove(Long schoolId) {
|
|
||||||
// 这里先删除主数据
|
|
||||||
return this.removeById(schoolId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
|
||||||
* 如果需要同时获取关联数据,请移步(getSchoolInfoListWithRelation)方法。
|
|
||||||
*
|
|
||||||
* @param filter 过滤对象。
|
|
||||||
* @param orderBy 排序参数。
|
|
||||||
* @return 查询结果集。
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SchoolInfo> getSchoolInfoList(SchoolInfo filter, String orderBy) {
|
|
||||||
return schoolInfoMapper.getSchoolInfoList(filter, orderBy);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
|
||||||
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
|
|
||||||
* 如果仅仅需要获取主表数据,请移步(getSchoolInfoList),以便获取更好的查询性能。
|
|
||||||
*
|
|
||||||
* @param filter 主表过滤对象。
|
|
||||||
* @param orderBy 排序参数。
|
|
||||||
* @return 查询结果集。
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SchoolInfo> getSchoolInfoListWithRelation(SchoolInfo filter, String orderBy) {
|
|
||||||
List<SchoolInfo> resultList = schoolInfoMapper.getSchoolInfoList(filter, orderBy);
|
|
||||||
// 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
|
|
||||||
// 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
|
|
||||||
int batchSize = resultList instanceof Page ? 0 : 1000;
|
|
||||||
this.buildRelationForDataList(resultList, MyRelationParam.normal(), batchSize);
|
|
||||||
return resultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据最新对象和原有对象的数据对比,判断关联的字典数据和多对一主表数据是否都是合法数据。
|
|
||||||
*
|
|
||||||
* @param schoolInfo 最新数据对象。
|
|
||||||
* @param originalSchoolInfo 原有数据对象。
|
|
||||||
* @return 数据全部正确返回true,否则false。
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public CallResult verifyRelatedData(SchoolInfo schoolInfo, SchoolInfo originalSchoolInfo) {
|
|
||||||
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
|
||||||
//这里是基于字典的验证。
|
|
||||||
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getProvinceId)
|
|
||||||
&& !areaCodeService.existId(schoolInfo.getProvinceId())) {
|
|
||||||
return CallResult.error(String.format(errorMessageFormat, "所在省份"));
|
|
||||||
}
|
|
||||||
//这里是基于字典的验证。
|
|
||||||
if (this.needToVerify(schoolInfo, originalSchoolInfo, SchoolInfo::getCityId)
|
|
||||||
&& !areaCodeService.existId(schoolInfo.getCityId())) {
|
|
||||||
return CallResult.error(String.format(errorMessageFormat, "所在城市"));
|
|
||||||
}
|
|
||||||
return CallResult.ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.orange.demo.webadmin.app.service.impl;
|
package com.orange.demo.webadmin.app.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
import com.orange.demo.webadmin.app.service.*;
|
||||||
import com.orange.demo.webadmin.app.dao.*;
|
import com.orange.demo.webadmin.app.dao.*;
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
import com.orange.demo.webadmin.app.model.*;
|
||||||
|
import com.orange.demo.webadmin.upms.service.SysDeptService;
|
||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.common.core.object.MyRelationParam;
|
import com.orange.demo.common.core.object.MyRelationParam;
|
||||||
import com.orange.demo.common.core.object.CallResult;
|
import com.orange.demo.common.core.object.CallResult;
|
||||||
@@ -29,7 +32,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StudentActionTransMapper studentActionTransMapper;
|
private StudentActionTransMapper studentActionTransMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SchoolInfoService schoolInfoService;
|
private SysDeptService sysDeptService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GradeService gradeService;
|
private GradeService gradeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -54,11 +57,24 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public StudentActionTrans saveNew(StudentActionTrans studentActionTrans) {
|
public StudentActionTrans saveNew(StudentActionTrans studentActionTrans) {
|
||||||
studentActionTrans.setTransId(idGenerator.nextLongId());
|
studentActionTransMapper.insert(this.buildDefaultValue(studentActionTrans));
|
||||||
studentActionTransMapper.insert(studentActionTrans);
|
|
||||||
return studentActionTrans;
|
return studentActionTrans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentActionTransList 新增对象列表。
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void saveNewBatch(List<StudentActionTrans> studentActionTransList) {
|
||||||
|
if (CollUtil.isNotEmpty(studentActionTransList)) {
|
||||||
|
studentActionTransList.forEach(this::buildDefaultValue);
|
||||||
|
studentActionTransMapper.insertList(studentActionTransList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
@@ -70,7 +86,8 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
@Override
|
@Override
|
||||||
public boolean update(StudentActionTrans studentActionTrans, StudentActionTrans originalStudentActionTrans) {
|
public boolean update(StudentActionTrans studentActionTrans, StudentActionTrans originalStudentActionTrans) {
|
||||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
||||||
return studentActionTransMapper.updateByPrimaryKey(studentActionTrans) == 1;
|
UpdateWrapper<StudentActionTrans> uw = this.createUpdateQueryForNullValue(studentActionTrans, studentActionTrans.getTransId());
|
||||||
|
return studentActionTransMapper.update(studentActionTrans, uw) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,8 +99,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(Long transId) {
|
public boolean remove(Long transId) {
|
||||||
// 这里先删除主数据
|
return studentActionTransMapper.deleteById(transId) == 1;
|
||||||
return this.removeById(transId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,7 +146,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
||||||
//这里是基于字典的验证。
|
//这里是基于字典的验证。
|
||||||
if (this.needToVerify(studentActionTrans, originalStudentActionTrans, StudentActionTrans::getSchoolId)
|
if (this.needToVerify(studentActionTrans, originalStudentActionTrans, StudentActionTrans::getSchoolId)
|
||||||
&& !schoolInfoService.existId(studentActionTrans.getSchoolId())) {
|
&& !sysDeptService.existId(studentActionTrans.getSchoolId())) {
|
||||||
return CallResult.error(String.format(errorMessageFormat, "学生校区"));
|
return CallResult.error(String.format(errorMessageFormat, "学生校区"));
|
||||||
}
|
}
|
||||||
//这里是基于字典的验证。
|
//这里是基于字典的验证。
|
||||||
@@ -140,4 +156,9 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
|||||||
}
|
}
|
||||||
return CallResult.ok();
|
return CallResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private StudentActionTrans buildDefaultValue(StudentActionTrans studentActionTrans) {
|
||||||
|
studentActionTrans.setTransId(idGenerator.nextLongId());
|
||||||
|
return studentActionTrans;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.orange.demo.webadmin.app.service.impl;
|
package com.orange.demo.webadmin.app.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
import com.orange.demo.webadmin.app.service.*;
|
||||||
import com.orange.demo.webadmin.app.dao.*;
|
import com.orange.demo.webadmin.app.dao.*;
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
import com.orange.demo.webadmin.app.model.*;
|
||||||
|
import com.orange.demo.webadmin.upms.service.SysDeptService;
|
||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||||
import com.orange.demo.common.core.object.TokenData;
|
import com.orange.demo.common.core.object.TokenData;
|
||||||
@@ -16,7 +20,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import tk.mybatis.mapper.entity.Example;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ClassStudentMapper classStudentMapper;
|
private ClassStudentMapper classStudentMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SchoolInfoService schoolInfoService;
|
private SysDeptService sysDeptService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StudentService studentService;
|
private StudentService studentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -62,16 +65,24 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public StudentClass saveNew(StudentClass studentClass) {
|
public StudentClass saveNew(StudentClass studentClass) {
|
||||||
studentClass.setClassId(idGenerator.nextLongId());
|
studentClassMapper.insert(this.buildDefaultValue(studentClass));
|
||||||
TokenData tokenData = TokenData.takeFromRequest();
|
|
||||||
studentClass.setCreateUserId(tokenData.getUserId());
|
|
||||||
studentClass.setCreateTime(new Date());
|
|
||||||
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
|
|
||||||
MyModelUtil.setDefaultValue(studentClass, "finishClassHour", 0);
|
|
||||||
studentClassMapper.insert(studentClass);
|
|
||||||
return studentClass;
|
return studentClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentClassList 新增对象列表。
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void saveNewBatch(List<StudentClass> studentClassList) {
|
||||||
|
if (CollUtil.isNotEmpty(studentClassList)) {
|
||||||
|
studentClassList.forEach(this::buildDefaultValue);
|
||||||
|
studentClassMapper.insertList(studentClassList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
@@ -84,9 +95,9 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
public boolean update(StudentClass studentClass, StudentClass originalStudentClass) {
|
public boolean update(StudentClass studentClass, StudentClass originalStudentClass) {
|
||||||
studentClass.setCreateUserId(originalStudentClass.getCreateUserId());
|
studentClass.setCreateUserId(originalStudentClass.getCreateUserId());
|
||||||
studentClass.setCreateTime(originalStudentClass.getCreateTime());
|
studentClass.setCreateTime(originalStudentClass.getCreateTime());
|
||||||
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
|
|
||||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
||||||
return studentClassMapper.updateByPrimaryKey(studentClass) == 1;
|
UpdateWrapper<StudentClass> uw = this.createUpdateQueryForNullValue(studentClass, studentClass.getClassId());
|
||||||
|
return studentClassMapper.update(studentClass, uw) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,17 +109,16 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(Long classId) {
|
public boolean remove(Long classId) {
|
||||||
// 这里先删除主数据
|
if (studentClassMapper.deleteById(classId) == 0) {
|
||||||
if (!this.removeById(classId)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 开始删除多对多子表的关联
|
// 开始删除多对多子表的关联
|
||||||
ClassCourse classCourse = new ClassCourse();
|
ClassCourse classCourse = new ClassCourse();
|
||||||
classCourse.setClassId(classId);
|
classCourse.setClassId(classId);
|
||||||
classCourseMapper.delete(classCourse);
|
classCourseMapper.delete(new QueryWrapper<>(classCourse));
|
||||||
ClassStudent classStudent = new ClassStudent();
|
ClassStudent classStudent = new ClassStudent();
|
||||||
classStudent.setClassId(classId);
|
classStudent.setClassId(classId);
|
||||||
classStudentMapper.delete(classStudent);
|
classStudentMapper.delete(new QueryWrapper<>(classStudent));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,8 +166,8 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
for (ClassCourse classCourse : classCourseList) {
|
for (ClassCourse classCourse : classCourseList) {
|
||||||
classCourse.setClassId(classId);
|
classCourse.setClassId(classId);
|
||||||
MyModelUtil.setDefaultValue(classCourse, "courseOrder", 0);
|
MyModelUtil.setDefaultValue(classCourse, "courseOrder", 0);
|
||||||
|
classCourseMapper.insert(classCourse);
|
||||||
}
|
}
|
||||||
classCourseMapper.insertList(classCourseList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -169,11 +179,13 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean updateClassCourse(ClassCourse classCourse) {
|
public boolean updateClassCourse(ClassCourse classCourse) {
|
||||||
Example e = new Example(ClassCourse.class);
|
ClassCourse filter = new ClassCourse();
|
||||||
e.createCriteria()
|
filter.setClassId(classCourse.getClassId());
|
||||||
.andEqualTo("classId", classCourse.getClassId())
|
filter.setCourseId(classCourse.getCourseId());
|
||||||
.andEqualTo("courseId", classCourse.getCourseId());
|
UpdateWrapper<ClassCourse> uw =
|
||||||
return classCourseMapper.updateByExample(classCourse, e) > 0;
|
BaseService.createUpdateQueryForNullValue(classCourse, ClassCourse.class);
|
||||||
|
uw.setEntity(filter);
|
||||||
|
return classCourseMapper.update(classCourse, uw) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -185,11 +197,10 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ClassCourse getClassCourse(Long classId, Long courseId) {
|
public ClassCourse getClassCourse(Long classId, Long courseId) {
|
||||||
Example e = new Example(ClassCourse.class);
|
ClassCourse filter = new ClassCourse();
|
||||||
e.createCriteria()
|
filter.setClassId(classId);
|
||||||
.andEqualTo("classId", classId)
|
filter.setCourseId(courseId);
|
||||||
.andEqualTo("courseId", courseId);
|
return classCourseMapper.selectOne(new QueryWrapper<>(filter));
|
||||||
return classCourseMapper.selectOneByExample(e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,7 +216,7 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
ClassCourse filter = new ClassCourse();
|
ClassCourse filter = new ClassCourse();
|
||||||
filter.setClassId(classId);
|
filter.setClassId(classId);
|
||||||
filter.setCourseId(courseId);
|
filter.setCourseId(courseId);
|
||||||
return classCourseMapper.delete(filter) > 0;
|
return classCourseMapper.delete(new QueryWrapper<>(filter)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -219,8 +230,8 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
public void addClassStudentList(List<ClassStudent> classStudentList, Long classId) {
|
public void addClassStudentList(List<ClassStudent> classStudentList, Long classId) {
|
||||||
for (ClassStudent classStudent : classStudentList) {
|
for (ClassStudent classStudent : classStudentList) {
|
||||||
classStudent.setClassId(classId);
|
classStudent.setClassId(classId);
|
||||||
|
classStudentMapper.insert(classStudent);
|
||||||
}
|
}
|
||||||
classStudentMapper.insertList(classStudentList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,7 +247,7 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
ClassStudent filter = new ClassStudent();
|
ClassStudent filter = new ClassStudent();
|
||||||
filter.setClassId(classId);
|
filter.setClassId(classId);
|
||||||
filter.setStudentId(studentId);
|
filter.setStudentId(studentId);
|
||||||
return classStudentMapper.delete(filter) > 0;
|
return classStudentMapper.delete(new QueryWrapper<>(filter)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,7 +262,7 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
||||||
//这里是基于字典的验证。
|
//这里是基于字典的验证。
|
||||||
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getSchoolId)
|
if (this.needToVerify(studentClass, originalStudentClass, StudentClass::getSchoolId)
|
||||||
&& !schoolInfoService.existId(studentClass.getSchoolId())) {
|
&& !sysDeptService.existId(studentClass.getSchoolId())) {
|
||||||
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
|
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
|
||||||
}
|
}
|
||||||
//这里是基于字典的验证。
|
//这里是基于字典的验证。
|
||||||
@@ -261,4 +272,14 @@ public class StudentClassServiceImpl extends BaseService<StudentClass, Long> imp
|
|||||||
}
|
}
|
||||||
return CallResult.ok();
|
return CallResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private StudentClass buildDefaultValue(StudentClass studentClass) {
|
||||||
|
studentClass.setClassId(idGenerator.nextLongId());
|
||||||
|
TokenData tokenData = TokenData.takeFromRequest();
|
||||||
|
studentClass.setCreateUserId(tokenData.getUserId());
|
||||||
|
studentClass.setCreateTime(new Date());
|
||||||
|
studentClass.setStatus(GlobalDeletedFlag.NORMAL);
|
||||||
|
MyModelUtil.setDefaultValue(studentClass, "finishClassHour", 0);
|
||||||
|
return studentClass;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package com.orange.demo.webadmin.app.service.impl;
|
package com.orange.demo.webadmin.app.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.orange.demo.application.common.constant.StudentStatus;
|
import com.orange.demo.application.common.constant.StudentStatus;
|
||||||
import com.orange.demo.webadmin.app.service.*;
|
import com.orange.demo.webadmin.app.service.*;
|
||||||
import com.orange.demo.webadmin.app.dao.*;
|
import com.orange.demo.webadmin.app.dao.*;
|
||||||
import com.orange.demo.webadmin.app.model.*;
|
import com.orange.demo.webadmin.app.model.*;
|
||||||
|
import com.orange.demo.webadmin.upms.service.SysDeptService;
|
||||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
import com.orange.demo.common.core.object.MyRelationParam;
|
import com.orange.demo.common.core.object.MyRelationParam;
|
||||||
import com.orange.demo.common.core.object.CallResult;
|
import com.orange.demo.common.core.object.CallResult;
|
||||||
@@ -37,7 +41,7 @@ public class StudentServiceImpl extends BaseService<Student, Long> implements St
|
|||||||
@Autowired
|
@Autowired
|
||||||
private GradeService gradeService;
|
private GradeService gradeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SchoolInfoService schoolInfoService;
|
private SysDeptService sysDeptService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IdGeneratorWrapper idGenerator;
|
private IdGeneratorWrapper idGenerator;
|
||||||
|
|
||||||
@@ -60,15 +64,24 @@ public class StudentServiceImpl extends BaseService<Student, Long> implements St
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Student saveNew(Student student) {
|
public Student saveNew(Student student) {
|
||||||
student.setStudentId(idGenerator.nextLongId());
|
studentMapper.insert(this.buildDefaultValue(student));
|
||||||
student.setRegisterTime(new Date());
|
|
||||||
MyModelUtil.setDefaultValue(student, "totalCoin", 0);
|
|
||||||
MyModelUtil.setDefaultValue(student, "leftCoin", 0);
|
|
||||||
MyModelUtil.setDefaultValue(student, "status", StudentStatus.NORMAL);
|
|
||||||
studentMapper.insert(student);
|
|
||||||
return student;
|
return student;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利用数据库的insertList语法,批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param studentList 新增对象列表。
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void saveNewBatch(List<Student> studentList) {
|
||||||
|
if (CollUtil.isNotEmpty(studentList)) {
|
||||||
|
studentList.forEach(this::buildDefaultValue);
|
||||||
|
studentMapper.insertList(studentList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新数据对象。
|
* 更新数据对象。
|
||||||
*
|
*
|
||||||
@@ -81,7 +94,8 @@ public class StudentServiceImpl extends BaseService<Student, Long> implements St
|
|||||||
public boolean update(Student student, Student originalStudent) {
|
public boolean update(Student student, Student originalStudent) {
|
||||||
student.setRegisterTime(originalStudent.getRegisterTime());
|
student.setRegisterTime(originalStudent.getRegisterTime());
|
||||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
||||||
return studentMapper.updateByPrimaryKey(student) == 1;
|
UpdateWrapper<Student> uw = this.createUpdateQueryForNullValue(student, student.getStudentId());
|
||||||
|
return studentMapper.update(student, uw) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,14 +107,13 @@ public class StudentServiceImpl extends BaseService<Student, Long> implements St
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean remove(Long studentId) {
|
public boolean remove(Long studentId) {
|
||||||
// 这里先删除主数据
|
if (studentMapper.deleteById(studentId) == 0) {
|
||||||
if (!this.removeById(studentId)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 开始删除多对多父表的关联
|
// 开始删除多对多父表的关联
|
||||||
ClassStudent classStudent = new ClassStudent();
|
ClassStudent classStudent = new ClassStudent();
|
||||||
classStudent.setStudentId(studentId);
|
classStudent.setStudentId(studentId);
|
||||||
classStudentMapper.delete(classStudent);
|
classStudentMapper.delete(new QueryWrapper<>(classStudent));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +213,18 @@ public class StudentServiceImpl extends BaseService<Student, Long> implements St
|
|||||||
}
|
}
|
||||||
//这里是基于字典的验证。
|
//这里是基于字典的验证。
|
||||||
if (this.needToVerify(student, originalStudent, Student::getSchoolId)
|
if (this.needToVerify(student, originalStudent, Student::getSchoolId)
|
||||||
&& !schoolInfoService.existId(student.getSchoolId())) {
|
&& !sysDeptService.existId(student.getSchoolId())) {
|
||||||
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
|
return CallResult.error(String.format(errorMessageFormat, "所属校区"));
|
||||||
}
|
}
|
||||||
return CallResult.ok();
|
return CallResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Student buildDefaultValue(Student student) {
|
||||||
|
student.setStudentId(idGenerator.nextLongId());
|
||||||
|
student.setRegisterTime(new Date());
|
||||||
|
MyModelUtil.setDefaultValue(student, "totalCoin", 0);
|
||||||
|
MyModelUtil.setDefaultValue(student, "leftCoin", 0);
|
||||||
|
MyModelUtil.setDefaultValue(student, "status", StudentStatus.NORMAL);
|
||||||
|
return student;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,31 +8,26 @@ import lombok.Data;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("行政区划实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class AreaCodeVo {
|
public class AreaCodeVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划主键Id
|
* 行政区划主键Id
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "行政区划主键Id", required = true)
|
|
||||||
private Long areaId;
|
private Long areaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划名称
|
* 行政区划名称
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "行政区划名称")
|
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "行政区划级别")
|
|
||||||
private Integer areaLevel;
|
private Integer areaLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父级行政区划Id
|
* 父级行政区划Id
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "父级行政区划Id")
|
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,28 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassCourseVO对象。
|
* ClassCourseVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("ClassCourseVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class ClassCourseVo {
|
public class ClassCourseVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程Id")
|
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程顺序(数值越小越靠前)。
|
* 课程顺序(数值越小越靠前)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程顺序(数值越小越靠前)")
|
|
||||||
private Integer courseOrder;
|
private Integer courseOrder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,23 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassStudentVO对象。
|
* ClassStudentVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("ClassStudentVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class ClassStudentVo {
|
public class ClassStudentVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id")
|
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,91 +1,76 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CourseTransStatsVO对象。
|
* CourseTransStatsVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("CourseTransStatsVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class CourseTransStatsVo {
|
public class CourseTransStatsVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id")
|
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计日期")
|
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 科目Id。
|
* 科目Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "科目Id")
|
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级名称")
|
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程Id。
|
* 课程Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程Id")
|
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程名称")
|
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生上课次数。
|
* 学生上课次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生上课次数")
|
|
||||||
private Integer studentAttendCount;
|
private Integer studentAttendCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花数量。
|
* 学生献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生献花数量")
|
|
||||||
private Integer studentFlowerAmount;
|
private Integer studentFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生献花次数。
|
* 学生献花次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生献花次数")
|
|
||||||
private Integer studentFlowerCount;
|
private Integer studentFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gradeId 字典关联数据。
|
* gradeId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gradeId 字典关联数据")
|
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* subjectId 常量字典关联数据。
|
* subjectId 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "subjectId 常量字典关联数据")
|
|
||||||
private Map<String, Object> subjectIdDictMap;
|
private Map<String, Object> subjectIdDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -9,108 +7,91 @@ import java.util.Date;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CourseVO对象。
|
* CourseVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("CourseVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class CourseVo {
|
public class CourseVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id")
|
|
||||||
private Long courseId;
|
private Long courseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程名称。
|
* 课程名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程名称")
|
|
||||||
private String courseName;
|
private String courseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程价格。
|
* 课程价格。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程价格")
|
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程描述。
|
* 课程描述。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程描述")
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)")
|
|
||||||
private Integer difficulty;
|
private Integer difficulty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学科Id。
|
* 学科Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学科Id")
|
|
||||||
private Integer subjectId;
|
private Integer subjectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课时数量。
|
* 课时数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "课时数量")
|
|
||||||
private Integer classHour;
|
private Integer classHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多张课程图片地址。
|
* 多张课程图片地址。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "多张课程图片地址")
|
|
||||||
private String pictureUrl;
|
private String pictureUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建用户Id。
|
* 创建用户Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "创建用户Id")
|
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间。
|
* 创建时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "创建时间")
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后修改时间。
|
* 最后修改时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "最后修改时间")
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo。
|
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo")
|
|
||||||
private Map<String, Object> classCourse;
|
private Map<String, Object> classCourse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gradeId 字典关联数据。
|
* gradeId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gradeId 字典关联数据")
|
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* difficulty 常量字典关联数据。
|
* difficulty 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "difficulty 常量字典关联数据")
|
|
||||||
private Map<String, Object> difficultyDictMap;
|
private Map<String, Object> difficultyDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* subjectId 常量字典关联数据。
|
* subjectId 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "subjectId 常量字典关联数据")
|
|
||||||
private Map<String, Object> subjectIdDictMap;
|
private Map<String, Object> subjectIdDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,23 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GradeVO对象。
|
* GradeVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("GradeVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class GradeVo {
|
public class GradeVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级名称。
|
* 年级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级名称")
|
|
||||||
private String gradeName;
|
private String gradeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SchoolInfoVO对象。
|
|
||||||
*
|
|
||||||
* @author Jerry
|
|
||||||
* @date 2020-09-24
|
|
||||||
*/
|
|
||||||
@ApiModel("SchoolInfoVO实体对象")
|
|
||||||
@Data
|
|
||||||
public class SchoolInfoVo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "学校Id")
|
|
||||||
private Long schoolId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学校名称。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "学校名称")
|
|
||||||
private String schoolName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在省Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "所在省Id")
|
|
||||||
private Long provinceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在城市Id。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "所在城市Id")
|
|
||||||
private Long cityId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provinceId 字典关联数据。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "provinceId 字典关联数据")
|
|
||||||
private Map<String, Object> provinceIdDictMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cityId 字典关联数据。
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "cityId 字典关联数据")
|
|
||||||
private Map<String, Object> cityIdDictMap;
|
|
||||||
}
|
|
||||||
@@ -1,163 +1,136 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StudentActionStatsVO对象。
|
* StudentActionStatsVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentActionStatsVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentActionStatsVo {
|
public class StudentActionStatsVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id")
|
|
||||||
private Long statsId;
|
private Long statsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计日期。
|
* 统计日期。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计日期")
|
|
||||||
private Date statsDate;
|
private Date statsDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计小时。
|
* 统计小时。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "统计小时")
|
|
||||||
private Date statsMonth;
|
private Date statsMonth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在省Id。
|
* 学生所在省Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生所在省Id")
|
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生所在城市Id。
|
* 学生所在城市Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生所在城市Id")
|
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购课学币数量。
|
* 购课学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购课学币数量")
|
|
||||||
private Integer buyCourseAmount;
|
private Integer buyCourseAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程次数。
|
* 购买课程次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买课程次数")
|
|
||||||
private Integer buyCourseCount;
|
private Integer buyCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频学币数量。
|
* 购买视频学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频学币数量")
|
|
||||||
private Integer buyVideoAmount;
|
private Integer buyVideoAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频次数。
|
* 购买视频次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频次数")
|
|
||||||
private Integer buyVideoCount;
|
private Integer buyVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业学币数量。
|
* 购买作业学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业学币数量")
|
|
||||||
private Integer buyPaperAmount;
|
private Integer buyPaperAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业次数。
|
* 购买作业次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业次数")
|
|
||||||
private Integer buyPaperCount;
|
private Integer buyPaperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花数量")
|
|
||||||
private Integer buyFlowerAmount;
|
private Integer buyFlowerAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花次数。
|
* 购买献花次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花次数")
|
|
||||||
private Integer buyFlowerCount;
|
private Integer buyFlowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币数量")
|
|
||||||
private Integer rechargeCoinAmount;
|
private Integer rechargeCoinAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币次数。
|
* 充值学币次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币次数")
|
|
||||||
private Integer rechargeCoinCount;
|
private Integer rechargeCoinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线下课程上课次数。
|
* 线下课程上课次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "线下课程上课次数")
|
|
||||||
private Integer doCourseCount;
|
private Integer doCourseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 观看视频次数。
|
* 观看视频次数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "观看视频次数")
|
|
||||||
private Integer watchVideoCount;
|
private Integer watchVideoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花消费学币数量。
|
* 购买献花消费学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花消费学币数量")
|
|
||||||
private Integer watchVideoTotalSecond;
|
private Integer watchVideoTotalSecond;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题数量。
|
* 做题数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题数量")
|
|
||||||
private Integer doExerciseCount;
|
private Integer doExerciseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题正确的数量。
|
* 做题正确的数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题正确的数量")
|
|
||||||
private Integer doExerciseCorrectCount;
|
private Integer doExerciseCorrectCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gradeId 字典关联数据。
|
* gradeId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gradeId 字典关联数据")
|
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* provinceId 字典关联数据。
|
* provinceId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "provinceId 字典关联数据")
|
|
||||||
private Map<String, Object> provinceIdDictMap;
|
private Map<String, Object> provinceIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cityId 字典关联数据。
|
* cityId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "cityId 字典关联数据")
|
|
||||||
private Map<String, Object> cityIdDictMap;
|
private Map<String, Object> cityIdDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,133 +1,111 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StudentActionTransVO对象。
|
* StudentActionTransVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentActionTransVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentActionTransVo {
|
public class StudentActionTransVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键Id。
|
* 主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主键Id")
|
|
||||||
private Long transId;
|
private Long transId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id")
|
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生名称。
|
* 学生名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生名称")
|
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生校区。
|
* 学生校区。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生校区")
|
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)")
|
|
||||||
private Integer actionType;
|
private Integer actionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)")
|
|
||||||
private Integer deviceType;
|
private Integer deviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 看视频秒数。
|
* 看视频秒数。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "看视频秒数")
|
|
||||||
private Integer watchVideoSeconds;
|
private Integer watchVideoSeconds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买献花数量。
|
* 购买献花数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买献花数量")
|
|
||||||
private Integer flowerCount;
|
private Integer flowerCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买作业数量。
|
* 购买作业数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买作业数量")
|
|
||||||
private Integer paperCount;
|
private Integer paperCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买视频数量。
|
* 购买视频数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买视频数量")
|
|
||||||
private Integer videoCount;
|
private Integer videoCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买课程数量。
|
* 购买课程数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "购买课程数量")
|
|
||||||
private Integer courseCount;
|
private Integer courseCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值学币数量。
|
* 充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "充值学币数量")
|
|
||||||
private Integer coinCount;
|
private Integer coinCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做题是否正确标记。
|
* 做题是否正确标记。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "做题是否正确标记")
|
|
||||||
private Integer exerciseCorrectFlag;
|
private Integer exerciseCorrectFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发生时间。
|
* 发生时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "发生时间")
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* schoolId 字典关联数据。
|
* schoolId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "schoolId 字典关联数据")
|
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gradeId 字典关联数据。
|
* gradeId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gradeId 字典关联数据")
|
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* actionType 常量字典关联数据。
|
* actionType 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "actionType 常量字典关联数据")
|
|
||||||
private Map<String, Object> actionTypeDictMap;
|
private Map<String, Object> actionTypeDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deviceType 常量字典关联数据。
|
* deviceType 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "deviceType 常量字典关联数据")
|
|
||||||
private Map<String, Object> deviceTypeDictMap;
|
private Map<String, Object> deviceTypeDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,85 +1,71 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StudentClassVO对象。
|
* StudentClassVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentClassVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentClassVo {
|
public class StudentClassVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级Id。
|
* 班级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级Id")
|
|
||||||
private Long classId;
|
private Long classId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级名称。
|
* 班级名称。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级名称")
|
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校Id。
|
* 学校Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学校Id")
|
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生班长Id。
|
* 学生班长Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生班长Id")
|
|
||||||
private Long leaderId;
|
private Long leaderId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已完成课时数量。
|
* 已完成课时数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "已完成课时数量")
|
|
||||||
private Integer finishClassHour;
|
private Integer finishClassHour;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)")
|
|
||||||
private Integer classLevel;
|
private Integer classLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建用户。
|
* 创建用户。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "创建用户")
|
|
||||||
private Long createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班级创建时间。
|
* 班级创建时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "班级创建时间")
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* schoolId 字典关联数据。
|
* schoolId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "schoolId 字典关联数据")
|
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* leaderId 字典关联数据。
|
* leaderId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "leaderId 字典关联数据")
|
|
||||||
private Map<String, Object> leaderIdDictMap;
|
private Map<String, Object> leaderIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* classLevel 常量字典关联数据。
|
* classLevel 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "classLevel 常量字典关联数据")
|
|
||||||
private Map<String, Object> classLevelDictMap;
|
private Map<String, Object> classLevelDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,157 +1,131 @@
|
|||||||
package com.orange.demo.webadmin.app.vo;
|
package com.orange.demo.webadmin.app.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StudentVO对象。
|
* StudentVO视图对象。
|
||||||
*
|
*
|
||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiModel("StudentVO实体对象")
|
|
||||||
@Data
|
@Data
|
||||||
public class StudentVo {
|
public class StudentVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生Id。
|
* 学生Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生Id")
|
|
||||||
private Long studentId;
|
private Long studentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录手机。
|
* 登录手机。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "登录手机")
|
|
||||||
private String loginMobile;
|
private String loginMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生姓名。
|
* 学生姓名。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生姓名")
|
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在省份Id。
|
* 所在省份Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "所在省份Id")
|
|
||||||
private Long provinceId;
|
private Long provinceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在城市Id。
|
* 所在城市Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "所在城市Id")
|
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区县Id。
|
* 区县Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "区县Id")
|
|
||||||
private Long districtId;
|
private Long districtId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生性别 (0: 女生 1: 男生)。
|
* 学生性别 (0: 女生 1: 男生)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)")
|
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生日。
|
* 生日。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "生日")
|
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)")
|
|
||||||
private Integer experienceLevel;
|
private Integer experienceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总共充值学币数量。
|
* 总共充值学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "总共充值学币数量")
|
|
||||||
private Integer totalCoin;
|
private Integer totalCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可用学币数量。
|
* 可用学币数量。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "可用学币数量")
|
|
||||||
private Integer leftCoin;
|
private Integer leftCoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年级Id。
|
* 年级Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "年级Id")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校区Id。
|
* 校区Id。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "校区Id")
|
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册时间。
|
* 注册时间。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "注册时间")
|
|
||||||
private Date registerTime;
|
private Date registerTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)")
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* provinceId 字典关联数据。
|
* provinceId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "provinceId 字典关联数据")
|
|
||||||
private Map<String, Object> provinceIdDictMap;
|
private Map<String, Object> provinceIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cityId 字典关联数据。
|
* cityId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "cityId 字典关联数据")
|
|
||||||
private Map<String, Object> cityIdDictMap;
|
private Map<String, Object> cityIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* districtId 字典关联数据。
|
* districtId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "districtId 字典关联数据")
|
|
||||||
private Map<String, Object> districtIdDictMap;
|
private Map<String, Object> districtIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gradeId 字典关联数据。
|
* gradeId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gradeId 字典关联数据")
|
|
||||||
private Map<String, Object> gradeIdDictMap;
|
private Map<String, Object> gradeIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* schoolId 字典关联数据。
|
* schoolId 字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "schoolId 字典关联数据")
|
|
||||||
private Map<String, Object> schoolIdDictMap;
|
private Map<String, Object> schoolIdDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gender 常量字典关联数据。
|
* gender 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "gender 常量字典关联数据")
|
|
||||||
private Map<String, Object> genderDictMap;
|
private Map<String, Object> genderDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* experienceLevel 常量字典关联数据。
|
* experienceLevel 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "experienceLevel 常量字典关联数据")
|
|
||||||
private Map<String, Object> experienceLevelDictMap;
|
private Map<String, Object> experienceLevelDictMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* status 常量字典关联数据。
|
* status 常量字典关联数据。
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "status 常量字典关联数据")
|
|
||||||
private Map<String, Object> statusDictMap;
|
private Map<String, Object> statusDictMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
import tk.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ package com.orange.demo.webadmin.upms.controller;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.orange.demo.webadmin.config.ApplicationConfig;
|
import com.orange.demo.webadmin.config.ApplicationConfig;
|
||||||
import com.orange.demo.webadmin.upms.service.*;
|
import com.orange.demo.webadmin.upms.service.*;
|
||||||
@@ -20,6 +16,8 @@ import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
|||||||
import com.orange.demo.common.core.object.*;
|
import com.orange.demo.common.core.object.*;
|
||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.redis.cache.SessionCacheHelper;
|
import com.orange.demo.common.redis.cache.SessionCacheHelper;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.redisson.api.RBucket;
|
import org.redisson.api.RBucket;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -37,8 +35,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@ApiSupport(order = 1)
|
|
||||||
@Api(tags = "用户登录接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/login")
|
@RequestMapping("/admin/upms/login")
|
||||||
@@ -53,6 +49,8 @@ public class LoginController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysPermService sysPermService;
|
private SysPermService sysPermService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private SysDataPermService sysDataPermService;
|
||||||
|
@Autowired
|
||||||
private ApplicationConfig appConfig;
|
private ApplicationConfig appConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedissonClient redissonClient;
|
private RedissonClient redissonClient;
|
||||||
@@ -68,13 +66,8 @@ public class LoginController {
|
|||||||
* @param password 密码。
|
* @param password 密码。
|
||||||
* @return 应答结果对象,其中包括JWT的Token数据,以及菜单列表。
|
* @return 应答结果对象,其中包括JWT的Token数据,以及菜单列表。
|
||||||
*/
|
*/
|
||||||
@ApiImplicitParams({
|
|
||||||
// 这里包含密码密文,仅用于方便开发期间的接口测试,集成测试和发布阶段,需要将当前注解去掉。
|
|
||||||
// 如果您重新生成了公钥和私钥,请替换password的缺省值。
|
|
||||||
@ApiImplicitParam(name = "loginName", defaultValue = "admin"),
|
|
||||||
@ApiImplicitParam(name = "password", defaultValue = "IP3ccke3GhH45iGHB5qP9p7iZw6xUyj28Ju10rnBiPKOI35sc%2BjI7%2FdsjOkHWMfUwGYGfz8ik31HC2Ruk%2Fhkd9f6RPULTHj7VpFdNdde2P9M4mQQnFBAiPM7VT9iW3RyCtPlJexQ3nAiA09OqG%2F0sIf1kcyveSrulxembARDbDo%3D")
|
|
||||||
})
|
|
||||||
@NoAuthInterface
|
@NoAuthInterface
|
||||||
|
@OperationLog(type = SysOperationLogType.LOGIN, saveResponse = false)
|
||||||
@PostMapping("/doLogin")
|
@PostMapping("/doLogin")
|
||||||
public ResponseResult<JSONObject> doLogin(
|
public ResponseResult<JSONObject> doLogin(
|
||||||
@MyRequestBody String loginName, @MyRequestBody String password) throws Exception {
|
@MyRequestBody String loginName, @MyRequestBody String password) throws Exception {
|
||||||
@@ -94,6 +87,8 @@ public class LoginController {
|
|||||||
errorMessage = "登录失败,用户账号被锁定!";
|
errorMessage = "登录失败,用户账号被锁定!";
|
||||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USER_STATUS, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.INVALID_USER_STATUS, errorMessage);
|
||||||
}
|
}
|
||||||
|
String patternKey = RedisKeyUtil.getSessionIdPrefix(user.getLoginName(), MyCommonUtil.getDeviceType()) + "*";
|
||||||
|
redissonClient.getKeys().deleteByPatternAsync(patternKey);
|
||||||
JSONObject jsonData = this.buildLoginData(user);
|
JSONObject jsonData = this.buildLoginData(user);
|
||||||
return ResponseResult.success(jsonData);
|
return ResponseResult.success(jsonData);
|
||||||
}
|
}
|
||||||
@@ -103,12 +98,14 @@ public class LoginController {
|
|||||||
*
|
*
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.LOGOUT)
|
||||||
@PostMapping("/doLogout")
|
@PostMapping("/doLogout")
|
||||||
public ResponseResult<Void> doLogout() {
|
public ResponseResult<Void> doLogout() {
|
||||||
TokenData tokenData = TokenData.takeFromRequest();
|
TokenData tokenData = TokenData.takeFromRequest();
|
||||||
String sessionIdKey = RedisKeyUtil.makeSessionIdKey(tokenData.getSessionId());
|
String sessionIdKey = RedisKeyUtil.makeSessionIdKey(tokenData.getSessionId());
|
||||||
redissonClient.getBucket(sessionIdKey).delete();
|
redissonClient.getBucket(sessionIdKey).delete();
|
||||||
sysPermService.removeUserSysPermCache(tokenData.getSessionId());
|
sysPermService.removeUserSysPermCache(tokenData.getSessionId());
|
||||||
|
sysDataPermService.removeDataPermCache(tokenData.getSessionId());
|
||||||
cacheHelper.removeAllSessionCache(tokenData.getSessionId());
|
cacheHelper.removeAllSessionCache(tokenData.getSessionId());
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
@@ -153,7 +150,7 @@ public class LoginController {
|
|||||||
@PostMapping("/changePassword")
|
@PostMapping("/changePassword")
|
||||||
public ResponseResult<Void> changePassword(
|
public ResponseResult<Void> changePassword(
|
||||||
@MyRequestBody String oldPass, @MyRequestBody String newPass) throws Exception {
|
@MyRequestBody String oldPass, @MyRequestBody String newPass) throws Exception {
|
||||||
if (MyCommonUtil.existBlankArgument(oldPass, oldPass)) {
|
if (MyCommonUtil.existBlankArgument(newPass, oldPass)) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
}
|
}
|
||||||
TokenData tokenData = TokenData.takeFromRequest();
|
TokenData tokenData = TokenData.takeFromRequest();
|
||||||
@@ -187,6 +184,7 @@ public class LoginController {
|
|||||||
TokenData tokenData = new TokenData();
|
TokenData tokenData = new TokenData();
|
||||||
tokenData.setSessionId(sessionId);
|
tokenData.setSessionId(sessionId);
|
||||||
tokenData.setUserId(user.getUserId());
|
tokenData.setUserId(user.getUserId());
|
||||||
|
tokenData.setDeptId(user.getDeptId());
|
||||||
tokenData.setLoginName(user.getLoginName());
|
tokenData.setLoginName(user.getLoginName());
|
||||||
tokenData.setShowName(user.getShowName());
|
tokenData.setShowName(user.getShowName());
|
||||||
tokenData.setIsAdmin(isAdmin);
|
tokenData.setIsAdmin(isAdmin);
|
||||||
@@ -214,6 +212,7 @@ public class LoginController {
|
|||||||
if (user.getUserType() != SysUserType.TYPE_ADMIN) {
|
if (user.getUserType() != SysUserType.TYPE_ADMIN) {
|
||||||
// 缓存用户的权限资源
|
// 缓存用户的权限资源
|
||||||
sysPermService.putUserSysPermCache(sessionId, user.getUserId());
|
sysPermService.putUserSysPermCache(sessionId, user.getUserId());
|
||||||
|
sysDataPermService.putDataPermCache(sessionId, user.getUserId(), user.getDeptId());
|
||||||
}
|
}
|
||||||
return jsonData;
|
return jsonData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.object.*;
|
import com.orange.demo.common.core.object.*;
|
||||||
import com.orange.demo.common.core.util.RedisKeyUtil;
|
import com.orange.demo.common.core.util.RedisKeyUtil;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.redisson.api.RBucket;
|
import org.redisson.api.RBucket;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
@@ -23,7 +22,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "在线用户接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/loginUser")
|
@RequestMapping("/admin/upms/loginUser")
|
||||||
|
|||||||
@@ -0,0 +1,288 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import com.orange.demo.webadmin.upms.dto.SysDataPermDto;
|
||||||
|
import com.orange.demo.webadmin.upms.dto.SysUserDto;
|
||||||
|
import com.orange.demo.webadmin.upms.vo.SysDataPermVo;
|
||||||
|
import com.orange.demo.webadmin.upms.vo.SysUserVo;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDataPerm;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysUser;
|
||||||
|
import com.orange.demo.webadmin.upms.service.SysDataPermService;
|
||||||
|
import com.orange.demo.webadmin.upms.service.SysUserService;
|
||||||
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
|
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||||
|
import com.orange.demo.common.core.object.*;
|
||||||
|
import com.orange.demo.common.core.util.*;
|
||||||
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.groups.Default;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限接口控制器对象。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/upms/sysDataPerm")
|
||||||
|
public class SysDataPermController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDataPermService sysDataPermService;
|
||||||
|
@Autowired
|
||||||
|
private SysUserService sysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加新数据权限操作。
|
||||||
|
*
|
||||||
|
* @param sysDataPermDto 新增对象。
|
||||||
|
* @param deptIdListString 数据权限关联的部门Id列表,多个之间逗号分隔。
|
||||||
|
* @return 应答结果对象。包含新增数据权限对象的主键Id。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
public ResponseResult<Long> add(
|
||||||
|
@MyRequestBody SysDataPermDto sysDataPermDto, @MyRequestBody String deptIdListString) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysDataPermDto);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
|
}
|
||||||
|
SysDataPerm sysDataPerm = MyModelUtil.copyTo(sysDataPermDto, SysDataPerm.class);
|
||||||
|
CallResult result = sysDataPermService.verifyRelatedData(sysDataPerm, deptIdListString);
|
||||||
|
if (!result.isSuccess()) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||||
|
}
|
||||||
|
Set<Long> deptIdSet = null;
|
||||||
|
if (result.getData() != null) {
|
||||||
|
deptIdSet = result.getData().getObject("deptIdSet", new TypeReference<Set<Long>>(){});
|
||||||
|
}
|
||||||
|
sysDataPermService.saveNew(sysDataPerm, deptIdSet);
|
||||||
|
return ResponseResult.success(sysDataPerm.getDataPermId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新数据权限操作。
|
||||||
|
*
|
||||||
|
* @param sysDataPermDto 更新的数据权限对象。
|
||||||
|
* @param deptIdListString 数据权限关联的部门Id列表,多个之间逗号分隔。
|
||||||
|
* @return 应答结果对象。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
public ResponseResult<Void> update(
|
||||||
|
@MyRequestBody SysDataPermDto sysDataPermDto, @MyRequestBody String deptIdListString) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysDataPermDto, Default.class, UpdateGroup.class);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
|
}
|
||||||
|
SysDataPerm originalSysDataPerm = sysDataPermService.getById(sysDataPermDto.getDataPermId());
|
||||||
|
if (originalSysDataPerm == null) {
|
||||||
|
errorMessage = "数据验证失败,当前数据权限并不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
SysDataPerm sysDataPerm = MyModelUtil.copyTo(sysDataPermDto, SysDataPerm.class);
|
||||||
|
CallResult result = sysDataPermService.verifyRelatedData(sysDataPerm, deptIdListString);
|
||||||
|
if (!result.isSuccess()) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||||
|
}
|
||||||
|
Set<Long> deptIdSet = null;
|
||||||
|
if (result.getData() != null) {
|
||||||
|
deptIdSet = result.getData().getObject("deptIdSet", new TypeReference<Set<Long>>(){});
|
||||||
|
}
|
||||||
|
if (!sysDataPermService.update(sysDataPerm, originalSysDataPerm, deptIdSet)) {
|
||||||
|
errorMessage = "更新失败,数据不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据权限操作。
|
||||||
|
*
|
||||||
|
* @param dataPermId 待删除数据权限主键Id。
|
||||||
|
* @return 应答数据结果。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public ResponseResult<Void> delete(@MyRequestBody Long dataPermId) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(dataPermId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
if (!sysDataPermService.remove(dataPermId)) {
|
||||||
|
String errorMessage = "数据操作失败,数据权限不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看数据权限列表。
|
||||||
|
*
|
||||||
|
* @param sysDataPermDtoFilter 数据权限查询过滤对象。
|
||||||
|
* @param orderParam 排序参数。
|
||||||
|
* @param pageParam 分页参数。
|
||||||
|
* @return 应答结果对象。包含数据权限列表。
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseResult<MyPageData<SysDataPermVo>> list(
|
||||||
|
@MyRequestBody SysDataPermDto sysDataPermDtoFilter,
|
||||||
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
|
if (pageParam != null) {
|
||||||
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
|
}
|
||||||
|
SysDataPerm filter = MyModelUtil.copyTo(sysDataPermDtoFilter, SysDataPerm.class);
|
||||||
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysDataPerm.class);
|
||||||
|
List<SysDataPerm> dataPermList = sysDataPermService.getSysDataPermList(filter, orderBy);
|
||||||
|
List<SysDataPermVo> dataPermVoList = MyModelUtil.copyCollectionTo(dataPermList, SysDataPermVo.class);
|
||||||
|
long totalCount = 0L;
|
||||||
|
if (dataPermList instanceof Page) {
|
||||||
|
totalCount = ((Page<SysDataPerm>) dataPermList).getTotal();
|
||||||
|
}
|
||||||
|
return ResponseResult.success(MyPageUtil.makeResponseData(dataPermVoList, totalCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看单条数据权限详情。
|
||||||
|
*
|
||||||
|
* @param dataPermId 数据权限的主键Id。
|
||||||
|
* @return 应答结果对象,包含数据权限的详情。
|
||||||
|
*/
|
||||||
|
@GetMapping("/view")
|
||||||
|
public ResponseResult<SysDataPermVo> view(@RequestParam Long dataPermId) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(dataPermId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
SysDataPerm dataPerm = sysDataPermService.getByIdWithRelation(dataPermId, MyRelationParam.full());
|
||||||
|
if (dataPerm == null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||||
|
}
|
||||||
|
SysDataPermVo dataPermVo = MyModelUtil.copyTo(dataPerm, SysDataPermVo.class);
|
||||||
|
return ResponseResult.success(dataPermVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取不包含指定数据权限Id的用户列表。
|
||||||
|
* 用户和数据权限是多对多关系,当前接口将返回没有赋值指定DataPermId的用户列表。可用于给数据权限添加新用户。
|
||||||
|
*
|
||||||
|
* @param dataPermId 数据权限主键Id。
|
||||||
|
* @param sysUserDtoFilter 用户数据的过滤对象。
|
||||||
|
* @param orderParam 排序参数。
|
||||||
|
* @param pageParam 分页参数。
|
||||||
|
* @return 应答结果对象,包含用户列表数据。
|
||||||
|
*/
|
||||||
|
@PostMapping("/listNotInDataPermUser")
|
||||||
|
public ResponseResult<MyPageData<SysUserVo>> listNotInDataPermUser(
|
||||||
|
@MyRequestBody Long dataPermId,
|
||||||
|
@MyRequestBody SysUserDto sysUserDtoFilter,
|
||||||
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
|
ResponseResult<Void> verifyResult = this.doDataPermUserVerify(dataPermId);
|
||||||
|
if (!verifyResult.isSuccess()) {
|
||||||
|
return ResponseResult.errorFrom(verifyResult);
|
||||||
|
}
|
||||||
|
if (pageParam != null) {
|
||||||
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
|
}
|
||||||
|
SysUser filter = MyModelUtil.copyTo(sysUserDtoFilter, SysUser.class);
|
||||||
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||||
|
List<SysUser> userList =
|
||||||
|
sysUserService.getNotInSysUserListByDataPermId(dataPermId, filter, orderBy);
|
||||||
|
List<SysUserVo> userVoList = MyModelUtil.copyCollectionTo(userList, SysUserVo.class);
|
||||||
|
return ResponseResult.success(MyPageUtil.makeResponseData(userVoList));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拥有指定数据权限的用户列表。
|
||||||
|
*
|
||||||
|
* @param dataPermId 数据权限Id。
|
||||||
|
* @param sysUserDtoFilter 用户过滤对象。
|
||||||
|
* @param orderParam 排序参数。
|
||||||
|
* @param pageParam 分页参数。
|
||||||
|
* @return 应答结果对象,包含用户列表数据。
|
||||||
|
*/
|
||||||
|
@PostMapping("/listDataPermUser")
|
||||||
|
public ResponseResult<MyPageData<SysUserVo>> listDataPermUser(
|
||||||
|
@MyRequestBody Long dataPermId,
|
||||||
|
@MyRequestBody SysUserDto sysUserDtoFilter,
|
||||||
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
|
ResponseResult<Void> verifyResult = this.doDataPermUserVerify(dataPermId);
|
||||||
|
if (!verifyResult.isSuccess()) {
|
||||||
|
return ResponseResult.errorFrom(verifyResult);
|
||||||
|
}
|
||||||
|
if (pageParam != null) {
|
||||||
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
|
}
|
||||||
|
SysUser filter = MyModelUtil.copyTo(sysUserDtoFilter, SysUser.class);
|
||||||
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||||
|
List<SysUser> userList =
|
||||||
|
sysUserService.getSysUserListByDataPermId(dataPermId, filter, orderBy);
|
||||||
|
List<SysUserVo> userVoList = MyModelUtil.copyCollectionTo(userList, SysUserVo.class);
|
||||||
|
return ResponseResult.success(MyPageUtil.makeResponseData(userVoList));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ResponseResult<Void> doDataPermUserVerify(Long dataPermId) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(dataPermId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
if (!sysDataPermService.existId(dataPermId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为指定数据权限添加用户列表。该操作可同时给一批用户赋值数据权限,并在同一事务内完成。
|
||||||
|
*
|
||||||
|
* @param dataPermId 数据权限主键Id。
|
||||||
|
* @param userIdListString 逗号分隔的用户Id列表。
|
||||||
|
* @return 应答结果对象。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD_M2M)
|
||||||
|
@PostMapping("/addDataPermUser")
|
||||||
|
public ResponseResult<Void> addDataPermUser(
|
||||||
|
@MyRequestBody Long dataPermId, @MyRequestBody String userIdListString) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(dataPermId, userIdListString)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
Set<Long> userIdSet =
|
||||||
|
Arrays.stream(userIdListString.split(",")).map(Long::valueOf).collect(Collectors.toSet());
|
||||||
|
if (!sysDataPermService.existId(dataPermId)
|
||||||
|
|| !sysUserService.existUniqueKeyList("userId", userIdSet)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.INVALID_RELATED_RECORD_ID);
|
||||||
|
}
|
||||||
|
sysDataPermService.addDataPermUserList(dataPermId, userIdSet);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为指定用户移除指定数据权限。
|
||||||
|
*
|
||||||
|
* @param dataPermId 指定数据权限主键Id。
|
||||||
|
* @param userId 指定用户主键Id。
|
||||||
|
* @return 应答数据结果。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE_M2M)
|
||||||
|
@PostMapping("/deleteDataPermUser")
|
||||||
|
public ResponseResult<Void> deleteDataPermUser(
|
||||||
|
@MyRequestBody Long dataPermId, @MyRequestBody Long userId) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(dataPermId, userId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
if (!sysDataPermService.removeDataPermUser(dataPermId, userId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
|
import cn.jimmyshi.beanquery.BeanQuery;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import com.orange.demo.webadmin.upms.vo.*;
|
||||||
|
import com.orange.demo.webadmin.upms.dto.*;
|
||||||
|
import com.orange.demo.webadmin.upms.model.*;
|
||||||
|
import com.orange.demo.webadmin.upms.service.*;
|
||||||
|
import com.orange.demo.common.core.object.*;
|
||||||
|
import com.orange.demo.common.core.util.*;
|
||||||
|
import com.orange.demo.common.core.constant.*;
|
||||||
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门管理操作控制器类。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/upms/sysDept")
|
||||||
|
public class SysDeptController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDeptService sysDeptService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增部门管理数据。
|
||||||
|
*
|
||||||
|
* @param sysDeptDto 新增对象。
|
||||||
|
* @return 应答结果对象,包含新增对象主键Id。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
public ResponseResult<Long> add(@MyRequestBody SysDeptDto sysDeptDto) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysDeptDto, false);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
|
}
|
||||||
|
SysDept sysDept = MyModelUtil.copyTo(sysDeptDto, SysDept.class);
|
||||||
|
// 验证父Id的数据合法性
|
||||||
|
SysDept parentSysDept = null;
|
||||||
|
if (MyCommonUtil.isNotBlankOrNull(sysDept.getParentId())) {
|
||||||
|
parentSysDept = sysDeptService.getById(sysDept.getParentId());
|
||||||
|
if (parentSysDept == null) {
|
||||||
|
errorMessage = "数据验证失败,关联的父节点并不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_PARENT_ID_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sysDept = sysDeptService.saveNew(sysDept, parentSysDept);
|
||||||
|
return ResponseResult.success(sysDept.getDeptId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新部门管理数据。
|
||||||
|
*
|
||||||
|
* @param sysDeptDto 更新对象。
|
||||||
|
* @return 应答结果对象。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
public ResponseResult<Void> update(@MyRequestBody SysDeptDto sysDeptDto) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysDeptDto, true);
|
||||||
|
if (errorMessage != null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
|
}
|
||||||
|
SysDept sysDept = MyModelUtil.copyTo(sysDeptDto, SysDept.class);
|
||||||
|
SysDept originalSysDept = sysDeptService.getById(sysDept.getDeptId());
|
||||||
|
if (originalSysDept == null) {
|
||||||
|
// NOTE: 修改下面方括号中的话述
|
||||||
|
errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
// 验证父Id的数据合法性
|
||||||
|
if (MyCommonUtil.isNotBlankOrNull(sysDept.getParentId())
|
||||||
|
&& ObjectUtils.notEqual(sysDept.getParentId(), originalSysDept.getParentId())) {
|
||||||
|
SysDept parentSysDept = sysDeptService.getById(sysDept.getParentId());
|
||||||
|
if (parentSysDept == null) {
|
||||||
|
// NOTE: 修改下面方括号中的话述
|
||||||
|
errorMessage = "数据验证失败,关联的 [父节点] 并不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_PARENT_ID_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!sysDeptService.update(sysDept, originalSysDept)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除部门管理数据。
|
||||||
|
*
|
||||||
|
* @param deptId 删除对象主键Id。
|
||||||
|
* @return 应答结果对象。
|
||||||
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public ResponseResult<Void> delete(@MyRequestBody Long deptId) {
|
||||||
|
String errorMessage;
|
||||||
|
if (MyCommonUtil.existBlankArgument(deptId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
// 验证关联Id的数据合法性
|
||||||
|
SysDept originalSysDept = sysDeptService.getById(deptId);
|
||||||
|
if (originalSysDept == null) {
|
||||||
|
// NOTE: 修改下面方括号中的话述
|
||||||
|
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
if (sysDeptService.hasChildren(deptId)) {
|
||||||
|
// NOTE: 修改下面方括号中的话述
|
||||||
|
errorMessage = "数据验证失败,当前 [对象存在子对象] ,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.HAS_CHILDREN_DATA, errorMessage);
|
||||||
|
}
|
||||||
|
if (sysDeptService.hasChildrenUser(deptId)) {
|
||||||
|
errorMessage = "数据验证失败,请先移除部门用户数据后,再删除当前部门!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.HAS_CHILDREN_DATA, errorMessage);
|
||||||
|
}
|
||||||
|
if (!sysDeptService.remove(deptId)) {
|
||||||
|
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列出符合过滤条件的部门管理列表。
|
||||||
|
*
|
||||||
|
* @param sysDeptDtoFilter 过滤对象。
|
||||||
|
* @param orderParam 排序参数。
|
||||||
|
* @param pageParam 分页参数。
|
||||||
|
* @return 应答结果对象,包含查询结果集。
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseResult<MyPageData<SysDeptVo>> list(
|
||||||
|
@MyRequestBody SysDeptDto sysDeptDtoFilter,
|
||||||
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
|
if (pageParam != null) {
|
||||||
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
|
}
|
||||||
|
SysDept sysDeptFilter = MyModelUtil.copyTo(sysDeptDtoFilter, SysDept.class);
|
||||||
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysDept.class);
|
||||||
|
List<SysDept> sysDeptList = sysDeptService.getSysDeptListWithRelation(sysDeptFilter, orderBy);
|
||||||
|
return ResponseResult.success(MyPageUtil.makeResponseData(sysDeptList, SysDept.INSTANCE));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看指定部门管理对象详情。
|
||||||
|
*
|
||||||
|
* @param deptId 指定对象主键Id。
|
||||||
|
* @return 应答结果对象,包含对象详情。
|
||||||
|
*/
|
||||||
|
@GetMapping("/view")
|
||||||
|
public ResponseResult<SysDeptVo> view(@RequestParam Long deptId) {
|
||||||
|
if (MyCommonUtil.existBlankArgument(deptId)) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||||
|
}
|
||||||
|
SysDept sysDept = sysDeptService.getByIdWithRelation(deptId, MyRelationParam.full());
|
||||||
|
if (sysDept == null) {
|
||||||
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||||
|
}
|
||||||
|
SysDeptVo sysDeptVo = SysDept.INSTANCE.fromModel(sysDept);
|
||||||
|
return ResponseResult.success(sysDeptVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以字典形式返回全部部门管理数据集合。字典的键值为[deptId, deptName]。
|
||||||
|
* 白名单接口,登录用户均可访问。
|
||||||
|
*
|
||||||
|
* @param filter 过滤对象。
|
||||||
|
* @return 应答结果对象,包含的数据为 List<Map<String, String>>,map中包含两条记录,key的值分别是id和name,value对应具体数据。
|
||||||
|
*/
|
||||||
|
@GetMapping("/listDict")
|
||||||
|
public ResponseResult<List<Map<String, Object>>> listDict(SysDept filter) {
|
||||||
|
List<SysDept> resultList = sysDeptService.getListByFilter(filter);
|
||||||
|
return ResponseResult.success(BeanQuery.select(
|
||||||
|
"parentId as parentId", "deptId as id", "deptName as name").executeFrom(resultList));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典Id集合,获取查询后的字典数据。
|
||||||
|
*
|
||||||
|
* @param dictIds 字典Id集合。
|
||||||
|
* @return 应答结果对象,包含字典形式的数据集合。
|
||||||
|
*/
|
||||||
|
@PostMapping("/listDictByIds")
|
||||||
|
public ResponseResult<List<Map<String, Object>>> listDictByIds(
|
||||||
|
@MyRequestBody(elementType = Long.class) List<Long> dictIds) {
|
||||||
|
List<SysDept> resultList = sysDeptService.getInList(new HashSet<>(dictIds));
|
||||||
|
return ResponseResult.success(BeanQuery.select(
|
||||||
|
"parentId as parentId", "deptId as id", "deptName as name").executeFrom(resultList));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父主键Id,以字典的形式返回其下级数据列表。
|
||||||
|
* 白名单接口,登录用户均可访问。
|
||||||
|
*
|
||||||
|
* @param parentId 父主键Id。
|
||||||
|
* @return 按照字典的形式返回下级数据列表。
|
||||||
|
*/
|
||||||
|
@GetMapping("/listDictByParentId")
|
||||||
|
public ResponseResult<List<Map<String, Object>>> listDictByParentId(@RequestParam(required = false) Long parentId) {
|
||||||
|
List<SysDept> resultList = sysDeptService.getListByParentId("parentId", parentId);
|
||||||
|
return ResponseResult.success(BeanQuery.select(
|
||||||
|
"parentId as parentId", "deptId as id", "deptName as name").executeFrom(resultList));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.orange.demo.webadmin.upms.dto.SysMenuDto;
|
import com.orange.demo.webadmin.upms.dto.SysMenuDto;
|
||||||
import com.orange.demo.webadmin.upms.vo.SysMenuVo;
|
import com.orange.demo.webadmin.upms.vo.SysMenuVo;
|
||||||
@@ -14,6 +13,8 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -26,7 +27,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "菜单管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysMenu")
|
@RequestMapping("/admin/upms/sysMenu")
|
||||||
@@ -42,8 +42,7 @@ public class SysMenuController {
|
|||||||
* @param permCodeIdListString 与当前菜单Id绑定的权限Id列表,多个权限之间逗号分隔。
|
* @param permCodeIdListString 与当前菜单Id绑定的权限Id列表,多个权限之间逗号分隔。
|
||||||
* @return 应答结果对象,包含新增菜单的主键Id。
|
* @return 应答结果对象,包含新增菜单的主键Id。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysMenuDto.menuId"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(
|
public ResponseResult<Long> add(
|
||||||
@MyRequestBody SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
@MyRequestBody SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
||||||
@@ -69,7 +68,7 @@ public class SysMenuController {
|
|||||||
}
|
}
|
||||||
Set<Long> permCodeIdSet = null;
|
Set<Long> permCodeIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
permCodeIdSet = (Set<Long>) result.getData().get("permCodeIdSet");
|
permCodeIdSet = result.getData().getObject("permCodeIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
sysMenuService.saveNew(sysMenu, permCodeIdSet);
|
sysMenuService.saveNew(sysMenu, permCodeIdSet);
|
||||||
return ResponseResult.success(sysMenu.getMenuId());
|
return ResponseResult.success(sysMenu.getMenuId());
|
||||||
@@ -82,7 +81,7 @@ public class SysMenuController {
|
|||||||
* @param permCodeIdListString 与当前菜单Id绑定的权限Id列表,多个权限之间逗号分隔。
|
* @param permCodeIdListString 与当前菜单Id绑定的权限Id列表,多个权限之间逗号分隔。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(
|
public ResponseResult<Void> update(
|
||||||
@MyRequestBody SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
@MyRequestBody SysMenuDto sysMenuDto, @MyRequestBody String permCodeIdListString) {
|
||||||
@@ -117,7 +116,7 @@ public class SysMenuController {
|
|||||||
}
|
}
|
||||||
Set<Long> permCodeIdSet = null;
|
Set<Long> permCodeIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
permCodeIdSet = (Set<Long>) result.getData().get("permCodeIdSet");
|
permCodeIdSet = result.getData().getObject("permCodeIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
if (!sysMenuService.update(sysMenu, originalSysMenu, permCodeIdSet)) {
|
if (!sysMenuService.update(sysMenu, originalSysMenu, permCodeIdSet)) {
|
||||||
errorMessage = "数据验证失败,当前权限字并不存在,请刷新后重试!";
|
errorMessage = "数据验证失败,当前权限字并不存在,请刷新后重试!";
|
||||||
@@ -132,6 +131,7 @@ public class SysMenuController {
|
|||||||
* @param menuId 指定菜单主键Id。
|
* @param menuId 指定菜单主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long menuId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long menuId) {
|
||||||
if (MyCommonUtil.existBlankArgument(menuId)) {
|
if (MyCommonUtil.existBlankArgument(menuId)) {
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.core.object.*;
|
||||||
|
import com.orange.demo.common.core.util.MyModelUtil;
|
||||||
|
import com.orange.demo.common.core.util.MyPageUtil;
|
||||||
|
import com.orange.demo.common.log.model.SysOperationLog;
|
||||||
|
import com.orange.demo.common.log.service.SysOperationLogService;
|
||||||
|
import com.orange.demo.webadmin.upms.dto.SysOperationLogDto;
|
||||||
|
import com.orange.demo.webadmin.upms.vo.SysOperationLogVo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志接口控制器对象。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/upms/sysOperationLog")
|
||||||
|
public class SysOperationLogController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysOperationLogService operationLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限列表。
|
||||||
|
*
|
||||||
|
* @param sysOperationLogDtoFilter 操作日志查询过滤对象。
|
||||||
|
* @param orderParam 排序参数。
|
||||||
|
* @param pageParam 分页参数。
|
||||||
|
* @return 应答结果对象。包含操作日志列表。
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseResult<MyPageData<SysOperationLogVo>> list(
|
||||||
|
@MyRequestBody SysOperationLogDto sysOperationLogDtoFilter,
|
||||||
|
@MyRequestBody MyOrderParam orderParam,
|
||||||
|
@MyRequestBody MyPageParam pageParam) {
|
||||||
|
if (pageParam != null) {
|
||||||
|
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||||
|
}
|
||||||
|
SysOperationLog filter = MyModelUtil.copyTo(sysOperationLogDtoFilter, SysOperationLog.class);
|
||||||
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysOperationLog.class);
|
||||||
|
List<SysOperationLog> operationLogList = operationLogService.getSysOperationLogList(filter, orderBy);
|
||||||
|
List<SysOperationLogVo> operationLogVoList = MyModelUtil.copyCollectionTo(operationLogList, SysOperationLogVo.class);
|
||||||
|
long totalCount = 0L;
|
||||||
|
if (operationLogList instanceof Page) {
|
||||||
|
totalCount = ((Page<SysOperationLog>) operationLogList).getTotal();
|
||||||
|
}
|
||||||
|
return ResponseResult.success(MyPageUtil.makeResponseData(operationLogVoList, totalCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.orange.demo.webadmin.upms.dto.SysPermCodeDto;
|
import com.orange.demo.webadmin.upms.dto.SysPermCodeDto;
|
||||||
import com.orange.demo.webadmin.upms.vo.SysPermCodeVo;
|
import com.orange.demo.webadmin.upms.vo.SysPermCodeVo;
|
||||||
@@ -12,6 +11,8 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -25,7 +26,6 @@ import java.util.*;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "权限字管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysPermCode")
|
@RequestMapping("/admin/upms/sysPermCode")
|
||||||
@@ -41,8 +41,7 @@ public class SysPermCodeController {
|
|||||||
* @param permIdListString 与当前权限Id绑定的权限资源Id列表,多个权限资源之间逗号分隔。
|
* @param permIdListString 与当前权限Id绑定的权限资源Id列表,多个权限资源之间逗号分隔。
|
||||||
* @return 应答结果对象,包含新增权限字的主键Id。
|
* @return 应答结果对象,包含新增权限字的主键Id。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysPermCodeDto.permCodeId"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(
|
public ResponseResult<Long> add(
|
||||||
@MyRequestBody SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
@MyRequestBody SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
||||||
@@ -57,7 +56,7 @@ public class SysPermCodeController {
|
|||||||
}
|
}
|
||||||
Set<Long> permIdSet = null;
|
Set<Long> permIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
permIdSet = (Set<Long>) result.getData().get("permIdSet");
|
permIdSet = result.getData().getObject("permIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
sysPermCode = sysPermCodeService.saveNew(sysPermCode, permIdSet);
|
sysPermCode = sysPermCodeService.saveNew(sysPermCode, permIdSet);
|
||||||
return ResponseResult.success(sysPermCode.getPermCodeId());
|
return ResponseResult.success(sysPermCode.getPermCodeId());
|
||||||
@@ -70,7 +69,7 @@ public class SysPermCodeController {
|
|||||||
* @param permIdListString 与当前权限Id绑定的权限资源Id列表,多个权限资源之间逗号分隔。
|
* @param permIdListString 与当前权限Id绑定的权限资源Id列表,多个权限资源之间逗号分隔。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(
|
public ResponseResult<Void> update(
|
||||||
@MyRequestBody SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
@MyRequestBody SysPermCodeDto sysPermCodeDto, @MyRequestBody String permIdListString) {
|
||||||
@@ -90,7 +89,7 @@ public class SysPermCodeController {
|
|||||||
}
|
}
|
||||||
Set<Long> permIdSet = null;
|
Set<Long> permIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
permIdSet = (Set<Long>) result.getData().get("permIdSet");
|
permIdSet = result.getData().getObject("permIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!sysPermCodeService.update(sysPermCode, originalSysPermCode, permIdSet)) {
|
if (!sysPermCodeService.update(sysPermCode, originalSysPermCode, permIdSet)) {
|
||||||
@@ -110,6 +109,7 @@ public class SysPermCodeController {
|
|||||||
* @param permCodeId 指定的权限字主键Id。
|
* @param permCodeId 指定的权限字主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long permCodeId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long permCodeId) {
|
||||||
if (MyCommonUtil.existBlankArgument(permCodeId)) {
|
if (MyCommonUtil.existBlankArgument(permCodeId)) {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -14,6 +12,8 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -27,7 +27,6 @@ import java.util.Map;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "权限资源管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysPerm")
|
@RequestMapping("/admin/upms/sysPerm")
|
||||||
@@ -42,7 +41,7 @@ public class SysPermController {
|
|||||||
* @param sysPermDto 新增权限资源对象。
|
* @param sysPermDto 新增权限资源对象。
|
||||||
* @return 应答结果对象,包含新增权限资源的主键Id。
|
* @return 应答结果对象,包含新增权限资源的主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysPermDto.permId"})
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody SysPermDto sysPermDto) {
|
public ResponseResult<Long> add(@MyRequestBody SysPermDto sysPermDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto);
|
||||||
@@ -64,6 +63,7 @@ public class SysPermController {
|
|||||||
* @param sysPermDto 更新权限资源对象。
|
* @param sysPermDto 更新权限资源对象。
|
||||||
* @return 应答结果对象,包含更新权限资源的主键Id。
|
* @return 应答结果对象,包含更新权限资源的主键Id。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody SysPermDto sysPermDto) {
|
public ResponseResult<Void> update(@MyRequestBody SysPermDto sysPermDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(sysPermDto, Default.class, UpdateGroup.class);
|
||||||
@@ -90,6 +90,7 @@ public class SysPermController {
|
|||||||
* @param permId 指定的权限资源主键Id。
|
* @param permId 指定的权限资源主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long permId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long permId) {
|
||||||
if (MyCommonUtil.existBlankArgument(permId)) {
|
if (MyCommonUtil.existBlankArgument(permId)) {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.orange.demo.webadmin.upms.dto.SysPermModuleDto;
|
import com.orange.demo.webadmin.upms.dto.SysPermModuleDto;
|
||||||
import com.orange.demo.webadmin.upms.vo.SysPermModuleVo;
|
import com.orange.demo.webadmin.upms.vo.SysPermModuleVo;
|
||||||
@@ -13,6 +11,8 @@ import com.orange.demo.common.core.object.*;
|
|||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -29,7 +29,6 @@ import java.util.Map;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "权限资源模块管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysPermModule")
|
@RequestMapping("/admin/upms/sysPermModule")
|
||||||
@@ -44,7 +43,7 @@ public class SysPermModuleController {
|
|||||||
* @param sysPermModuleDto 新增权限资源模块对象。
|
* @param sysPermModuleDto 新增权限资源模块对象。
|
||||||
* @return 应答结果对象,包含新增权限资源模块的主键Id。
|
* @return 应答结果对象,包含新增权限资源模块的主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysPermModuleDto.moduleId"})
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(@MyRequestBody SysPermModuleDto sysPermModuleDto) {
|
public ResponseResult<Long> add(@MyRequestBody SysPermModuleDto sysPermModuleDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto);
|
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto);
|
||||||
@@ -67,6 +66,7 @@ public class SysPermModuleController {
|
|||||||
* @param sysPermModuleDto 更新权限资源模块对象。
|
* @param sysPermModuleDto 更新权限资源模块对象。
|
||||||
* @return 应答结果对象,包含新增权限资源模块的主键Id。
|
* @return 应答结果对象,包含新增权限资源模块的主键Id。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(@MyRequestBody SysPermModuleDto sysPermModuleDto) {
|
public ResponseResult<Void> update(@MyRequestBody SysPermModuleDto sysPermModuleDto) {
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto, Default.class, UpdateGroup.class);
|
String errorMessage = MyCommonUtil.getModelValidationError(sysPermModuleDto, Default.class, UpdateGroup.class);
|
||||||
@@ -98,6 +98,7 @@ public class SysPermModuleController {
|
|||||||
* @param moduleId 指定的权限资源模块主键Id。
|
* @param moduleId 指定的权限资源模块主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long moduleId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long moduleId) {
|
||||||
if (MyCommonUtil.existBlankArgument(moduleId)) {
|
if (MyCommonUtil.existBlankArgument(moduleId)) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -19,6 +18,8 @@ import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
|||||||
import com.orange.demo.common.core.object.*;
|
import com.orange.demo.common.core.object.*;
|
||||||
import com.orange.demo.common.core.util.*;
|
import com.orange.demo.common.core.util.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -32,7 +33,6 @@ import java.util.stream.Collectors;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "角色管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysRole")
|
@RequestMapping("/admin/upms/sysRole")
|
||||||
@@ -50,8 +50,7 @@ public class SysRoleController {
|
|||||||
* @param menuIdListString 与当前角色Id绑定的menuId列表,多个menuId之间逗号分隔。
|
* @param menuIdListString 与当前角色Id绑定的menuId列表,多个menuId之间逗号分隔。
|
||||||
* @return 应答结果对象,包含新增角色的主键Id。
|
* @return 应答结果对象,包含新增角色的主键Id。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysRoleDto.roleId", "sysRoleDto.createTimeStart", "sysRoleDto.createTimeEnd"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(
|
public ResponseResult<Long> add(
|
||||||
@MyRequestBody SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
@MyRequestBody SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
||||||
@@ -66,7 +65,7 @@ public class SysRoleController {
|
|||||||
}
|
}
|
||||||
Set<Long> menuIdSet = null;
|
Set<Long> menuIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
menuIdSet = (Set<Long>) result.getData().get("menuIdSet");
|
menuIdSet = result.getData().getObject("menuIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
sysRoleService.saveNew(sysRole, menuIdSet);
|
sysRoleService.saveNew(sysRole, menuIdSet);
|
||||||
return ResponseResult.success(sysRole.getRoleId());
|
return ResponseResult.success(sysRole.getRoleId());
|
||||||
@@ -79,8 +78,7 @@ public class SysRoleController {
|
|||||||
* @param menuIdListString 与当前角色Id绑定的menuId列表,多个menuId之间逗号分隔。
|
* @param menuIdListString 与当前角色Id绑定的menuId列表,多个menuId之间逗号分隔。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
@ApiOperationSupport(ignoreParameters = {"sysRoleDto.createTimeStart", "sysRoleDto.createTimeEnd"})
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(
|
public ResponseResult<Void> update(
|
||||||
@MyRequestBody SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
@MyRequestBody SysRoleDto sysRoleDto, @MyRequestBody String menuIdListString) {
|
||||||
@@ -100,7 +98,7 @@ public class SysRoleController {
|
|||||||
}
|
}
|
||||||
Set<Long> menuIdSet = null;
|
Set<Long> menuIdSet = null;
|
||||||
if (result.getData() != null) {
|
if (result.getData() != null) {
|
||||||
menuIdSet = (Set<Long>) result.getData().get("menuIdSet");
|
menuIdSet = result.getData().getObject("menuIdSet", new TypeReference<Set<Long>>(){});
|
||||||
}
|
}
|
||||||
if (!sysRoleService.update(sysRole, originalSysRole, menuIdSet)) {
|
if (!sysRoleService.update(sysRole, originalSysRole, menuIdSet)) {
|
||||||
errorMessage = "更新失败,数据不存在,请刷新后重试!";
|
errorMessage = "更新失败,数据不存在,请刷新后重试!";
|
||||||
@@ -115,6 +113,7 @@ public class SysRoleController {
|
|||||||
* @param roleId 指定角色主键Id。
|
* @param roleId 指定角色主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long roleId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long roleId) {
|
||||||
if (MyCommonUtil.existBlankArgument(roleId)) {
|
if (MyCommonUtil.existBlankArgument(roleId)) {
|
||||||
@@ -249,6 +248,7 @@ public class SysRoleController {
|
|||||||
* @param userIdListString 逗号分隔的用户Id列表。
|
* @param userIdListString 逗号分隔的用户Id列表。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.ADD_M2M)
|
||||||
@PostMapping("/addUserRole")
|
@PostMapping("/addUserRole")
|
||||||
public ResponseResult<Void> addUserRole(
|
public ResponseResult<Void> addUserRole(
|
||||||
@MyRequestBody Long roleId, @MyRequestBody String userIdListString) {
|
@MyRequestBody Long roleId, @MyRequestBody String userIdListString) {
|
||||||
@@ -279,6 +279,7 @@ public class SysRoleController {
|
|||||||
* @param userId 指定用户主键Id。
|
* @param userId 指定用户主键Id。
|
||||||
* @return 应答数据结果。
|
* @return 应答数据结果。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE_M2M)
|
||||||
@PostMapping("/deleteUserRole")
|
@PostMapping("/deleteUserRole")
|
||||||
public ResponseResult<Void> deleteUserRole(
|
public ResponseResult<Void> deleteUserRole(
|
||||||
@MyRequestBody Long roleId, @MyRequestBody Long userId) {
|
@MyRequestBody Long roleId, @MyRequestBody Long userId) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.orange.demo.webadmin.upms.controller;
|
package com.orange.demo.webadmin.upms.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.orange.demo.common.log.annotation.OperationLog;
|
||||||
|
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||||
import com.github.pagehelper.page.PageMethod;
|
import com.github.pagehelper.page.PageMethod;
|
||||||
import com.orange.demo.webadmin.upms.vo.*;
|
import com.orange.demo.webadmin.upms.vo.*;
|
||||||
import com.orange.demo.webadmin.upms.dto.*;
|
import com.orange.demo.webadmin.upms.dto.*;
|
||||||
@@ -11,17 +13,13 @@ import com.orange.demo.common.core.util.*;
|
|||||||
import com.orange.demo.common.core.constant.*;
|
import com.orange.demo.common.core.constant.*;
|
||||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||||
import com.orange.demo.common.core.validator.AddGroup;
|
import com.orange.demo.common.core.validator.AddGroup;
|
||||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
|
||||||
import com.orange.demo.webadmin.config.ApplicationConfig;
|
import com.orange.demo.webadmin.config.ApplicationConfig;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.groups.Default;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户管理操作控制器类。
|
* 用户管理操作控制器类。
|
||||||
@@ -29,7 +27,6 @@ import javax.validation.groups.Default;
|
|||||||
* @author Jerry
|
* @author Jerry
|
||||||
* @date 2020-09-24
|
* @date 2020-09-24
|
||||||
*/
|
*/
|
||||||
@Api(tags = "用户管理管理接口")
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/upms/sysUser")
|
@RequestMapping("/admin/upms/sysUser")
|
||||||
@@ -46,28 +43,29 @@ public class SysUserController {
|
|||||||
* 新增用户操作。
|
* 新增用户操作。
|
||||||
*
|
*
|
||||||
* @param sysUserDto 新增用户对象。
|
* @param sysUserDto 新增用户对象。
|
||||||
|
* @param dataPermIdListString 逗号分隔的数据权限Id列表。
|
||||||
* @param roleIdListString 逗号分隔的角色Id列表。
|
* @param roleIdListString 逗号分隔的角色Id列表。
|
||||||
* @return 应答结果对象,包含新增用户的主键Id。
|
* @return 应答结果对象,包含新增用户的主键Id。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.ADD)
|
||||||
"sysUserDto.userId",
|
|
||||||
"sysUserDto.createTimeStart",
|
|
||||||
"sysUserDto.createTimeEnd"})
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ResponseResult<Long> add(
|
public ResponseResult<Long> add(
|
||||||
@MyRequestBody SysUserDto sysUserDto, @MyRequestBody String roleIdListString) {
|
@MyRequestBody SysUserDto sysUserDto,
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, AddGroup.class);
|
@MyRequestBody String dataPermIdListString,
|
||||||
|
@MyRequestBody String roleIdListString) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, false);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
||||||
CallResult result = sysUserService.verifyRelatedData(
|
CallResult result = sysUserService.verifyRelatedData(
|
||||||
sysUser, null, roleIdListString);
|
sysUser, null, roleIdListString, dataPermIdListString);
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||||
}
|
}
|
||||||
Set<Long> roleIdSet = result.getData().getObject("roleIdSet", new TypeReference<Set<Long>>() {});
|
Set<Long> roleIdSet = result.getData().getObject("roleIdSet", new TypeReference<Set<Long>>() {});
|
||||||
sysUserService.saveNew(sysUser, roleIdSet);
|
Set<Long> dataPermIdSet = result.getData().getObject("dataPermIdSet", new TypeReference<Set<Long>>() {});
|
||||||
|
sysUserService.saveNew(sysUser, roleIdSet, dataPermIdSet);
|
||||||
return ResponseResult.success(sysUser.getUserId());
|
return ResponseResult.success(sysUser.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,16 +73,17 @@ public class SysUserController {
|
|||||||
* 更新用户操作。
|
* 更新用户操作。
|
||||||
*
|
*
|
||||||
* @param sysUserDto 更新用户对象。
|
* @param sysUserDto 更新用户对象。
|
||||||
|
* @param dataPermIdListString 逗号分隔的数据权限Id列表。
|
||||||
* @param roleIdListString 逗号分隔的角色Id列表。
|
* @param roleIdListString 逗号分隔的角色Id列表。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
@ApiOperationSupport(ignoreParameters = {
|
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||||
"sysUserDto.createTimeStart",
|
|
||||||
"sysUserDto.createTimeEnd"})
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResponseResult<Void> update(
|
public ResponseResult<Void> update(
|
||||||
@MyRequestBody SysUserDto sysUserDto, @MyRequestBody String roleIdListString) {
|
@MyRequestBody SysUserDto sysUserDto,
|
||||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, Default.class, UpdateGroup.class);
|
@MyRequestBody String dataPermIdListString,
|
||||||
|
@MyRequestBody String roleIdListString) {
|
||||||
|
String errorMessage = MyCommonUtil.getModelValidationError(sysUserDto, true);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||||
}
|
}
|
||||||
@@ -94,12 +93,13 @@ public class SysUserController {
|
|||||||
}
|
}
|
||||||
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
||||||
CallResult result = sysUserService.verifyRelatedData(
|
CallResult result = sysUserService.verifyRelatedData(
|
||||||
sysUser, originalUser, roleIdListString);
|
sysUser, originalUser, roleIdListString, dataPermIdListString);
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||||
}
|
}
|
||||||
Set<Long> roleIdSet = result.getData().getObject("roleIdSet", new TypeReference<Set<Long>>() {});
|
Set<Long> roleIdSet = result.getData().getObject("roleIdSet", new TypeReference<Set<Long>>() {});
|
||||||
if (!sysUserService.update(sysUser, originalUser, roleIdSet)) {
|
Set<Long> dataPermIdSet = result.getData().getObject("dataPermIdSet", new TypeReference<Set<Long>>() {});
|
||||||
|
if (!sysUserService.update(sysUser, originalUser, roleIdSet, dataPermIdSet)) {
|
||||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||||
}
|
}
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
@@ -128,6 +128,7 @@ public class SysUserController {
|
|||||||
* @param userId 删除对象主键Id。
|
* @param userId 删除对象主键Id。
|
||||||
* @return 应答结果对象。
|
* @return 应答结果对象。
|
||||||
*/
|
*/
|
||||||
|
@OperationLog(type = SysOperationLogType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ResponseResult<Void> delete(@MyRequestBody Long userId) {
|
public ResponseResult<Void> delete(@MyRequestBody Long userId) {
|
||||||
String errorMessage;
|
String errorMessage;
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.dao;
|
||||||
|
|
||||||
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDataPermDept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限与部门关系数据访问操作接口。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
public interface SysDataPermDeptMapper extends BaseDaoMapper<SysDataPermDept> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.dao;
|
||||||
|
|
||||||
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDataPerm;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限数据访问操作接口。
|
||||||
|
* NOTE: 该对象一定不能被 @EnableDataPerm 注解标注,否则会导致无限递归。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
public interface SysDataPermMapper extends BaseDaoMapper<SysDataPerm> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据权限列表。
|
||||||
|
*
|
||||||
|
* @param sysDataPermFilter 过滤对象。
|
||||||
|
* @param orderBy 排序字符串。
|
||||||
|
* @return 过滤后的数据权限列表。
|
||||||
|
*/
|
||||||
|
List<SysDataPerm> getSysDataPermList(
|
||||||
|
@Param("sysDataPermFilter") SysDataPerm sysDataPermFilter, @Param("orderBy") String orderBy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定用户的数据权限列表。
|
||||||
|
*
|
||||||
|
* @param userId 用户Id。
|
||||||
|
* @return 数据权限列表。
|
||||||
|
*/
|
||||||
|
List<SysDataPerm> getSysDataPermListByUserId(@Param("userId") Long userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.dao;
|
||||||
|
|
||||||
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDataPermUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限与用户关系数据访问操作接口。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
public interface SysDataPermUserMapper extends BaseDaoMapper<SysDataPermUser> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.dao;
|
||||||
|
|
||||||
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDept;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门管理数据操作访问接口。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
public interface SysDeptMapper extends BaseDaoMapper<SysDept> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param sysDeptList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<SysDept> sysDeptList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取过滤后的对象列表。
|
||||||
|
*
|
||||||
|
* @param sysDeptFilter 主表过滤对象。
|
||||||
|
* @param orderBy 排序字符串,order by从句的参数。
|
||||||
|
* @return 对象列表。
|
||||||
|
*/
|
||||||
|
List<SysDept> getSysDeptList(
|
||||||
|
@Param("sysDeptFilter") SysDept sysDeptFilter, @Param("orderBy") String orderBy);
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.orange.demo.webadmin.upms.dao;
|
||||||
|
|
||||||
|
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||||
|
import com.orange.demo.webadmin.upms.model.SysDeptRelation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门关系树关联关系表访问接口。
|
||||||
|
*
|
||||||
|
* @author Jerry
|
||||||
|
* @date 2020-09-24
|
||||||
|
*/
|
||||||
|
public interface SysDeptRelationMapper extends BaseDaoMapper<SysDeptRelation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将myDeptId的所有子部门,与其父部门parentDeptId解除关联关系。
|
||||||
|
*
|
||||||
|
* @param parentDeptId myDeptId的父部门Id。
|
||||||
|
* @param myDeptId 当前部门。
|
||||||
|
*/
|
||||||
|
void removeBetweenChildrenAndParents(
|
||||||
|
@Param("parentDeptId") Long parentDeptId, @Param("myDeptId") Long myDeptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入部门关联数据。
|
||||||
|
* 由于目前版本(3.4.1)的Mybatis Plus没有提供真正的批量插入,为了保证效率需要自己实现。
|
||||||
|
* 目前我们仅仅给出MySQL的insert list实现作为参考,其他数据库需要自行修改。
|
||||||
|
*
|
||||||
|
* @param deptRelationList 部门关联关系数据列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<SysDeptRelation> deptRelationList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入当前部门的所有父部门列表,包括自己和自己的关系。
|
||||||
|
*
|
||||||
|
* @param parentDeptId myDeptId的父部门Id。
|
||||||
|
* @param myDeptId 当前部门。
|
||||||
|
*/
|
||||||
|
void insertParentList(@Param("parentDeptId") Long parentDeptId, @Param("myDeptId") Long myDeptId);
|
||||||
|
}
|
||||||
@@ -14,6 +14,13 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public interface SysUserMapper extends BaseDaoMapper<SysUser> {
|
public interface SysUserMapper extends BaseDaoMapper<SysUser> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入对象列表。
|
||||||
|
*
|
||||||
|
* @param sysUserList 新增对象列表。
|
||||||
|
*/
|
||||||
|
void insertList(List<SysUser> sysUserList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取过滤后的对象列表。
|
* 获取过滤后的对象列表。
|
||||||
*
|
*
|
||||||
@@ -50,6 +57,32 @@ public interface SysUserMapper extends BaseDaoMapper<SysUser> {
|
|||||||
@Param("sysUserFilter") SysUser sysUserFilter,
|
@Param("sysUserFilter") SysUser sysUserFilter,
|
||||||
@Param("orderBy") String orderBy);
|
@Param("orderBy") String orderBy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据数据权限Id,获取关联的用户Id列表。
|
||||||
|
*
|
||||||
|
* @param dataPermId 关联的数据权限Id。
|
||||||
|
* @param sysUserFilter 用户过滤条件对象。
|
||||||
|
* @param orderBy order by从句的参数。
|
||||||
|
* @return 和DataPermId关联的用户列表。
|
||||||
|
*/
|
||||||
|
List<SysUser> getSysUserListByDataPermId(
|
||||||
|
@Param("dataPermId") Long dataPermId,
|
||||||
|
@Param("sysUserFilter") SysUser sysUserFilter,
|
||||||
|
@Param("orderBy") String orderBy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据数据权限Id,获取和当前数据权限Id没有建立多对多关联关系的用户Id列表。
|
||||||
|
*
|
||||||
|
* @param dataPermId 关联的数据权限Id。
|
||||||
|
* @param sysUserFilter 用户过滤条件对象。
|
||||||
|
* @param orderBy order by从句的参数。
|
||||||
|
* @return 和DataPermId没有建立关联关系的用户列表。
|
||||||
|
*/
|
||||||
|
List<SysUser> getNotInSysUserListByDataPermId(
|
||||||
|
@Param("dataPermId") Long dataPermId,
|
||||||
|
@Param("sysUserFilter") SysUser sysUserFilter,
|
||||||
|
@Param("orderBy") String orderBy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户的权限资源地址列表。同时返回详细的分配路径。
|
* 查询用户的权限资源地址列表。同时返回详细的分配路径。
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.orange.demo.webadmin.upms.dao.SysDataPermDeptMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.upms.model.SysDataPermDept">
|
||||||
|
<id column="data_perm_id" jdbcType="BIGINT" property="dataPermId"/>
|
||||||
|
<id column="dept_id" jdbcType="BIGINT" property="deptId"/>
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.orange.demo.webadmin.upms.dao.SysDataPermMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.upms.model.SysDataPerm">
|
||||||
|
<id column="data_perm_id" jdbcType="BIGINT" property="dataPermId"/>
|
||||||
|
<result column="data_perm_name" jdbcType="VARCHAR" property="dataPermName"/>
|
||||||
|
<result column="rule_type" jdbcType="INTEGER" property="ruleType"/>
|
||||||
|
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
|
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
|
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMapEx" type="com.orange.demo.webadmin.upms.model.SysDataPerm" extends="BaseResultMap">
|
||||||
|
<collection property="dataPermDeptList" column="data_perm_id" javaType="ArrayList"
|
||||||
|
ofType="com.orange.demo.webadmin.upms.model.SysDataPermDept" notNullColumn="dept_id"
|
||||||
|
resultMap="com.orange.demo.webadmin.upms.dao.SysDataPermDeptMapper.BaseResultMap">
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="filterRef">
|
||||||
|
<if test="sysDataPermFilter != null">
|
||||||
|
<if test="sysDataPermFilter.ruleType != null">
|
||||||
|
AND zz_sys_data_perm.rule_type = #{sysDataPermFilter.ruleType}
|
||||||
|
</if>
|
||||||
|
<if test="sysDataPermFilter.searchString != null and sysDataPermFilter.searchString != ''">
|
||||||
|
<bind name= "safeSearchString" value= "'%' + sysDataPermFilter.searchString + '%'" />
|
||||||
|
AND IFNULL(zz_sys_data_perm.data_perm_name, '') LIKE #{safeSearchString}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
AND zz_sys_data_perm.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getSysDataPermList" resultMap="BaseResultMap" parameterType="com.orange.demo.webadmin.upms.model.SysDataPerm">
|
||||||
|
SELECT
|
||||||
|
zz_sys_data_perm.*
|
||||||
|
FROM
|
||||||
|
zz_sys_data_perm
|
||||||
|
<where>
|
||||||
|
<include refid="filterRef"/>
|
||||||
|
</where>
|
||||||
|
<if test="orderBy != null and orderBy != ''">
|
||||||
|
ORDER BY ${orderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getSysDataPermListByUserId" resultMap="BaseResultMapEx" parameterType="com.orange.demo.webadmin.upms.model.SysDataPerm">
|
||||||
|
SELECT
|
||||||
|
zz_sys_data_perm.*,
|
||||||
|
zz_sys_data_perm_dept.*
|
||||||
|
FROM
|
||||||
|
zz_sys_data_perm_user
|
||||||
|
INNER JOIN
|
||||||
|
zz_sys_data_perm ON zz_sys_data_perm_user.data_perm_id = zz_sys_data_perm.data_perm_id
|
||||||
|
LEFT JOIN
|
||||||
|
zz_sys_data_perm_dept ON zz_sys_data_perm.data_perm_id = zz_sys_data_perm_dept.data_perm_id
|
||||||
|
<where>
|
||||||
|
AND zz_sys_data_perm_user.user_id = #{userId}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.orange.demo.webadmin.upms.dao.SysDataPermUserMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.upms.model.SysDataPermUser">
|
||||||
|
<id column="data_perm_id" jdbcType="BIGINT" property="dataPermId"/>
|
||||||
|
<id column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.orange.demo.webadmin.upms.dao.SysDeptMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.upms.model.SysDept">
|
||||||
|
<id column="dept_id" jdbcType="BIGINT" property="deptId"/>
|
||||||
|
<result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
|
||||||
|
<result column="show_order" jdbcType="INTEGER" property="showOrder"/>
|
||||||
|
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
|
||||||
|
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||||
|
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||||
|
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_sys_dept
|
||||||
|
(dept_id,
|
||||||
|
dept_name,
|
||||||
|
show_order,
|
||||||
|
parent_id,
|
||||||
|
deleted_flag,
|
||||||
|
create_user_id,
|
||||||
|
update_user_id,
|
||||||
|
create_time,
|
||||||
|
update_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.deptId},
|
||||||
|
#{item.deptName},
|
||||||
|
#{item.showOrder},
|
||||||
|
#{item.parentId},
|
||||||
|
#{item.deletedFlag},
|
||||||
|
#{item.createUserId},
|
||||||
|
#{item.updateUserId},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
|
<sql id="filterRef">
|
||||||
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
|
<include refid="com.orange.demo.webadmin.upms.dao.SysDeptMapper.inputFilterRef"/>
|
||||||
|
AND zz_sys_dept.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||||
|
<sql id="inputFilterRef">
|
||||||
|
<if test="sysDeptFilter != null">
|
||||||
|
<if test="sysDeptFilter.deptName != null and sysDeptFilter.deptName != ''">
|
||||||
|
<bind name = "safeSysDeptDeptName" value = "'%' + sysDeptFilter.deptName + '%'" />
|
||||||
|
AND zz_sys_dept.dept_name LIKE #{safeSysDeptDeptName}
|
||||||
|
</if>
|
||||||
|
<if test="sysDeptFilter.parentId != null">
|
||||||
|
AND zz_sys_dept.parent_id = #{sysDeptFilter.parentId}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getSysDeptList" resultMap="BaseResultMap" parameterType="com.orange.demo.webadmin.upms.model.SysDept">
|
||||||
|
SELECT * FROM zz_sys_dept
|
||||||
|
<where>
|
||||||
|
<include refid="filterRef"/>
|
||||||
|
</where>
|
||||||
|
<if test="orderBy != null and orderBy != ''">
|
||||||
|
ORDER BY ${orderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.orange.demo.webadmin.upms.dao.SysDeptRelationMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.orange.demo.webadmin.upms.model.SysDeptRelation">
|
||||||
|
<id column="parent_dept_id" jdbcType="BIGINT" property="parentDeptId"/>
|
||||||
|
<id column="dept_id" jdbcType="BIGINT" property="deptId"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<delete id="removeBetweenChildrenAndParents">
|
||||||
|
DELETE a FROM zz_sys_dept_relation a
|
||||||
|
INNER JOIN zz_sys_dept_relation b ON a.dept_id = b.dept_id
|
||||||
|
WHERE a.parent_dept_id = #{parentDeptId} AND b.parent_dept_id = #{myDeptId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_sys_dept_relation(parent_dept_id, dept_id) VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator=",">
|
||||||
|
(#{item.parentDeptId}, #{item.deptId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertParentList">
|
||||||
|
INSERT INTO zz_sys_dept_relation(parent_dept_id, dept_id)
|
||||||
|
SELECT t.parent_dept_id, #{myDeptId} FROM zz_sys_dept_relation t
|
||||||
|
WHERE t.dept_id = #{parentDeptId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT #{myDeptId}, #{myDeptId}
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
<result column="login_name" jdbcType="VARCHAR" property="loginName"/>
|
<result column="login_name" jdbcType="VARCHAR" property="loginName"/>
|
||||||
<result column="password" jdbcType="VARCHAR" property="password"/>
|
<result column="password" jdbcType="VARCHAR" property="password"/>
|
||||||
<result column="show_name" jdbcType="VARCHAR" property="showName"/>
|
<result column="show_name" jdbcType="VARCHAR" property="showName"/>
|
||||||
|
<result column="dept_id" jdbcType="BIGINT" property="deptId"/>
|
||||||
<result column="user_type" jdbcType="INTEGER" property="userType"/>
|
<result column="user_type" jdbcType="INTEGER" property="userType"/>
|
||||||
<result column="head_image_url" jdbcType="VARCHAR" property="headImageUrl"/>
|
<result column="head_image_url" jdbcType="VARCHAR" property="headImageUrl"/>
|
||||||
<result column="user_status" jdbcType="INTEGER" property="userStatus"/>
|
<result column="user_status" jdbcType="INTEGER" property="userStatus"/>
|
||||||
@@ -16,6 +17,39 @@
|
|||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertList">
|
||||||
|
INSERT INTO zz_sys_user
|
||||||
|
(user_id,
|
||||||
|
login_name,
|
||||||
|
password,
|
||||||
|
show_name,
|
||||||
|
dept_id,
|
||||||
|
user_type,
|
||||||
|
head_image_url,
|
||||||
|
user_status,
|
||||||
|
deleted_flag,
|
||||||
|
create_user_id,
|
||||||
|
update_user_id,
|
||||||
|
create_time,
|
||||||
|
update_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" index="index" item="item" separator="," >
|
||||||
|
(#{item.userId},
|
||||||
|
#{item.loginName},
|
||||||
|
#{item.password},
|
||||||
|
#{item.showName},
|
||||||
|
#{item.deptId},
|
||||||
|
#{item.userType},
|
||||||
|
#{item.headImageUrl},
|
||||||
|
#{item.userStatus},
|
||||||
|
#{item.deletedFlag},
|
||||||
|
#{item.createUserId},
|
||||||
|
#{item.updateUserId},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||||
<sql id="filterRef">
|
<sql id="filterRef">
|
||||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||||
@@ -34,6 +68,9 @@
|
|||||||
<bind name = "safeSysUserShowName" value = "'%' + sysUserFilter.showName + '%'" />
|
<bind name = "safeSysUserShowName" value = "'%' + sysUserFilter.showName + '%'" />
|
||||||
AND zz_sys_user.show_name LIKE #{safeSysUserShowName}
|
AND zz_sys_user.show_name LIKE #{safeSysUserShowName}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sysUserFilter.deptId != null">
|
||||||
|
AND zz_sys_user.dept_id = #{sysUserFilter.deptId}
|
||||||
|
</if>
|
||||||
<if test="sysUserFilter.userStatus != null">
|
<if test="sysUserFilter.userStatus != null">
|
||||||
AND zz_sys_user.user_status = #{sysUserFilter.userStatus}
|
AND zz_sys_user.user_status = #{sysUserFilter.userStatus}
|
||||||
</if>
|
</if>
|
||||||
@@ -84,6 +121,34 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSysUserListByDataPermId" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
zz_sys_user.*
|
||||||
|
FROM
|
||||||
|
zz_sys_data_perm_user,
|
||||||
|
zz_sys_user
|
||||||
|
<where>
|
||||||
|
AND zz_sys_data_perm_user.data_perm_id = #{dataPermId}
|
||||||
|
AND zz_sys_data_perm_user.user_id = zz_sys_user.user_id
|
||||||
|
<include refid="filterRef"/>
|
||||||
|
</where>
|
||||||
|
<if test="orderBy != null and orderBy != ''">
|
||||||
|
ORDER BY ${orderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getNotInSysUserListByDataPermId" resultMap="BaseResultMap">
|
||||||
|
SELECT * FROM zz_sys_user
|
||||||
|
<where>
|
||||||
|
NOT EXISTS (SELECT * FROM zz_sys_data_perm_user
|
||||||
|
WHERE zz_sys_data_perm_user.data_perm_id = #{dataPermId} AND zz_sys_data_perm_user.user_id = zz_sys_user.user_id)
|
||||||
|
<include refid="filterRef"/>
|
||||||
|
</where>
|
||||||
|
<if test="orderBy != null and orderBy != ''">
|
||||||
|
ORDER BY ${orderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||||
<select id="getSysPermListWithDetail" resultType="map">
|
<select id="getSysPermListWithDetail" resultType="map">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user