Commit ca918b83 authored by KeYong's avatar KeYong

修改bug及站端相关优化项

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