WANG пре 6 година
родитељ
комит
be61ea06d3

+ 2 - 2
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/OrgService.java

@@ -38,10 +38,10 @@ public interface OrgService {
 	 * 保存机构属性
 	 *
 	 * @author WANGWEI
+	 * @param orgId
 	 * @param properties
-	 * @param saved
 	 */
-	void saveOrgProperties(Map<String, String> properties, OrgEntity saved);
+	void saveOrgProperties(Long orgId, Map<String, String> properties);
 
 	/**
 	 * 删除子机构

+ 5 - 13
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgServiceImpl.java

@@ -150,7 +150,7 @@ public class OrgServiceImpl implements OrgService {
 			dataSyncCloudService.syncOrg(req);
 		}
 
-		saveOrgProperties(properties, saved);
+		saveOrgProperties(saved.getId(), properties);
 
 		return saved;
 	}
@@ -244,29 +244,21 @@ public class OrgServiceImpl implements OrgService {
 			dataSyncCloudService.syncOrg(req);
 		}
 
-		saveOrgProperties(properties, saved);
+		saveOrgProperties(saved.getId(), properties);
 
 		return saved;
 	}
 
-	/**
-	 * 保存机构属性
-	 *
-	 * @author WANGWEI
-	 * @param properties
-	 * @param saved
-	 */
 	@Override
-	public void saveOrgProperties(Map<String, String> properties, OrgEntity saved) {
+	public void saveOrgProperties(Long orgId, Map<String, String> properties) {
 		Map<DynamicEnum, String> map = checkAndGetOrgProperties(properties);
 		for (Entry<DynamicEnum, String> entry : map.entrySet()) {
 			DynamicEnum de = entry.getKey();
 			String value = entry.getValue();
-			OrgPropertyEntity entity = orgPropertyRepo.findByOrgIdAndKeyId(saved.getId(),
-					de.getId());
+			OrgPropertyEntity entity = orgPropertyRepo.findByOrgIdAndKeyId(orgId, de.getId());
 			if (null == entity) {
 				entity = new OrgPropertyEntity();
-				entity.setOrgId(saved.getId());
+				entity.setOrgId(orgId);
 				entity.setKeyId(de.getId());
 			}
 			entity.setValue(value);