Commit 47ea81d7 authored by gaodongdong's avatar gaodongdong

添加新接口

parent 93a57fb4
package com.yeejoin.amos.boot.module.common.api.dto;
import java.util.List;
import lombok.Data;
@Data
public class CompanyPerson extends OrgUsrDto{
/**
*
*/
private static final long serialVersionUID = -988100154344061090L;
List<OrgUsrDto> persons;
}
...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
...@@ -238,4 +239,17 @@ public class OrgUsrController extends BaseController { ...@@ -238,4 +239,17 @@ public class OrgUsrController extends BaseController {
public ResponseModel<List<Map<String, Object>> > selectUsersByOrgCode(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception { public ResponseModel<List<Map<String, Object>> > selectUsersByOrgCode(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.returnCompanyPersonMsg(ids)) ; return ResponseHelper.buildResponse(iOrgUsrService.returnCompanyPersonMsg(ids)) ;
} }
/**
* 根据id获取单位人员列表
*
* @param ids
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/company/{ids}/person", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id获取单位人员列表", notes = "根据id获取单位人员列表")
public ResponseModel<List<CompanyPerson>> selectCompanyPerson(@PathVariable List<Long> ids) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.returnCompanyPerson(ids)) ;
}
} }
\ No newline at end of file
...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto; import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
...@@ -855,4 +856,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -855,4 +856,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<OrgUsr> listOrgUserById(Long orgUserId) { public List<OrgUsr> listOrgUserById(Long orgUserId) {
return this.baseMapper.listOrgUserById(orgUserId); return this.baseMapper.listOrgUserById(orgUserId);
} }
public List<CompanyPerson> returnCompanyPerson(List<Long> ids) {
if (ids == null) return null;
return ids.stream().map(m -> {
OrgUsr org = getById(m);
CompanyPerson company = new CompanyPerson();
BeanUtils.copyProperties(org, company);
company.setPersons(this.queryForListByParentIdAndOrgType(org.getSequenceNbr(), OrgPersonEnum.人员.getKey()));
return company;
}).collect(Collectors.toList());
}
private List<OrgUsrDto> queryForListByParentIdAndOrgType( Long parentId, String bizOrgType) {
return this.queryForList(null, false, parentId, bizOrgType);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment