Bläddra i källkod

加入机构同步

wangliang 2 år sedan
förälder
incheckning
a020d2b75e

+ 17 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
+import com.qmth.boot.core.solar.config.SolarProperties;
+import com.qmth.boot.core.solar.service.SolarService;
 import com.qmth.themis.admin.config.DictionaryConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
@@ -107,6 +109,21 @@ public class SysController {
     @Resource
     TIeInvigilateWarnInfoService tIeInvigilateWarnInfoService;
 
+    @Resource
+    SolarService solarService;
+
+    @Resource
+    SolarProperties solarProperties;
+
+    @ApiOperation(value = "同步机构接口")
+    @RequestMapping(value = "/sync/org", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "菜单信息", response = TBPrivilege.class)})
+    public Result syncOrg() {
+        solarService.update(solarProperties.getAccessKey(), solarProperties.getAccessSecret());
+        authInfoService.appInfoInit();
+        return ResultUtil.ok(true);
+    }
+
     @ApiOperation(value = "菜单查询接口")
     @RequestMapping(value = "/getMenu", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "菜单信息", response = TBPrivilege.class)})

+ 4 - 0
themis-business/src/main/resources/db/init-table-data.sql

@@ -187,6 +187,7 @@ INSERT INTO `t_b_privilege` VALUES (180, '考试场次语音启用/禁用', '/ap
 INSERT INTO `t_b_privilege` VALUES (181, '学生视频监考回放查询接口', '/api/admin/student/exam_record/video/query', 'LINK', 8, 5, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (182, '查询考试语音信息', '/api/mobile/exam/audio/query', 'LINK', 60, 47, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (183, '推送考试数据到云阅卷', '/api/admin/exam/cloud_mark/push/data', 'LINK', 5, 14, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (184, '同步机构数据', '/api/admin/sys/sync/org', 'LINK', 1, 49, NULL, 1600932652000);
 
 INSERT INTO `t_b_role_privilege` VALUES (1, 'SUPER_ADMIN', 1);
 INSERT INTO `t_b_role_privilege` VALUES (2, 'SUPER_ADMIN', 2);
@@ -411,6 +412,9 @@ INSERT INTO `t_b_role_privilege` VALUES (227, 'ADMIN', 180);
 INSERT INTO `t_b_role_privilege` VALUES (228, 'ADMIN', 181);
 INSERT INTO `t_b_role_privilege` VALUES (229, 'STUDENT', 182);
 INSERT INTO `t_b_role_privilege` VALUES (230, 'ADMIN', 183);
+INSERT INTO `t_b_role_privilege` VALUES (231, 'INVIGILATE', 85);
+INSERT INTO `t_b_role_privilege` VALUES (232, 'INVIGILATE', 181);
+INSERT INTO `t_b_role_privilege` VALUES (233, 'SUPER_ADMIN', 184);
 
 INSERT INTO `t_b_role` VALUES (1, 'SUPER_ADMIN', '系统管理员', 1600932652000);
 INSERT INTO `t_b_role` VALUES (2, 'INVIGILATE', '监考员', 1600932652000);