|
@@ -1657,4 +1657,17 @@ public class OrgController extends ControllerSupport {
|
|
|
return url;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "按code查询子机构", notes = "code查询")
|
|
|
+ @GetMapping("byCode")
|
|
|
+ public OrgEntity getOrgByCode(@RequestParam Long rootOrgId, @RequestParam String code) {
|
|
|
+ validateRootOrgIsolation(rootOrgId);
|
|
|
+
|
|
|
+ OrgEntity org = orgRepo.findByRootIdAndCode(rootOrgId, code);
|
|
|
+ if (null == org) {
|
|
|
+ throw new StatusException("540001", "机构不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ return org;
|
|
|
+ }
|
|
|
+
|
|
|
}
|