diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MicroGridScreenDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MicroGridScreenDetailResultDTO.java new file mode 100755 index 0000000000..63554c37d3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MicroGridScreenDetailResultDTO.java @@ -0,0 +1,103 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 微网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-07 + */ +@Data +public class MicroGridScreenDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + + /** + * 微网格名称 + */ + private String microgridName; + + /** + * 微网格长 + */ + private String contacts; + + /** + * 性别(女性-0,男性-1) + */ + private String sex; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * 网格id + */ + private String gridId; + + /** + * 所属组织机构ID + */ + private String agencyId; + + /** + * 所有上级组织ID + */ + private String agencyPids; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 网格排序 + */ + private Integer sort; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 中心点位地址 + */ + private String centerAddress; + + /** + * 坐标区域 + */ + private String coordinates; + + /** + * 编码 + */ + private String code; + + private Integer houseNum; + + private Integer buildingNum; + + private Integer resiNum; + + private Integer dangyuanNum; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java index ec3b6a1b45..ae675db767 100755 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java @@ -14,6 +14,7 @@ import com.epmet.dto.form.CustomerMicroGridExportFormDTO; import com.epmet.dto.form.CustomerMicroGridPageFormDTO; import com.epmet.dto.result.CustomerMicroGridDetailResultDTO; import com.epmet.dto.result.CustomerMicroGridPageResultDTO; +import com.epmet.dto.result.MicroGridScreenDetailResultDTO; import com.epmet.excel.CustomerMicroGridExcel; import com.epmet.service.CustomerMicroGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -82,5 +83,31 @@ public class CustomerMicroGridController { } + /** + * @Description: 大屏获取 微网格列表 + * @param gridId: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: lichao + * @Date: 2023/12/8 09:41 + */ + @GetMapping("screen/searchByGridId") + public Result> searchByGridId(String gridId){ + List result = customerMicroGridService.searchByGridId(gridId); + return new Result>().ok(result); + } + + /** + * @Description: 大屏详情 + * @param microGridId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: lichao + * @Date: 2023/12/8 09:56 + */ + @GetMapping("screen/detail") + public Result screenDetail(String microGridId){ + MicroGridScreenDetailResultDTO result = customerMicroGridService.screenDetail(microGridId); + return new Result().ok(result); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java index ca61b8ce5c..80369417eb 100755 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java @@ -7,6 +7,7 @@ import com.epmet.dto.form.CustomerMicroGridExportFormDTO; import com.epmet.dto.form.CustomerMicroGridPageFormDTO; import com.epmet.dto.result.CustomerMicroGridDetailResultDTO; import com.epmet.dto.result.CustomerMicroGridPageResultDTO; +import com.epmet.dto.result.MicroGridScreenDetailResultDTO; import com.epmet.entity.CustomerMicroGridEntity; import java.util.List; @@ -81,4 +82,8 @@ public interface CustomerMicroGridService extends BaseService exportList(CustomerMicroGridExportFormDTO dto); + + List searchByGridId(String gridId); + + MicroGridScreenDetailResultDTO screenDetail(String microGridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java index 2f5a1e58b7..d1045c6b7c 100755 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java @@ -4,21 +4,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerMicroGridDao; +import com.epmet.dao.IcHouseDao; import com.epmet.dto.CustomerMicroGridDTO; import com.epmet.dto.IcBirthRecordDTO; import com.epmet.dto.form.CustomerMicroGridExportFormDTO; import com.epmet.dto.form.CustomerMicroGridPageFormDTO; import com.epmet.dto.result.CustomerMicroGridDetailResultDTO; import com.epmet.dto.result.CustomerMicroGridPageResultDTO; +import com.epmet.dto.result.IcResiScreenResultDTO; +import com.epmet.dto.result.MicroGridScreenDetailResultDTO; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.entity.CustomerMicroGridEntity; +import com.epmet.entity.IcHouseEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.CustomerMicroGridRedis; import com.epmet.service.CustomerMicroGridService; import com.github.pagehelper.PageHelper; @@ -31,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 微网格表 @@ -47,6 +54,10 @@ public class CustomerMicroGridServiceImpl extends BaseServiceImpl page(CustomerMicroGridPageFormDTO dto) { @@ -124,4 +135,45 @@ public class CustomerMicroGridServiceImpl extends BaseServiceImpl searchByGridId(String gridId) { + LambdaQueryWrapper customerMicroGridEntityLambdaQueryWrapper = + new LambdaQueryWrapper().eq(CustomerMicroGridEntity::getGridId,gridId); + List customerMicroGridEntities = baseDao.selectList(customerMicroGridEntityLambdaQueryWrapper); + return ConvertUtils.sourceToTarget(customerMicroGridEntities,CustomerMicroGridPageResultDTO.class); + } + + @Override + public MicroGridScreenDetailResultDTO screenDetail(String microGridId) { + + CustomerMicroGridEntity entity = baseDao.selectById(microGridId); + if (entity == null){ + throw new EpmetException("未查询到微网格信息"); + } + + MicroGridScreenDetailResultDTO result = ConvertUtils.sourceToTarget(entity,MicroGridScreenDetailResultDTO.class); + + LambdaQueryWrapper houseEntityLambdaQueryWrapper = + new LambdaQueryWrapper().eq(IcHouseEntity::getMicroGridId,microGridId); + List houseEntities = houseDao.selectList(houseEntityLambdaQueryWrapper); + result.setHouseNum(houseEntities.size()); + if (houseEntities.size()>0){ + + List houseIds = houseEntities.stream().map(IcHouseEntity::getId).collect(Collectors.toList()); + + IcResiScreenResultDTO resiScreenResultDTO = epmetUserOpenFeignClient.getScreenResiStatistics(houseIds).getData(); + if (resiScreenResultDTO!=null){ + result.setResiNum(resiScreenResultDTO.getResiCount()); + result.setDangyuanNum(resiScreenResultDTO.getDangyuanCount()); + } + } + + houseEntityLambdaQueryWrapper = + new LambdaQueryWrapper().eq(IcHouseEntity::getMicroGridId,microGridId).groupBy(IcHouseEntity::getBuildingId); + List buildingCount = houseDao.selectList(houseEntityLambdaQueryWrapper); + result.setBuildingNum(buildingCount.size()); + + return result; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserScreenListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserScreenListFormDTO.java index 8c7da5a200..3dc6c92053 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserScreenListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserScreenListFormDTO.java @@ -17,4 +17,5 @@ public class IcUserScreenListFormDTO implements Serializable { private String level; private Integer pageSize; private Integer pageNo; + private Integer dangyuan; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiScreenResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiScreenResultDTO.java new file mode 100644 index 0000000000..51b5ef380f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiScreenResultDTO.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 居民 大屏 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-04 + */ +@Data +public class IcResiScreenResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private Integer resiCount; + + private Integer dangyuanCount; +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e37454ed35..a4404b5be1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -729,6 +729,10 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/getexistuserbyhouseids") Result> getExistUserByHouseIds(@RequestBody List ids); + + @PostMapping("/epmetuser/icresiuser/getScreenResiStatistics") + Result getScreenResiStatistics(@RequestBody List ids); + /** * 租客房东根据身份证更新头像 * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 71711e66a8..6e3d26c42b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -546,6 +546,11 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getExistUserByHouseIds", ids); } + @Override + public Result getScreenResiStatistics(List ids) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getScreenResiStatistics", ids); + } + @Override public Result updateImage(@RequestBody RentTenantFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateImage", formDTO); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index b1a678597c..989640c0f1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -1047,6 +1047,11 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(icResiUserService.getExistUserByHouseIds(ids)); } + @PostMapping("getScreenResiStatistics") + public Result getScreenResiStatistics(@RequestBody List ids) { + return new Result().ok(icResiUserService.getScreenResiStatistics(ids)); + } + /** * @Author sun * @Description 【人房】居民总数饼图 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index efc4a6980b..47b98d2ecf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -291,6 +291,9 @@ public interface IcResiUserDao extends BaseDao { */ List getExistUserByHouseIds(@Param("ids") List ids); + + IcResiScreenResultDTO getScreenResiStatistics(@Param("ids") List ids); + /** * 居民防疫信息查询 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 8aed1cee26..e50a51ed34 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -515,4 +515,6 @@ public interface IcResiUserService extends BaseService { List getScreenUserStatistics(String agencyId, String level); PageData getScreenUserList(IcUserScreenListFormDTO dto); + + IcResiScreenResultDTO getScreenResiStatistics(List ids); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 15db43ad32..ab61ba5bab 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -3343,12 +3343,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl pageData = new PageInfo<>(); + LambdaQueryWrapper userEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + if (dto.getDangyuan()!=null && dto.getDangyuan() == 1){ + userEntityLambdaQueryWrapper.eq(IcResiUserEntity::getIsParty,1); + } if (dto.getLevel().equals("street")){ CustomerAgencyDTO customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(dto.getAgencyId()).getData(); - LambdaQueryWrapper userEntityLambdaQueryWrapper - = new LambdaQueryWrapper().likeRight(IcResiUserEntity::getPids, customerAgencyDTO.getPids()+":"+customerAgencyDTO.getId()); + userEntityLambdaQueryWrapper.likeRight(IcResiUserEntity::getPids, customerAgencyDTO.getPids()+":"+customerAgencyDTO.getId()); PageHelper.startPage(dto.getPageNo(),dto.getPageSize()); @@ -3361,8 +3364,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userEntityLambdaQueryWrapper - = new LambdaQueryWrapper().eq(IcResiUserEntity::getAgencyId, dto.getAgencyId()); + userEntityLambdaQueryWrapper.eq(IcResiUserEntity::getAgencyId, dto.getAgencyId()); PageHelper.startPage(dto.getPageNo(),dto.getPageSize()); @@ -3375,8 +3377,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userEntityLambdaQueryWrapper - = new LambdaQueryWrapper().eq(IcResiUserEntity::getGridId, dto.getAgencyId()); + userEntityLambdaQueryWrapper.eq(IcResiUserEntity::getGridId, dto.getAgencyId()); PageHelper.startPage(dto.getPageNo(),dto.getPageSize()); @@ -3392,6 +3393,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl(list,pageData.getTotal()); } + @Override + public IcResiScreenResultDTO getScreenResiStatistics(List ids) { + return baseDao.getScreenResiStatistics(ids); + } + public PaCustomerDTO getCustomerInfo(String appId) { JSONObject jsonObject = new JSONObject(); String data = HttpClientManager.getInstance().sendPostByJSON("https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/" + appId, JSON.toJSONString(jsonObject)).getData(); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 631d1e8fcc..76378d7ea8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1293,4 +1293,17 @@ where PIDS like concat(#{pids},'%') +