Browse Source

Merge remote-tracking branch 'origin_elink/yantai_zhengwu_master'

dev
yinzuomei 2 years ago
parent
commit
a05d9a03dd
  1. 33
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java
  2. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  4. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  5. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  6. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  7. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  8. 36
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  9. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

33
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.form.yt;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/4/19 14:13
*/
@Data
public class ChooseGridFormDTO extends PageFormDTO {
/**
* 客户id
*/
private String customerId;
/**
* 组织id
*/
private String agencyId;
/**
* 网格id
*/
private String gridId;
/**
* 楼栋名
*/
private String buildingName;
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -40,6 +40,7 @@ import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -183,8 +184,10 @@ public class IcNeighborHoodController {
* @date 2022/8/19 15:56 * @date 2022/8/19 15:56
*/ */
@PostMapping("neighborhoodlist") @PostMapping("neighborhoodlist")
public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody ChooseGridFormDTO dto) {
return new Result<List<BuildingResultDTO>>().ok(icNeighborHoodService.getNeighborhoodList(tokenDto, dto)); ValidatorUtils.validateEntity(dto, ChooseGridFormDTO.AddUserInternalGroup.class);
dto.setCustomerId(tokenDto.getCustomerId());
return new Result<List<BuildingResultDTO>>().ok(icNeighborHoodService.getNeighborhoodList(dto));
} }
/** /**

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -436,6 +436,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<AgencyCountCensusResultDTO> agencyCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); List<AgencyCountCensusResultDTO> agencyCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
Integer communityCount(@Param("pids") String pids);
Integer agencyGridCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); Integer agencyGridCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
Integer agencyStaffCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); Integer agencyStaffCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -19,7 +19,6 @@ package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.IcBuildingListFormDTO; import com.epmet.dto.form.IcBuildingListFormDTO;
@ -240,12 +239,14 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
/** /**
* 展示所有楼栋和小区信息 * 展示所有楼栋和小区信息
* *
* @param dto
* @return java.util.List<com.epmet.dto.result.BuildingResultDTO> * @return java.util.List<com.epmet.dto.result.BuildingResultDTO>
* @author zhy * @author zhy
* @date 2022/8/19 17:32 * @date 2022/8/19 17:32
*/ */
List<BuildingResultDTO> listBuildingInfo(IcNeighborHoodDTO dto); List<BuildingResultDTO> listBuildingInfo(@Param("customerId")String customerId,
@Param("agencyId")String agencyId,
@Param("gridId") String gridId,
@Param("buildingName")String buildingName);
/** /**

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -20,7 +20,6 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
@ -28,6 +27,7 @@ import com.epmet.dto.NeighborHoodAndManagementDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.IcNeighborHoodDetailDTO; import com.epmet.dto.result.IcNeighborHoodDetailDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -123,13 +123,12 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
/** /**
* 获取用户组织下小区列表 * 获取用户组织下小区列表
* *
* @param tokenDto
* @param dto * @param dto
* @return java.util.List<com.epmet.dto.BuildingResultDTO> * @return java.util.List<com.epmet.dto.BuildingResultDTO>
* @author zhy * @author zhy
* @date 2022/8/19 15:57 * @date 2022/8/19 15:57
*/ */
List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto); List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto);
/** /**
* @Description 通过ID查询小区信息 * @Description 通过ID查询小区信息

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -1147,12 +1147,15 @@ public class AgencyServiceImpl implements AgencyService {
calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.MILLISECOND, 0);
Date endTime = calendar.getTime(); Date endTime = calendar.getTime();
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); /* AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId()); agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId());
List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null); List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null);*/
// List<String> preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime); // List<String> preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime);
// return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size()); // return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size());
return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), 0); CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(orgId);
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
return new UsingCommunityStatsResultDTO(customerAgencyDao.communityCount(pids), 0);
} else if ("grid".equals(orgType)) { } else if ("grid".equals(orgType)) {
// 网格下不会有该数据,给个0 // 网格下不会有该数据,给个0
return new UsingCommunityStatsResultDTO(0, 0); return new UsingCommunityStatsResultDTO(0, 0);

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -44,7 +44,6 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant; import com.epmet.constant.CustomerGridConstant;
@ -55,6 +54,7 @@ import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
@ -242,8 +242,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
return datas; return datas;
} }
public List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) { public List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
// if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) { // if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) {
// log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); // log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
// CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); // CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
@ -253,7 +252,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
// } // }
// dto.setAgencyId(result.getAgencyId()); // dto.setAgencyId(result.getAgencyId());
// } // }
return icBuildingDao.listBuildingInfo(dto); PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
List<BuildingResultDTO> list = icBuildingDao.listBuildingInfo(dto.getCustomerId(), dto.getAgencyId(), dto.getGridId(), dto.getBuildingName());
return list;
} }
/** /**

36
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -899,6 +899,16 @@
</select> </select>
<select id="communityCount" resultType="java.lang.Integer">
select count(1)
from customer_agency agency
where agency.DEL_FLAG = 0
and agency.LEVEL = 'community'
and agency.PIDS like concat(#{pids},'%')
</select>
<select id="agencyGridCount" resultType="java.lang.Integer"> <select id="agencyGridCount" resultType="java.lang.Integer">
select count(*) select count(*)
@ -1112,21 +1122,21 @@
select t.ID select t.ID
from (select ca.ID from (select ca.ID
, ca.CREATED_TIME created_time , ca.CREATED_TIME created_time
, count(csa.ID) community_count , count(ca.ID) community_count
from customer_agency ca from customer_agency ca
inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0) <!--inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0)-->
where ca.DEL_FLAG = 0 where ca.DEL_FLAG = 0
and ca.CUSTOMER_ID=#{customerId} and ca.CUSTOMER_ID=#{customerId}
and ca.LEVEL = 'community' and ca.LEVEL = 'community'
<if test="endDate != null"> <if test="endDate != null">
and csa.CREATED_TIME <![CDATA[<]]> #{endDate} and ca.CREATED_TIME <![CDATA[<]]> #{endDate}
</if> </if>
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%'))
group by ca.ID, ca.CREATED_TIME group by ca.ID, ca.CREATED_TIME
having community_count > 0 having community_count > 0
order by created_time desc) t order by created_time desc) t
</select> </select>
<select id="getCurrentUserCommunityInfo" <select id="getCurrentUserCommunityInfo"
resultType="com.epmet.dto.result.CurrentUserCommunityInfoResultDTO"> resultType="com.epmet.dto.result.CurrentUserCommunityInfoResultDTO">
select select
ID AS orgId, ID AS orgId,
@ -1140,9 +1150,9 @@
</if> </if>
</select> </select>
<select id="selectAgencyTree" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> <select id="selectAgencyTree" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO">
SELECT SELECT
ca.ID as id, ca.ID as id,
ca.ORGANIZATION_NAME as label, ca.ORGANIZATION_NAME as label,
@ -1156,9 +1166,9 @@
WHERE WHERE
ca.ID = #{agencyId} ca.ID = #{agencyId}
AND ca.DEL_FLAG = '0' AND ca.DEL_FLAG = '0'
</select> </select>
<select id="selectNextOrg" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> <select id="selectNextOrg" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO">
(SELECT ca.ID as id, (SELECT ca.ID as id,
ca.ORGANIZATION_NAME as label, ca.ORGANIZATION_NAME as label,
ca.LONGITUDE as longitude, ca.LONGITUDE as longitude,
@ -1182,9 +1192,9 @@
WHERE cg.DEL_FLAG = '0' WHERE cg.DEL_FLAG = '0'
AND cg.PID = #{agencyId} AND cg.PID = #{agencyId}
ORDER BY cg.sort, CAST(cg.GRID_NAME AS SIGNED), CONVERT(cg.GRID_NAME using gbk)) ORDER BY cg.sort, CAST(cg.GRID_NAME AS SIGNED), CONVERT(cg.GRID_NAME using gbk))
</select> </select>
<select id="selectTotalNext" parameterType="java.lang.String" resultType="java.lang.Integer"> <select id="selectTotalNext" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT SELECT
sum( t.total ) sum( t.total )
FROM FROM
@ -1205,9 +1215,9 @@
g.PID = #{agencyId} g.PID = #{agencyId}
AND g.DEL_FLAG = '0' AND g.DEL_FLAG = '0'
) t ) t
</select> </select>
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName --> <!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName -->
<select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO"> <select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT SELECT
ca.id agencyId, ca.id agencyId,

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -517,11 +517,13 @@
a.ALL_PARENT_NAME, a.ALL_PARENT_NAME,
a.ORGANIZATION_NAME AS AGENCY_NAME, a.ORGANIZATION_NAME AS AGENCY_NAME,
n.CUSTOMER_ID n.CUSTOMER_ID
FROM FROM ic_building b
ic_building b LEFT JOIN ic_neighbor_hood n
LEFT JOIN ic_neighbor_hood n ON b.NEIGHBOR_HOOD_ID = n.id ON b.NEIGHBOR_HOOD_ID = n.id
LEFT JOIN customer_grid g ON n.GRID_ID = g.id LEFT JOIN customer_grid g
LEFT JOIN customer_agency a ON a.id = g.pid ON n.GRID_ID = g.id
LEFT JOIN customer_agency a
ON a.id = g.pid
WHERE WHERE
n.DEL_FLAG = '0' n.DEL_FLAG = '0'
AND b.DEL_FLAG = '0' AND b.DEL_FLAG = '0'
@ -532,13 +534,14 @@
AND n.GRID_ID = #{gridId} AND n.GRID_ID = #{gridId}
</if> </if>
<if test="buildingName != null and buildingName != ''"> <if test="buildingName != null and buildingName != ''">
AND (n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%') OR b.BUILDING_NAME LIKE CONCAT('%', #{buildingName}, '%')) AND n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%')
</if> </if>
<if test="agencyId != null and agencyId != ''"> <if test="agencyId != null and agencyId != ''">
AND ( AND (
n.AGENCY_ID = #{agencyId} n.AGENCY_ID = #{agencyId}
OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%')) OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%'))
</if> </if>
order by n.CREATED_TIME asc,n.id asc
</select> </select>
<select id="getBuildingInfoByName" resultType="com.epmet.entity.IcBuildingEntity" <select id="getBuildingInfoByName" resultType="com.epmet.entity.IcBuildingEntity"

Loading…
Cancel
Save