|
@@ -9,6 +9,7 @@ import com.qmth.distributed.print.business.bean.result.SysAdminSetResult;
|
|
import com.qmth.teachcloud.common.bean.dto.PrivilegeDto;
|
|
import com.qmth.teachcloud.common.bean.dto.PrivilegeDto;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
@@ -61,6 +62,56 @@ public class SysAdminSetController {
|
|
@Resource
|
|
@Resource
|
|
SysConfigService sysConfigService;
|
|
SysConfigService sysConfigService;
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "查询自定义菜单权限")
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "菜单权限信息", response = SysPrivilege.class)})
|
|
|
|
+ @RequestMapping(value = "/paper/sys/select", method = RequestMethod.POST)
|
|
|
|
+ public Result sysadminPaperSysSelect() {
|
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_PDF_SIZE_LIST);
|
|
|
|
+ Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置全局pdf格式清单"));
|
|
|
|
+ CustomPrivilegeResult customPrivilegeResult = new CustomPrivilegeResult();
|
|
|
|
+ customPrivilegeResult.setSysPdfSize(Arrays.asList(sysConfig.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", ")));
|
|
|
|
+ return ResultUtil.ok(customPrivilegeResult);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "试卷规格配置查询")
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "试卷规格配置信息", response = SysAdminSetResult.class)})
|
|
|
|
+ @RequestMapping(value = "/paper/select", method = RequestMethod.POST)
|
|
|
|
+ public Result sysadminPaperSelect(@ApiParam(value = "学校id ", required = true) @RequestParam Long schoolId) {
|
|
|
|
+ SysConfig sysConfigPdfSize = commonCacheService.addSysConfigCache(schoolId, SystemConstant.PDF_SIZE_LIST);
|
|
|
|
+ List<String> pdfSize = null;
|
|
|
|
+ if (Objects.nonNull(sysConfigPdfSize)) {
|
|
|
|
+ pdfSize = Arrays.asList(sysConfigPdfSize.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", "));
|
|
|
|
+ }
|
|
|
|
+ return ResultUtil.ok(new SysAdminSetResult(schoolId, CollectionUtils.isEmpty(pdfSize) ? new ArrayList<>() : pdfSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "试卷规格配置保存")
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "试卷规格配置信息", response = ResultUtil.class)})
|
|
|
|
+ @RequestMapping(value = "/paper/save", method = RequestMethod.POST)
|
|
|
|
+ @Transactional
|
|
|
|
+ public Result sysadminPaperSave(@Valid @RequestBody SysAdminSetParam sysAdminSetParam, BindingResult bindingResult) {
|
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
|
+ return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
|
+ }
|
|
|
|
+ Optional.ofNullable(sysAdminSetParam.getPdfSize()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("试卷规格配置不能为空"));
|
|
|
|
+
|
|
|
|
+ SysConfig sysConfigPdfSize = commonCacheService.addSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
|
|
|
|
+ if (Objects.isNull(sysConfigPdfSize)) {
|
|
|
|
+ sysConfigPdfSize = new SysConfig(sysAdminSetParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST, "pdf格式清单", Arrays.asList(sysAdminSetParam.getPdfSize()).toString());
|
|
|
|
+ } else {
|
|
|
|
+ if (Objects.nonNull(sysAdminSetParam.getPdfSize()) && sysAdminSetParam.getPdfSize().length > 0) {
|
|
|
|
+ sysConfigPdfSize.setConfigValue(Arrays.asList(sysAdminSetParam.getPdfSize()).toString());
|
|
|
|
+ } else {
|
|
|
|
+ sysConfigPdfSize.setConfigValue(null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ sysConfigService.saveOrUpdate(sysConfigPdfSize);
|
|
|
|
+
|
|
|
|
+ commonCacheService.removeSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
|
|
|
|
+ return ResultUtil.ok(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@ApiOperation(value = "用户验证查询")
|
|
@ApiOperation(value = "用户验证查询")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "用户验证信息", response = SysAdminSetResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "用户验证信息", response = SysAdminSetResult.class)})
|
|
@RequestMapping(value = "/user/select", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/user/select", method = RequestMethod.POST)
|
|
@@ -78,6 +129,9 @@ public class SysAdminSetController {
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
}
|
|
}
|
|
|
|
+ Optional.ofNullable(sysAdminSetParam.getAccountSmsVerify()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("用户/密码模式是否开启不能为空"));
|
|
|
|
+ Optional.ofNullable(sysAdminSetParam.getTeachcloudExchangeSerivePath()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("第三方统一身份认证不能为空"));
|
|
|
|
+
|
|
List<SysConfig> sysConfigList = new ArrayList<>();
|
|
List<SysConfig> sysConfigList = new ArrayList<>();
|
|
SysConfig sysConfigAccount = commonCacheService.addSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.ACCOUNT_SMS_VERIFY);
|
|
SysConfig sysConfigAccount = commonCacheService.addSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.ACCOUNT_SMS_VERIFY);
|
|
if (Objects.isNull(sysConfigAccount)) {
|
|
if (Objects.isNull(sysConfigAccount)) {
|