|
@@ -69,6 +69,9 @@ import cn.com.qmth.examcloud.core.basic.service.impl.OrgServiceImpl;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.api.UpyunCloudService;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.api.request.PutFileReq;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.api.response.PutFileResp;
|
|
|
+import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.OrgCacheBean;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.OrgPropertyCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
|
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
import cn.com.qmth.examcloud.task.api.request.SyncOrgReq;
|
|
@@ -728,19 +731,14 @@ public class OrgController extends ControllerSupport {
|
|
|
@ApiOperation(value = "查询机构单个属性")
|
|
|
@GetMapping("property/{orgId}/{key}")
|
|
|
public String getOrgProperty(@PathVariable Long orgId, @PathVariable String key) {
|
|
|
- OrgEntity orgEntity = GlobalHelper.getEntity(orgRepo, orgId, OrgEntity.class);
|
|
|
- if (null == orgEntity) {
|
|
|
- throw new StatusException("001250", "orgId is wrong");
|
|
|
- }
|
|
|
- validateRootOrgIsolation(orgEntity.getRootId());
|
|
|
+ OrgCacheBean org = CacheHelper.getOrg(orgId);
|
|
|
+ validateRootOrgIsolation(org.getRootId());
|
|
|
|
|
|
- DynamicEnumManager manager = OrgProperty.getDynamicEnumManager();
|
|
|
- DynamicEnum de = manager.getByName(key);
|
|
|
- OrgPropertyEntity one = orgPropertyRepo.findByOrgIdAndKeyId(orgId, de.getId());
|
|
|
- if (null == one) {
|
|
|
+ OrgPropertyCacheBean orgProperty = CacheHelper.getOrgProperty(orgId, key);
|
|
|
+ if (!orgProperty.getHasValue()) {
|
|
|
return null;
|
|
|
}
|
|
|
- return one.getValue();
|
|
|
+ return orgProperty.getValue();
|
|
|
}
|
|
|
|
|
|
@Naked
|