浏览代码

超管设置新增试卷规格配置

wangliang 2 年之前
父节点
当前提交
226de46b00

+ 16 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/SysAdminSetController.java

@@ -1,6 +1,7 @@
 package com.qmth.distributed.print.api;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.backup.MySQLDatabaseBackup;
@@ -12,7 +13,6 @@ import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.*;
-import com.qmth.teachcloud.common.util.JacksonUtil;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -83,7 +83,13 @@ public class SysAdminSetController {
         SysConfig sysConfigSyncServicePath = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SYNC_SERVICE_PATH);
         String syncServicePath = null;
         if (Objects.nonNull(sysConfigSyncServicePath)) {
-            syncServicePath = JacksonUtil.parseJson(sysConfigSyncServicePath.getConfigValue());
+            syncServicePath = sysConfigSyncServicePath.getConfigValue();
+        } else {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put(SystemConstant.QUESTION, "");
+            jsonObject.put(SystemConstant.CLOUD_MARK, "");
+            jsonObject.put(SystemConstant.REPORT, "");
+            syncServicePath = jsonObject.toString();
         }
         return ResultUtil.ok(new SysAdminSetResult(schoolId, syncServicePath));
     }
@@ -106,7 +112,7 @@ public class SysAdminSetController {
         }
         sysConfigService.saveOrUpdate(sysConfigSyncServicePath);
 
-        commonCacheService.removeSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.SYNC_SERVICE_PATH);
+        commonCacheService.updateSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.SYNC_SERVICE_PATH);
         return ResultUtil.ok(true);
     }
 
@@ -130,7 +136,10 @@ public class SysAdminSetController {
         if (Objects.nonNull(sysConfigPdfSize)) {
             pdfSize = Arrays.asList(sysConfigPdfSize.getConfigValue().replaceAll("\\[", "").replaceAll("\\]", "").split(", "));
         }
-        return ResultUtil.ok(new SysAdminSetResult(schoolId, CollectionUtils.isEmpty(pdfSize) ? new ArrayList<>() : pdfSize));
+        SysAdminSetResult sysAdminSetResult = new SysAdminSetResult();
+        sysAdminSetResult.setSchoolId(schoolId);
+        sysAdminSetResult.setPdfSize(CollectionUtils.isEmpty(pdfSize) ? new ArrayList<>() : pdfSize);
+        return ResultUtil.ok(sysAdminSetResult);
     }
 
     @ApiOperation(value = "试卷规格配置保存")
@@ -155,7 +164,7 @@ public class SysAdminSetController {
         }
         sysConfigService.saveOrUpdate(sysConfigPdfSize);
 
-        commonCacheService.removeSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
+        commonCacheService.updateSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
         return ResultUtil.ok(true);
     }
 
@@ -197,8 +206,8 @@ public class SysAdminSetController {
         sysConfigList.add(sysConfigTeachcloudExchangeSerivePath);
         sysConfigService.saveOrUpdateBatch(sysConfigList);
 
-        commonCacheService.removeSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.ACCOUNT_SMS_VERIFY);
-        commonCacheService.removeSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.TEACHCLOUD_EXCHANGE_SERVICE_PATH);
+        commonCacheService.updateSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.ACCOUNT_SMS_VERIFY);
+        commonCacheService.updateSysConfigCache(sysAdminSetParam.getSchoolId(), SystemConstant.TEACHCLOUD_EXCHANGE_SERVICE_PATH);
         return ResultUtil.ok(true);
     }
 

+ 3 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -42,6 +42,9 @@ public class SystemConstant {
     public static final String ACCOUNT_SMS_VERIFY = "account.sms.verify";
     public static final String TEACHCLOUD_EXCHANGE_SERVICE_PATH = "teachcloud.exchange.serive.path";
     public static final String SYNC_SERVICE_PATH = "sync.service.path";
+    public static final String QUESTION = "question";
+    public static final String CLOUD_MARK = "cloudmark";
+    public static final String REPORT = "report";
     public static final String CHARSET_NAME = "UTF-8";
     //    public static final String CHARSET_GB2312 = "gb2312";
     public static final String CHARSET_GBK = "gbk";