Commit fc32f558 authored by chenzhao's avatar chenzhao

修改代码

parent 859f7408
...@@ -4,6 +4,7 @@ import java.util.LinkedHashMap; ...@@ -4,6 +4,7 @@ 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 io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -351,4 +352,13 @@ public class BuildingController extends AbstractBaseController { ...@@ -351,4 +352,13 @@ public class BuildingController extends AbstractBaseController {
return buildService.getBuildingTreeInOrgCode(bizOrgCode); return buildService.getBuildingTreeInOrgCode(bizOrgCode);
} }
@ApiOperation(value = "查询指定单位的建筑树")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/myTree")
public List<BuildingTreeVo> buildingTreeByMyCompany(){
ReginParams reginParams = getSelectedOrgInfo();
return buildService.getBuildingTreeInMyOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
}
} }
...@@ -331,5 +331,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -331,5 +331,7 @@ public interface IBuilldService extends IService<Building> {
*/ */
List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode); List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode);
List<BuildingTreeVo> getBuildingTreeInMyOrgCode(String bizOrgCode);
List<OrgMenuDto> companyTreeByUserAndType(); List<OrgMenuDto> companyTreeByUserAndType();
} }
...@@ -47,6 +47,7 @@ import org.typroject.tyboot.core.foundation.exception.BaseException; ...@@ -47,6 +47,7 @@ import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -1490,6 +1491,19 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1490,6 +1491,19 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
public List<BuildingTreeVo> getBuildingTreeInMyOrgCode(String bizOrgCode) {
//如果传递的为部门bizOrgCode 取其上级单位下的建筑
ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
String companyCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().startsWith(companyCode)).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));
}).collect(Collectors.toList());
}
@Override @Override
public List<OrgMenuDto> companyTreeByUserAndType() { public List<OrgMenuDto> companyTreeByUserAndType() {
return jcsRemoteService.getCompanyDeptTreeWithAuth(authKey, "COMPANY"); return jcsRemoteService.getCompanyDeptTreeWithAuth(authKey, "COMPANY");
......
...@@ -1364,11 +1364,12 @@ public class PointController extends AbstractBaseController { ...@@ -1364,11 +1364,12 @@ public class PointController extends AbstractBaseController {
@ApiParam(value = "点编号") @RequestParam(value = "pointNo", required = false) String pointNo, @ApiParam(value = "点编号") @RequestParam(value = "pointNo", required = false) String pointNo,
@ApiParam(value = "点名称") @RequestParam(value = "name", required = false) String name, @ApiParam(value = "点名称") @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "pageNumber", defaultValue = "0") int pageNumber, @RequestParam(value = "pageNumber", defaultValue = "0") int pageNumber,
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) { @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
@RequestParam(value = "companyId") String companyId) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode(); String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
return CommonResponseUtil.success(iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize)); return CommonResponseUtil.success(iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize,companyId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -1379,6 +1380,7 @@ public class PointController extends AbstractBaseController { ...@@ -1379,6 +1380,7 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.success(iPointService.queryPointListByRouteId(routeId)); return CommonResponseUtil.success(iPointService.queryPointListByRouteId(routeId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新*查询巡检点对应设备列表", notes = "新*查询巡检点对应设备列表") @ApiOperation(value = "新*查询巡检点对应设备列表", notes = "新*查询巡检点对应设备列表")
@GetMapping(value = "/equip-list-new", produces = "application/json;charset=UTF-8") @GetMapping(value = "/equip-list-new", produces = "application/json;charset=UTF-8")
......
...@@ -138,13 +138,13 @@ public interface PointMapper extends BaseMapper { ...@@ -138,13 +138,13 @@ public interface PointMapper extends BaseMapper {
int queryPointCount4Route(@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId); int queryPointCount4Route(@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId);
int queryPointCount4RouteNew(@Param(value = "bizOrgCode") String bizOrgCode,@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId); int queryPointCount4RouteNew(@Param(value = "bizOrgCode") String bizOrgCode,@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId,@Param(value = "companyId") String companyId);
List<Map<String, Object>> queryPointList4Route(@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, List<Map<String, Object>> queryPointList4Route(@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name,
@Param(value = "offset") int offset, @Param(value = "size") int size, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId); @Param(value = "offset") int offset, @Param(value = "size") int size, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId);
List<Map<String, Object>> queryPointList4RouteNew(@Param(value = "bizOrgCode") String bizOrgCode,@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, List<Map<String, Object>> queryPointList4RouteNew(@Param(value = "bizOrgCode") String bizOrgCode,@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name,
@Param(value = "offset") int offset, @Param(value = "size") int size, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId); @Param(value = "offset") int offset, @Param(value = "size") int size, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId,@Param(value = "companyId") String companyId);
......
...@@ -1776,7 +1776,7 @@ public class PointServiceImpl implements IPointService { ...@@ -1776,7 +1776,7 @@ public class PointServiceImpl implements IPointService {
} }
@Override @Override
public Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size) { public Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size,String companyId) {
List<Long> structureIdList = null; List<Long> structureIdList = null;
List<Map<String, Object>> list = Collections.EMPTY_LIST; List<Map<String, Object>> list = Collections.EMPTY_LIST;
// 传入riskSourceId为-2请求的是巡检点区域为空 // 传入riskSourceId为-2请求的是巡检点区域为空
...@@ -1797,10 +1797,10 @@ public class PointServiceImpl implements IPointService { ...@@ -1797,10 +1797,10 @@ public class PointServiceImpl implements IPointService {
nullRiskSourceId = true; nullRiskSourceId = true;
} }
int total = pointMapper.queryPointCount4RouteNew(bizOrgCode,structureIdList, pointNo, name, nullRiskSourceId); int total = pointMapper.queryPointCount4RouteNew(bizOrgCode,structureIdList, pointNo, name, nullRiskSourceId,companyId);
int offset = (current - 1) * size; int offset = (current - 1) * size;
if (total > offset) { if (total > offset) {
list = pointMapper.queryPointList4RouteNew(bizOrgCode,structureIdList, pointNo, name, offset, size, nullRiskSourceId); list = pointMapper.queryPointList4RouteNew(bizOrgCode,structureIdList, pointNo, name, offset, size, nullRiskSourceId,companyId);
} }
return new PageImpl(list, PageRequest.of(current - 1, size), total); return new PageImpl(list, PageRequest.of(current - 1, size), total);
} }
......
...@@ -361,7 +361,7 @@ public interface IPointService { ...@@ -361,7 +361,7 @@ public interface IPointService {
Page queryPointList4Route(Long riskSourceId, String pointNo, String name, int current, int size); Page queryPointList4Route(Long riskSourceId, String pointNo, String name, int current, int size);
Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size); Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size,String companyId);
List queryPointListByRouteId(Long routeId); List queryPointListByRouteId(Long routeId);
......
...@@ -1229,6 +1229,9 @@ ...@@ -1229,6 +1229,9 @@
<if test="nullRiskSourceId == true"> <if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='') AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='')
</if> </if>
<if test="companyId != null and companyId != '' ">
AND PP.charge_dept_id = #{companyId}
</if>
<if test="bizOrgCode != null and bizOrgCode != '' "> <if test="bizOrgCode != null and bizOrgCode != '' ">
AND PP.biz_org_code LIKE CONCAT (#{bizOrgCode},'%') AND PP.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if> </if>
...@@ -1303,6 +1306,9 @@ ...@@ -1303,6 +1306,9 @@
<if test="bizOrgCode != null and bizOrgCode != '' "> <if test="bizOrgCode != null and bizOrgCode != '' ">
AND PP.biz_org_code LIKE CONCAT (#{bizOrgCode},'%') AND PP.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if> </if>
<if test="companyId != null and companyId != '' ">
AND PP.charge_dept_id = #{companyId}
</if>
and ( select COUNT(p_point_inputitem.id) fROM p_point_inputitem where p_point_inputitem.point_id =pp.id) >0 and ( select COUNT(p_point_inputitem.id) fROM p_point_inputitem where p_point_inputitem.point_id =pp.id) >0
AND pp.is_delete = 0 AND pp.is_delete = 0
</where> </where>
......
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