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. 16
      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.ImportTaskCommonFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -183,8 +184,10 @@ public class IcNeighborHoodController {
* @date 2022/8/19 15:56
*/
@PostMapping("neighborhoodlist")
public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) {
return new Result<List<BuildingResultDTO>>().ok(icNeighborHoodService.getNeighborhoodList(tokenDto, dto));
public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody ChooseGridFormDTO 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);
Integer communityCount(@Param("pids") String pids);
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);

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.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
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>
* @author zhy
* @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.tools.dto.result.OptionResultDTO;
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.dto.IcNeighborHoodDTO;
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.ImportInfoFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.IcNeighborHoodDetailDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -123,13 +123,12 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
/**
* 获取用户组织下小区列表
*
* @param tokenDto
* @param dto
* @return java.util.List<com.epmet.dto.BuildingResultDTO>
* @author zhy
* @date 2022/8/19 15:57
*/
List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto);
List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto);
/**
* @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);
Date endTime = calendar.getTime();
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
/* AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
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);
// 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)) {
// 网格下不会有该数据,给个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.bean.AgencyInfoCache;
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.Result;
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.ImportTaskCommonFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel;
@ -242,8 +242,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
return datas;
}
public List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
public List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto) {
// if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) {
// log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
// CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
@ -253,7 +252,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
// }
// 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;
}
/**

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

@ -899,6 +899,16 @@
</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 count(*)
@ -1112,14 +1122,14 @@
select t.ID
from (select ca.ID
, ca.CREATED_TIME created_time
, count(csa.ID) community_count
, count(ca.ID) community_count
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
and ca.CUSTOMER_ID=#{customerId}
and ca.LEVEL = 'community'
<if test="endDate != null">
and csa.CREATED_TIME <![CDATA[<]]> #{endDate}
and ca.CREATED_TIME <![CDATA[<]]> #{endDate}
</if>
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%'))
group by ca.ID, ca.CREATED_TIME

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

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

Loading…
Cancel
Save