|
@@ -10,9 +10,11 @@ import com.qmth.themis.admin.config.DictionaryConfig;
|
|
|
import com.qmth.themis.business.bean.admin.DataCountBean;
|
|
|
import com.qmth.themis.business.bean.admin.MapDataCountBean;
|
|
|
import com.qmth.themis.business.bean.admin.OrgDataCountBean;
|
|
|
+import com.qmth.themis.business.bean.exam.VersionBean;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.AuthDto;
|
|
|
import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
|
|
|
+import com.qmth.themis.business.dto.response.TBOrgDownloadBean;
|
|
|
import com.qmth.themis.business.dto.response.TEExamQueryDto;
|
|
|
import com.qmth.themis.business.entity.*;
|
|
|
import com.qmth.themis.business.enums.DownloadFileEnum;
|
|
@@ -118,6 +120,9 @@ public class SysController {
|
|
|
@Resource
|
|
|
SolarProperties solarProperties;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TBClientVersionService tbClientVersionService;
|
|
|
+
|
|
|
@ApiOperation(value = "同步机构接口")
|
|
|
@RequestMapping(value = "/sync/org", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "菜单信息", response = Result.class)})
|
|
@@ -255,9 +260,7 @@ public class SysController {
|
|
|
@RequestMapping(value = "/org/queryByOrgCode", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrg.class)})
|
|
|
public Result queryByOrgCode(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
|
|
|
- if (Objects.isNull(code) || Objects.equals(code, "")) {
|
|
|
- throw new BusinessException(ExceptionResultEnum.ORG_CODE_IS_NULL);
|
|
|
- }
|
|
|
+ Optional.ofNullable(code).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_CODE_IS_NULL));
|
|
|
if (!Objects.equals(code.toUpperCase(), SystemConstant.ADMIN)) {
|
|
|
TBOrg tbOrg = themisCacheService.addOrgCodeCache(code);
|
|
|
Optional.ofNullable(tbOrg).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_NO));
|
|
@@ -270,6 +273,28 @@ public class SysController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "根据机构代码查询下载安装包信息接口")
|
|
|
+ @RequestMapping(value = "/download/package", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrgDownloadBean.class)})
|
|
|
+ public Result downloadPackage(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
|
|
|
+ Optional.ofNullable(code).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_CODE_IS_NULL));
|
|
|
+ if (!Objects.equals(code.toUpperCase(), SystemConstant.ADMIN)) {
|
|
|
+ TBOrg tbOrg = themisCacheService.addOrgCodeCache(code);
|
|
|
+ Optional.ofNullable(tbOrg).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_NO));
|
|
|
+ authInfoService.appHasExpired(code);
|
|
|
+
|
|
|
+ TBOrgDownloadBean tbOrgDownloadBean = GsonUtil.fromJson(GsonUtil.toJson(tbOrg), TBOrgDownloadBean.class);
|
|
|
+ TBClientVersion tbClientVersion = tbClientVersionService.getMaxClientVersion();
|
|
|
+ if (Objects.nonNull(tbClientVersion)) {
|
|
|
+ VersionBean v = new VersionBean(tbClientVersion.getName(), tbClientVersion.getValue(), tbClientVersion.getUrl());
|
|
|
+ tbOrgDownloadBean.setVersion(v);
|
|
|
+ }
|
|
|
+ return ResultUtil.ok(tbOrgDownloadBean);
|
|
|
+ } else {
|
|
|
+ throw new BusinessException("超级管理员无需下载");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "机构查询接口")
|
|
|
@RequestMapping(value = "/org/query", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrg.class)})
|