Browse Source

Merge remote-tracking branch 'origin/master'

feature/teamB_zz_wgh
jianjun 3 years ago
parent
commit
1f3720f043
  1. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelAgencyGridIdResultDTO.java
  2. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  3. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  6. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  7. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  8. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  9. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  10. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  11. 9
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  12. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java
  13. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  14. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  15. 10
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DelAgencyGridIdResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 无效组织网格Id列表
*/
@Data
public class DelAgencyGridIdResultDTO implements Serializable {
//组织Id集合
private List<String> agencyIdList;
//网格Id集合
private List<String> gridIdList;
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -617,7 +617,6 @@ public interface GovOrgOpenFeignClient {
/**
* Desc: 房屋更新
* @param tokenDTO
* @param formDTO
* @author zxc
* @date 2022/5/11 09:46
@ -632,4 +631,12 @@ public interface GovOrgOpenFeignClient {
*/
@GetMapping("/gov/org/customeragency/subOrgList/{agencyId}")
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId")String agencyId);
/**
* @Author sun
* @Description 获取当前组织及下级无效组织网格Id列表
**/
@PostMapping(value = "/gov/org/customeragency/getDelAgencyGridIdList/{agencyId}")
Result<DelAgencyGridIdResultDTO> getDelAgencyGridIdList(@PathVariable("agencyId") String agencyId);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -414,4 +414,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<SubOrgResDTO>> subOrgList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",agencyId);
}
@Override
public Result<DelAgencyGridIdResultDTO> getDelAgencyGridIdList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDelAgencyGridIdList", agencyId);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -440,5 +440,14 @@ public class CustomerAgencyController {
return new Result<List<SubOrgResDTO>>().ok(list);
}
/**
* @Author sun
* @Description 获取当前组织及下级无效组织网格Id列表
**/
@PostMapping("getDelAgencyGridIdList/{agencyId}")
public Result<DelAgencyGridIdResultDTO> getDelAgencyGridIdList(@PathVariable("agencyId") String agencyId) {
return new Result<DelAgencyGridIdResultDTO>().ok(customerAgencyService.getDelAgencyGridIdList(agencyId));
}
}

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

@ -342,5 +342,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<AgencyAddressBookTreeResultDTO> getAddressTree(@Param("name") String name,
@Param("customerId") String customerId);
List<String> getDelAgencyIdList(@Param("agencyId") String agencyId);
}

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

@ -382,4 +382,6 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @return
*/
int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount);
List<String> getDelGridIdList(@Param("agencyId") String agencyId);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -304,4 +304,10 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.PartyOrgTreeResultDTO>>
*/
Result<List<PartyOrgTreeResultDTO>> getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto);
/**
* @Author sun
* @Description 获取当前组织及下级无效组织网格Id列表
**/
DelAgencyGridIdResultDTO getDelAgencyGridIdList(String agencyId);
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1526,4 +1526,20 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return baseDao.selectSubOrg(agencyId);
}
/**
* @Author sun
* @Description 获取当前组织及下级无效组织网格Id列表
**/
@Override
public DelAgencyGridIdResultDTO getDelAgencyGridIdList(String agencyId) {
DelAgencyGridIdResultDTO resultDTO = new DelAgencyGridIdResultDTO();
//查询当前组织及下级无效组织列表
List<String> agencyIdList = baseDao.getDelAgencyIdList(agencyId);
//查询当做组织及下级无效网格列表
List<String> gridIdList = customerGridDao.getDelGridIdList(agencyId);
resultDTO.setAgencyIdList(agencyIdList);
resultDTO.setGridIdList(gridIdList);
return resultDTO;
}
}

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

@ -857,4 +857,15 @@
</if>
order by CREATED_TIME desc
</select>
<select id="getDelAgencyIdList" resultType="java.lang.String">
SELECT
id
FROM
customer_agency
WHERE
del_flag = '1'
AND pids LIKE CONCAT('%', #{agencyId}, '%')
</select>
</mapper>

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -846,6 +846,17 @@
</foreach>
)
</select>
<select id="getDelGridIdList" resultType="java.lang.String">
SELECT
id
FROM
customer_grid
WHERE
del_flag = '1'
AND pids LIKE CONCAT('%', #{agencyId}, '%')
</select>
<update id="updateTotalUser">
UPDATE customer_grid SET total_user = total_user+#{incrCount}
where id = #{gridId} and del_flag = '0'

9
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -347,9 +347,12 @@
<choose>
<when test='orgType == "agency"'>
AND neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and (agency_id = #{orgId} OR agency_pids LIKE CONCAT('%', #{orgId}, '%'))
select a.id from ic_neighbor_hood a
<!-- 排除掉无效组织、网格数据 -->
inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0'
inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0'
where a.del_flag = '0'
and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%'))
)
</when>
<when test='orgType == "grid"'>

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java

@ -29,5 +29,9 @@ public class UserChartFormDTO implements Serializable {
//token这信息
private String customerId;
private String userId;
//无效组织Id集合
private List<String> agencyIdList;
//无效网格Id集合
private List<String> gridIdList;
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -306,7 +306,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
IcResiUserEntity selectResiNoDelFlag(@Param("icResiUserId") String icResiUserId);
List<UserChartResultDTO> userChart(@Param("orgId") String orgId, @Param("orgType") String orgType);
List<UserChartResultDTO> userChart(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("agencyIdList") List<String> agencyIdList, @Param("gridIdList") List<String> gridIdList);
/**
* desc:根据维度获取居民信息表的数据[正常状态的居民]

21
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1842,19 +1842,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
//获取无效组织网格Id列表
if("agency".equals(formDTO.getOrgType())){
//查询组织数据时排除掉当前组织及下级无效组织列表
Result<DelAgencyGridIdResultDTO> result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId());
if (!result.success()) {
throw new EpmetException(String.format("获取当前组织及下级已删除组织、网格列表失败,组织Id->%s", formDTO.getUserId()));
}
formDTO.setAgencyIdList(result.getData().getAgencyIdList());
formDTO.setGridIdList(result.getData().getGridIdList());
}
//2.根据入参值查询对应的房屋统计数据
List<UserChartResultDTO> list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType());
List<UserChartResultDTO> list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getAgencyIdList(), formDTO.getGridIdList());
//3.汇总数据
AtomicInteger userTotal = new AtomicInteger();
AtomicInteger czUserTotal = new AtomicInteger();
AtomicInteger ldUserTotal = new AtomicInteger();
list.forEach(l -> {
userTotal.addAndGet(l.getNum());
if ("0".equals(l.getIsFloating())) {
resultDTO.setCzUserTotal(l.getNum());
czUserTotal.addAndGet(l.getNum());
} else {
resultDTO.setLdUserTotal(l.getNum());
ldUserTotal.addAndGet(l.getNum());
}
});
resultDTO.setUserTotal(userTotal.get());
resultDTO.setCzUserTotal(czUserTotal.get());
resultDTO.setLdUserTotal(ldUserTotal.get());
resultDTO.setCzUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getCzUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzUserTotal() / (float) resultDTO.getUserTotal()) * 100)));
resultDTO.setLdUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getLdUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getLdUserTotal() / (float) resultDTO.getUserTotal()) * 100)));
resultDTO.setOrgId(formDTO.getOrgId());

10
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -952,6 +952,16 @@
<choose>
<when test='orgType == "agency"'>
AND (agency_id = #{orgId} OR pids LIKE CONCAT('%', #{orgId}, '%'))
<if test='null != agencyIdList and agencyIdList.size() > 0'>
<foreach collection="agencyIdList" item="agencyId" open="AND agency_id NOT IN (" separator="," close=")">
#{agencyId}
</foreach>
</if>
<if test='null != gridIdList and gridIdList.size() > 0'>
<foreach collection="gridIdList" item="gridId" open="AND grid_id NOT IN (" separator="," close=")">
#{gridId}
</foreach>
</if>
</when>
<when test='orgType == "grid"'>
AND grid_id = #{orgId}

Loading…
Cancel
Save