|
@@ -3,15 +3,12 @@ package com.qmth.distributed.print.api;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
-import com.qmth.distributed.print.business.service.TeachCourseService;
|
|
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
import com.qmth.teachcloud.common.bean.params.BasicCourseParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicCourseParams;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
-import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
|
|
|
|
-import com.qmth.teachcloud.common.enums.log.LevelEnum;
|
|
|
|
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
|
|
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
@@ -57,7 +54,7 @@ public class BasicCourseController {
|
|
@ApiOperation(value = "模糊查询")
|
|
@ApiOperation(value = "模糊查询")
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
public Result query(@RequestParam(value = "param", required = false) String param, @RequestParam(value = "printPlanId", required = false) List<String> printPlanId,
|
|
public Result query(@RequestParam(value = "param", required = false) String param, @RequestParam(value = "printPlanId", required = false) List<String> printPlanId,
|
|
- @RequestParam(value = "teachingRoomId", required = false) Long teachingRoomId) {
|
|
|
|
|
|
+ @RequestParam(value = "teachingRoomId", required = false) Long teachingRoomId) {
|
|
if (Objects.isNull(printPlanId)) {
|
|
if (Objects.isNull(printPlanId)) {
|
|
printPlanId = new ArrayList<>();
|
|
printPlanId = new ArrayList<>();
|
|
}
|
|
}
|
|
@@ -68,7 +65,7 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "删除")
|
|
@ApiOperation(value = "删除")
|
|
@RequestMapping(value = "/remove", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/remove", method = RequestMethod.POST)
|
|
- @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.DELETE)
|
|
|
|
|
|
+ @OperationLogDetail(operationType = OperationTypeEnum.DELETE)
|
|
public Result remove(@RequestBody BasicCourse course) {
|
|
public Result remove(@RequestBody BasicCourse course) {
|
|
boolean isSuccess = printCommonService.remove(course.getId());
|
|
boolean isSuccess = printCommonService.remove(course.getId());
|
|
return ResultUtil.ok(isSuccess);
|
|
return ResultUtil.ok(isSuccess);
|
|
@@ -76,11 +73,11 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "课程管理-查询")
|
|
@ApiOperation(value = "课程管理-查询")
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = Result.class) })
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
public Result findBasicCourseList(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName,
|
|
public Result findBasicCourseList(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName,
|
|
- @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime, @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime,
|
|
|
|
- @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
- @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
|
|
|
+ @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime, @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime,
|
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(basicCourseService.basicCoursePage(SystemConstant.convertIdToLong(belongOrgId), courseName,
|
|
return ResultUtil.ok(basicCourseService.basicCoursePage(SystemConstant.convertIdToLong(belongOrgId), courseName,
|
|
SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime),
|
|
SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime),
|
|
pageNumber, pageSize));
|
|
pageNumber, pageSize));
|
|
@@ -88,8 +85,8 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "课程管理-新增/编辑")
|
|
@ApiOperation(value = "课程管理-新增/编辑")
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "更新成功", response = EditResult.class) })
|
|
|
|
- @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = EditResult.class)})
|
|
|
|
+ @OperationLogDetail(operationType = OperationTypeEnum.SAVE)
|
|
@Transactional
|
|
@Transactional
|
|
public Result saveBasicCourse(@Valid @RequestBody BasicCourseParams basicCourseParams, BindingResult bindingResult) {
|
|
public Result saveBasicCourse(@Valid @RequestBody BasicCourseParams basicCourseParams, BindingResult bindingResult) {
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
@@ -105,21 +102,21 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "课程管理-批量删除")
|
|
@ApiOperation(value = "课程管理-批量删除")
|
|
@RequestMapping(value = "/delete_batch", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/delete_batch", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "删除成功", response = EditResult.class) })
|
|
|
|
- @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.DELETE)
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "删除成功", response = EditResult.class)})
|
|
|
|
+ @OperationLogDetail(operationType = OperationTypeEnum.DELETE)
|
|
public Result enableBasicCourse(@ApiParam(value = "选择的要删除的课程id集合", required = true) @RequestParam List<Long> idList) {
|
|
public Result enableBasicCourse(@ApiParam(value = "选择的要删除的课程id集合", required = true) @RequestParam List<Long> idList) {
|
|
return ResultUtil.ok(basicCourseService.removeBasicCourseBatch(idList));
|
|
return ResultUtil.ok(basicCourseService.removeBasicCourseBatch(idList));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "课程管理-根据查询条件批量删除")
|
|
@ApiOperation(value = "课程管理-根据查询条件批量删除")
|
|
@RequestMapping(value = "/delete_by_query", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/delete_by_query", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "删除成功", response = EditResult.class) })
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "删除成功", response = EditResult.class)})
|
|
@OperationLogDetail(detail =
|
|
@OperationLogDetail(detail =
|
|
"根据查询条件[所属机构id[{{belongOrgId}}],课程名称(模糊查询)[{{courseName}}],创建时间(起始位置)[{{startCreateTime}}],"
|
|
"根据查询条件[所属机构id[{{belongOrgId}}],课程名称(模糊查询)[{{courseName}}],创建时间(起始位置)[{{startCreateTime}}],"
|
|
- + "创建时间(终止位置)[{{endCreateTime}}],状态[{{enable}}],启用&禁用操作[{{enableOperate}}]]批量启用/禁用课程", level = LevelEnum.TERTIARY, operationType = OperationTypeEnum.EDIT, customizedOperationType = CustomizedOperationTypeEnum.DELETE)
|
|
|
|
|
|
+ + "创建时间(终止位置)[{{endCreateTime}}],状态[{{enable}}],启用&禁用操作[{{enableOperate}}]]批量启用/禁用课程", operationType = OperationTypeEnum.DELETE)
|
|
public Result enableBasicCourseByQuery(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId,
|
|
public Result enableBasicCourseByQuery(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId,
|
|
- @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName, @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime,
|
|
|
|
- @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime) {
|
|
|
|
|
|
+ @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName, @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime,
|
|
|
|
+ @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime) {
|
|
// 禁用条件
|
|
// 禁用条件
|
|
if (!SystemConstant.strNotNull(belongOrgId) && !SystemConstant.strNotNull(courseName) && !SystemConstant.strNotNull(startCreateTime) && !SystemConstant.strNotNull(endCreateTime)) {
|
|
if (!SystemConstant.strNotNull(belongOrgId) && !SystemConstant.strNotNull(courseName) && !SystemConstant.strNotNull(startCreateTime) && !SystemConstant.strNotNull(endCreateTime)) {
|
|
throw ExceptionResultEnum.ERROR.exception("请选择要禁用的条件");
|
|
throw ExceptionResultEnum.ERROR.exception("请选择要禁用的条件");
|
|
@@ -131,8 +128,8 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "课程基本信息管理-批量导入")
|
|
@ApiOperation(value = "课程基本信息管理-批量导入")
|
|
@RequestMapping(value = "/data_import", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/data_import", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = EditResult.class) })
|
|
|
|
- @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.IMPORT)
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
|
|
|
|
+ @OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
|
|
@Transactional
|
|
@Transactional
|
|
public Result basicCourseImportAsync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file)
|
|
public Result basicCourseImportAsync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file)
|
|
throws Exception {
|
|
throws Exception {
|
|
@@ -142,19 +139,19 @@ public class BasicCourseController {
|
|
|
|
|
|
@ApiOperation(value = "课程管理-导出")
|
|
@ApiOperation(value = "课程管理-导出")
|
|
@RequestMapping(value = "/export", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/export", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "返回信息") })
|
|
|
|
- @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EXPORT)
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息")})
|
|
|
|
+ @OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
|
|
public void export(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName,
|
|
public void export(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName,
|
|
- @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime, @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime,
|
|
|
|
- HttpServletResponse response) throws Exception {
|
|
|
|
|
|
+ @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime, @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime,
|
|
|
|
+ HttpServletResponse response) throws Exception {
|
|
basicCourseService.exportData(response, SystemConstant.convertIdToLong(belongOrgId), courseName, SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime));
|
|
basicCourseService.exportData(response, SystemConstant.convertIdToLong(belongOrgId), courseName, SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "课程管理-查询")
|
|
@ApiOperation(value = "课程管理-查询")
|
|
@RequestMapping(value = "/list_by_org", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/list_by_org", method = RequestMethod.POST)
|
|
- @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = Result.class) })
|
|
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
public Result findBasicCourseListByOrg(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
|
|
public Result findBasicCourseListByOrg(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
|
|
- @ApiParam(value = "所属机构id", required = true) @RequestParam String belongOrgId) {
|
|
|
|
|
|
+ @ApiParam(value = "所属机构id", required = true) @RequestParam String belongOrgId) {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
return ResultUtil.ok(basicCourseService.listByOrgId(SystemConstant.convertIdToLong(belongOrgId), SystemConstant.convertIdToLong(examId), sysUser));
|
|
return ResultUtil.ok(basicCourseService.listByOrgId(SystemConstant.convertIdToLong(belongOrgId), SystemConstant.convertIdToLong(examId), sysUser));
|
|
}
|
|
}
|