|
@@ -357,7 +357,7 @@ public class OrgController extends ControllerSupport {
|
|
|
}
|
|
|
|
|
|
// 过载保护
|
|
|
- int total = orgRepo.countByNameLike(name);
|
|
|
+ int total = orgRepo.countByRootIdAndNameLike(getRootOrgId(), name);
|
|
|
if (total > 1000) {
|
|
|
List<OrgEntity> list = Lists.newArrayList();
|
|
|
return list;
|
|
@@ -615,12 +615,6 @@ public class OrgController extends ControllerSupport {
|
|
|
return saved;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "按ID删除机构", notes = "删除")
|
|
|
- @DeleteMapping("/{id}")
|
|
|
- public void deleteSchool(@PathVariable Long id) {
|
|
|
- orgRepo.delete(id);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -628,7 +622,7 @@ public class OrgController extends ControllerSupport {
|
|
|
* @param ids
|
|
|
*/
|
|
|
@ApiOperation(value = "启用机构", notes = "启用")
|
|
|
- @PutMapping("/enable/{ids}")
|
|
|
+ @PutMapping("enable/{ids}")
|
|
|
public void enableOrgs(@PathVariable String ids) {
|
|
|
List<Long> orgIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
.collect(Collectors.toList());
|
|
@@ -646,7 +640,7 @@ public class OrgController extends ControllerSupport {
|
|
|
* @param ids
|
|
|
*/
|
|
|
@ApiOperation(value = "禁用机构", notes = "禁用")
|
|
|
- @PutMapping("/disable/{ids}")
|
|
|
+ @PutMapping("disable/{ids}")
|
|
|
public void disableOrgs(@PathVariable String ids) {
|
|
|
List<Long> orgIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
.collect(Collectors.toList());
|
|
@@ -665,7 +659,7 @@ public class OrgController extends ControllerSupport {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
@ApiOperation(value = "获取logo")
|
|
|
- @GetMapping("/logo")
|
|
|
+ @GetMapping("logo")
|
|
|
public void getLogo(@RequestParam("domain") String domain, HttpServletResponse response)
|
|
|
throws IOException {
|
|
|
OrgEntity org = orgRepo.findByParentIdIsNullAndDomainName(domain);
|
|
@@ -689,7 +683,7 @@ public class OrgController extends ControllerSupport {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
@ApiOperation(value = "导入logo", notes = "导入logo")
|
|
|
- @PostMapping("/importLogo/{orgId}")
|
|
|
+ @PostMapping("importLogo/{orgId}")
|
|
|
public void importLogo(@PathVariable Long orgId, HttpServletRequest request,
|
|
|
@RequestParam CommonsMultipartFile file) throws IOException {
|
|
|
String schoolLogoPath = PropertiesUtil.getString(PropKeys.SCHOOL_LOGO_PATH);
|
|
@@ -724,4 +718,10 @@ public class OrgController extends ControllerSupport {
|
|
|
orgPropertyRepo.save(entity);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "删除子机构", notes = "")
|
|
|
+ @DeleteMapping("deleteSubOrg/{orgId}")
|
|
|
+ public void deleteSubOrg(@PathVariable Long orgId) {
|
|
|
+ orgService.deleteSubOrg(orgId, false);
|
|
|
+ }
|
|
|
+
|
|
|
}
|