Commit ca918b83 authored by KeYong's avatar KeYong

修改bug及站端相关优化项

parent 4fa061a7
......@@ -4,7 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -105,7 +107,9 @@ public class BuildingController extends AbstractBaseController {
@ApiOperation("消防建筑树")
@GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingTree();
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.getBuildingTree(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树列表信息")
......
......@@ -47,7 +47,7 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenList(String parentId);
List<Map<String,Object>> querySpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的子
......
......@@ -74,7 +74,7 @@ public interface IBuilldService extends IService<Building> {
*
* @return List<BuildingTreeVo>
*/
List<BuildingTreeVo> getBuildingTree();
List<BuildingTreeVo> getBuildingTree(String bizOrgCode);
/**
* 消防建筑树查询接口(带条件bizOrgCode)
......
......@@ -70,7 +70,7 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenList(String parentId);
List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的下降
......
......@@ -451,8 +451,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public List<BuildingTreeVo> getBuildingTree(String bizOrgCode) {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
public List<BuildingTreeVo> getBuildingTree() {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true);
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, null);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
......@@ -487,12 +499,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<Map<String, Object>> getBuildingDetaiList() {
return iFormInstanceService.getSpecialChildrenList(null);
return iFormInstanceService.getSpecialChildrenList(null, null);
}
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode) {
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode, String bizOrgCode) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, bizOrgCode);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
......@@ -502,7 +514,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<BuildingTreeVo> getBuildingTierTree(Integer tier) {
if (tier != null) {
List<BuildingTreeVo> list = getBuildingTreeVos(true);
List<BuildingTreeVo> list = getBuildingTreeVos(true, null);
if (!CollectionUtils.isEmpty(list)) {
if (tier == 1) {
List<BuildingTreeVo> collect = list.stream().filter(x -> "-1".equals(x.getParentId()) || "building".equalsIgnoreCase(x.getGroupType())).collect(Collectors.toList());
......@@ -1191,7 +1203,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<Long, String> getBuildingAbsolutePosition() {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, true);
return getBuildingAbsolutePosition(allListVo);
}
......@@ -1199,7 +1211,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<String, Long> getBuildingCodeKey() {
Map<String, Long> resMap = new HashMap<>();
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
if (!allList.isEmpty()) {
allList.forEach(map -> resMap.put(String.valueOf(map.get("code")), Long.valueOf(String.valueOf(map.get("id")))));
}
......@@ -1361,7 +1373,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey;
}
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false);
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
if(orgUsrLists.isEmpty()){
......@@ -1511,7 +1523,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑
// ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
// String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true);
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, null);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList());
return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> {
b.setId(0L);
......
......@@ -72,7 +72,7 @@ public class DownloadFileService implements IDownloadFileService {
//建筑信息
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList);
appDownload.setBuildTree(allListVo);
......
......@@ -432,8 +432,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
}
@Override
public List<Map<String, Object>> getSpecialChildrenList(String parentId) {
return this.baseMapper.querySpecialChildrenList(parentId);
public List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode) {
return this.baseMapper.querySpecialChildrenList(parentId, bizOrgCode);
}
@Override
......
......@@ -120,6 +120,9 @@
<if test="parentId != null and parentId !=''">
sa.parentId = #{parentId}
</if>
<if test="bizOrgCode != null and bizOrgCode !=''">
sa.bizOrgCode like CONCAT(#{bizOrgCode},'%')
</if>
</where>
</select>
<select id="queryPage" resultType="hashmap">
......
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