commit:权限模块新增分配详情功能

This commit is contained in:
Jerry
2020-11-21 11:33:37 +08:00
parent 5cdf9b7115
commit 512b9be702
401 changed files with 5651 additions and 1328 deletions

View File

@@ -1,11 +1,10 @@
package com.orange.demo.statsinterface.client;
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
import com.orange.demo.common.core.config.FeignConfig;
import com.orange.demo.common.core.base.client.BaseClient;
import com.orange.demo.common.core.constant.ErrorCodeEnum;
import com.orange.demo.common.core.object.*;
import com.orange.demo.statsinterface.dto.CourseTransStatsDto;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
@@ -71,6 +70,26 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
@PostMapping("/courseTransStats/existId")
ResponseResult<Boolean> existId(@RequestParam("statsId") Long statsId);
/**
* 删除主键Id关联的对象。
*
* @param statsId 主键Id。
* @return 应答结果对象。
*/
@Override
@PostMapping("/courseTransStats/delete")
ResponseResult<Void> delete(@RequestParam("statsId") Long statsId);
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 应答结果对象,包含删除数量。
*/
@Override
@PostMapping("/courseTransStats/deleteBy")
ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter);
/**
* 获取远程主对象中符合查询条件的数据列表。
*
@@ -124,54 +143,8 @@ public interface CourseTransStatsClient extends BaseClient<CourseTransStatsDto,
@Component("StatsCourseTransStatsClientFallbackFactory")
@Slf4j
class CourseTransStatsClientFallbackFactory implements FallbackFactory<CourseTransStatsClient>, CourseTransStatsClient {
@Override
public ResponseResult<List<CourseTransStatsDto>> listByIds(
Set<Long> statsIds, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<CourseTransStatsDto> getById(
Long statsId, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existIds(Set<Long> statsIds) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existId(Long statsId) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<CourseTransStatsDto>> listBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<CourseTransStatsDto> getBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
class CourseTransStatsClientFallbackFactory
extends BaseFallbackFactory<CourseTransStatsDto, Long, CourseTransStatsClient> implements CourseTransStatsClient {
@Override
public CourseTransStatsClient create(Throwable throwable) {

View File

@@ -1,11 +1,10 @@
package com.orange.demo.statsinterface.client;
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
import com.orange.demo.common.core.config.FeignConfig;
import com.orange.demo.common.core.base.client.BaseClient;
import com.orange.demo.common.core.constant.ErrorCodeEnum;
import com.orange.demo.common.core.object.*;
import com.orange.demo.statsinterface.dto.StudentActionStatsDto;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
@@ -71,6 +70,26 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
@PostMapping("/studentActionStats/existId")
ResponseResult<Boolean> existId(@RequestParam("statsId") Long statsId);
/**
* 删除主键Id关联的对象。
*
* @param statsId 主键Id。
* @return 应答结果对象。
*/
@Override
@PostMapping("/studentActionStats/delete")
ResponseResult<Void> delete(@RequestParam("statsId") Long statsId);
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 应答结果对象,包含删除数量。
*/
@Override
@PostMapping("/studentActionStats/deleteBy")
ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter);
/**
* 获取远程主对象中符合查询条件的数据列表。
*
@@ -124,54 +143,8 @@ public interface StudentActionStatsClient extends BaseClient<StudentActionStatsD
@Component("StatsStudentActionStatsClientFallbackFactory")
@Slf4j
class StudentActionStatsClientFallbackFactory implements FallbackFactory<StudentActionStatsClient>, StudentActionStatsClient {
@Override
public ResponseResult<List<StudentActionStatsDto>> listByIds(
Set<Long> statsIds, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<StudentActionStatsDto> getById(
Long statsId, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existIds(Set<Long> statsIds) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existId(Long statsId) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<StudentActionStatsDto>> listBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<StudentActionStatsDto> getBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
class StudentActionStatsClientFallbackFactory
extends BaseFallbackFactory<StudentActionStatsDto, Long, StudentActionStatsClient> implements StudentActionStatsClient {
@Override
public StudentActionStatsClient create(Throwable throwable) {

View File

@@ -1,11 +1,10 @@
package com.orange.demo.statsinterface.client;
import com.orange.demo.common.core.base.client.BaseFallbackFactory;
import com.orange.demo.common.core.config.FeignConfig;
import com.orange.demo.common.core.base.client.BaseClient;
import com.orange.demo.common.core.constant.ErrorCodeEnum;
import com.orange.demo.common.core.object.*;
import com.orange.demo.statsinterface.dto.StudentActionTransDto;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
@@ -71,6 +70,26 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
@PostMapping("/studentActionTrans/existId")
ResponseResult<Boolean> existId(@RequestParam("transId") Long transId);
/**
* 删除主键Id关联的对象。
*
* @param transId 主键Id。
* @return 应答结果对象。
*/
@Override
@PostMapping("/studentActionTrans/delete")
ResponseResult<Void> delete(@RequestParam("transId") Long transId);
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 应答结果对象,包含删除数量。
*/
@Override
@PostMapping("/studentActionTrans/deleteBy")
ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter);
/**
* 获取远程主对象中符合查询条件的数据列表。
*
@@ -124,54 +143,8 @@ public interface StudentActionTransClient extends BaseClient<StudentActionTransD
@Component("StatsStudentActionTransClientFallbackFactory")
@Slf4j
class StudentActionTransClientFallbackFactory implements FallbackFactory<StudentActionTransClient>, StudentActionTransClient {
@Override
public ResponseResult<List<StudentActionTransDto>> listByIds(
Set<Long> transIds, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<StudentActionTransDto> getById(
Long transId, Boolean withDict) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existIds(Set<Long> transIds) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Boolean> existId(Long transId) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<StudentActionTransDto>> listBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<StudentActionTransDto> getBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> listMapBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<Integer> countBy(MyQueryParam queryParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
@Override
public ResponseResult<List<Map<String, Object>>> aggregateBy(MyAggregationParam aggregationParam) {
return ResponseResult.error(ErrorCodeEnum.RPC_DATA_ACCESS_FAILED);
}
class StudentActionTransClientFallbackFactory
extends BaseFallbackFactory<StudentActionTransDto, Long, StudentActionTransClient> implements StudentActionTransClient {
@Override
public StudentActionTransClient create(Throwable throwable) {

View File

@@ -81,7 +81,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
@PostMapping("/listWithGroup")
public ResponseResult<MyPageData<CourseTransStatsDto>> listWithGroup(
@MyRequestBody("courseTransStatsFilter") CourseTransStatsDto courseTransStatsDtoFilter,
@MyRequestBody MyGroupParam groupParam,
@MyRequestBody(required = true) MyGroupParam groupParam,
@MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) {
String orderBy = MyOrderParam.buildOrderBy(orderParam, CourseTransStats.class);
@@ -173,6 +173,18 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
return super.baseExistId(statsId);
}
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 删除数量。
*/
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody CourseTransStatsDto filter) throws Exception {
return super.baseDeleteBy(filter, CourseTransStats.INSTANCE);
}
/**
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
*

View File

@@ -81,7 +81,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
@PostMapping("/listWithGroup")
public ResponseResult<MyPageData<StudentActionStatsDto>> listWithGroup(
@MyRequestBody("studentActionStatsFilter") StudentActionStatsDto studentActionStatsDtoFilter,
@MyRequestBody MyGroupParam groupParam,
@MyRequestBody(required = true) MyGroupParam groupParam,
@MyRequestBody MyOrderParam orderParam,
@MyRequestBody MyPageParam pageParam) {
String orderBy = MyOrderParam.buildOrderBy(orderParam, StudentActionStats.class);
@@ -173,6 +173,18 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
return super.baseExistId(statsId);
}
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 删除数量。
*/
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionStatsDto filter) throws Exception {
return super.baseDeleteBy(filter, StudentActionStats.INSTANCE);
}
/**
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
*

View File

@@ -56,14 +56,14 @@ public class StudentActionTransController extends BaseController<StudentActionTr
public ResponseResult<Long> add(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
if (errorMessage != null) {
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
}
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
// 验证远程服务关联Id的数据合法性
CallResult remoteCallResult = studentActionTransService.verifyRemoteRelatedData(studentActionTrans, null);
if (!remoteCallResult.isSuccess()) {
errorMessage = remoteCallResult.getErrorMessage();
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
}
studentActionTrans = studentActionTransService.saveNew(studentActionTrans);
return ResponseResult.success(studentActionTrans.getTransId());
@@ -82,7 +82,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
public ResponseResult<Void> update(@MyRequestBody("studentActionTrans") StudentActionTransDto studentActionTransDto) {
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);
if (errorMessage != null) {
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
}
StudentActionTrans studentActionTrans = StudentActionTrans.INSTANCE.toModel(studentActionTransDto);
StudentActionTrans originalStudentActionTrans = studentActionTransService.getById(studentActionTrans.getTransId());
@@ -95,7 +95,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
CallResult remoteCallResult = studentActionTransService.verifyRemoteRelatedData(studentActionTrans, originalStudentActionTrans);
if (!remoteCallResult.isSuccess()) {
errorMessage = remoteCallResult.getErrorMessage();
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATAED_FAILED, errorMessage);
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
}
if (!studentActionTransService.update(studentActionTrans, originalStudentActionTrans)) {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
@@ -118,7 +118,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
// 验证关联Id的数据合法性
StudentActionTrans originalStudentActionTrans = studentActionTransService.getById(transId);
if (originalStudentActionTrans == null) {
//NOTE: 修改下面方括号中的话述
// NOTE: 修改下面方括号中的话述
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
}
@@ -231,6 +231,18 @@ public class StudentActionTransController extends BaseController<StudentActionTr
return super.baseExistId(transId);
}
/**
* 删除符合过滤条件的数据。
*
* @param filter 过滤对象。
* @return 删除数量。
*/
@ApiOperation(hidden = true, value = "deleteBy")
@PostMapping("/deleteBy")
public ResponseResult<Integer> deleteBy(@RequestBody StudentActionTransDto filter) throws Exception {
return super.baseDeleteBy(filter, StudentActionTrans.INSTANCE);
}
/**
* 复杂的查询调用,包括(in list)过滤,对象条件过滤,分组和排序等。主要用于微服务间远程过程调用。
*

View File

@@ -16,7 +16,6 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />