Browse Source

居民大屏统计

master
lichao 2 years ago
parent
commit
a72dfa0481
  1. 143
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerAgencyResultDTO.java
  2. 4
      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. 12
      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/service/CustomerAgencyService.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  7. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserStreetResultDTO.java
  8. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserStreetTypeResultDTO.java
  9. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  10. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  11. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  12. 34
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  13. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

143
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerAgencyResultDTO.java

@ -0,0 +1,143 @@
/**
* 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 2020-04-20
*/
@Data
public class CustomerAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 上级组织机构ID
*/
private String pid;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
private String pids;
/**
* 所有上级名称,-连接
*/
private String allParentName;
/**
* 组织名称
*/
private String organizationName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String level;
/**
* 地区编码
*/
private String areaCode;
/**
* 总人数
*/
private Integer totalUser;
/**
*
*/
private String province;
/**
* 城市名称
*/
private String city;
/**
* 区县名称
*/
private String district;
/**
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 街道
*/
private String street;
/**
* 社区名称0409
*/
private String community;
/**
* 坐标
*/
private String coordinates;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 中心点位位置
*/
private String centerAddress;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

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

@ -712,4 +712,8 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/department/notsyncdept") @PostMapping("/gov/org/department/notsyncdept")
Result<CheckStaffInfoResultDTO> notSyncDept(@RequestBody CheckStaffInfoFormDTO formDTO); Result<CheckStaffInfoResultDTO> notSyncDept(@RequestBody CheckStaffInfoFormDTO formDTO);
@GetMapping("/gov/org/customeragency/getLevelAagencyList/{level}")
Result<List<CustomerAgencyResultDTO>> getLevelAagencyList(@PathVariable("level") String level);
} }

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

@ -464,6 +464,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO);
} }
@Override
public Result<List<CustomerAgencyResultDTO>> getLevelAagencyList(String level) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getLevelAagencyList", level);
}
@Override @Override
public Result<List<CustomerGridStaffListResultDTO>> gridStaff(CustomerGridStaffListFormDTO dto) { public Result<List<CustomerGridStaffListResultDTO>> gridStaff(CustomerGridStaffListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto);

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

@ -32,6 +32,7 @@ import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.excel.CustomerAgencyExcel; import com.epmet.excel.CustomerAgencyExcel;
import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerOrgParameterService; import com.epmet.service.CustomerOrgParameterService;
@ -487,5 +488,16 @@ public class CustomerAgencyController {
return customerAgencyService.getCommunityInfoByUserId(userId); return customerAgencyService.getCommunityInfoByUserId(userId);
} }
/**
* @Description: 获取level的组织列表
* @param level:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.entity.CustomerAgencyEntity>>
* @Author: lichao
* @Date: 2023/12/4 15:36
*/
@GetMapping("getLevelAagencyList/{level}")
public Result<List<CustomerAgencyResultDTO>> getLevelAagencyList(@PathVariable("level") String level) {
return customerAgencyService.getLevelAagencyList(level);
}
} }

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

@ -335,4 +335,6 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2022/6/21 22:41 * @Date 2022/6/21 22:41
**/ **/
Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId); Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId);
Result<List<CustomerAgencyResultDTO>> getLevelAagencyList(String level);
} }

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

@ -1587,4 +1587,15 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return new Result<CommunityInfoResultDTO>().ok(communityInfoResultDTO); return new Result<CommunityInfoResultDTO>().ok(communityInfoResultDTO);
} }
@Override
public Result<List<CustomerAgencyResultDTO>> getLevelAagencyList(String level) {
LambdaUpdateWrapper<CustomerAgencyEntity> lambdaUpdateWrapper = new LambdaUpdateWrapper<CustomerAgencyEntity>()
.eq(CustomerAgencyEntity::getLevel,level);
List<CustomerAgencyEntity> result = baseDao.selectList(lambdaUpdateWrapper);
return new Result<List<CustomerAgencyResultDTO>>().ok(ConvertUtils.sourceToTarget(result, CustomerAgencyResultDTO.class));
}
} }

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserStreetResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/8/5 11:14
* @DESC
*/
@Data
public class IcUserStreetResultDTO implements Serializable {
private static final long serialVersionUID = -3215965796907113918L;
private String streetId;
private String streetName;
private Integer count;
}

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserStreetTypeResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/8/5 11:14
* @DESC
*/
@Data
public class IcUserStreetTypeResultDTO implements Serializable {
private static final long serialVersionUID = -3215965796907113918L;
private Integer dangyuanCount;
private Integer dibaohuCount;
private Integer baozhangfangCount;
private Integer shiyeCount;
private Integer yulingfunvCount;
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -1306,4 +1306,29 @@ public class IcResiUserController implements ResultDataResolver {
return new Result<IcUserMatchGridResultDTO>().ok(icResiUserService.icUserMatchGrid(formDTO)); return new Result<IcUserMatchGridResultDTO>().ok(icResiUserService.icUserMatchGrid(formDTO));
} }
/**
* @Description: 大屏 街道居民统计
* @param :
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.IcUserStreetResultDTO>>
* @Author: lichao
* @Date: 2023/12/4 15:52
*/
@GetMapping("screen/getStreetUserStatistics")
public Result<List<IcUserStreetResultDTO>> getStreetUserStatistics(){
return new Result<List<IcUserStreetResultDTO>>().ok(icResiUserService.getStreetUserStatistics());
}
/**
* @Description: 大屏 街道居民类型统计
* @param :
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.IcUserStreetResultDTO>>
* @Author: lichao
* @Date: 2023/12/4 15:52
*/
@GetMapping("screen/getStreetUserTypeStatistics")
public Result<IcUserStreetTypeResultDTO> getStreetUserTypeStatistics(String streetId){
return new Result<IcUserStreetTypeResultDTO>().ok(icResiUserService.getStreetUserTypeStatistics(streetId));
}
} }

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

@ -428,4 +428,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @Date 2022/6/29 17:37 * @Date 2022/6/29 17:37
*/ */
List<IcUserCountResultDTO> getIcUserCount(IcUserCountFormDTO formDTO); List<IcUserCountResultDTO> getIcUserCount(IcUserCountFormDTO formDTO);
IcUserStreetTypeResultDTO getStreetUserTypeStatistics(@Param("pids") String pids);
} }

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

@ -508,4 +508,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/ */
IcUserMatchGridResultDTO icUserMatchGrid(IcUserMatchGridFormDTO formDTO); IcUserMatchGridResultDTO icUserMatchGrid(IcUserMatchGridFormDTO formDTO);
List<IcUserStreetResultDTO> getStreetUserStatistics();
IcUserStreetTypeResultDTO getStreetUserTypeStatistics(String streetId);
} }

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

@ -3251,6 +3251,40 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return result; return result;
} }
@Override
public List<IcUserStreetResultDTO> getStreetUserStatistics() {
List<IcUserStreetResultDTO> result = new ArrayList<>();
List<CustomerAgencyResultDTO> streetList = govOrgOpenFeignClient.getLevelAagencyList("street").getData();
streetList.forEach(
street -> {
IcUserStreetResultDTO dto = new IcUserStreetResultDTO();
LambdaQueryWrapper<IcResiUserEntity> resiUserEntityLambdaQueryWrapper
= new LambdaQueryWrapper<IcResiUserEntity>().likeRight(IcResiUserEntity::getPids, street.getPids()+ ":" + street.getId());
List<IcResiUserEntity> houseEntities = icResiUserDao.selectList(resiUserEntityLambdaQueryWrapper);
dto.setStreetName(street.getOrganizationName());
dto.setStreetId(street.getId());
dto.setCount(houseEntities.size());
result.add(dto);
});
return result;
}
@Override
public IcUserStreetTypeResultDTO getStreetUserTypeStatistics(String streetId) {
IcUserStreetTypeResultDTO result = new IcUserStreetTypeResultDTO();
CustomerAgencyDTO customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(streetId).getData();
if (customerAgencyDTO!=null){
result = baseDao.getStreetUserTypeStatistics(customerAgencyDTO.getPids() +":"+ customerAgencyDTO.getId());
}else{
throw new EpmetException("未查询到街道"+streetId);
}
return result;
}
public PaCustomerDTO getCustomerInfo(String appId) { public PaCustomerDTO getCustomerInfo(String appId) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String data = HttpClientManager.getInstance().sendPostByJSON("https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/" + appId, JSON.toJSONString(jsonObject)).getData(); String data = HttpClientManager.getInstance().sendPostByJSON("https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/" + appId, JSON.toJSONString(jsonObject)).getData();

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

@ -1281,4 +1281,16 @@
</choose> </choose>
</if> </if>
</select> </select>
<select id="getStreetUserTypeStatistics" resultType="com.epmet.dto.result.IcUserStreetTypeResultDTO">
select count(IS_PARTY=1 or null) as dangyuanCount,
count(IS_DBH=1 or null) as dibaohuCount,
count(IS_ENSURE_HOUSE=1 or null) as baozhangfangCount,
count(IS_UNEMPLOYED=1 or null) as shiyeCount,
count(IS_YLFN=1 or null) as yulingfunvCount
from ic_resi_user
where PIDS
like concat(#{pids},'%')
</select>
</mapper> </mapper>

Loading…
Cancel
Save