|
@@ -351,7 +351,7 @@ public class CompanyInfoController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String name,
|
|
|
+ String name,String parentId,Boolean subordinate,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -369,11 +369,25 @@ public class CompanyInfoController {
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("sort_no","asc"));
|
|
|
+ sortList.add(new Sort("name_","asc"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
|
searchParams.put("name","%" + name + "%");
|
|
|
}
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(parentId)) {
|
|
|
+ CompanyInfo parent = companyInfoService.get(parentId);
|
|
|
+
|
|
|
+ if (parent!=null){
|
|
|
+ if(subordinate!=null && subordinate){
|
|
|
+ searchParams.put("parentCode",parent.getCode() + "%");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ searchParams.put("parentCode",parent.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Page<CompanyInfo> page = companyInfoService.pageSearch(searchParams,pageIndex,pageSize,sortList);
|
|
|
Page<CompanyInfoDTO> pageDTO = PojoUtils.convertPage(page, CompanyInfoDTO.class);
|
|
|
for(CompanyInfoDTO li : pageDTO.getResult()){
|