mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:VO支持以及bug修复
This commit is contained in:
@@ -3,9 +3,9 @@ package com.orange.demo.courseclassinterface.client;
|
||||
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.MyQueryParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -20,7 +20,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@FeignClient(name = "system-service", fallbackFactory = AreaCodeClient.AreaCodeClientFallbackFactory.class)
|
||||
public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
public interface AreaCodeClient extends BaseClient<AreaCodeDto, AreaCodeVo, Long> {
|
||||
|
||||
/**
|
||||
* 根据主键Id集合,返回给定的数据集合。
|
||||
@@ -31,7 +31,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/listByIds")
|
||||
ResponseResult<List<AreaCodeDto>> listByIds(
|
||||
ResponseResult<List<AreaCodeVo>> listByIds(
|
||||
@RequestParam("areaCodeIds") Set<Long> areaCodeIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/areaCode/getById")
|
||||
ResponseResult<AreaCodeDto> getById(
|
||||
ResponseResult<AreaCodeVo> getById(
|
||||
@RequestParam("areaId") Long areaId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -76,7 +76,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/listBy")
|
||||
ResponseResult<List<AreaCodeDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<AreaCodeVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -86,7 +86,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/areaCode/getBy")
|
||||
ResponseResult<AreaCodeDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<AreaCodeVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 以id、name的形式返回所有字典数据的列表。
|
||||
@@ -108,7 +108,7 @@ public interface AreaCodeClient extends BaseClient<AreaCodeDto, Long> {
|
||||
@Component
|
||||
@Slf4j
|
||||
class AreaCodeClientFallbackFactory
|
||||
extends BaseFallbackFactory<AreaCodeDto, Long, AreaCodeClient> implements AreaCodeClient {
|
||||
extends BaseFallbackFactory<AreaCodeDto, AreaCodeVo, Long, AreaCodeClient> implements AreaCodeClient {
|
||||
|
||||
@Override
|
||||
public ResponseResult<List<Map<String, Object>>> listDict() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import com.orange.demo.courseclassinterface.vo.CourseVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = CourseClient.CourseClientFallbackFactory.class)
|
||||
public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
public interface CourseClient extends BaseClient<CourseDto, CourseVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listByIds")
|
||||
ResponseResult<List<CourseDto>> listByIds(
|
||||
ResponseResult<List<CourseVo>> listByIds(
|
||||
@RequestParam("courseIds") Set<Long> courseIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/getById")
|
||||
ResponseResult<CourseDto> getById(
|
||||
ResponseResult<CourseVo> getById(
|
||||
@RequestParam("courseId") Long courseId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listBy")
|
||||
ResponseResult<List<CourseDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/getBy")
|
||||
ResponseResult<CourseDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/course/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface CourseClient extends BaseClient<CourseDto, Long> {
|
||||
@Component("CourseClassCourseClientFallbackFactory")
|
||||
@Slf4j
|
||||
class CourseClientFallbackFactory
|
||||
extends BaseFallbackFactory<CourseDto, Long, CourseClient> implements CourseClient {
|
||||
extends BaseFallbackFactory<CourseDto, CourseVo, Long, CourseClient> implements CourseClient {
|
||||
|
||||
@Override
|
||||
public CourseClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = GradeClient.GradeClientFallbackFactory.class)
|
||||
public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
public interface GradeClient extends BaseClient<GradeDto, GradeVo, Integer> {
|
||||
|
||||
/**
|
||||
* 基于主键的(in list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/listByIds")
|
||||
ResponseResult<List<GradeDto>> listByIds(
|
||||
ResponseResult<List<GradeVo>> listByIds(
|
||||
@RequestParam("gradeIds") Set<Integer> gradeIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/getById")
|
||||
ResponseResult<GradeDto> getById(
|
||||
ResponseResult<GradeVo> getById(
|
||||
@RequestParam("gradeId") Integer gradeId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/listBy")
|
||||
ResponseResult<List<GradeDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,12 +109,12 @@ public interface GradeClient extends BaseClient<GradeDto, Integer> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/grade/getBy")
|
||||
ResponseResult<GradeDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
@Component("CourseClassGradeClientFallbackFactory")
|
||||
@Slf4j
|
||||
class GradeClientFallbackFactory
|
||||
extends BaseFallbackFactory<GradeDto, Integer, GradeClient> implements GradeClient {
|
||||
extends BaseFallbackFactory<GradeDto, GradeVo, Integer, GradeClient> implements GradeClient {
|
||||
|
||||
@Override
|
||||
public GradeClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import com.orange.demo.courseclassinterface.vo.SchoolInfoVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = SchoolInfoClient.SchoolInfoClientFallbackFactory.class)
|
||||
public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, SchoolInfoVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listByIds")
|
||||
ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
ResponseResult<List<SchoolInfoVo>> listByIds(
|
||||
@RequestParam("schoolIds") Set<Long> schoolIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/getById")
|
||||
ResponseResult<SchoolInfoDto> getById(
|
||||
ResponseResult<SchoolInfoVo> getById(
|
||||
@RequestParam("schoolId") Long schoolId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listBy")
|
||||
ResponseResult<List<SchoolInfoDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/getBy")
|
||||
ResponseResult<SchoolInfoDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/schoolInfo/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface SchoolInfoClient extends BaseClient<SchoolInfoDto, Long> {
|
||||
@Component("CourseClassSchoolInfoClientFallbackFactory")
|
||||
@Slf4j
|
||||
class SchoolInfoClientFallbackFactory
|
||||
extends BaseFallbackFactory<SchoolInfoDto, Long, SchoolInfoClient> implements SchoolInfoClient {
|
||||
extends BaseFallbackFactory<SchoolInfoDto, SchoolInfoVo, Long, SchoolInfoClient> implements SchoolInfoClient {
|
||||
|
||||
@Override
|
||||
public SchoolInfoClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentClassDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentClassVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentClassClient.StudentClassClientFallbackFactory.class)
|
||||
public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
public interface StudentClassClient extends BaseClient<StudentClassDto, StudentClassVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listByIds")
|
||||
ResponseResult<List<StudentClassDto>> listByIds(
|
||||
ResponseResult<List<StudentClassVo>> listByIds(
|
||||
@RequestParam("classIds") Set<Long> classIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/getById")
|
||||
ResponseResult<StudentClassDto> getById(
|
||||
ResponseResult<StudentClassVo> getById(
|
||||
@RequestParam("classId") Long classId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listBy")
|
||||
ResponseResult<List<StudentClassDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/getBy")
|
||||
ResponseResult<StudentClassDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentClass/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentClassClient extends BaseClient<StudentClassDto, Long> {
|
||||
@Component("CourseClassStudentClassClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClassClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentClassDto, Long, StudentClassClient> implements StudentClassClient {
|
||||
extends BaseFallbackFactory<StudentClassDto, StudentClassVo, Long, StudentClassClient> implements StudentClassClient {
|
||||
|
||||
@Override
|
||||
public StudentClassClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "course-class",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentClient.StudentClientFallbackFactory.class)
|
||||
public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
public interface StudentClient extends BaseClient<StudentDto, StudentVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listByIds")
|
||||
ResponseResult<List<StudentDto>> listByIds(
|
||||
ResponseResult<List<StudentVo>> listByIds(
|
||||
@RequestParam("studentIds") Set<Long> studentIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/getById")
|
||||
ResponseResult<StudentDto> getById(
|
||||
ResponseResult<StudentVo> getById(
|
||||
@RequestParam("studentId") Long studentId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listBy")
|
||||
ResponseResult<List<StudentDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/getBy")
|
||||
ResponseResult<StudentDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/student/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentClient extends BaseClient<StudentDto, Long> {
|
||||
@Component("CourseClassStudentClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentDto, Long, StudentClient> implements StudentClient {
|
||||
extends BaseFallbackFactory<StudentDto, StudentVo, Long, StudentClient> implements StudentClient {
|
||||
|
||||
@Override
|
||||
public StudentClient create(Throwable throwable) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseDto对象。
|
||||
@@ -142,28 +141,4 @@ public class CourseDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "updateTime 范围过滤结束值(<=)")
|
||||
private String updateTimeEnd;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseDto。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classCourse;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* difficulty 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SchoolInfoDto对象。
|
||||
@@ -47,16 +46,4 @@ public class SchoolInfoDto {
|
||||
@ApiModelProperty(value = "所在城市Id", required = true)
|
||||
@NotNull(message = "数据验证失败,所在城市不能为空!")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentClassDto对象。
|
||||
@@ -77,22 +76,4 @@ public class StudentClassDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "班级创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* leaderId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
/**
|
||||
* classLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentDto对象。
|
||||
@@ -161,52 +160,4 @@ public class StudentDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "LIKE模糊搜索字符串")
|
||||
private String searchString;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
/**
|
||||
* districtId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gender 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
/**
|
||||
* experienceLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
/**
|
||||
* status 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> statusDictMap;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 行政区划VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("行政区划实体对象VO")
|
||||
@Data
|
||||
public class AreaCodeVo {
|
||||
|
||||
/**
|
||||
* 行政区划主键Id
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划主键Id", required = true)
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划名称")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 行政区划级别 (1: 省级别 2: 市级别 3: 区级别)
|
||||
*/
|
||||
@ApiModelProperty(value = "行政区划级别")
|
||||
private Integer areaLevel;
|
||||
|
||||
/**
|
||||
* 父级行政区划Id
|
||||
*/
|
||||
@ApiModelProperty(value = "父级行政区划Id")
|
||||
private Long parentId;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassCourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class ClassCourseVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程顺序(数值越小越靠前)。
|
||||
*/
|
||||
private Integer courseOrder;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ClassStudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class ClassStudentVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
private Long studentId;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("CourseVO实体对象")
|
||||
@Data
|
||||
public class CourseVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程名称")
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 课程价格。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 课程描述。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 课程难度(0: 容易 1: 普通 2: 很难)。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程难度(0: 容易 1: 普通 2: 很难)")
|
||||
private Integer difficulty;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学科Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学科Id")
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "课时数量")
|
||||
private Integer classHour;
|
||||
|
||||
/**
|
||||
* 多张课程图片地址。
|
||||
*/
|
||||
@ApiModelProperty(value = "多张课程图片地址")
|
||||
private String pictureUrl;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户Id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最后修改时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "最后修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* courseId 的多对多关联表数据对象,数据对应类型为ClassCourseVo。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classCourse;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* difficulty 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> difficultyDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* GradeVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("GradeVO实体对象")
|
||||
@Data
|
||||
public class GradeVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级名称")
|
||||
private String gradeName;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SchoolInfoVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@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(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentClassVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentClassVO实体对象")
|
||||
@Data
|
||||
public class StudentClassVo {
|
||||
|
||||
/**
|
||||
* 班级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级Id")
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级名称")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学校Id")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学生班长Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生班长Id")
|
||||
private Long leaderId;
|
||||
|
||||
/**
|
||||
* 已完成课时数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "已完成课时数量")
|
||||
private Integer finishClassHour;
|
||||
|
||||
/**
|
||||
* 班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级级别(0: 初级班 1: 培优班 2: 冲刺提分班 3: 竞赛班)")
|
||||
private Integer classLevel;
|
||||
|
||||
/**
|
||||
* 创建用户。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 班级创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "班级创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* leaderId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> leaderIdDictMap;
|
||||
|
||||
/**
|
||||
* classLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.orange.demo.courseclassinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentVO实体对象")
|
||||
@Data
|
||||
public class StudentVo {
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id")
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 登录手机。
|
||||
*/
|
||||
@ApiModelProperty(value = "登录手机")
|
||||
private String loginMobile;
|
||||
|
||||
/**
|
||||
* 学生姓名。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生姓名")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 所在省份Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在省份Id")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "所在城市Id")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 区县Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "区县Id")
|
||||
private Long districtId;
|
||||
|
||||
/**
|
||||
* 学生性别 (0: 女生 1: 男生)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生性别 (0: 女生 1: 男生)")
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 生日。
|
||||
*/
|
||||
@ApiModelProperty(value = "生日")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)。
|
||||
*/
|
||||
@ApiModelProperty(value = "经验等级 (0: 初级 1: 中级 2: 高级 3: 资深)")
|
||||
private Integer experienceLevel;
|
||||
|
||||
/**
|
||||
* 总共充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "总共充值学币数量")
|
||||
private Integer totalCoin;
|
||||
|
||||
/**
|
||||
* 可用学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "可用学币数量")
|
||||
private Integer leftCoin;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 校区Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "校区Id")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 注册时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date registerTime;
|
||||
|
||||
/**
|
||||
* 学生状态 (0: 正常 1: 锁定 2: 注销)。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生状态 (0: 正常 1: 锁定 2: 注销)")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
/**
|
||||
* districtId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> districtIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gender 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> genderDictMap;
|
||||
|
||||
/**
|
||||
* experienceLevel 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> experienceLevelDictMap;
|
||||
|
||||
/**
|
||||
* status 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> statusDictMap;
|
||||
}
|
||||
@@ -5,9 +5,8 @@ import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orange.demo.common.core.object.MyQueryParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
|
||||
import com.orange.demo.courseclassservice.model.AreaCode;
|
||||
import com.orange.demo.courseclassservice.service.AreaCodeService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -25,13 +24,13 @@ import java.util.*;
|
||||
@Api(tags = "行政区划数据访问接口")
|
||||
@RestController
|
||||
@RequestMapping("/areaCode")
|
||||
public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Long> {
|
||||
public class AreaCodeController extends BaseController<AreaCode, AreaCodeVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private AreaCodeService areaCodeService;
|
||||
|
||||
@Override
|
||||
protected BaseService<AreaCode, AreaCodeDto, Long> service() {
|
||||
protected BaseService<AreaCode, Long> service() {
|
||||
return areaCodeService;
|
||||
}
|
||||
|
||||
@@ -70,9 +69,9 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果的Data对象中,将包含行政区划对象。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<AreaCodeDto> view(@RequestParam Long areaId) {
|
||||
public ResponseResult<AreaCodeVo> view(@RequestParam Long areaId) {
|
||||
AreaCode areaCode = areaCodeService.getById(areaId);
|
||||
return ResponseResult.success(MyModelUtil.copyTo(areaCode, AreaCodeDto.class));
|
||||
return ResponseResult.success(MyModelUtil.copyTo(areaCode, AreaCodeVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +82,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 符合主键(in list)的数据集合。
|
||||
*/
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<AreaCodeDto>> listByIds(
|
||||
public ResponseResult<List<AreaCodeVo>> listByIds(
|
||||
@RequestParam Set<Long> areaCodeIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(areaCodeIds, withDict, null);
|
||||
}
|
||||
@@ -96,7 +95,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含主对象数据。
|
||||
*/
|
||||
@GetMapping("/getById")
|
||||
public ResponseResult<AreaCodeDto> getById(@RequestParam Long areaId, @RequestParam Boolean withDict) {
|
||||
public ResponseResult<AreaCodeVo> getById(@RequestParam Long areaId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(areaId, withDict, null);
|
||||
}
|
||||
|
||||
@@ -129,7 +128,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<AreaCodeDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<AreaCodeVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, null);
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ public class AreaCodeController extends BaseController<AreaCode, AreaCodeDto, Lo
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
*/
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<AreaCodeDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<AreaCodeVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import com.orange.demo.common.core.upload.BaseUpDownloader;
|
||||
import com.orange.demo.common.core.upload.UpDownloaderFactory;
|
||||
import com.orange.demo.common.core.upload.UploadResponseInfo;
|
||||
import com.orange.demo.common.core.upload.UploadStoreInfo;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -42,7 +42,7 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/course")
|
||||
public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
public class CourseController extends BaseController<Course, CourseVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
@@ -54,7 +54,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
private UpDownloaderFactory upDownloaderFactory;
|
||||
|
||||
@Override
|
||||
protected BaseService<Course, CourseDto, Long> service() {
|
||||
protected BaseService<Course, Long> service() {
|
||||
return courseService;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
Course course = MyModelUtil.copyTo(courseDto, Course.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = courseService.verifyRelatedData(course, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -108,7 +108,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Course course = Course.INSTANCE.toModel(courseDto);
|
||||
Course course = MyModelUtil.copyTo(courseDto, Course.class);
|
||||
Course originalCourse = courseService.getById(course.getCourseId());
|
||||
if (originalCourse == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -162,25 +162,18 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<CourseDto>> list(
|
||||
public ResponseResult<MyPageData<CourseVo>> list(
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course courseFilter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course courseFilter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListWithRelation(courseFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (courseList instanceof Page) {
|
||||
totalCount = ((Page<Course>) courseList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<CourseDto>, Long> responseData =
|
||||
new Tuple2<>(Course.INSTANCE.fromModelList(courseList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseList, Course.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +183,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<CourseDto> view(@RequestParam Long courseId) {
|
||||
public ResponseResult<CourseVo> view(@RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -199,8 +192,8 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
if (course == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
CourseDto courseDto = Course.INSTANCE.fromModel(course);
|
||||
return ResponseResult.success(courseDto);
|
||||
CourseVo courseVo = Course.INSTANCE.fromModel(course);
|
||||
return ResponseResult.success(courseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,7 +312,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<CourseDto>> listByIds(
|
||||
public ResponseResult<List<CourseVo>> listByIds(
|
||||
@RequestParam Set<Long> courseIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(courseIds, withDict, Course.INSTANCE);
|
||||
}
|
||||
@@ -333,7 +326,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<CourseDto> getById(
|
||||
public ResponseResult<CourseVo> getById(
|
||||
@RequestParam Long courseId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(courseId, withDict, Course.INSTANCE);
|
||||
}
|
||||
@@ -371,30 +364,30 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody CourseDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, Course.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Course.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<CourseDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<CourseVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -406,7 +399,7 @@ public class CourseController extends BaseController<Course, CourseDto, Long> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<CourseDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<CourseVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, Course.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.BaseDictService;
|
||||
import com.orange.demo.common.core.constant.ErrorCodeEnum;
|
||||
import com.orange.demo.common.core.object.MyQueryParam;
|
||||
import com.orange.demo.common.core.object.ResponseResult;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.MyModelUtil;
|
||||
import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import com.orange.demo.courseclassservice.model.Grade;
|
||||
import com.orange.demo.courseclassservice.service.GradeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -33,13 +33,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/grade")
|
||||
public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
public class GradeController extends BaseController<Grade, GradeVo, Integer> {
|
||||
|
||||
@Autowired
|
||||
private GradeService gradeService;
|
||||
|
||||
@Override
|
||||
protected BaseDictService<Grade, GradeDto, Integer> service() {
|
||||
protected BaseDictService<Grade, Integer> service() {
|
||||
return gradeService;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<GradeDto> view(@RequestParam Integer gradeId) {
|
||||
public ResponseResult<GradeVo> view(@RequestParam Integer gradeId) {
|
||||
if (MyCommonUtil.existBlankArgument(gradeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -116,8 +116,8 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
if (grade == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
GradeDto gradeDto = MyModelUtil.copyTo(grade, GradeDto.class);
|
||||
return ResponseResult.success(gradeDto);
|
||||
GradeVo gradeVo = MyModelUtil.copyTo(grade, GradeVo.class);
|
||||
return ResponseResult.success(gradeVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<GradeDto>> listByIds(
|
||||
public ResponseResult<List<GradeVo>> listByIds(
|
||||
@RequestParam Set<Integer> gradeIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(gradeIds, withDict, null);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<GradeDto> getById(
|
||||
public ResponseResult<GradeVo> getById(
|
||||
@RequestParam Integer gradeId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(gradeId, withDict, null);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody GradeDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, null);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Grade.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,7 +205,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<GradeDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<GradeVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, null);
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public class GradeController extends BaseController<Grade, GradeDto, Integer> {
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<GradeDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<GradeVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -33,13 +33,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/schoolInfo")
|
||||
public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoDto, Long> {
|
||||
public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private SchoolInfoService schoolInfoService;
|
||||
|
||||
@Override
|
||||
protected BaseService<SchoolInfo, SchoolInfoDto, Long> service() {
|
||||
protected BaseService<SchoolInfo, Long> service() {
|
||||
return schoolInfoService;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = schoolInfoService.verifyRelatedData(schoolInfo, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -79,7 +79,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SchoolInfo schoolInfo = SchoolInfo.INSTANCE.toModel(schoolInfoDto);
|
||||
SchoolInfo schoolInfo = MyModelUtil.copyTo(schoolInfoDto, SchoolInfo.class);
|
||||
SchoolInfo originalSchoolInfo = schoolInfoService.getById(schoolInfo.getSchoolId());
|
||||
if (originalSchoolInfo == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -133,25 +133,18 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SchoolInfoDto>> list(
|
||||
public ResponseResult<MyPageData<SchoolInfoVo>> list(
|
||||
@MyRequestBody("schoolInfoFilter") SchoolInfoDto schoolInfoDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
SchoolInfo schoolInfoFilter = SchoolInfo.INSTANCE.toModel(schoolInfoDtoFilter);
|
||||
SchoolInfo schoolInfoFilter = MyModelUtil.copyTo(schoolInfoDtoFilter, SchoolInfo.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SchoolInfo.class);
|
||||
List<SchoolInfo> schoolInfoList =
|
||||
schoolInfoService.getSchoolInfoListWithRelation(schoolInfoFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (schoolInfoList instanceof Page) {
|
||||
totalCount = ((Page<SchoolInfo>) schoolInfoList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<SchoolInfoDto>, Long> responseData =
|
||||
new Tuple2<>(SchoolInfo.INSTANCE.fromModelList(schoolInfoList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(schoolInfoList, SchoolInfo.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,7 +154,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SchoolInfoDto> view(@RequestParam Long schoolId) {
|
||||
public ResponseResult<SchoolInfoVo> view(@RequestParam Long schoolId) {
|
||||
if (MyCommonUtil.existBlankArgument(schoolId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -170,8 +163,8 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
if (schoolInfo == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SchoolInfoDto schoolInfoDto = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
||||
return ResponseResult.success(schoolInfoDto);
|
||||
SchoolInfoVo schoolInfoVo = SchoolInfo.INSTANCE.fromModel(schoolInfo);
|
||||
return ResponseResult.success(schoolInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +190,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<SchoolInfoDto>> listByIds(
|
||||
public ResponseResult<List<SchoolInfoVo>> listByIds(
|
||||
@RequestParam Set<Long> schoolIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(schoolIds, withDict, SchoolInfo.INSTANCE);
|
||||
}
|
||||
@@ -211,7 +204,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<SchoolInfoDto> getById(
|
||||
public ResponseResult<SchoolInfoVo> getById(
|
||||
@RequestParam Long schoolId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(schoolId, withDict, SchoolInfo.INSTANCE);
|
||||
}
|
||||
@@ -249,30 +242,30 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody SchoolInfoDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, SchoolInfo.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, SchoolInfo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<SchoolInfoDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<SchoolInfoVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -284,7 +277,7 @@ public class SchoolInfoController extends BaseController<SchoolInfo, SchoolInfoD
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<SchoolInfoDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<SchoolInfoVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, SchoolInfo.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/studentClass")
|
||||
public class StudentClassController extends BaseController<StudentClass, StudentClassDto, Long> {
|
||||
public class StudentClassController extends BaseController<StudentClass, StudentClassVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentClassService studentClassService;
|
||||
@@ -43,7 +43,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
private StudentService studentService;
|
||||
|
||||
@Override
|
||||
protected BaseService<StudentClass, StudentClassDto, Long> service() {
|
||||
protected BaseService<StudentClass, Long> service() {
|
||||
return studentClassService;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
StudentClass studentClass = MyModelUtil.copyTo(studentClassDto, StudentClass.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentClassService.verifyRelatedData(studentClass, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -83,7 +83,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentClass studentClass = StudentClass.INSTANCE.toModel(studentClassDto);
|
||||
StudentClass studentClass = MyModelUtil.copyTo(studentClassDto, StudentClass.class);
|
||||
StudentClass originalStudentClass = studentClassService.getById(studentClass.getClassId());
|
||||
if (originalStudentClass == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -137,25 +137,18 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentClassDto>> list(
|
||||
public ResponseResult<MyPageData<StudentClassVo>> list(
|
||||
@MyRequestBody("studentClassFilter") StudentClassDto studentClassDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
StudentClass studentClassFilter = StudentClass.INSTANCE.toModel(studentClassDtoFilter);
|
||||
StudentClass studentClassFilter = MyModelUtil.copyTo(studentClassDtoFilter, StudentClass.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentClass.class);
|
||||
List<StudentClass> studentClassList =
|
||||
studentClassService.getStudentClassListWithRelation(studentClassFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentClassList instanceof Page) {
|
||||
totalCount = ((Page<StudentClass>) studentClassList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentClassDto>, Long> responseData =
|
||||
new Tuple2<>(StudentClass.INSTANCE.fromModelList(studentClassList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentClassList, StudentClass.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,7 +158,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentClassDto> view(@RequestParam Long classId) {
|
||||
public ResponseResult<StudentClassVo> view(@RequestParam Long classId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -174,8 +167,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (studentClass == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentClassDto studentClassDto = StudentClass.INSTANCE.fromModel(studentClass);
|
||||
return ResponseResult.success(studentClassDto);
|
||||
StudentClassVo studentClassVo = StudentClass.INSTANCE.fromModel(studentClass);
|
||||
return ResponseResult.success(studentClassVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +182,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassCourse")
|
||||
public ResponseResult<MyPageData<CourseDto>> listNotInClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listNotInClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -203,7 +196,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course filter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getNotInCourseListByClassId(classId, filter, orderBy);
|
||||
@@ -220,7 +213,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassCourse")
|
||||
public ResponseResult<MyPageData<CourseDto>> listClassCourse(
|
||||
public ResponseResult<MyPageData<CourseVo>> listClassCourse(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("courseFilter") CourseDto courseDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -234,7 +227,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Course filter = Course.INSTANCE.toModel(courseDtoFilter);
|
||||
Course filter = MyModelUtil.copyTo(courseDtoFilter, Course.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Course.class);
|
||||
List<Course> courseList =
|
||||
courseService.getCourseListByClassId(classId, filter, orderBy);
|
||||
@@ -301,7 +294,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,包括中间表详情。
|
||||
*/
|
||||
@GetMapping("/viewClassCourse")
|
||||
public ResponseResult<ClassCourseDto> viewClassCourse(
|
||||
public ResponseResult<ClassCourseVo> viewClassCourse(
|
||||
@RequestParam Long classId, @RequestParam Long courseId) {
|
||||
if (MyCommonUtil.existBlankArgument(classId, courseId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
@@ -310,8 +303,8 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (classCourse == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
ClassCourseDto classCourseDto = MyModelUtil.copyTo(classCourse, ClassCourseDto.class);
|
||||
return ResponseResult.success(classCourseDto);
|
||||
ClassCourseVo classCourseVo = MyModelUtil.copyTo(classCourse, ClassCourseVo.class);
|
||||
return ResponseResult.success(classCourseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +337,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listNotInClassStudent")
|
||||
public ResponseResult<MyPageData<StudentDto>> listNotInClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listNotInClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -358,7 +351,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student filter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getNotInStudentListByClassId(classId, filter, orderBy);
|
||||
@@ -375,7 +368,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
* @return 应答结果对象,返回符合条件的数据列表。
|
||||
*/
|
||||
@PostMapping("/listClassStudent")
|
||||
public ResponseResult<MyPageData<StudentDto>> listClassStudent(
|
||||
public ResponseResult<MyPageData<StudentVo>> listClassStudent(
|
||||
@MyRequestBody Long classId,
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -389,7 +382,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student filter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student filter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListByClassId(classId, filter, orderBy);
|
||||
@@ -456,7 +449,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentClassDto>> listByIds(
|
||||
public ResponseResult<List<StudentClassVo>> listByIds(
|
||||
@RequestParam Set<Long> classIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(classIds, withDict, StudentClass.INSTANCE);
|
||||
}
|
||||
@@ -470,7 +463,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentClassDto> getById(
|
||||
public ResponseResult<StudentClassVo> getById(
|
||||
@RequestParam Long classId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(classId, withDict, StudentClass.INSTANCE);
|
||||
}
|
||||
@@ -508,30 +501,30 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentClassDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentClass.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentClass.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentClassDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentClassVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -543,7 +536,7 @@ public class StudentClassController extends BaseController<StudentClass, Student
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentClassDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentClassVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, StudentClass.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.orange.demo.courseclassservice.controller;
|
||||
|
||||
import cn.jimmyshi.beanquery.BeanQuery;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassservice.service.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -33,13 +33,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
public class StudentController extends BaseController<Student, StudentDto, Long> {
|
||||
public class StudentController extends BaseController<Student, StudentVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentService studentService;
|
||||
|
||||
@Override
|
||||
protected BaseService<Student, StudentDto, Long> service() {
|
||||
protected BaseService<Student, Long> service() {
|
||||
return studentService;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
Student student = MyModelUtil.copyTo(studentDto, Student.class);
|
||||
// 验证关联Id的数据合法性
|
||||
CallResult callResult = studentService.verifyRelatedData(student, null);
|
||||
if (!callResult.isSuccess()) {
|
||||
@@ -91,7 +91,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
Student student = Student.INSTANCE.toModel(studentDto);
|
||||
Student student = MyModelUtil.copyTo(studentDto, Student.class);
|
||||
Student originalStudent = studentService.getById(student.getStudentId());
|
||||
if (originalStudent == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -145,25 +145,18 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentDto>> list(
|
||||
public ResponseResult<MyPageData<StudentVo>> list(
|
||||
@MyRequestBody("studentFilter") StudentDto studentDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
Student studentFilter = Student.INSTANCE.toModel(studentDtoFilter);
|
||||
Student studentFilter = MyModelUtil.copyTo(studentDtoFilter, Student.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, Student.class);
|
||||
List<Student> studentList =
|
||||
studentService.getStudentListWithRelation(studentFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentList instanceof Page) {
|
||||
totalCount = ((Page<Student>) studentList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentDto>, Long> responseData =
|
||||
new Tuple2<>(Student.INSTANCE.fromModelList(studentList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentList, Student.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +166,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentDto> view(@RequestParam Long studentId) {
|
||||
public ResponseResult<StudentVo> view(@RequestParam Long studentId) {
|
||||
if (MyCommonUtil.existBlankArgument(studentId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -182,8 +175,8 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
if (student == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentDto studentDto = Student.INSTANCE.fromModel(student);
|
||||
return ResponseResult.success(studentDto);
|
||||
StudentVo studentVo = Student.INSTANCE.fromModel(student);
|
||||
return ResponseResult.success(studentVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +202,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentDto>> listByIds(
|
||||
public ResponseResult<List<StudentVo>> listByIds(
|
||||
@RequestParam Set<Long> studentIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(studentIds, withDict, Student.INSTANCE);
|
||||
}
|
||||
@@ -223,7 +216,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentDto> getById(
|
||||
public ResponseResult<StudentVo> getById(
|
||||
@RequestParam Long studentId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(studentId, withDict, Student.INSTANCE);
|
||||
}
|
||||
@@ -261,30 +254,30 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, Student.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, Student.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -296,7 +289,7 @@ public class StudentController extends BaseController<Student, StudentDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, Student.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,13 @@
|
||||
<association property="classCourse" column="course_id" foreignColumn="course_id"
|
||||
notNullColumn="course_id" resultMap="com.orange.demo.courseclassservice.dao.ClassCourseMapper.BaseResultMap" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.CourseMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="courseFilter != null">
|
||||
<if test="courseFilter.courseName != null and courseFilter.courseName != ''">
|
||||
<bind name = "safeCourseName" value = "'%' + courseFilter.courseName + '%'" />
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
<result column="province_id" jdbcType="BIGINT" property="provinceId"/>
|
||||
<result column="city_id" jdbcType="BIGINT" property="cityId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.SchoolInfoMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="schoolInfoFilter != null">
|
||||
<if test="schoolInfoFilter.schoolName != null and schoolInfoFilter.schoolName != ''">
|
||||
<bind name = "safeSchoolName" value = "'%' + schoolInfoFilter.schoolName + '%'" />
|
||||
|
||||
@@ -12,8 +12,14 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.StudentClassMapper.inputFilterRef"/>
|
||||
AND zz_class.status = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentClassFilter != null">
|
||||
<if test="studentClassFilter.className != null and studentClassFilter.className != ''">
|
||||
AND zz_class.class_name = #{studentClassFilter.className}
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
<result column="register_time" jdbcType="TIMESTAMP" property="registerTime"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.courseclassservice.dao.StudentMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentFilter != null">
|
||||
<if test="studentFilter.provinceId != null">
|
||||
AND zz_student.province_id = #{studentFilter.provinceId}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import com.orange.demo.courseclassinterface.vo.CourseVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -174,25 +174,25 @@ public class Course {
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface CourseModelMapper extends BaseModelMapper<CourseDto, Course> {
|
||||
public interface CourseModelMapper extends BaseModelMapper<CourseVo, Course> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param courseDto 域对象。
|
||||
* @param courseVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(mapToBean(courseDto.getClassCourse(), com.orange.demo.courseclassservice.model.ClassCourse.class))")
|
||||
@Mapping(target = "classCourse", expression = "java(mapToBean(courseVo.getClassCourse(), com.orange.demo.courseclassservice.model.ClassCourse.class))")
|
||||
@Override
|
||||
Course toModel(CourseDto courseDto);
|
||||
Course toModel(CourseVo courseVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param course 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "classCourse", expression = "java(beanToMap(course.getClassCourse(), false))")
|
||||
@Override
|
||||
CourseDto fromModel(Course course);
|
||||
CourseVo fromModel(Course course);
|
||||
}
|
||||
public static final CourseModelMapper INSTANCE = Mappers.getMapper(CourseModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.orange.demo.courseclassservice.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import com.orange.demo.courseclassinterface.vo.SchoolInfoVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -69,23 +69,23 @@ public class SchoolInfo {
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface SchoolInfoModelMapper extends BaseModelMapper<SchoolInfoDto, SchoolInfo> {
|
||||
public interface SchoolInfoModelMapper extends BaseModelMapper<SchoolInfoVo, SchoolInfo> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param schoolInfoDto 域对象。
|
||||
* @param schoolInfoVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfo toModel(SchoolInfoDto schoolInfoDto);
|
||||
SchoolInfo toModel(SchoolInfoVo schoolInfoVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param schoolInfo 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
SchoolInfoDto fromModel(SchoolInfo schoolInfo);
|
||||
SchoolInfoVo fromModel(SchoolInfo schoolInfo);
|
||||
}
|
||||
public static final SchoolInfoModelMapper INSTANCE = Mappers.getMapper(SchoolInfoModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -226,23 +226,23 @@ public class Student {
|
||||
private Map<String, Object> statusDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentModelMapper extends BaseModelMapper<StudentDto, Student> {
|
||||
public interface StudentModelMapper extends BaseModelMapper<StudentVo, Student> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentDto 域对象。
|
||||
* @param studentVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
Student toModel(StudentDto studentDto);
|
||||
Student toModel(StudentVo studentVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param student 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentDto fromModel(Student student);
|
||||
StudentVo fromModel(Student student);
|
||||
}
|
||||
public static final StudentModelMapper INSTANCE = Mappers.getMapper(StudentModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.courseclassinterface.dto.StudentClassDto;
|
||||
import com.orange.demo.courseclassinterface.vo.StudentClassVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -115,23 +115,23 @@ public class StudentClass {
|
||||
private Map<String, Object> classLevelDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentClassModelMapper extends BaseModelMapper<StudentClassDto, StudentClass> {
|
||||
public interface StudentClassModelMapper extends BaseModelMapper<StudentClassVo, StudentClass> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentClassDto 域对象。
|
||||
* @param studentClassVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClass toModel(StudentClassDto studentClassDto);
|
||||
StudentClass toModel(StudentClassVo studentClassVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentClass 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentClassDto fromModel(StudentClass studentClass);
|
||||
StudentClassVo fromModel(StudentClass studentClass);
|
||||
}
|
||||
public static final StudentClassModelMapper INSTANCE = Mappers.getMapper(StudentClassModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.courseclassservice.dao.AreaCodeMapper;
|
||||
import com.orange.demo.courseclassservice.model.AreaCode;
|
||||
import com.orange.demo.common.core.cache.MapTreeDictionaryCache;
|
||||
@@ -20,7 +19,7 @@ import java.util.List;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, AreaCodeDto, Long> {
|
||||
public class AreaCodeService extends BaseDictService<AreaCode, Long> {
|
||||
|
||||
@Autowired
|
||||
private AreaCodeMapper areaCodeMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -24,7 +23,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class CourseService extends BaseService<Course, CourseDto, Long> {
|
||||
public class CourseService extends BaseService<Course, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseMapper courseMapper;
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.courseclassservice.dao.GradeMapper;
|
||||
import com.orange.demo.courseclassservice.model.Grade;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -21,7 +20,7 @@ import javax.annotation.PostConstruct;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class GradeService extends BaseDictService<Grade, GradeDto, Integer> {
|
||||
public class GradeService extends BaseDictService<Grade, Integer> {
|
||||
|
||||
@Autowired
|
||||
private GradeMapper gradeMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -23,7 +22,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, SchoolInfoDto, Long> {
|
||||
public class SchoolInfoService extends BaseService<SchoolInfo, Long> {
|
||||
|
||||
@Autowired
|
||||
private SchoolInfoMapper schoolInfoMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -26,7 +25,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentClassService extends BaseService<StudentClass, StudentClassDto, Long> {
|
||||
public class StudentClassService extends BaseService<StudentClass, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentClassMapper studentClassMapper;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.orange.demo.courseclassservice.service;
|
||||
import com.orange.demo.application.common.constant.StudentStatus;
|
||||
import com.orange.demo.courseclassservice.dao.*;
|
||||
import com.orange.demo.courseclassservice.model.*;
|
||||
import com.orange.demo.courseclassinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
@@ -24,7 +23,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentService extends BaseService<Student, StudentDto, Long> {
|
||||
public class StudentService extends BaseService<Student, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentMapper studentMapper;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.CourseTransStatsDto;
|
||||
import com.orange.demo.statsinterface.vo.CourseTransStatsVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "stats",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = CourseTransStatsClient.CourseTransStatsClientFallbackFactory.class)
|
||||
public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto, Long> {
|
||||
public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto, CourseTransStatsVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/listByIds")
|
||||
ResponseResult<List<CourseTransStatsDto>> listByIds(
|
||||
ResponseResult<List<CourseTransStatsVo>> listByIds(
|
||||
@RequestParam("statsIds") Set<Long> statsIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/getById")
|
||||
ResponseResult<CourseTransStatsDto> getById(
|
||||
ResponseResult<CourseTransStatsVo> getById(
|
||||
@RequestParam("statsId") Long statsId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/listBy")
|
||||
ResponseResult<List<CourseTransStatsDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<CourseTransStatsVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/getBy")
|
||||
ResponseResult<CourseTransStatsDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<CourseTransStatsVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/courseTransStats/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
|
||||
@Component("StatsCourseTransStatsClientFallbackFactory")
|
||||
@Slf4j
|
||||
class CourseTransStatsClientFallbackFactory
|
||||
extends BaseFallbackFactory<CourseTransStatsDto, Long, CourseTransStatsClient> implements CourseTransStatsClient {
|
||||
extends BaseFallbackFactory<CourseTransStatsDto, CourseTransStatsVo, Long, CourseTransStatsClient> implements CourseTransStatsClient {
|
||||
|
||||
@Override
|
||||
public CourseTransStatsClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionStatsDto;
|
||||
import com.orange.demo.statsinterface.vo.StudentActionStatsVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "stats",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentActionStatsClient.StudentActionStatsClientFallbackFactory.class)
|
||||
public interface StudentActionStatsClient extends BaseClient<StudentActionStatsDto, Long> {
|
||||
public interface StudentActionStatsClient extends BaseClient<StudentActionStatsDto, StudentActionStatsVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/listByIds")
|
||||
ResponseResult<List<StudentActionStatsDto>> listByIds(
|
||||
ResponseResult<List<StudentActionStatsVo>> listByIds(
|
||||
@RequestParam("statsIds") Set<Long> statsIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/getById")
|
||||
ResponseResult<StudentActionStatsDto> getById(
|
||||
ResponseResult<StudentActionStatsVo> getById(
|
||||
@RequestParam("statsId") Long statsId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/listBy")
|
||||
ResponseResult<List<StudentActionStatsDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentActionStatsVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/getBy")
|
||||
ResponseResult<StudentActionStatsDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentActionStatsVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionStats/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
|
||||
@Component("StatsStudentActionStatsClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentActionStatsClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentActionStatsDto, Long, StudentActionStatsClient> implements StudentActionStatsClient {
|
||||
extends BaseFallbackFactory<StudentActionStatsDto, StudentActionStatsVo, Long, StudentActionStatsClient> implements StudentActionStatsClient {
|
||||
|
||||
@Override
|
||||
public StudentActionStatsClient create(Throwable throwable) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionTransDto;
|
||||
import com.orange.demo.statsinterface.vo.StudentActionTransVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "stats",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = StudentActionTransClient.StudentActionTransClientFallbackFactory.class)
|
||||
public interface StudentActionTransClient extends BaseClient<StudentActionTransDto, Long> {
|
||||
public interface StudentActionTransClient extends BaseClient<StudentActionTransDto, StudentActionTransVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/listByIds")
|
||||
ResponseResult<List<StudentActionTransDto>> listByIds(
|
||||
ResponseResult<List<StudentActionTransVo>> listByIds(
|
||||
@RequestParam("transIds") Set<Long> transIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/getById")
|
||||
ResponseResult<StudentActionTransDto> getById(
|
||||
ResponseResult<StudentActionTransVo> getById(
|
||||
@RequestParam("transId") Long transId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/listBy")
|
||||
ResponseResult<List<StudentActionTransDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<StudentActionTransVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/getBy")
|
||||
ResponseResult<StudentActionTransDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<StudentActionTransVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/studentActionTrans/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
|
||||
@Component("StatsStudentActionTransClientFallbackFactory")
|
||||
@Slf4j
|
||||
class StudentActionTransClientFallbackFactory
|
||||
extends BaseFallbackFactory<StudentActionTransDto, Long, StudentActionTransClient> implements StudentActionTransClient {
|
||||
extends BaseFallbackFactory<StudentActionTransDto, StudentActionTransVo, Long, StudentActionTransClient> implements StudentActionTransClient {
|
||||
|
||||
@Override
|
||||
public StudentActionTransClient create(Throwable throwable) {
|
||||
|
||||
@@ -11,7 +11,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseTransStatsDto对象。
|
||||
@@ -103,22 +102,4 @@ public class CourseTransStatsDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
||||
private String statsDateEnd;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* courseId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> courseIdDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionStatsDto对象。
|
||||
@@ -178,22 +177,4 @@ public class StudentActionStatsDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "statsDate 范围过滤结束值(<=)")
|
||||
private String statsDateEnd;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionTransDto对象。
|
||||
@@ -135,28 +134,4 @@ public class StudentActionTransDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
||||
private String createTimeEnd;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* actionType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> actionTypeDictMap;
|
||||
|
||||
/**
|
||||
* deviceType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.orange.demo.statsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseTransStatsVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("CourseTransStatsVO实体对象")
|
||||
@Data
|
||||
public class CourseTransStatsVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计日期")
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 科目Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "科目Id")
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级名称")
|
||||
private String gradeName;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程Id")
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "课程名称")
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 学生上课次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生上课次数")
|
||||
private Integer studentAttendCount;
|
||||
|
||||
/**
|
||||
* 学生献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生献花数量")
|
||||
private Integer studentFlowerAmount;
|
||||
|
||||
/**
|
||||
* 学生献花次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生献花次数")
|
||||
private Integer studentFlowerCount;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* courseId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> courseIdDictMap;
|
||||
|
||||
/**
|
||||
* subjectId 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.orange.demo.statsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionStatsVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentActionStatsVO实体对象")
|
||||
@Data
|
||||
public class StudentActionStatsVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计日期")
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 统计小时。
|
||||
*/
|
||||
@ApiModelProperty(value = "统计小时")
|
||||
private Date statsMonth;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学生所在省Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生所在省Id")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 学生所在城市Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生所在城市Id")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 购课学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购课学币数量")
|
||||
private Integer buyCourseAmount;
|
||||
|
||||
/**
|
||||
* 购买课程次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买课程次数")
|
||||
private Integer buyCourseCount;
|
||||
|
||||
/**
|
||||
* 购买视频学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频学币数量")
|
||||
private Integer buyVideoAmount;
|
||||
|
||||
/**
|
||||
* 购买视频次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频次数")
|
||||
private Integer buyVideoCount;
|
||||
|
||||
/**
|
||||
* 购买作业学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业学币数量")
|
||||
private Integer buyPaperAmount;
|
||||
|
||||
/**
|
||||
* 购买作业次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业次数")
|
||||
private Integer buyPaperCount;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花数量")
|
||||
private Integer buyFlowerAmount;
|
||||
|
||||
/**
|
||||
* 购买献花次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花次数")
|
||||
private Integer buyFlowerCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币数量")
|
||||
private Integer rechargeCoinAmount;
|
||||
|
||||
/**
|
||||
* 充值学币次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币次数")
|
||||
private Integer rechargeCoinCount;
|
||||
|
||||
/**
|
||||
* 线下课程上课次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "线下课程上课次数")
|
||||
private Integer doCourseCount;
|
||||
|
||||
/**
|
||||
* 观看视频次数。
|
||||
*/
|
||||
@ApiModelProperty(value = "观看视频次数")
|
||||
private Integer watchVideoCount;
|
||||
|
||||
/**
|
||||
* 购买献花消费学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花消费学币数量")
|
||||
private Integer watchVideoTotalSecond;
|
||||
|
||||
/**
|
||||
* 做题数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题数量")
|
||||
private Integer doExerciseCount;
|
||||
|
||||
/**
|
||||
* 做题正确的数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题正确的数量")
|
||||
private Integer doExerciseCorrectCount;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* provinceId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
/**
|
||||
* cityId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.orange.demo.statsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionTransVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentActionTransVO实体对象")
|
||||
@Data
|
||||
public class StudentActionTransVo {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "主键Id")
|
||||
private Long transId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生Id")
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生名称")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学生校区。
|
||||
*/
|
||||
@ApiModelProperty(value = "学生校区")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "年级Id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||
*/
|
||||
@ApiModelProperty(value = "行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)")
|
||||
private Integer actionType;
|
||||
|
||||
/**
|
||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||
*/
|
||||
@ApiModelProperty(value = "设备类型(0: iOS 1: Android 2: PC)")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 看视频秒数。
|
||||
*/
|
||||
@ApiModelProperty(value = "看视频秒数")
|
||||
private Integer watchVideoSeconds;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买献花数量")
|
||||
private Integer flowerCount;
|
||||
|
||||
/**
|
||||
* 购买作业数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买作业数量")
|
||||
private Integer paperCount;
|
||||
|
||||
/**
|
||||
* 购买视频数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买视频数量")
|
||||
private Integer videoCount;
|
||||
|
||||
/**
|
||||
* 购买课程数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "购买课程数量")
|
||||
private Integer courseCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@ApiModelProperty(value = "充值学币数量")
|
||||
private Integer coinCount;
|
||||
|
||||
/**
|
||||
* 做题是否正确标记。
|
||||
*/
|
||||
@ApiModelProperty(value = "做题是否正确标记")
|
||||
private Integer exerciseCorrectFlag;
|
||||
|
||||
/**
|
||||
* 发生时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "发生时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* schoolId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
/**
|
||||
* gradeId 字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
/**
|
||||
* actionType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> actionTypeDictMap;
|
||||
|
||||
/**
|
||||
* deviceType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.statsservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsservice.service.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.statsinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -29,13 +29,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/courseTransStats")
|
||||
public class CourseTransStatsController extends BaseController<CourseTransStats, CourseTransStatsDto, Long> {
|
||||
public class CourseTransStatsController extends BaseController<CourseTransStats, CourseTransStatsVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseTransStatsService courseTransStatsService;
|
||||
|
||||
@Override
|
||||
protected BaseService<CourseTransStats, CourseTransStatsDto, Long> service() {
|
||||
protected BaseService<CourseTransStats, Long> service() {
|
||||
return courseTransStatsService;
|
||||
}
|
||||
|
||||
@@ -48,25 +48,18 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<CourseTransStatsDto>> list(
|
||||
public ResponseResult<MyPageData<CourseTransStatsVo>> list(
|
||||
@MyRequestBody("courseTransStatsFilter") CourseTransStatsDto courseTransStatsDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
CourseTransStats courseTransStatsFilter = CourseTransStats.INSTANCE.toModel(courseTransStatsDtoFilter);
|
||||
CourseTransStats courseTransStatsFilter = MyModelUtil.copyTo(courseTransStatsDtoFilter, CourseTransStats.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
|
||||
List<CourseTransStats> courseTransStatsList =
|
||||
courseTransStatsService.getCourseTransStatsListWithRelation(courseTransStatsFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (courseTransStatsList instanceof Page) {
|
||||
totalCount = ((Page<CourseTransStats>) courseTransStatsList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<CourseTransStatsDto>, Long> responseData =
|
||||
new Tuple2<>(CourseTransStats.INSTANCE.fromModelList(courseTransStatsList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(courseTransStatsList, CourseTransStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +72,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<CourseTransStatsDto>> listWithGroup(
|
||||
public ResponseResult<MyPageData<CourseTransStatsVo>> listWithGroup(
|
||||
@MyRequestBody("courseTransStatsFilter") CourseTransStatsDto courseTransStatsDtoFilter,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -93,7 +86,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
CourseTransStats filter = CourseTransStats.INSTANCE.toModel(courseTransStatsDtoFilter);
|
||||
CourseTransStats filter = MyModelUtil.copyTo(courseTransStatsDtoFilter, CourseTransStats.class);
|
||||
MyGroupCriteria criteria = groupParam.getGroupCriteria();
|
||||
List<CourseTransStats> resultList = courseTransStatsService.getGroupedCourseTransStatsListWithRelation(
|
||||
filter, criteria.getGroupSelect(), criteria.getGroupBy(), orderBy);
|
||||
@@ -108,7 +101,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<CourseTransStatsDto> view(@RequestParam Long statsId) {
|
||||
public ResponseResult<CourseTransStatsVo> view(@RequestParam Long statsId) {
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -117,8 +110,8 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
if (courseTransStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
CourseTransStatsDto courseTransStatsDto = CourseTransStats.INSTANCE.fromModel(courseTransStats);
|
||||
return ResponseResult.success(courseTransStatsDto);
|
||||
CourseTransStatsVo courseTransStatsVo = CourseTransStats.INSTANCE.fromModel(courseTransStats);
|
||||
return ResponseResult.success(courseTransStatsVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +123,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<CourseTransStatsDto>> listByIds(
|
||||
public ResponseResult<List<CourseTransStatsVo>> listByIds(
|
||||
@RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(statsIds, withDict, CourseTransStats.INSTANCE);
|
||||
}
|
||||
@@ -144,7 +137,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<CourseTransStatsDto> getById(
|
||||
public ResponseResult<CourseTransStatsVo> getById(
|
||||
@RequestParam Long statsId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(statsId, withDict, CourseTransStats.INSTANCE);
|
||||
}
|
||||
@@ -182,30 +175,30 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, CourseTransStats.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, CourseTransStats.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<CourseTransStatsDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<CourseTransStatsVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, CourseTransStats.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, CourseTransStats.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -217,7 +210,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<CourseTransStatsDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<CourseTransStatsVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, CourseTransStats.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.statsservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsservice.service.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.statsinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -29,13 +29,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/studentActionStats")
|
||||
public class StudentActionStatsController extends BaseController<StudentActionStats, StudentActionStatsDto, Long> {
|
||||
public class StudentActionStatsController extends BaseController<StudentActionStats, StudentActionStatsVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentActionStatsService studentActionStatsService;
|
||||
|
||||
@Override
|
||||
protected BaseService<StudentActionStats, StudentActionStatsDto, Long> service() {
|
||||
protected BaseService<StudentActionStats, Long> service() {
|
||||
return studentActionStatsService;
|
||||
}
|
||||
|
||||
@@ -48,25 +48,18 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentActionStatsDto>> list(
|
||||
public ResponseResult<MyPageData<StudentActionStatsVo>> list(
|
||||
@MyRequestBody("studentActionStatsFilter") StudentActionStatsDto studentActionStatsDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
StudentActionStats studentActionStatsFilter = StudentActionStats.INSTANCE.toModel(studentActionStatsDtoFilter);
|
||||
StudentActionStats studentActionStatsFilter = MyModelUtil.copyTo(studentActionStatsDtoFilter, StudentActionStats.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
|
||||
List<StudentActionStats> studentActionStatsList =
|
||||
studentActionStatsService.getStudentActionStatsListWithRelation(studentActionStatsFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentActionStatsList instanceof Page) {
|
||||
totalCount = ((Page<StudentActionStats>) studentActionStatsList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentActionStatsDto>, Long> responseData =
|
||||
new Tuple2<>(StudentActionStats.INSTANCE.fromModelList(studentActionStatsList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionStatsList, StudentActionStats.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +72,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/listWithGroup")
|
||||
public ResponseResult<MyPageData<StudentActionStatsDto>> listWithGroup(
|
||||
public ResponseResult<MyPageData<StudentActionStatsVo>> listWithGroup(
|
||||
@MyRequestBody("studentActionStatsFilter") StudentActionStatsDto studentActionStatsDtoFilter,
|
||||
@MyRequestBody(required = true) MyGroupParam groupParam,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -93,7 +86,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
StudentActionStats filter = StudentActionStats.INSTANCE.toModel(studentActionStatsDtoFilter);
|
||||
StudentActionStats filter = MyModelUtil.copyTo(studentActionStatsDtoFilter, StudentActionStats.class);
|
||||
MyGroupCriteria criteria = groupParam.getGroupCriteria();
|
||||
List<StudentActionStats> resultList = studentActionStatsService.getGroupedStudentActionStatsListWithRelation(
|
||||
filter, criteria.getGroupSelect(), criteria.getGroupBy(), orderBy);
|
||||
@@ -108,7 +101,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentActionStatsDto> view(@RequestParam Long statsId) {
|
||||
public ResponseResult<StudentActionStatsVo> view(@RequestParam Long statsId) {
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -117,8 +110,8 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
if (studentActionStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentActionStatsDto studentActionStatsDto = StudentActionStats.INSTANCE.fromModel(studentActionStats);
|
||||
return ResponseResult.success(studentActionStatsDto);
|
||||
StudentActionStatsVo studentActionStatsVo = StudentActionStats.INSTANCE.fromModel(studentActionStats);
|
||||
return ResponseResult.success(studentActionStatsVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +123,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentActionStatsDto>> listByIds(
|
||||
public ResponseResult<List<StudentActionStatsVo>> listByIds(
|
||||
@RequestParam Set<Long> statsIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(statsIds, withDict, StudentActionStats.INSTANCE);
|
||||
}
|
||||
@@ -144,7 +137,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentActionStatsDto> getById(
|
||||
public ResponseResult<StudentActionStatsVo> getById(
|
||||
@RequestParam Long statsId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(statsId, withDict, StudentActionStats.INSTANCE);
|
||||
}
|
||||
@@ -182,30 +175,30 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentActionStats.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionStats.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentActionStatsDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentActionStatsVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, StudentActionStats.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, StudentActionStats.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -217,7 +210,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentActionStatsDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentActionStatsVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, StudentActionStats.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.statsservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsservice.service.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.statsinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -32,13 +32,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/studentActionTrans")
|
||||
public class StudentActionTransController extends BaseController<StudentActionTrans, StudentActionTransDto, Long> {
|
||||
public class StudentActionTransController extends BaseController<StudentActionTrans, StudentActionTransVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentActionTransService studentActionTransService;
|
||||
|
||||
@Override
|
||||
protected BaseService<StudentActionTrans, StudentActionTransDto, Long> service() {
|
||||
protected BaseService<StudentActionTrans, Long> service() {
|
||||
return studentActionTransService;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
|
||||
StudentActionTrans studentActionTrans = MyModelUtil.copyTo(studentActionTransDto, StudentActionTrans.class);
|
||||
// 验证远程服务关联Id的数据合法性
|
||||
CallResult remoteCallResult = studentActionTransService.verifyRemoteRelatedData(studentActionTrans, null);
|
||||
if (!remoteCallResult.isSuccess()) {
|
||||
@@ -84,7 +84,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
|
||||
StudentActionTrans studentActionTrans = MyModelUtil.copyTo(studentActionTransDto, StudentActionTrans.class);
|
||||
StudentActionTrans originalStudentActionTrans = studentActionTransService.getById(studentActionTrans.getTransId());
|
||||
if (originalStudentActionTrans == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
@@ -138,25 +138,18 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<StudentActionTransDto>> list(
|
||||
public ResponseResult<MyPageData<StudentActionTransVo>> list(
|
||||
@MyRequestBody("studentActionTransFilter") StudentActionTransDto studentActionTransDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
StudentActionTrans studentActionTransFilter = StudentActionTrans.INSTANCE.toModel(studentActionTransDtoFilter);
|
||||
StudentActionTrans studentActionTransFilter = MyModelUtil.copyTo(studentActionTransDtoFilter, StudentActionTrans.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionTrans.class);
|
||||
List<StudentActionTrans> studentActionTransList =
|
||||
studentActionTransService.getStudentActionTransListWithRelation(studentActionTransFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (studentActionTransList instanceof Page) {
|
||||
totalCount = ((Page<StudentActionTrans>) studentActionTransList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<StudentActionTransDto>, Long> responseData =
|
||||
new Tuple2<>(StudentActionTrans.INSTANCE.fromModelList(studentActionTransList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(studentActionTransList, StudentActionTrans.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +159,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<StudentActionTransDto> view(@RequestParam Long transId) {
|
||||
public ResponseResult<StudentActionTransVo> view(@RequestParam Long transId) {
|
||||
if (MyCommonUtil.existBlankArgument(transId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -175,8 +168,8 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
if (studentActionTrans == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
StudentActionTransDto studentActionTransDto = StudentActionTrans.INSTANCE.fromModel(studentActionTrans);
|
||||
return ResponseResult.success(studentActionTransDto);
|
||||
StudentActionTransVo studentActionTransVo = StudentActionTrans.INSTANCE.fromModel(studentActionTrans);
|
||||
return ResponseResult.success(studentActionTransVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,7 +181,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<StudentActionTransDto>> listByIds(
|
||||
public ResponseResult<List<StudentActionTransVo>> listByIds(
|
||||
@RequestParam Set<Long> transIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(transIds, withDict, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
@@ -202,7 +195,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<StudentActionTransDto> getById(
|
||||
public ResponseResult<StudentActionTransVo> getById(
|
||||
@RequestParam Long transId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(transId, withDict, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
@@ -240,30 +233,30 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, StudentActionTrans.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, StudentActionTrans.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<StudentActionTransDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<StudentActionTransVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -275,7 +268,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<StudentActionTransDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<StudentActionTransVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, StudentActionTrans.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
<result column="student_flower_amount" jdbcType="INTEGER" property="studentFlowerAmount"/>
|
||||
<result column="student_flower_count" jdbcType="INTEGER" property="studentFlowerCount"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.statsservice.dao.CourseTransStatsMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="courseTransStatsFilter != null">
|
||||
<if test="courseTransStatsFilter.statsDateStart != null and courseTransStatsFilter.statsDateStart != ''">
|
||||
AND zz_course_trans_stats.stats_date >= #{courseTransStatsFilter.statsDateStart}
|
||||
|
||||
@@ -24,8 +24,13 @@
|
||||
<result column="do_exercise_count" jdbcType="INTEGER" property="doExerciseCount"/>
|
||||
<result column="do_exercise_correct_count" jdbcType="INTEGER" property="doExerciseCorrectCount"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.statsservice.dao.StudentActionStatsMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentActionStatsFilter != null">
|
||||
<if test="studentActionStatsFilter.statsDateStart != null and studentActionStatsFilter.statsDateStart != ''">
|
||||
AND zz_student_action_stats.stats_date >= #{studentActionStatsFilter.statsDateStart}
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
<result column="exercise_correct_flag" jdbcType="TINYINT" property="exerciseCorrectFlag"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.statsservice.dao.StudentActionTransMapper.inputFilterRef"/>
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="studentActionTransFilter != null">
|
||||
<if test="studentActionTransFilter.studentId != null">
|
||||
AND zz_student_action_trans.student_id = #{studentActionTransFilter.studentId}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.orange.demo.courseclassinterface.client.GradeClient;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.client.CourseClient;
|
||||
import com.orange.demo.courseclassinterface.dto.CourseDto;
|
||||
import com.orange.demo.courseclassinterface.vo.CourseVo;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import com.orange.demo.application.common.constant.Subject;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.statsinterface.dto.CourseTransStatsDto;
|
||||
import com.orange.demo.statsinterface.vo.CourseTransStatsVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -115,7 +115,7 @@ public class CourseTransStats {
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveClientClass = GradeClient.class,
|
||||
slaveModelClass = GradeDto.class,
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@@ -124,7 +124,7 @@ public class CourseTransStats {
|
||||
@RelationDict(
|
||||
masterIdField = "courseId",
|
||||
slaveClientClass = CourseClient.class,
|
||||
slaveModelClass = CourseDto.class,
|
||||
slaveModelClass = CourseVo.class,
|
||||
slaveIdField = "courseId",
|
||||
slaveNameField = "courseName")
|
||||
@Transient
|
||||
@@ -137,23 +137,23 @@ public class CourseTransStats {
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface CourseTransStatsModelMapper extends BaseModelMapper<CourseTransStatsDto, CourseTransStats> {
|
||||
public interface CourseTransStatsModelMapper extends BaseModelMapper<CourseTransStatsVo, CourseTransStats> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param courseTransStatsDto 域对象。
|
||||
* @param courseTransStatsVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
CourseTransStats toModel(CourseTransStatsDto courseTransStatsDto);
|
||||
CourseTransStats toModel(CourseTransStatsVo courseTransStatsVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param courseTransStats 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
CourseTransStatsDto fromModel(CourseTransStats courseTransStats);
|
||||
CourseTransStatsVo fromModel(CourseTransStats courseTransStats);
|
||||
}
|
||||
public static final CourseTransStatsModelMapper INSTANCE = Mappers.getMapper(CourseTransStatsModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.orange.demo.courseclassinterface.vo.AreaCodeVo;
|
||||
import com.orange.demo.courseclassinterface.client.GradeClient;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.client.AreaCodeClient;
|
||||
import com.orange.demo.courseclassinterface.dto.AreaCodeDto;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionStatsDto;
|
||||
import com.orange.demo.statsinterface.vo.StudentActionStatsVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -188,7 +188,7 @@ public class StudentActionStats {
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveClientClass = GradeClient.class,
|
||||
slaveModelClass = GradeDto.class,
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@@ -197,7 +197,7 @@ public class StudentActionStats {
|
||||
@RelationDict(
|
||||
masterIdField = "provinceId",
|
||||
slaveClientClass = AreaCodeClient.class,
|
||||
slaveModelClass = AreaCodeDto.class,
|
||||
slaveModelClass = AreaCodeVo.class,
|
||||
slaveIdField = "areaId",
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
@@ -206,30 +206,30 @@ public class StudentActionStats {
|
||||
@RelationDict(
|
||||
masterIdField = "cityId",
|
||||
slaveClientClass = AreaCodeClient.class,
|
||||
slaveModelClass = AreaCodeDto.class,
|
||||
slaveModelClass = AreaCodeVo.class,
|
||||
slaveIdField = "areaId",
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentActionStatsModelMapper extends BaseModelMapper<StudentActionStatsDto, StudentActionStats> {
|
||||
public interface StudentActionStatsModelMapper extends BaseModelMapper<StudentActionStatsVo, StudentActionStats> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentActionStatsDto 域对象。
|
||||
* @param studentActionStatsVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionStats toModel(StudentActionStatsDto studentActionStatsDto);
|
||||
StudentActionStats toModel(StudentActionStatsVo studentActionStatsVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentActionStats 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionStatsDto fromModel(StudentActionStats studentActionStats);
|
||||
StudentActionStatsVo fromModel(StudentActionStats studentActionStats);
|
||||
}
|
||||
public static final StudentActionStatsModelMapper INSTANCE = Mappers.getMapper(StudentActionStatsModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.orange.demo.courseclassinterface.dto.SchoolInfoDto;
|
||||
import com.orange.demo.courseclassinterface.client.GradeClient;
|
||||
import com.orange.demo.courseclassinterface.dto.GradeDto;
|
||||
import com.orange.demo.courseclassinterface.client.SchoolInfoClient;
|
||||
import com.orange.demo.courseclassinterface.vo.SchoolInfoVo;
|
||||
import com.orange.demo.courseclassinterface.vo.GradeVo;
|
||||
import com.orange.demo.application.common.constant.StudentActionType;
|
||||
import com.orange.demo.application.common.constant.DeviceType;
|
||||
import com.orange.demo.common.core.annotation.RelationDict;
|
||||
import com.orange.demo.common.core.annotation.RelationConstDict;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.statsinterface.dto.StudentActionTransDto;
|
||||
import com.orange.demo.statsinterface.vo.StudentActionTransVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -146,7 +146,7 @@ public class StudentActionTrans {
|
||||
@RelationDict(
|
||||
masterIdField = "schoolId",
|
||||
slaveClientClass = SchoolInfoClient.class,
|
||||
slaveModelClass = SchoolInfoDto.class,
|
||||
slaveModelClass = SchoolInfoVo.class,
|
||||
slaveIdField = "schoolId",
|
||||
slaveNameField = "schoolName")
|
||||
@Transient
|
||||
@@ -155,7 +155,7 @@ public class StudentActionTrans {
|
||||
@RelationDict(
|
||||
masterIdField = "gradeId",
|
||||
slaveClientClass = GradeClient.class,
|
||||
slaveModelClass = GradeDto.class,
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@@ -174,23 +174,23 @@ public class StudentActionTrans {
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface StudentActionTransModelMapper extends BaseModelMapper<StudentActionTransDto, StudentActionTrans> {
|
||||
public interface StudentActionTransModelMapper extends BaseModelMapper<StudentActionTransVo, StudentActionTrans> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param studentActionTransDto 域对象。
|
||||
* @param studentActionTransVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionTrans toModel(StudentActionTransDto studentActionTransDto);
|
||||
StudentActionTrans toModel(StudentActionTransVo studentActionTransVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param studentActionTrans 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Override
|
||||
StudentActionTransDto fromModel(StudentActionTrans studentActionTrans);
|
||||
StudentActionTransVo fromModel(StudentActionTrans studentActionTrans);
|
||||
}
|
||||
public static final StudentActionTransModelMapper INSTANCE = Mappers.getMapper(StudentActionTransModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.statsservice.service;
|
||||
|
||||
import com.orange.demo.statsservice.dao.*;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.MyWhereCriteria;
|
||||
@@ -20,7 +19,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class CourseTransStatsService extends BaseService<CourseTransStats, CourseTransStatsDto, Long> {
|
||||
public class CourseTransStatsService extends BaseService<CourseTransStats, Long> {
|
||||
|
||||
@Autowired
|
||||
private CourseTransStatsMapper courseTransStatsMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.statsservice.service;
|
||||
|
||||
import com.orange.demo.statsservice.dao.*;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.object.MyWhereCriteria;
|
||||
@@ -20,7 +19,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentActionStatsService extends BaseService<StudentActionStats, StudentActionStatsDto, Long> {
|
||||
public class StudentActionStatsService extends BaseService<StudentActionStats, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentActionStatsMapper studentActionStatsMapper;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.orange.demo.statsservice.service;
|
||||
|
||||
import com.orange.demo.statsservice.dao.*;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsinterface.dto.*;
|
||||
import com.orange.demo.courseclassinterface.client.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
@@ -25,7 +24,7 @@ import java.util.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class StudentActionTransService extends BaseService<StudentActionTrans, StudentActionTransDto, Long> {
|
||||
public class StudentActionTransService extends BaseService<StudentActionTrans, Long> {
|
||||
|
||||
@Autowired
|
||||
private StudentActionTransMapper studentActionTransMapper;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orange.demo.common.core.config.FeignConfig;
|
||||
import com.orange.demo.common.core.base.client.BaseClient;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.upmsinterface.dto.SysUserDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysUserVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -22,7 +23,7 @@ import java.util.*;
|
||||
name = "upms",
|
||||
configuration = FeignConfig.class,
|
||||
fallbackFactory = SysUserClient.SysUserClientFallbackFactory.class)
|
||||
public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
public interface SysUserClient extends BaseClient<SysUserDto, SysUserVo, Long> {
|
||||
|
||||
/**
|
||||
* 基于主键的(In-list)条件获取远程数据接口。
|
||||
@@ -33,7 +34,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/listByIds")
|
||||
ResponseResult<List<SysUserDto>> listByIds(
|
||||
ResponseResult<List<SysUserVo>> listByIds(
|
||||
@RequestParam("userIds") Set<Long> userIds,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/getById")
|
||||
ResponseResult<SysUserDto> getById(
|
||||
ResponseResult<SysUserVo> getById(
|
||||
@RequestParam("userId") Long userId,
|
||||
@RequestParam("withDict") Boolean withDict);
|
||||
|
||||
@@ -98,7 +99,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/listBy")
|
||||
ResponseResult<List<SysUserDto>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<SysUserVo>> listBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的单条数据对象。
|
||||
@@ -108,7 +109,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/getBy")
|
||||
ResponseResult<SysUserDto> getBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<SysUserVo> getBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据列表。
|
||||
@@ -119,7 +120,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
*/
|
||||
@Override
|
||||
@PostMapping("/sysUser/listMapBy")
|
||||
ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取远程主对象中符合查询条件的数据数量。
|
||||
@@ -144,7 +145,7 @@ public interface SysUserClient extends BaseClient<SysUserDto, Long> {
|
||||
@Component("UpmsSysUserClientFallbackFactory")
|
||||
@Slf4j
|
||||
class SysUserClientFallbackFactory
|
||||
extends BaseFallbackFactory<SysUserDto, Long, SysUserClient> implements SysUserClient {
|
||||
extends BaseFallbackFactory<SysUserDto, SysUserVo, Long, SysUserClient> implements SysUserClient {
|
||||
|
||||
@Override
|
||||
public SysUserClient create(Throwable throwable) {
|
||||
|
||||
@@ -10,8 +10,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 菜单Dto。
|
||||
@@ -75,10 +73,4 @@ public class SysMenuDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 菜单与权限字关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<Map<String, Object>> sysMenuPermCodeList;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限字Dto。
|
||||
@@ -70,10 +68,4 @@ public class SysPermCodeDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 权限字与权限资源关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<Map<String, Object>> sysPermCodePermList;
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限资源Dto。
|
||||
@@ -66,10 +65,4 @@ public class SysPermDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 模块Id的字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> moduleIdDictMap;
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限资源模块Dto。
|
||||
@@ -62,10 +61,4 @@ public class SysPermModuleDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 权限资源对象列表。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<SysPermDto> sysPermList;
|
||||
}
|
||||
@@ -7,8 +7,6 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色Dto。
|
||||
@@ -57,19 +55,4 @@ public class SysRoleDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色与菜单关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<Map<String, Object>> sysRoleMenuList;
|
||||
|
||||
@ApiModelProperty(value = "创建时间开始查询时间")
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "创建时间结束查询时间")
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "LIKE 模糊搜索字符串")
|
||||
private String searchString;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ import lombok.Data;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SysUserDto对象。
|
||||
@@ -111,22 +109,4 @@ public class SysUserDto {
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime 范围过滤结束值(<=)")
|
||||
private String createTimeEnd;
|
||||
|
||||
/**
|
||||
* 多对多用户角色数据集合。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<Map<String, Object>> sysUserRoleList;
|
||||
|
||||
/**
|
||||
* userType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> userTypeDictMap;
|
||||
|
||||
/**
|
||||
* userStatus 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> userStatusDictMap;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 菜单VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("菜单VO")
|
||||
@Data
|
||||
public class SysMenuVo {
|
||||
|
||||
/**
|
||||
* 菜单Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单Id")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 父菜单Id,目录菜单的父菜单为null
|
||||
*/
|
||||
@ApiModelProperty(value = "父菜单Id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 菜单显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单显示名称")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 菜单类型 (0: 目录 1: 菜单 2: 按钮 3: UI片段)。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单类型")
|
||||
private Integer menuType;
|
||||
|
||||
/**
|
||||
* 前端表单路由名称,仅用于menu_type为1的菜单类型。
|
||||
*/
|
||||
@ApiModelProperty(value = "前端表单路由名称")
|
||||
private String formRouterName;
|
||||
|
||||
/**
|
||||
* 菜单显示顺序 (值越小,排序越靠前)。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单显示顺序")
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 菜单图标。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单显示顺序")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 菜单与权限字关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单与权限字关联对象列表")
|
||||
private List<Map<String, Object>> sysMenuPermCodeList;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 权限字VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("权限字VO")
|
||||
@Data
|
||||
public class SysPermCodeVo {
|
||||
|
||||
/**
|
||||
* 权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字Id")
|
||||
private Long permCodeId;
|
||||
|
||||
/**
|
||||
* 权限字标识(一般为有含义的英文字符串)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字标识")
|
||||
private String permCode;
|
||||
|
||||
/**
|
||||
* 上级权限字Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "上级权限字Id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 权限字类型(0: 表单 1: UI片段 2: 操作)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字类型")
|
||||
private Integer permCodeType;
|
||||
|
||||
/**
|
||||
* 显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示名称")
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 显示顺序(数值越小,越靠前)。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 权限字与权限资源关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字与权限资源关联对象列表")
|
||||
private List<Map<String, Object>> sysPermCodePermList;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 权限资源模块VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("权限资源模块VO")
|
||||
@Data
|
||||
public class SysPermModuleVo {
|
||||
|
||||
/**
|
||||
* 权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块Id")
|
||||
private Long moduleId;
|
||||
|
||||
/**
|
||||
* 权限模块名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块名称")
|
||||
private String moduleName;
|
||||
|
||||
/**
|
||||
* 上级权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "上级权限模块Id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 权限模块类型(0: 普通模块 1: Controller模块)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限模块类型")
|
||||
private Integer moduleType;
|
||||
|
||||
/**
|
||||
* 权限模块在当前层级下的顺序,由小到大。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 权限资源对象列表。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限资源对象列表")
|
||||
private List<SysPermVo> sysPermList;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 权限资源VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("权限资源VO")
|
||||
@Data
|
||||
public class SysPermVo {
|
||||
|
||||
/**
|
||||
* 权限资源Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限资源Id")
|
||||
private Long permId;
|
||||
|
||||
/**
|
||||
* 权限资源名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限资源名称")
|
||||
private String permName;
|
||||
|
||||
/**
|
||||
* shiro格式的权限字,如(upms:sysUser:add)。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字")
|
||||
private String permCode;
|
||||
|
||||
/**
|
||||
* 权限所在的权限模块Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "权限所在的权限模块Id")
|
||||
private Long moduleId;
|
||||
|
||||
/**
|
||||
* 关联的URL。
|
||||
*/
|
||||
@ApiModelProperty(value = "关联的URL")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 权限在当前模块下的顺序,由小到大。
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 模块Id的字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(value = "模块Id的字典关联数据")
|
||||
private Map<String, Object> moduleIdDictMap;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 角色VO。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("角色VO")
|
||||
@Data
|
||||
public class SysRoleVo {
|
||||
|
||||
/**
|
||||
* 角色Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色Id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 创建者Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者Id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建者显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者显示名称")
|
||||
private String createUsername;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色与菜单关联对象列表。
|
||||
*/
|
||||
@ApiModelProperty(value = "角色与菜单关联对象列表")
|
||||
private List<Map<String, Object>> sysRoleMenuList;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.orange.demo.upmsinterface.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SysUserVO对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("SysUserVO实体对象")
|
||||
@Data
|
||||
public class SysUserVo {
|
||||
|
||||
/**
|
||||
* 用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 登录用户名。
|
||||
*/
|
||||
@ApiModelProperty(value = "登录用户名")
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 用户密码。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户显示名称")
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户类型(0: 管理员 1: 系统管理用户 2: 系统业务用户)")
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 用户头像的Url。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户头像的Url")
|
||||
private String headImageUrl;
|
||||
|
||||
/**
|
||||
* 用户状态(0: 正常 1: 锁定)。
|
||||
*/
|
||||
@ApiModelProperty(value = "用户状态(0: 正常 1: 锁定)")
|
||||
private Integer userStatus;
|
||||
|
||||
/**
|
||||
* 创建用户Id。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户Id")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建用户名。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建用户名")
|
||||
private String createUsername;
|
||||
|
||||
/**
|
||||
* 创建时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间。
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 多对多用户角色数据集合。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private List<Map<String, Object>> sysUserRoleList;
|
||||
|
||||
/**
|
||||
* userType 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> userTypeDictMap;
|
||||
|
||||
/**
|
||||
* userStatus 常量字典关联数据。
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Map<String, Object> userStatusDictMap;
|
||||
}
|
||||
@@ -100,10 +100,42 @@ public class LoginController {
|
||||
*/
|
||||
@PostMapping("/doLogout")
|
||||
public ResponseResult<Void> doLogout() {
|
||||
cacheHelper.removeAllSessionCache();
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
cacheHelper.removeAllSessionCache(tokenData.getSessionId());
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 在登录之后,通过token再次获取登录信息。
|
||||
* 用于在当前浏览器登录系统后,在新tab页中可以免密登录。
|
||||
*
|
||||
* @return 应答结果对象,其中包括JWT的Token数据,以及菜单列表。
|
||||
*/
|
||||
@GetMapping("/getLoginInfo")
|
||||
public ResponseResult<JSONObject> getLoginInfo() {
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
// 这里解释一下为什么没有缓存menuList和permCodeList。
|
||||
// 1. 该操作和权限验证不同,属于低频操作。
|
||||
// 2. 第一次登录和再次获取登录信息之间,如果修改了用户的权限,那么本次获取的是最新权限。
|
||||
// 3. 上一个问题无法避免,因为即便缓存也是有过期时间的,过期之后还是要从数据库获取的。
|
||||
JSONObject jsonData = new JSONObject();
|
||||
jsonData.put("showName", tokenData.getShowName());
|
||||
jsonData.put("isAdmin", tokenData.getIsAdmin());
|
||||
List<SysMenu> menuList;
|
||||
if (tokenData.getIsAdmin()) {
|
||||
menuList = sysMenuService.getAllMenuList();
|
||||
} else {
|
||||
menuList = sysMenuService.getMenuListByUserId(tokenData.getUserId());
|
||||
List<String> permCodeList = sysPermCodeService.getPermCodeListByUserId(tokenData.getUserId());
|
||||
jsonData.put("permCodeList", permCodeList);
|
||||
// 将白名单url列表合并到当前用户的权限资源列表中,便于网关一并处理。
|
||||
Set<String> permSet = sysUserService.getSysPermSetByUserId(tokenData.getUserId());
|
||||
permSet.addAll(sysPermWhitelistService.getAllListWithField(SysPermWhitelist::getPermUrl));
|
||||
jsonData.put("permSet", permSet);
|
||||
}
|
||||
jsonData.put("menuList", menuList);
|
||||
return ResponseResult.success(jsonData);
|
||||
}
|
||||
/**
|
||||
* 用户修改自己的密码。
|
||||
*
|
||||
|
||||
@@ -10,8 +10,8 @@ import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upmsinterface.dto.SysMenuDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysMenuVo;
|
||||
import com.orange.demo.upmsservice.model.SysMenu;
|
||||
import com.orange.demo.upmsservice.service.SysPermCodeService;
|
||||
import com.orange.demo.upmsservice.service.SysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -33,8 +33,6 @@ public class SysMenuController {
|
||||
|
||||
@Autowired
|
||||
private SysMenuService sysMenuService;
|
||||
@Autowired
|
||||
private SysPermCodeService sysPermCodeService;
|
||||
|
||||
/**
|
||||
* 添加新菜单操作。
|
||||
@@ -130,9 +128,9 @@ public class SysMenuController {
|
||||
* @return 应答结果对象,包含全部菜单数据列表。
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseResult<List<SysMenuDto>> list() {
|
||||
public ResponseResult<List<SysMenuVo>> list() {
|
||||
List<SysMenu> sysMenuList = sysMenuService.getAllListByOrder("menuType", "showOrder");
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(sysMenuList, SysMenuDto.class));
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(sysMenuList, SysMenuVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +140,7 @@ public class SysMenuController {
|
||||
* @return 应答结果对象,包含菜单详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysMenuDto> view(@RequestParam Long menuId) {
|
||||
public ResponseResult<SysMenuVo> view(@RequestParam Long menuId) {
|
||||
if (MyCommonUtil.existBlankArgument(menuId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -150,8 +148,8 @@ public class SysMenuController {
|
||||
if (sysMenu == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysMenuDto sysMenuDto = MyModelUtil.copyTo(sysMenu, SysMenuDto.class);
|
||||
return ResponseResult.success(sysMenuDto);
|
||||
SysMenuVo sysMenuVo = MyModelUtil.copyTo(sysMenu, SysMenuVo.class);
|
||||
return ResponseResult.success(sysMenuVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermCodeDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysPermCodeVo;
|
||||
import com.orange.demo.upmsservice.model.SysPermCode;
|
||||
import com.orange.demo.upmsservice.service.SysPermCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -133,10 +134,10 @@ public class SysPermCodeController {
|
||||
* @return 应答结果对象,包含权限字列表。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<List<SysPermCodeDto>> list() {
|
||||
public ResponseResult<List<SysPermCodeVo>> list() {
|
||||
List<SysPermCode> sysPermCodeList =
|
||||
sysPermCodeService.getAllListByOrder("permCodeType", "showOrder");
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(sysPermCodeList, SysPermCodeDto.class));
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(sysPermCodeList, SysPermCodeVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +147,7 @@ public class SysPermCodeController {
|
||||
* @return 应答结果对象,包含权限字对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysPermCodeDto> view(@RequestParam Long permCodeId) {
|
||||
public ResponseResult<SysPermCodeVo> view(@RequestParam Long permCodeId) {
|
||||
if (MyCommonUtil.existBlankArgument(permCodeId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -155,8 +156,8 @@ public class SysPermCodeController {
|
||||
if (sysPermCode == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysPermCodeDto sysPermCodeDto = MyModelUtil.copyTo(sysPermCode, SysPermCodeDto.class);
|
||||
return ResponseResult.success(sysPermCodeDto);
|
||||
SysPermCodeVo sysPermCodeVo = MyModelUtil.copyTo(sysPermCode, SysPermCodeVo.class);
|
||||
return ResponseResult.success(sysPermCodeVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysPermVo;
|
||||
import com.orange.demo.upmsservice.model.SysPerm;
|
||||
import com.orange.demo.upmsservice.model.SysPermModule;
|
||||
import com.orange.demo.upmsservice.service.SysPermService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -83,10 +83,6 @@ public class SysPermController {
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
}
|
||||
if (result.getData() != null) {
|
||||
SysPermModule permModule = (SysPermModule) result.getData().get("permModule");
|
||||
sysPerm.setModuleId(permModule.getModuleId());
|
||||
}
|
||||
sysPermService.update(sysPerm, originalPerm);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
@@ -116,7 +112,7 @@ public class SysPermController {
|
||||
* @return 应答结果对象,包含权限资源对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysPermDto> view(@RequestParam Long permId) {
|
||||
public ResponseResult<SysPermVo> view(@RequestParam Long permId) {
|
||||
if (MyCommonUtil.existBlankArgument(permId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -124,8 +120,8 @@ public class SysPermController {
|
||||
if (perm == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysPermDto permDto = MyModelUtil.copyTo(perm, SysPermDto.class);
|
||||
return ResponseResult.success(permDto);
|
||||
SysPermVo permVo = MyModelUtil.copyTo(perm, SysPermVo.class);
|
||||
return ResponseResult.success(permVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,19 +132,19 @@ public class SysPermController {
|
||||
* @return 应答结果对象,包含权限资源列表。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysPermDto>> list(
|
||||
public ResponseResult<MyPageData<SysPermVo>> list(
|
||||
@MyRequestBody("sysPermFilter") SysPermDto sysPermDtoFiltter, @MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
SysPerm filter = MyModelUtil.copyTo(sysPermDtoFiltter, SysPerm.class);
|
||||
List<SysPerm> permList = sysPermService.getPermListWithRelation(filter);
|
||||
List<SysPermDto> permDtoList = MyModelUtil.copyCollectionTo(permList, SysPermDto.class);
|
||||
List<SysPermVo> permVoList = MyModelUtil.copyCollectionTo(permList, SysPermVo.class);
|
||||
long totalCount = 0L;
|
||||
if (permList instanceof Page) {
|
||||
totalCount = ((Page<SysPerm>) permList).getTotal();
|
||||
}
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(permDtoList, totalCount));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(permVoList, totalCount));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.orange.demo.common.core.util.MyCommonUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermModuleDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysPermModuleVo;
|
||||
import com.orange.demo.upmsservice.model.SysPerm;
|
||||
import com.orange.demo.upmsservice.model.SysPermModule;
|
||||
import com.orange.demo.upmsservice.service.SysPermModuleService;
|
||||
@@ -122,9 +123,9 @@ public class SysPermModuleController {
|
||||
* @return 应答结果对象,包含权限资源模块列表。
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseResult<List<SysPermModuleDto>> list() {
|
||||
public ResponseResult<List<SysPermModuleVo>> list() {
|
||||
List<SysPermModule> permModuleList = sysPermModuleService.getAllListByOrder("showOrder");
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(permModuleList, SysPermModuleDto.class));
|
||||
return ResponseResult.success(MyModelUtil.copyCollectionTo(permModuleList, SysPermModuleVo.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,8 @@ import com.orange.demo.common.core.util.MyPageUtil;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.upmsinterface.dto.SysRoleDto;
|
||||
import com.orange.demo.upmsinterface.dto.SysUserDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysRoleVo;
|
||||
import com.orange.demo.upmsinterface.vo.SysUserVo;
|
||||
import com.orange.demo.upmsservice.model.SysRole;
|
||||
import com.orange.demo.upmsservice.model.SysUser;
|
||||
import com.orange.demo.upmsservice.model.SysUserRole;
|
||||
@@ -137,7 +139,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含角色列表。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysRoleDto>> list(
|
||||
public ResponseResult<MyPageData<SysRoleVo>> list(
|
||||
@MyRequestBody("sysRoleFilter") SysRoleDto sysRoleDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
@@ -147,12 +149,12 @@ public class SysRoleController {
|
||||
SysRole filter = MyModelUtil.copyTo(sysRoleDtoFilter, SysRole.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysRole.class);
|
||||
List<SysRole> roleList = sysRoleService.getSysRoleList(filter, orderBy);
|
||||
List<SysRoleDto> roleDtoList = MyModelUtil.copyCollectionTo(roleList, SysRoleDto.class);
|
||||
List<SysRoleVo> roleVoList = MyModelUtil.copyCollectionTo(roleList, SysRoleVo.class);
|
||||
long totalCount = 0L;
|
||||
if (roleList instanceof Page) {
|
||||
totalCount = ((Page<SysRole>) roleList).getTotal();
|
||||
}
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleDtoList, totalCount));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(roleVoList, totalCount));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +164,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含角色详情对象。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysRoleDto> view(@RequestParam Long roleId) {
|
||||
public ResponseResult<SysRoleVo> view(@RequestParam Long roleId) {
|
||||
if (MyCommonUtil.existBlankArgument(roleId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -170,8 +172,8 @@ public class SysRoleController {
|
||||
if (sysRole == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysRoleDto sysRoleDto = MyModelUtil.copyTo(sysRole, SysRoleDto.class);
|
||||
return ResponseResult.success(sysRoleDto);
|
||||
SysRoleVo sysRoleVo = MyModelUtil.copyTo(sysRole, SysRoleVo.class);
|
||||
return ResponseResult.success(sysRoleVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,7 +187,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含用户列表数据。
|
||||
*/
|
||||
@PostMapping("/listNotInUserRole")
|
||||
public ResponseResult<MyPageData<SysUserDto>> listNotInUserRole(
|
||||
public ResponseResult<MyPageData<SysUserVo>> listNotInUserRole(
|
||||
@MyRequestBody Long roleId,
|
||||
@MyRequestBody("sysUserFilter") SysUserDto sysUserDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -200,8 +202,8 @@ public class SysRoleController {
|
||||
SysUser filter = MyModelUtil.copyTo(sysUserDtoFilter, SysUser.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> userList = sysUserService.getNotInSysUserListByRoleId(roleId, filter, orderBy);
|
||||
List<SysUserDto> userDtoList = MyModelUtil.copyCollectionTo(userList, SysUserDto.class);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userDtoList));
|
||||
List<SysUserVo> userVoList = MyModelUtil.copyCollectionTo(userList, SysUserVo.class);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userVoList));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +216,7 @@ public class SysRoleController {
|
||||
* @return 应答结果对象,包含用户列表数据。
|
||||
*/
|
||||
@PostMapping("/listUserRole")
|
||||
public ResponseResult<MyPageData<SysUserDto>> listUserRole(
|
||||
public ResponseResult<MyPageData<SysUserVo>> listUserRole(
|
||||
@MyRequestBody Long roleId,
|
||||
@MyRequestBody("sysUserFilter") SysUserDto sysUserDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@@ -229,8 +231,8 @@ public class SysRoleController {
|
||||
SysUser filter = MyModelUtil.copyTo(sysUserDtoFilter, SysUser.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> userList = sysUserService.getSysUserListByRoleId(roleId, filter, orderBy);
|
||||
List<SysUserDto> userDtoList = MyModelUtil.copyCollectionTo(userList, SysUserDto.class);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userDtoList));
|
||||
List<SysUserVo> userVoList = MyModelUtil.copyCollectionTo(userList, SysUserVo.class);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(userVoList));
|
||||
}
|
||||
|
||||
private ResponseResult<Void> doRoleUserVerify(Long roleId) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.orange.demo.upmsservice.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.upmsservice.model.*;
|
||||
import com.orange.demo.upmsservice.service.*;
|
||||
import com.orange.demo.upmsinterface.dto.*;
|
||||
import com.orange.demo.upmsinterface.vo.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.constant.*;
|
||||
@@ -34,7 +34,7 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sysUser")
|
||||
public class SysUserController extends BaseController<SysUser, SysUserDto, Long> {
|
||||
public class SysUserController extends BaseController<SysUser, SysUserVo, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
@@ -42,7 +42,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
private ApplicationConfig appConfig;
|
||||
|
||||
@Override
|
||||
protected BaseService<SysUser, SysUserDto, Long> service() {
|
||||
protected BaseService<SysUser, Long> service() {
|
||||
return sysUserService;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
SysUser sysUser = SysUser.INSTANCE.toModel(sysUserDto);
|
||||
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
||||
CallResult result = sysUserService.verifyRelatedData(sysUser, null, roleIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
@@ -97,7 +97,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
if (originalUser == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysUser sysUser = SysUser.INSTANCE.toModel(sysUserDto);
|
||||
SysUser sysUser = MyModelUtil.copyTo(sysUserDto, SysUser.class);
|
||||
CallResult result = sysUserService.verifyRelatedData(sysUser, originalUser, roleIdListString);
|
||||
if (!result.isSuccess()) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, result.getErrorMessage());
|
||||
@@ -161,25 +161,18 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysUserDto>> list(
|
||||
public ResponseResult<MyPageData<SysUserVo>> list(
|
||||
@MyRequestBody("sysUserFilter") SysUserDto sysUserDtoFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
SysUser sysUserFilter = SysUser.INSTANCE.toModel(sysUserDtoFilter);
|
||||
SysUser sysUserFilter = MyModelUtil.copyTo(sysUserDtoFilter, SysUser.class);
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUser.class);
|
||||
List<SysUser> sysUserList =
|
||||
sysUserService.getSysUserListWithRelation(sysUserFilter, orderBy);
|
||||
long totalCount = 0L;
|
||||
if (sysUserList instanceof Page) {
|
||||
totalCount = ((Page<SysUser>) sysUserList).getTotal();
|
||||
}
|
||||
// 分页连同对象数据转换copy工作,下面的方法一并完成。
|
||||
Tuple2<List<SysUserDto>, Long> responseData =
|
||||
new Tuple2<>(SysUser.INSTANCE.fromModelList(sysUserList), totalCount);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(responseData));
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(sysUserList, SysUser.INSTANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +182,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysUserDto> view(@RequestParam Long userId) {
|
||||
public ResponseResult<SysUserVo> view(@RequestParam Long userId) {
|
||||
if (MyCommonUtil.existBlankArgument(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
@@ -199,8 +192,8 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
if (sysUser == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
SysUserDto sysUserDto = SysUser.INSTANCE.fromModel(sysUser);
|
||||
return ResponseResult.success(sysUserDto);
|
||||
SysUserVo sysUserVo = SysUser.INSTANCE.fromModel(sysUser);
|
||||
return ResponseResult.success(sysUserVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,7 +250,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listByIds")
|
||||
@PostMapping("/listByIds")
|
||||
public ResponseResult<List<SysUserDto>> listByIds(
|
||||
public ResponseResult<List<SysUserVo>> listByIds(
|
||||
@RequestParam Set<Long> userIds, @RequestParam Boolean withDict) {
|
||||
return super.baseListByIds(userIds, withDict, SysUser.INSTANCE);
|
||||
}
|
||||
@@ -271,7 +264,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getById")
|
||||
@PostMapping("/getById")
|
||||
public ResponseResult<SysUserDto> getById(
|
||||
public ResponseResult<SysUserVo> getById(
|
||||
@RequestParam Long userId, @RequestParam Boolean withDict) {
|
||||
return super.baseGetById(userId, withDict, SysUser.INSTANCE);
|
||||
}
|
||||
@@ -309,30 +302,30 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
@ApiOperation(hidden = true, value = "deleteBy")
|
||||
@PostMapping("/deleteBy")
|
||||
public ResponseResult<Integer> deleteBy(@RequestBody SysUserDto filter) throws Exception {
|
||||
return super.baseDeleteBy(filter, SysUser.INSTANCE);
|
||||
return super.baseDeleteBy(MyModelUtil.copyTo(filter, SysUser.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listBy")
|
||||
@PostMapping("/listBy")
|
||||
public ResponseResult<List<SysUserDto>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<SysUserVo>> listBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListBy(queryParam, SysUser.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
|
||||
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分页和排序等。主要用于微服务间远程过程调用。
|
||||
*
|
||||
* @param queryParam 查询参数。
|
||||
* @return 应答结果对象,包含符合查询过滤条件的对象结果集。
|
||||
* @return 分页数据集合对象。如MyQueryParam参数的分页属性为空,则不会执行分页操作,只是基于MyPageData对象返回数据结果。
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "listMapBy")
|
||||
@PostMapping("/listMapBy")
|
||||
public ResponseResult<List<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<MyPageData<Map<String, Object>>> listMapBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseListMapBy(queryParam, SysUser.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -344,7 +337,7 @@ public class SysUserController extends BaseController<SysUser, SysUserDto, Long>
|
||||
*/
|
||||
@ApiOperation(hidden = true, value = "getBy")
|
||||
@PostMapping("/getBy")
|
||||
public ResponseResult<SysUserDto> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
public ResponseResult<SysUserVo> getBy(@RequestBody MyQueryParam queryParam) {
|
||||
return super.baseGetBy(queryParam, SysUser.INSTANCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,15 +23,6 @@ public interface SysPermMapper extends BaseDaoMapper<SysPerm> {
|
||||
*/
|
||||
List<SysPerm> getPermListByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 根据关联权限字主键Id,获取权限资源数据列表。
|
||||
*
|
||||
* @param permCodeId 关联权限字主键Id。
|
||||
* @param orderBy 排序字符串,ORDER BY从句的参数。
|
||||
* @return 从表数据列表。
|
||||
*/
|
||||
List<SysPerm> getPermListByPermCodeId(@Param("permCodeId") Long permCodeId, @Param("orderBy") String orderBy);
|
||||
|
||||
/**
|
||||
* 查询权限资源地址的用户列表。同时返回详细的分配路径。
|
||||
*
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.orange.demo.upmsservice.dao;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.upmsservice.model.SysUserRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与角色关联关系数据访问操作接口。
|
||||
*
|
||||
@@ -12,11 +10,4 @@ import java.util.List;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUserRoleMapper extends BaseDaoMapper<SysUserRole> {
|
||||
|
||||
/**
|
||||
* 批量插入用户角色信息,如果用户角色已经存在,则不会重复插入。
|
||||
*
|
||||
* @param userRoleList 待插入的角色用户列表。
|
||||
*/
|
||||
void addUserRoleList(List<SysUserRole> userRoleList);
|
||||
}
|
||||
|
||||
@@ -17,18 +17,14 @@
|
||||
SELECT
|
||||
DISTINCT m.*
|
||||
FROM
|
||||
zz_sys_user u,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu m
|
||||
<where>
|
||||
AND u.user_id = #{userId}
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND u.user_id = ur.user_id
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = m.menu_id
|
||||
AND m.menu_type <= ${@com.orange.demo.upmsinterface.constant.SysMenuType@TYPE_MENU}
|
||||
AND m.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
ORDER BY m.show_order
|
||||
</select>
|
||||
|
||||
@@ -16,19 +16,15 @@
|
||||
SELECT
|
||||
DISTINCT pc.perm_code
|
||||
FROM
|
||||
zz_sys_user u,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code pc
|
||||
<where>
|
||||
AND u.user_id = #{userId}
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND u.user_id = ur.user_id
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pc.perm_code_id
|
||||
AND pc.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -15,40 +15,20 @@
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
zz_sys_user u,
|
||||
zz_sys_user_role ur,
|
||||
zz_sys_role_menu rm,
|
||||
zz_sys_menu_perm_code mpc,
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm p
|
||||
<where>
|
||||
AND u.user_id = #{userId}
|
||||
AND u.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
AND u.user_id = ur.user_id
|
||||
AND ur.user_id = #{userId}
|
||||
AND ur.role_id = rm.role_id
|
||||
AND rm.menu_id = mpc.menu_id
|
||||
AND mpc.perm_code_id = pcp.perm_code_id
|
||||
AND pcp.perm_id = p.perm_id
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPermListByPermCodeId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
zz_sys_perm_code_perm pcp,
|
||||
zz_sys_perm p
|
||||
<where>
|
||||
AND pcp.perm_code_id = #{permCodeId}
|
||||
AND pcp.perm_id = p.perm_id
|
||||
AND p.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</where>
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 以下查询仅用于权限分配的问题定位,由于关联表较多,可能会给系统运行带来性能影响 -->
|
||||
<select id="getSysUserListWithDetail" resultType="map">
|
||||
SELECT
|
||||
|
||||
@@ -11,16 +11,20 @@
|
||||
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="filterRef">
|
||||
<if test="sysRoleFilter != null">
|
||||
<if test="sysRoleFilter.roleName != null and sysRoleFilter.roleName != ''">
|
||||
<bind name= "safeRoleName" value= "'%' + sysRoleFilter.roleName + '%'"/>
|
||||
AND role_name LIKE #{safeRoleName}
|
||||
</if>
|
||||
</if>
|
||||
AND deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getSysRoleList" resultMap="BaseResultMap" parameterType="com.orange.demo.upmsservice.model.SysRole">
|
||||
SELECT * FROM zz_sys_role
|
||||
<where>
|
||||
<if test="sysRoleFilter != null">
|
||||
<if test="sysRoleFilter.roleName != null and sysRoleFilter.roleName != ''">
|
||||
<bind name= "safeRoleName" value= "'%' + sysRoleFilter.roleName + '%'"/>
|
||||
AND role_name LIKE #{safeRoleName}
|
||||
</if>
|
||||
</if>
|
||||
AND deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
<include refid="com.orange.demo.upmsservice.dao.SysUserMapper.inputFilterRef"/>
|
||||
AND zz_sys_user.deleted_flag = ${@com.orange.demo.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
|
||||
<sql id="inputFilterRef">
|
||||
<if test="sysUserFilter != null">
|
||||
<if test="sysUserFilter.loginName != null and sysUserFilter.loginName != ''">
|
||||
<bind name = "safeLoginName" value = "'%' + sysUserFilter.loginName + '%'" />
|
||||
|
||||
@@ -5,11 +5,4 @@
|
||||
<id column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<id column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="addUserRoleList">
|
||||
REPLACE INTO zz_sys_user_role(user_id, role_id) VALUES
|
||||
<foreach collection="list" index="index" item="item" separator=",">
|
||||
(#{item.userId}, #{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.upmsinterface.constant.SysMenuType;
|
||||
import com.orange.demo.upmsinterface.dto.SysMenuDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysMenuVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
@@ -96,25 +96,25 @@ public class SysMenu {
|
||||
private List<SysMenuPermCode> sysMenuPermCodeList;
|
||||
|
||||
@Mapper
|
||||
public interface SysMenuModelMapper extends BaseModelMapper<SysMenuDto, SysMenu> {
|
||||
public interface SysMenuModelMapper extends BaseModelMapper<SysMenuVo, SysMenu> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换VO对象到实体对象。
|
||||
*
|
||||
* @param sysMenuDto 域对象。
|
||||
* @param sysMenuVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "sysMenuPermCodeList", expression = "java(mapToBean(sysMenuDto.getSysMenuPermCodeList(), com.orange.demo.upmsservice.model.SysMenuPermCode.class))")
|
||||
@Mapping(target = "sysMenuPermCodeList", expression = "java(mapToBean(sysMenuVo.getSysMenuPermCodeList(), com.orange.demo.upmsservice.model.SysMenuPermCode.class))")
|
||||
@Override
|
||||
SysMenu toModel(SysMenuDto sysMenuDto);
|
||||
SysMenu toModel(SysMenuVo sysMenuVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param sysMenu 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "sysMenuPermCodeList", expression = "java(beanToMap(sysMenu.getSysMenuPermCodeList(), false))")
|
||||
@Override
|
||||
SysMenuDto fromModel(SysMenu sysMenu);
|
||||
SysMenuVo fromModel(SysMenu sysMenu);
|
||||
}
|
||||
public static final SysMenuModelMapper INSTANCE = Mappers.getMapper(SysMenu.SysMenuModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.upmsinterface.constant.SysPermCodeType;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermCodeDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysPermCodeVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
@@ -92,25 +92,25 @@ public class SysPermCode {
|
||||
private List<SysPermCodePerm> sysPermCodePermList;
|
||||
|
||||
@Mapper
|
||||
public interface SysPermCodeModelMapper extends BaseModelMapper<SysPermCodeDto, SysPermCode> {
|
||||
public interface SysPermCodeModelMapper extends BaseModelMapper<SysPermCodeVo, SysPermCode> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换VO对象到实体对象。
|
||||
*
|
||||
* @param sysPermCodeDto 域对象。
|
||||
* @param sysPermCodeVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "sysPermCodePermList", expression = "java(mapToBean(sysPermCodeDto.getSysPermCodePermList(), com.orange.demo.upmsservice.model.SysPermCodePerm.class))")
|
||||
@Mapping(target = "sysPermCodePermList", expression = "java(mapToBean(sysPermCodeVo.getSysPermCodePermList(), com.orange.demo.upmsservice.model.SysPermCodePerm.class))")
|
||||
@Override
|
||||
SysPermCode toModel(SysPermCodeDto sysPermCodeDto);
|
||||
SysPermCode toModel(SysPermCodeVo sysPermCodeVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param sysPermCode 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "sysPermCodePermList", expression = "java(beanToMap(sysPermCode.getSysPermCodePermList(), false))")
|
||||
@Override
|
||||
SysPermCodeDto fromModel(SysPermCode sysPermCode);
|
||||
SysPermCodeVo fromModel(SysPermCode sysPermCode);
|
||||
}
|
||||
public static final SysPermCodeModelMapper INSTANCE = Mappers.getMapper(SysPermCode.SysPermCodeModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.upmsinterface.dto.SysRoleDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysRoleVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
@@ -79,32 +79,26 @@ public class SysRole {
|
||||
@Transient
|
||||
private List<SysRoleMenu> sysRoleMenuList;
|
||||
|
||||
@Transient
|
||||
private String createTimeStart;
|
||||
|
||||
@Transient
|
||||
private String createTimeEnd;
|
||||
|
||||
@Mapper
|
||||
public interface SysRoleModelMapper extends BaseModelMapper<SysRoleDto, SysRole> {
|
||||
public interface SysRoleModelMapper extends BaseModelMapper<SysRoleVo, SysRole> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换VO对象到实体对象。
|
||||
*
|
||||
* @param sysRoleDto 域对象。
|
||||
* @param sysRoleVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "sysRoleMenuList", expression = "java(mapToBean(sysRoleDto.getSysRoleMenuList(), com.orange.demo.upmsservice.model.SysRoleMenu.class))")
|
||||
@Mapping(target = "sysRoleMenuList", expression = "java(mapToBean(sysRoleVo.getSysRoleMenuList(), com.orange.demo.upmsservice.model.SysRoleMenu.class))")
|
||||
@Override
|
||||
SysRole toModel(SysRoleDto sysRoleDto);
|
||||
SysRole toModel(SysRoleVo sysRoleVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param sysRole 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "sysRoleMenuList", expression = "java(beanToMap(sysRole.getSysRoleMenuList(), false))")
|
||||
@Override
|
||||
SysRoleDto fromModel(SysRole sysRole);
|
||||
SysRoleVo fromModel(SysRole sysRole);
|
||||
}
|
||||
public static final SysRoleModelMapper INSTANCE = Mappers.getMapper(SysRole.SysRoleModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.orange.demo.common.core.annotation.RelationManyToMany;
|
||||
import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.orange.demo.common.core.validator.ConstDictRef;
|
||||
import com.orange.demo.upmsinterface.dto.SysUserDto;
|
||||
import com.orange.demo.upmsinterface.vo.SysUserVo;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -146,25 +146,25 @@ public class SysUser {
|
||||
private Map<String, Object> userStatusDictMap;
|
||||
|
||||
@Mapper
|
||||
public interface SysUserModelMapper extends BaseModelMapper<SysUserDto, SysUser> {
|
||||
public interface SysUserModelMapper extends BaseModelMapper<SysUserVo, SysUser> {
|
||||
/**
|
||||
* 转换Dto对象到实体对象。
|
||||
* 转换Vo对象到实体对象。
|
||||
*
|
||||
* @param sysUserDto 域对象。
|
||||
* @param sysUserVo 域对象。
|
||||
* @return 实体对象。
|
||||
*/
|
||||
@Mapping(target = "sysUserRoleList", expression = "java(mapToBean(sysUserDto.getSysUserRoleList(), com.orange.demo.upmsservice.model.SysUserRole.class))")
|
||||
@Mapping(target = "sysUserRoleList", expression = "java(mapToBean(sysUserVo.getSysUserRoleList(), com.orange.demo.upmsservice.model.SysUserRole.class))")
|
||||
@Override
|
||||
SysUser toModel(SysUserDto sysUserDto);
|
||||
SysUser toModel(SysUserVo sysUserVo);
|
||||
/**
|
||||
* 转换实体对象到Dto对象。
|
||||
* 转换实体对象到VO对象。
|
||||
*
|
||||
* @param sysUser 实体对象。
|
||||
* @return 域对象。
|
||||
*/
|
||||
@Mapping(target = "sysUserRoleList", expression = "java(beanToMap(sysUser.getSysUserRoleList(), false))")
|
||||
@Override
|
||||
SysUserDto fromModel(SysUser sysUser);
|
||||
SysUserVo fromModel(SysUser sysUser);
|
||||
}
|
||||
public static final SysUserModelMapper INSTANCE = Mappers.getMapper(SysUserModelMapper.class);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.upmsinterface.constant.SysMenuType;
|
||||
import com.orange.demo.upmsinterface.dto.SysMenuDto;
|
||||
import com.orange.demo.upmsservice.dao.SysMenuMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysMenuPermCodeMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysRoleMenuMapper;
|
||||
@@ -30,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuService extends BaseService<SysMenu, SysMenuDto, Long> {
|
||||
public class SysMenuService extends BaseService<SysMenu, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysMenuMapper sysMenuMapper;
|
||||
@@ -179,20 +178,19 @@ public class SysMenuService extends BaseService<SysMenu, SysMenuDto, Long> {
|
||||
* @return 验证结果。
|
||||
*/
|
||||
public CallResult verifyRelatedData(SysMenu sysMenu, SysMenu originalSysMenu, String permCodeIdListString) {
|
||||
JSONObject jsonObject = null;
|
||||
if (this.needToVerify(sysMenu, originalSysMenu, SysMenu::getParentId)) {
|
||||
// menu、ui fragment和button类型的menu不能没有parentId
|
||||
if (sysMenu.getParentId() == null) {
|
||||
if (sysMenu.getMenuType() != SysMenuType.TYPE_DIRECTORY) {
|
||||
return CallResult.error("数据验证失败,当前类型菜单项的上级菜单不能为空!");
|
||||
}
|
||||
} else {
|
||||
String errorMessage = checkErrorOfNonDirectoryMenu(sysMenu);
|
||||
if (errorMessage != null) {
|
||||
return CallResult.error(errorMessage);
|
||||
}
|
||||
// menu、ui fragment和button类型的menu不能没有parentId
|
||||
if (sysMenu.getParentId() == null) {
|
||||
if (sysMenu.getMenuType() != SysMenuType.TYPE_DIRECTORY) {
|
||||
return CallResult.error("数据验证失败,当前类型菜单项的上级菜单不能为空!");
|
||||
}
|
||||
}
|
||||
if (this.needToVerify(sysMenu, originalSysMenu, SysMenu::getParentId)) {
|
||||
String errorMessage = checkErrorOfNonDirectoryMenu(sysMenu);
|
||||
if (errorMessage != null) {
|
||||
return CallResult.error(errorMessage);
|
||||
}
|
||||
}
|
||||
JSONObject jsonObject = null;
|
||||
if (StringUtils.isNotBlank(permCodeIdListString)) {
|
||||
Set<Long> permCodeIdSet = Arrays.stream(
|
||||
permCodeIdListString.split(",")).map(Long::valueOf).collect(Collectors.toSet());
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermCodeDto;
|
||||
import com.orange.demo.upmsservice.dao.SysMenuPermCodeMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysPermCodeMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysPermCodePermMapper;
|
||||
@@ -28,7 +27,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysPermCodeService extends BaseService<SysPermCode, SysPermCodeDto, Long> {
|
||||
public class SysPermCodeService extends BaseService<SysPermCode, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysPermCodeMapper sysPermCodeMapper;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermModuleDto;
|
||||
import com.orange.demo.upmsservice.dao.SysPermModuleMapper;
|
||||
import com.orange.demo.upmsservice.model.SysPerm;
|
||||
import com.orange.demo.upmsservice.model.SysPermModule;
|
||||
@@ -22,7 +21,7 @@ import java.util.List;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysPermModuleService extends BaseService<SysPermModule, SysPermModuleDto, Long> {
|
||||
public class SysPermModuleService extends BaseService<SysPermModule, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysPermModuleMapper sysPermModuleMapper;
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package com.orange.demo.upmsservice.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orange.demo.common.core.base.service.BaseService;
|
||||
import com.orange.demo.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.upmsinterface.dto.SysPermDto;
|
||||
import com.orange.demo.upmsservice.dao.SysPermCodePermMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysPermMapper;
|
||||
import com.orange.demo.upmsservice.model.SysPerm;
|
||||
@@ -30,7 +28,7 @@ import java.util.Map;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
public class SysPermService extends BaseService<SysPerm, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysPermMapper sysPermMapper;
|
||||
@@ -123,17 +121,6 @@ public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
return permList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取与指定权限字关联的权限资源列表。
|
||||
*
|
||||
* @param permCodeId 关联的权限字主键Id。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 与指定权限字Id关联的权限资源列表。
|
||||
*/
|
||||
public List<SysPerm> getPermListByPermCodeId(Long permCodeId, String orderBy) {
|
||||
return sysPermMapper.getPermListByPermCodeId(permCodeId, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取与指定用户关联的权限资源列表。
|
||||
*
|
||||
@@ -152,16 +139,13 @@ public class SysPermService extends BaseService<SysPerm, SysPermDto, Long> {
|
||||
* @return 验证结果。
|
||||
*/
|
||||
public CallResult verifyRelatedData(SysPerm sysPerm, SysPerm originalSysPerm) {
|
||||
JSONObject jsonObject = null;
|
||||
if (this.needToVerify(sysPerm, originalSysPerm, SysPerm::getModuleId)) {
|
||||
SysPermModule permModule = sysPermModuleService.getById(sysPerm.getModuleId());
|
||||
if (permModule == null) {
|
||||
return CallResult.error("数据验证失败,关联的权限模块Id并不存在,请刷新后重试!");
|
||||
}
|
||||
jsonObject = new JSONObject();
|
||||
jsonObject.put("permModule", permModule);
|
||||
}
|
||||
return CallResult.ok(jsonObject);
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysPermWhitelistService extends BaseService<SysPermWhitelist, SysPermWhitelist, String> {
|
||||
public class SysPermWhitelistService extends BaseService<SysPermWhitelist, String> {
|
||||
|
||||
@Autowired
|
||||
private SysPermWhitelistMapper sysPermWhitelistMapper;
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orange.demo.common.core.object.TokenData;
|
||||
import com.orange.demo.common.core.object.CallResult;
|
||||
import com.orange.demo.upmsinterface.dto.SysRoleDto;
|
||||
import com.orange.demo.upmsservice.dao.SysRoleMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysRoleMenuMapper;
|
||||
import com.orange.demo.upmsservice.dao.SysUserRoleMapper;
|
||||
@@ -15,7 +14,6 @@ import com.orange.demo.upmsservice.model.SysRole;
|
||||
import com.orange.demo.upmsservice.model.SysRoleMenu;
|
||||
import com.orange.demo.upmsservice.model.SysUserRole;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -30,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleService extends BaseService<SysRole, SysRoleDto, Long> {
|
||||
public class SysRoleService extends BaseService<SysRole, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper sysRoleMapper;
|
||||
@@ -94,11 +92,11 @@ public class SysRoleService extends BaseService<SysRole, SysRoleDto, Long> {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(SysRole role, SysRole originalRole, Set<Long> menuIdSet) {
|
||||
SysRole updateRole = new SysRole();
|
||||
BeanUtils.copyProperties(role, updateRole, "createUserId", "createUsername", "createTime");
|
||||
updateRole.setUpdateTime(new Date());
|
||||
updateRole.setDeletedFlag(GlobalDeletedFlag.NORMAL);
|
||||
if (sysRoleMapper.updateByPrimaryKeySelective(updateRole) != 1) {
|
||||
role.setCreateUserId(originalRole.getCreateUserId());
|
||||
role.setCreateTime(originalRole.getCreateTime());
|
||||
role.setUpdateTime(new Date());
|
||||
role.setDeletedFlag(GlobalDeletedFlag.NORMAL);
|
||||
if (sysRoleMapper.updateByPrimaryKey(role) != 1) {
|
||||
return false;
|
||||
}
|
||||
SysRoleMenu deletedRoleMenu = new SysRoleMenu();
|
||||
@@ -158,7 +156,7 @@ public class SysRoleService extends BaseService<SysRole, SysRoleDto, Long> {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addUserRoleList(List<SysUserRole> userRoleList) {
|
||||
sysUserRoleMapper.addUserRoleList(userRoleList);
|
||||
sysUserRoleMapper.insertList(userRoleList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.orange.demo.upmsservice.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orange.demo.upmsservice.dao.*;
|
||||
import com.orange.demo.upmsservice.model.*;
|
||||
import com.orange.demo.upmsinterface.dto.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.*;
|
||||
import com.orange.demo.common.core.constant.GlobalDeletedFlag;
|
||||
@@ -29,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysUserService extends BaseService<SysUser, SysUserDto, Long> {
|
||||
public class SysUserService extends BaseService<SysUser, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@@ -146,8 +145,9 @@ public class SysUserService extends BaseService<SysUser, SysUserDto, Long> {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changePassword(Long userId, String newPass) {
|
||||
Example e = new Example(SysUser.class);
|
||||
e.createCriteria().andEqualTo(super.idFieldName, userId);
|
||||
e.createCriteria().andEqualTo(super.deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
|
||||
e.createCriteria()
|
||||
.andEqualTo(super.idFieldName, userId)
|
||||
.andEqualTo(super.deletedFlagFieldName, GlobalDeletedFlag.NORMAL);
|
||||
SysUser updatedUser = new SysUser();
|
||||
updatedUser.setPassword(passwordEncoder.encode(newPass));
|
||||
return sysUserMapper.updateByExampleSelective(updatedUser, e) == 1;
|
||||
|
||||
Reference in New Issue
Block a user