Commit a41e7af8 authored by chenhao's avatar chenhao

Merge branch 'develop_ccs' of http://172.16.10.76/moa/amos-boot-biz into develop_ccs

parents ae362b9f 512eafdd
......@@ -734,4 +734,20 @@ public class OrgUsrController extends BaseController {
}
return ResponseHelper.buildResponse(orgUserList);
}
/**
* 查询多个组织机构下面的所有人员列表信息
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询上级单位", notes = "查询上级单位")
@GetMapping(value = "/company/bizOrgCode/list")
public ResponseModel<OrgUsrDto> getCompanyByBizOrgCodeList(@RequestParam String bizOrgCode) {
if (ValidationUtil.isEmpty(bizOrgCode)) {
return ResponseHelper.buildResponse(new OrgUsrDto());
}
return ResponseHelper.buildResponse(iOrgUsrService.getCompanyByBizOrgCodeList(bizOrgCode));
}
}
\ No newline at end of file
......@@ -82,6 +82,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
private static final String FIELD_CODE = "telephone";
private static final String COMPANY_FIELD_CODE = "companyLocation,longitude,latitude";
private static final String COMPANY_VALUE = "COMPANY";
@Autowired
DynamicFormInstanceServiceImpl alertFormValueServiceImpl;
......@@ -2190,4 +2191,29 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return this.baseMapper.selectPersonListByCompanyIdList(companyIdList);
}
/**
* 根据bizOrgCode查询详情
*
* @param bizOrgCode
* @return
*/
public OrgUsrDto getCompanyByBizOrgCodeList(String bizOrgCode) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getBizOrgCode,bizOrgCode);
wrapper.eq(BaseEntity::getIsDelete,false);
OrgUsr orgUsr = baseMapper.selectOne(wrapper);
OrgUsrDto orgUsrDto = new OrgUsrDto();
if (!orgUsr.getBizOrgType().equals(COMPANY_VALUE)){
for (int i = 0; i < 10; i++) {
OrgUsr result = baseMapper.selectById(orgUsr.getParentId());
if (result.getBizOrgType().equals(COMPANY_VALUE)){
BeanUtils.copyProperties(result,orgUsrDto);
break;
}
}
}
return orgUsrDto;
}
}
......@@ -16,7 +16,7 @@ import java.util.Map;
/**
* @author DELL
*/
@FeignClient(name = "${jcs.fegin.name}", path = "jcs", configuration = {FeignConfiguration.class})
@FeignClient(name = "${jcs.fegin.name}",path = "jcs", configuration = {FeignConfiguration.class})
public interface JcsFeign {
@RequestMapping(value = "/water-resource/select_list", method = RequestMethod.GET, consumes = "application/json")
......@@ -133,4 +133,14 @@ public interface JcsFeign {
*/
@GetMapping(value = "/org-usr/{authKey}/listWithAuth")
FeignClientResult<List<OrgUsrDto>> getCompanyDeptListWithAuth(@PathVariable String authKey, @RequestParam(required = false) String orgTypes);
/**
* 获取机场人员
*
* @return
*/
@RequestMapping(value = "/org-usr/company/bizOrgCode/list", method = RequestMethod.GET, consumes = "application/json")
ResponseModel<OrgUsrDto> getCompanyByBizOrgCodeList(
@RequestParam(required = false) String bizOrgCode);
}
......@@ -29,6 +29,7 @@ import com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO;
import com.yeejoin.equipmanage.common.vo.BuildingTreeVo;
import com.yeejoin.equipmanage.context.SpringContextHolder;
import com.yeejoin.equipmanage.event.SyncRiskEvent;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.operation.GroupTypeOperator;
import com.yeejoin.equipmanage.operation.PageOperation;
......@@ -47,6 +48,7 @@ import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -83,7 +85,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Autowired
private FormInstanceMapper formInstanceMapper;
@Autowired
private JcsFeign jcsFeign;
@Autowired
FireFightingSystemMapper fireFightingSystemMapper;
......@@ -1229,8 +1232,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode) {
//如果传递的为部门bizOrgCode 取其上级单位下的建筑
ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList());
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(resultCode)).collect(Collectors.toList());
return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> {
b.setId(0L);
b.setChildren(this.getCompanyBuildingChildrenTree(b.getId().toString(), orgBuildingTreeVos));
......
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