|
@@ -168,6 +168,45 @@ public class OrgController extends ControllerSupport {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改请通知作者
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param curPage
|
|
|
+ * @param pageSize
|
|
|
+ * @param rootOrgId
|
|
|
+ * @param code
|
|
|
+ * @param name
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "模糊查询顶级机构")
|
|
|
+ @GetMapping("/getRootOrgList/{curPage}/{pageSize}")
|
|
|
+ public Page<Org> getRootOrgList(@PathVariable Integer curPage, @PathVariable Integer pageSize,
|
|
|
+ @RequestParam String code, @RequestParam String name) {
|
|
|
+
|
|
|
+ Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
+ "updateTime");
|
|
|
+
|
|
|
+ Org criteria = new Org();
|
|
|
+ criteria.setCode(code);
|
|
|
+ criteria.setName(name);
|
|
|
+
|
|
|
+ Specification<Org> specification = (root, query, cb) -> {
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(criteria.getName())) {
|
|
|
+ predicates.add(cb.like(root.get("name"), toSqlSearchPattern(criteria.getName())));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(criteria.getCode())) {
|
|
|
+ predicates.add(cb.like(root.get("code"), toSqlSearchPattern(criteria.getCode())));
|
|
|
+ }
|
|
|
+ predicates.add(cb.isNull(root.get("parentId")));
|
|
|
+ return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ };
|
|
|
+
|
|
|
+ Page<Org> ret = orgRepo.findAll(specification, pageable);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|