Browse Source

大屏 微网格相关

master
lichao 2 years ago
parent
commit
b156cf8658
  1. 103
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MicroGridScreenDetailResultDTO.java
  2. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java
  3. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java
  4. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java
  5. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserScreenListFormDTO.java
  6. 40
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiScreenResultDTO.java
  7. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  8. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  9. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  10. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  11. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  12. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  13. 13
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

103
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;
}

27
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<java.util.List < com.epmet.dto.result.CustomerMicroGridPageResultDTO>>
* @Author: lichao
* @Date: 2023/12/8 09:41
*/
@GetMapping("screen/searchByGridId")
public Result<List<CustomerMicroGridPageResultDTO>> searchByGridId(String gridId){
List<CustomerMicroGridPageResultDTO> result = customerMicroGridService.searchByGridId(gridId);
return new Result<List<CustomerMicroGridPageResultDTO>>().ok(result);
}
/**
* @Description: 大屏详情
* @param microGridId:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.MicroGridScreenDetailResultDTO>
* @Author: lichao
* @Date: 2023/12/8 09:56
*/
@GetMapping("screen/detail")
public Result<MicroGridScreenDetailResultDTO> screenDetail(String microGridId){
MicroGridScreenDetailResultDTO result = customerMicroGridService.screenDetail(microGridId);
return new Result<MicroGridScreenDetailResultDTO>().ok(result);
}
}

5
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<CustomerMicroGridE
void delete(String[] ids);
List<CustomerMicroGridPageResultDTO> exportList(CustomerMicroGridExportFormDTO dto);
List<CustomerMicroGridPageResultDTO> searchByGridId(String gridId);
MicroGridScreenDetailResultDTO screenDetail(String microGridId);
}

52
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<CustomerMicroG
private CustomerAgencyDao customerAgencyDao;
@Autowired
private CustomerGridDao customerGridDao;
@Autowired
private IcHouseDao houseDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<CustomerMicroGridPageResultDTO> page(CustomerMicroGridPageFormDTO dto) {
@ -124,4 +135,45 @@ public class CustomerMicroGridServiceImpl extends BaseServiceImpl<CustomerMicroG
return entityList;
}
@Override
public List<CustomerMicroGridPageResultDTO> searchByGridId(String gridId) {
LambdaQueryWrapper<CustomerMicroGridEntity> customerMicroGridEntityLambdaQueryWrapper =
new LambdaQueryWrapper<CustomerMicroGridEntity>().eq(CustomerMicroGridEntity::getGridId,gridId);
List<CustomerMicroGridEntity> 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<IcHouseEntity> houseEntityLambdaQueryWrapper =
new LambdaQueryWrapper<IcHouseEntity>().eq(IcHouseEntity::getMicroGridId,microGridId);
List<IcHouseEntity> houseEntities = houseDao.selectList(houseEntityLambdaQueryWrapper);
result.setHouseNum(houseEntities.size());
if (houseEntities.size()>0){
List<String> 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<IcHouseEntity>().eq(IcHouseEntity::getMicroGridId,microGridId).groupBy(IcHouseEntity::getBuildingId);
List<IcHouseEntity> buildingCount = houseDao.selectList(houseEntityLambdaQueryWrapper);
result.setBuildingNum(buildingCount.size());
return result;
}
}

1
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;
}

40
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiScreenResultDTO.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

4
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<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids);
@PostMapping("/epmetuser/icresiuser/getScreenResiStatistics")
Result<IcResiScreenResultDTO> getScreenResiStatistics(@RequestBody List<String> ids);
/**
* 租客房东根据身份证更新头像
*

5
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<IcResiScreenResultDTO> getScreenResiStatistics(List<String> 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);

5
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<List<String>>().ok(icResiUserService.getExistUserByHouseIds(ids));
}
@PostMapping("getScreenResiStatistics")
public Result<IcResiScreenResultDTO> getScreenResiStatistics(@RequestBody List<String> ids) {
return new Result<IcResiScreenResultDTO>().ok(icResiUserService.getScreenResiStatistics(ids));
}
/**
* @Author sun
* @Description 人房居民总数饼图

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

@ -291,6 +291,9 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<String> getExistUserByHouseIds(@Param("ids") List<String> ids);
IcResiScreenResultDTO getScreenResiStatistics(@Param("ids") List<String> ids);
/**
* 居民防疫信息查询
*

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -515,4 +515,6 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
List<IcUserScreenResultDTO> getScreenUserStatistics(String agencyId, String level);
PageData<IcUserScreenListResultDTO> getScreenUserList(IcUserScreenListFormDTO dto);
IcResiScreenResultDTO getScreenResiStatistics(List<String> ids);
}

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

@ -3343,12 +3343,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
PageInfo<IcUserScreenListResultDTO> pageData = new PageInfo<>();
LambdaQueryWrapper<IcResiUserEntity> 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<IcResiUserEntity> userEntityLambdaQueryWrapper
= new LambdaQueryWrapper<IcResiUserEntity>().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<IcResiUserDao, IcResi
}
else if (dto.getLevel().equals("community")){
LambdaQueryWrapper<IcResiUserEntity> userEntityLambdaQueryWrapper
= new LambdaQueryWrapper<IcResiUserEntity>().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<IcResiUserDao, IcResi
}else if (dto.getLevel().equals("grid")){
LambdaQueryWrapper<IcResiUserEntity> userEntityLambdaQueryWrapper
= new LambdaQueryWrapper<IcResiUserEntity>().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<IcResiUserDao, IcResi
return new PageData<>(list,pageData.getTotal());
}
@Override
public IcResiScreenResultDTO getScreenResiStatistics(List<String> 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();

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

@ -1293,4 +1293,17 @@
where PIDS
like concat(#{pids},'%')
</select>
<select id="getScreenResiStatistics" resultType="com.epmet.dto.result.IcResiScreenResultDTO">
SELECT
count(1) as resiCount, count(IS_PARTY=1 or null) as dangyuanCount
FROM ic_resi_user
WHERE DEL_FLAG = '0'
AND home_id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

Loading…
Cancel
Save