Commit 2e4a7f64 authored by chenzhao's avatar chenzhao

增加树

parent 85f52c13
......@@ -140,6 +140,13 @@ public interface EquipFeignClient {
@RequestMapping(value = "/building/tree", method = RequestMethod.GET)
ResponseModel<Object> getBuildingTree();
/**
* 获取消防系统列表
*
* @return
*/
@RequestMapping(value = "/building/treeCompany", method = RequestMethod.GET)
ResponseModel<Object> getBuildingTreeCompany();
/**
* 获取消防建筑详情
*
* @return
......@@ -418,4 +425,5 @@ public interface EquipFeignClient {
*/
@RequestMapping(value = "equipSpecific/getListByEquipmentCodeEQ/{code}", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getListByEquipmentCodeEQ(@PathVariable("code") String code);
}
......@@ -8,6 +8,8 @@ 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 com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -42,6 +44,7 @@ import com.yeejoin.equipmanage.service.IFormInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* @author ZeHua Li
......@@ -60,6 +63,8 @@ public class BuildingController extends AbstractBaseController {
IFormInstanceService formInstanceService;
@Value("${window.vedioFormat}")
String vedioFormat;
@Autowired
JcsFeign jcsFeign;
/**
* @param groupCode
* @Description 根据groupCode查询allowOperation对应的操作菜单
......@@ -117,6 +122,19 @@ public class BuildingController extends AbstractBaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树 查询所在单位下的建筑")
@GetMapping(value = "/treeCompany")
public List<BuildingTreeVo> getBuildingTreeCompany() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
ResponseModel<OrgUsrDto> company = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
if (company.getResult() != null){
bizOrgCode = company.getResult().getBizOrgCode();
}
return buildService.getBuildingTreeNew(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树带筛选")
@GetMapping(value = "/treeByName")
public List<BuildingTreeVo> treeByName(@RequestParam(required = false) String name) {
......
......@@ -76,6 +76,9 @@ public interface IBuilldService extends IService<Building> {
*/
List<BuildingTreeVo> getBuildingTree(String bizOrgCode);
List<BuildingTreeVo> getBuildingTreeNew(String bizOrgCode);
/**
* 消防建筑树查询接口(带条件bizOrgCode)
*
......
......@@ -464,6 +464,18 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return formKeyMap;
}
public List<BuildingTreeVo> getBuildingTreeNew(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());
}
@Override
public List<BuildingTreeVo> getBuildingTree(String bizOrgCode) {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
......
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