diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml index ad85f31..d56e31f 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml @@ -249,12 +249,13 @@ resultType="com.casic.missiles.modular.system.dto.BatchExportDataDto" parameterType="com.baomidou.mybatisplus.plugins.Page"> SELECT w.WELL_CODE AS wellCode, w.WELL_NAME AS wellName, w.deep, w.WELL_TYPE AS wellType,w.deptid AS deptId, - w.bfzt, w.position,w.id, IFNULL(deviceCount,0) AS deviceCount + w.bfzt, concat(sa.fullName, '/', w.position) as position, w.id, IFNULL(deviceCount,0) AS deviceCount FROM bus_well_info w LEFT JOIN (SELECT COUNT(1) AS deviceCount ,well_id FROM bus_device_well d WHERE d.VALID = '1' GROUP BY well_id) c ON w.id = c.well_id + left join sys_area sa on sa.id = w.area WHERE w.VALID = '1' AND w.WELL_CODE LIKE CONCAT('%',#{keywords},'%') @@ -265,6 +266,9 @@ and w.DEPTID = #{deptid} + + and area IN (${areaId}) + + SELECT + sa.id + FROM sys_area sa + where 1=1 + + AND (sa.PIDS like CONCAT('%[',#{areaId},']%')) + + + diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml index ad85f31..d56e31f 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml @@ -249,12 +249,13 @@ resultType="com.casic.missiles.modular.system.dto.BatchExportDataDto" parameterType="com.baomidou.mybatisplus.plugins.Page"> SELECT w.WELL_CODE AS wellCode, w.WELL_NAME AS wellName, w.deep, w.WELL_TYPE AS wellType,w.deptid AS deptId, - w.bfzt, w.position,w.id, IFNULL(deviceCount,0) AS deviceCount + w.bfzt, concat(sa.fullName, '/', w.position) as position, w.id, IFNULL(deviceCount,0) AS deviceCount FROM bus_well_info w LEFT JOIN (SELECT COUNT(1) AS deviceCount ,well_id FROM bus_device_well d WHERE d.VALID = '1' GROUP BY well_id) c ON w.id = c.well_id + left join sys_area sa on sa.id = w.area WHERE w.VALID = '1' AND w.WELL_CODE LIKE CONCAT('%',#{keywords},'%') @@ -265,6 +266,9 @@ and w.DEPTID = #{deptid} + + and area IN (${areaId}) + + SELECT + sa.id + FROM sys_area sa + where 1=1 + + AND (sa.PIDS like CONCAT('%[',#{areaId},']%')) + + + diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java index b5f4079..efc0767 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java @@ -17,5 +17,5 @@ private Integer deviceCount;//设备数量 private String bfzt;//布防状态 private String bfztName;//布防状态名称 - + private String areaFullName; // 所在分区全称 } diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml index ad85f31..d56e31f 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml @@ -249,12 +249,13 @@ resultType="com.casic.missiles.modular.system.dto.BatchExportDataDto" parameterType="com.baomidou.mybatisplus.plugins.Page"> SELECT w.WELL_CODE AS wellCode, w.WELL_NAME AS wellName, w.deep, w.WELL_TYPE AS wellType,w.deptid AS deptId, - w.bfzt, w.position,w.id, IFNULL(deviceCount,0) AS deviceCount + w.bfzt, concat(sa.fullName, '/', w.position) as position, w.id, IFNULL(deviceCount,0) AS deviceCount FROM bus_well_info w LEFT JOIN (SELECT COUNT(1) AS deviceCount ,well_id FROM bus_device_well d WHERE d.VALID = '1' GROUP BY well_id) c ON w.id = c.well_id + left join sys_area sa on sa.id = w.area WHERE w.VALID = '1' AND w.WELL_CODE LIKE CONCAT('%',#{keywords},'%') @@ -265,6 +266,9 @@ and w.DEPTID = #{deptid} + + and area IN (${areaId}) + + SELECT + sa.id + FROM sys_area sa + where 1=1 + + AND (sa.PIDS like CONCAT('%[',#{areaId},']%')) + + + diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java index b5f4079..efc0767 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java @@ -17,5 +17,5 @@ private Integer deviceCount;//设备数量 private String bfzt;//布防状态 private String bfztName;//布防状态名称 - + private String areaFullName; // 所在分区全称 } diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java index 8996b83..07e97bb 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java @@ -14,11 +14,8 @@ add(new Header("井编号", "wellCode")); add(new Header("井名称", "wellName")); add(new Header("井深", "deep")); - add(new Header("详细地址", "position")); - add(new Header("井类型", "wellTypeName")); - add(new Header("权属单位", "deptName")); + add(new Header("详细位置", "position")); add(new Header("设备数量", "deviceCount")); - add(new Header("布防状态", "bfztName")); }}, "sluicewell.xlsx", "井数据导出"); //SLUICEWELLDATA_EXPORT("sluicewell.xlsx", "sluicewell.xlsx", "闸井数据"); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml index ad85f31..d56e31f 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml @@ -249,12 +249,13 @@ resultType="com.casic.missiles.modular.system.dto.BatchExportDataDto" parameterType="com.baomidou.mybatisplus.plugins.Page"> SELECT w.WELL_CODE AS wellCode, w.WELL_NAME AS wellName, w.deep, w.WELL_TYPE AS wellType,w.deptid AS deptId, - w.bfzt, w.position,w.id, IFNULL(deviceCount,0) AS deviceCount + w.bfzt, concat(sa.fullName, '/', w.position) as position, w.id, IFNULL(deviceCount,0) AS deviceCount FROM bus_well_info w LEFT JOIN (SELECT COUNT(1) AS deviceCount ,well_id FROM bus_device_well d WHERE d.VALID = '1' GROUP BY well_id) c ON w.id = c.well_id + left join sys_area sa on sa.id = w.area WHERE w.VALID = '1' AND w.WELL_CODE LIKE CONCAT('%',#{keywords},'%') @@ -265,6 +266,9 @@ and w.DEPTID = #{deptid} + + and area IN (${areaId}) + + SELECT + sa.id + FROM sys_area sa + where 1=1 + + AND (sa.PIDS like CONCAT('%[',#{areaId},']%')) + + + diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java index b5f4079..efc0767 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java @@ -17,5 +17,5 @@ private Integer deviceCount;//设备数量 private String bfzt;//布防状态 private String bfztName;//布防状态名称 - + private String areaFullName; // 所在分区全称 } diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java index 8996b83..07e97bb 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java @@ -14,11 +14,8 @@ add(new Header("井编号", "wellCode")); add(new Header("井名称", "wellName")); add(new Header("井深", "deep")); - add(new Header("详细地址", "position")); - add(new Header("井类型", "wellTypeName")); - add(new Header("权属单位", "deptName")); + add(new Header("详细位置", "position")); add(new Header("设备数量", "deviceCount")); - add(new Header("布防状态", "bfztName")); }}, "sluicewell.xlsx", "井数据导出"); //SLUICEWELLDATA_EXPORT("sluicewell.xlsx", "sluicewell.xlsx", "闸井数据"); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java index c8574da..871769a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java @@ -39,7 +39,7 @@ List selectDataScope(DataScope dataScope, Page page, String deviceType, String deptid, String keywords); - List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords); + List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords, String areaId); Integer getDeviceCountData(Long id); String getDeptNameData(String deptid); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java index 1e17979..bdd7871 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/controller/BusWellInfoController.java @@ -370,22 +370,21 @@ @ApiOperation("批量导出井接口") @RequestMapping(value = "/batchExport", method = RequestMethod.GET) @ResponseBody - public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid) throws IOException { - + public void batchExport(HttpServletResponse response, String keywords, String wellType, String deptid, String areaId) throws IOException { Page page = new PageFactory().defaultPage(); page.setSearchCount(false); page.setCurrent(1); page.setSize(Integer.MAX_VALUE); DataScope dataScope = permissionService.getCurrUserDataScope(); - List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords); - list.forEach(batchExportDataDto -> { - batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); -// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); -// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); - batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); - batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); - - }); + List list = busWellInfoService.getBatchExportData(dataScope, page, wellType, deptid, keywords, areaId); +// list.forEach(batchExportDataDto -> { +//// batchExportDataDto.setBfztName(permissionService.getDictNameByCode("bfzt", batchExportDataDto.getBfzt())); +//// batchExportDataDto.setDeviceCount(busWellInfoService.getDeviceCountData(batchExportDataDto.getId())); +//// batchExportDataDto.setDeptName(busWellInfoService.getDeptNameData(batchExportDataDto.getDeptId())); +//// batchExportDataDto.setWellTypeName(permissionService.getDictNameByCode(BusWellConst.SLUICEWELL_TYPE, batchExportDataDto.getWellType())); +//// batchExportDataDto.setDeptName(permissionService.getDeptName(batchExportDataDto.getDeptId())); +// +// }); List res = new ArrayList<>(); res.addAll(list); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java index adbcc3a..3cf3a5a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/BusWellInfoMapper.java @@ -51,7 +51,7 @@ List selectDataScope(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); - List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords); + List getBatchExportData(@Param("scope") DataScope dataScope, @Param("page") Page page, @Param("wellType") String deviceType, @Param("deptid") String deptid, @Param("keywords") String keywords, @Param("areaId") String areaId); Integer deviceCountData(@Param("id") Long id); @@ -59,6 +59,7 @@ String deptNameData(@Param("deptid") String deptid); String getAreaId(@Param("qu") String qu, @Param("area") String area); + List getAreaIds(@Param("areaId") Long areaId); String getArea(@Param("id") String id); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml index ad85f31..d56e31f 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dao/mapping/BusWellInfoMapper.xml @@ -249,12 +249,13 @@ resultType="com.casic.missiles.modular.system.dto.BatchExportDataDto" parameterType="com.baomidou.mybatisplus.plugins.Page"> SELECT w.WELL_CODE AS wellCode, w.WELL_NAME AS wellName, w.deep, w.WELL_TYPE AS wellType,w.deptid AS deptId, - w.bfzt, w.position,w.id, IFNULL(deviceCount,0) AS deviceCount + w.bfzt, concat(sa.fullName, '/', w.position) as position, w.id, IFNULL(deviceCount,0) AS deviceCount FROM bus_well_info w LEFT JOIN (SELECT COUNT(1) AS deviceCount ,well_id FROM bus_device_well d WHERE d.VALID = '1' GROUP BY well_id) c ON w.id = c.well_id + left join sys_area sa on sa.id = w.area WHERE w.VALID = '1' AND w.WELL_CODE LIKE CONCAT('%',#{keywords},'%') @@ -265,6 +266,9 @@ and w.DEPTID = #{deptid} + + and area IN (${areaId}) + + SELECT + sa.id + FROM sys_area sa + where 1=1 + + AND (sa.PIDS like CONCAT('%[',#{areaId},']%')) + + + diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java index b5f4079..efc0767 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/dto/BatchExportDataDto.java @@ -17,5 +17,5 @@ private Integer deviceCount;//设备数量 private String bfzt;//布防状态 private String bfztName;//布防状态名称 - + private String areaFullName; // 所在分区全称 } diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java index 8996b83..07e97bb 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/enmus/SluicewellExportEnum.java @@ -14,11 +14,8 @@ add(new Header("井编号", "wellCode")); add(new Header("井名称", "wellName")); add(new Header("井深", "deep")); - add(new Header("详细地址", "position")); - add(new Header("井类型", "wellTypeName")); - add(new Header("权属单位", "deptName")); + add(new Header("详细位置", "position")); add(new Header("设备数量", "deviceCount")); - add(new Header("布防状态", "bfztName")); }}, "sluicewell.xlsx", "井数据导出"); //SLUICEWELLDATA_EXPORT("sluicewell.xlsx", "sluicewell.xlsx", "闸井数据"); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java index c8574da..871769a 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/IBusWellInfoService.java @@ -39,7 +39,7 @@ List selectDataScope(DataScope dataScope, Page page, String deviceType, String deptid, String keywords); - List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords); + List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords, String areaId); Integer getDeviceCountData(Long id); String getDeptNameData(String deptid); diff --git a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/impl/BusWellInfoServiceImpl.java b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/impl/BusWellInfoServiceImpl.java index 59ec1ba..19a88df 100644 --- a/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/impl/BusWellInfoServiceImpl.java +++ b/casic-sluicewell/src/main/java/com/casic/missiles/modular/system/service/impl/BusWellInfoServiceImpl.java @@ -16,6 +16,7 @@ import com.casic.missiles.modular.system.model.Dict; import com.casic.missiles.modular.system.service.IBusWellInfoService; import com.casic.missiles.modular.system.util.Utility; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -418,8 +419,13 @@ } @Override - public List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords) { - return this.baseMapper.getBatchExportData(dataScope, page, deviceType, deptid, keywords); + public List getBatchExportData(DataScope dataScope, Page page, String deviceType, String deptid, String keywords, String areaId) { + String areaIds =""; + if(ToolUtil.isNotEmpty(areaId)){ + List areaIdList= getAreaPids(Long.valueOf(areaId)); + areaIds= StringUtils.join(areaIdList.toArray(),","); + } + return this.baseMapper.getBatchExportData(dataScope, page, deviceType, deptid, keywords, areaIds); } @Override @@ -444,6 +450,15 @@ // return fullName; } + public List getAreaPids(Long areaId) { + List areaIds = null; + if (ToolUtil.isNotEmpty(areaId)) { + areaIds = this.baseMapper.getAreaIds(areaId); + areaIds.add(areaId); + } + return areaIds; + } + @Override public List deleteBatchByIds(List ids) {