Browse Source

新增:

1.志愿者坐标分布
2.志愿者信息简介
dev_shibei_match
wangxianzhang 4 years ago
parent
commit
990031cbf0
  1. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java
  2. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java
  3. 43
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java
  4. 83
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java
  5. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java
  6. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java
  7. 36
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml
  8. 26
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java
  9. 14
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java
  10. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  11. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  12. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  13. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  14. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  15. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  16. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  17. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java
  18. 9
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  19. 6
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  20. 20
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java
  21. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java
  22. 47
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java
  23. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java
  24. 61
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java
  25. 36
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java
  26. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  27. 55
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java
  28. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  29. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java
  30. 73
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  31. 179
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java

41
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.result.heart;
import lombok.Data;
/**
* @Description 描述
* @Author wangxianzhang
* @Date 2021/12/10 4:24 下午
* @Version 1.0
*/
@Data
public class VolunteerDemandServiceStatsResultDTO {
private String customerId;
private String dateId;
/**
* 客户下志愿者总数
*/
private Integer volunteerTotal;
/**
* 客户下志愿者中党员数量
*/
private Integer partyTotal;
/**
* 客户下志愿者中居民数量
*/
private Integer resiTotal;
/**
* 客户下志愿者服务总次数
*/
private Integer serviceTotal;
/**
* 客户下党员志愿者服务次数
*/
private Integer partyServiceTotal;
/**
* 客户下居民志愿者服务次数
*/
private Integer resiServiceTotal;
}

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java

@ -0,0 +1,38 @@
package com.epmet.datareport.controller.heart;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description 描述
* @Author wangxianzhang
* @Date 2021/12/10 3:55 下午
* @Version 1.0
*/
@RestController
@RequestMapping("heart/demand")
public class DataReportHeartDemandController {
@Autowired
private DemandService demandService;
/**
* 查询志愿者需求服务统计信息
* @param loginUser
* @return
*/
@PostMapping("volunteer/service")
public Result<VolunteerDemandServiceStatsResultDTO> getVolunteerServiceStats(@LoginUser TokenDto loginUser) {
String customerId = loginUser.getCustomerId();
VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId);
return new Result<VolunteerDemandServiceStatsResultDTO>().ok(r);
}
}

43
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java

@ -0,0 +1,43 @@
/**
* 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.datareport.dao.fact;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 志愿者服务情况统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-08
*/
@Mapper
public interface FactVolunteerServiceDailyDao extends BaseDao<FactVolunteerServiceDailyEntity> {
/**
* 查询最新一条"志愿者需求服务统计信息"
* @param customerId
* @return
*/
VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId);
}

83
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java

@ -0,0 +1,83 @@
/**
* 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.datareport.entity.heart;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 志愿者服务情况统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-12-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_volunteer_service_daily")
public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* yyyyMMdd
*/
private String dateId;
/**
* yyyyMM
*/
private String monthId;
/**
* 截止到当前dateId当前客户下共有多少个爱心互助的志愿者
*/
private Integer volunteerTotal;
/**
* 截止到当前dateId当前客户下XX个爱心互助志愿者中党员有多少个
*/
private Integer partyTotal;
/**
* 截止到当前dateId当前客户下XX个爱心互助志愿者中居民有多少个
*/
private Integer resiTotal;
/**
* 服务总次数
*/
private Integer serviceTotal;
/**
* 党员服务总次数
*/
private Integer partyServiceTotal;
/**
* 居民服务总次数
*/
private Integer resiServiceTotal;
}

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java

@ -0,0 +1,13 @@
package com.epmet.datareport.service.heart;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
/**
* @Description 需求服务
* @Author wangxianzhang
* @Date 2021/12/10 4:18 下午
* @Version 1.0
*/
public interface DemandService {
VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId);
}

29
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java

@ -0,0 +1,29 @@
package com.epmet.datareport.service.heart.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao;
import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description 需求服务
* @Author wangxianzhang
* @Date 2021/12/10 4:20 下午
* @Version 1.0
*/
@Service
public class DemandServiceImpl implements DemandService {
@Autowired
private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao;
@Override
public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) {
return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId);
}
}

36
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao">
<resultMap type="com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity" id="factVolunteerServiceDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="volunteerTotal" column="VOLUNTEER_TOTAL"/>
<result property="partyTotal" column="PARTY_TOTAL"/>
<result property="resiTotal" column="RESI_TOTAL"/>
<result property="serviceTotal" column="SERVICE_TOTAL"/>
<result property="partyServiceTotal" column="PARTY_SERVICE_TOTAL"/>
<result property="resiServiceTotal" column="RESI_SERVICE_TOTAL"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getLatestVolunteerDemandServiceStats"
resultType="com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO">
select *
from fact_volunteer_service_daily
where DEL_FLAG = 0
and CUSTOMER_ID = #{customerId}
order by DATE_ID desc
limit 1
</select>
</mapper>

26
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form.resi;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description
* @Author wangxianzhang
* @Date 2021/12/10 6:10 下午
* @Version 1.0
*/
@Data
public class VolunteerCommonFormDTO {
public interface VolunteerPage {
}
@NotBlank(message = "客户ID不能为空", groups = {VolunteerPage.class})
private String customerId;
private Integer pageNo = 0;
private Integer pageSize = 20;
}

14
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java

@ -0,0 +1,14 @@
package com.epmet.dto.result.resi;
import lombok.Data;
/**
* @Description 志愿者信息分页查询结果
* @Author wangxianzhang
* @Date 2021/12/10 6:17 下午
* @Version 1.0
*/
@Data
public class PageVolunteerInfoResultDTO {
private String userId;
}

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -6,6 +6,8 @@ import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
@ -56,4 +58,12 @@ public interface EpmetHeartOpenFeignClient {
@PostMapping("/heart/icresidemanddict/demangnames")
Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO);
/**
* 分页查询志愿者列表
* @param input
* @return
*/
@PostMapping("/heart/resi/volunteer/page")
Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input);
}

7
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -7,6 +7,8 @@ import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import java.util.List;
@ -53,4 +55,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO);
}
@Override
public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input);
}
}

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -26,7 +26,9 @@ import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.service.VolunteerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
@ -125,4 +127,21 @@ public class ResiVolunteerController {
public Result<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName()));
}
/**
* 分页查询志愿者列表
* @param input
* @return
*/
@PostMapping("page")
public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input) {
ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class);
Integer pageNo = input.getPageNo();
Integer pageSize = input.getPageSize();
String customerId = input.getCustomerId();
List<PageVolunteerInfoResultDTO> l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize);
return new Result<List<PageVolunteerInfoResultDTO>>().ok(l);
}
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -25,6 +25,7 @@ import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
@ -94,4 +95,6 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @return
*/
List<OptionDTO> queryListVolunteer(String customerId,String userRealName);
List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize);
}

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -18,6 +18,7 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -44,12 +45,14 @@ import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.HeartUserInfoService;
import com.epmet.service.VolunteerInfoService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
@ -258,4 +261,21 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
}
return resultList;
}
@Override
public List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) {
LambdaQueryWrapper<VolunteerInfoEntity> query = new LambdaQueryWrapper<>();
query.eq(VolunteerInfoEntity::getCustomerId, customerId);
PageHelper.startPage(pageNo, pageSize);
List<VolunteerInfoEntity> volunteerInfoEntities = baseDao.selectList(query);
List<PageVolunteerInfoResultDTO> list = volunteerInfoEntities.stream().map(vi -> {
PageVolunteerInfoResultDTO p = new PageVolunteerInfoResultDTO();
p.setUserId(vi.getUserId());
return p;
}).collect(Collectors.toList());
return list;
}
}

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

@ -540,4 +540,22 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/agency/getsonagencyid")
Result<List<String>> getSonAgencyId(@RequestParam("orgId")String orgId);
// /icbuilding/{id}?id=demoData
/**
* 根据ID查询楼栋信息
* @param id
* @return
*/
@GetMapping("/gov/org/icbuilding/{id}")
Result<IcBuildingDTO> getBuildingById(@PathVariable("id") String id);
/**
* 通过ID查询小区信息
* @param id
* @return
*/
@GetMapping("/gov/org/icneighborhood/{id}")
Result<IcNeighborHoodDTO> getIcNeighbordhoodById(@PathVariable("id") String id);
}

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

@ -344,4 +344,13 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);
}
@Override
public Result<IcBuildingDTO> getBuildingById(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBuildingById", id);
}
@Override
public Result<IcNeighborHoodDTO> getIcNeighbordhoodById(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getIcNeighbordhoodById", id);
}
}

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description ic 表单options查询通用dto
* @Author wangxianzhang
* @Date 2021/12/12 1:07 下午
* @Version 1.0
*/
@Data
public class IcFormOptionsQueryFormDTO {
public interface QueryByLabelAndCustomerIdForForm {}
@NotBlank(message = "客户ID必填", groups = { QueryByLabelAndCustomerIdForForm.class })
private String customerId;
@NotBlank(message = "FormCode必填", groups = { QueryByLabelAndCustomerIdForForm.class })
private String formCode;
@NotBlank(message = "OptionsLabel必填", groups = { QueryByLabelAndCustomerIdForForm.class })
private String label;
}

9
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.*;
@ -120,4 +121,12 @@ public interface OperCustomizeOpenFeignClient {
@PostMapping("/oper/customize/icformitemoptions/volunteerlabelbyvalues")
Result<List<String>> volunteerLabelByValues(@RequestBody List<String> volunteers,@RequestParam("customerId") String customerId);
/**
* 使用item相关条件查询关联的options
* @param input
* @return
*/
@PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions")
Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input);
}

6
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.form.*;
@ -103,4 +104,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
public Result<List<String>> volunteerLabelByValues(List<String> volunteers,String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "volunteerLabelByValues",volunteers,customerId);
}
@Override
public Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input);
}
}

20
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java

@ -26,14 +26,17 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.dto.form.IcFormOptionsQueryFormDTO;
import com.epmet.excel.IcFormItemOptionsExcel;
import com.epmet.service.IcFormItemOptionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.tags.form.InputTag;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.function.IntUnaryOperator;
/**
@ -102,4 +105,21 @@ public class IcFormItemOptionsController {
return new Result<List<String>>().ok(icFormItemOptionsService.volunteerLabelByValues(volunteers,customerId));
}
/**
* 使用item相关条件查询关联的options
* @param input
* @return
*/
@PostMapping("list-by-item-conditions")
public Result<List<IcFormItemOptionsDTO>> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input) {
ValidatorUtils.validateEntity(input, IcFormOptionsQueryFormDTO.QueryByLabelAndCustomerIdForForm.class);
String customerId = input.getCustomerId();
String formCode = input.getFormCode();
String label = input.getLabel();
List<IcFormItemOptionsDTO> r = icFormItemOptionsService.getOptionsByItemConditions(customerId, formCode, label);
return new Result<List<IcFormItemOptionsDTO>>().ok(r);
}
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java

@ -100,4 +100,13 @@ public interface IcFormItemOptionsService extends BaseService<IcFormItemOptionsE
* @date 2021/11/8 10:02 上午
*/
List<String> volunteerLabelByValues(List<String> volunteers, String customerId);
/**
* 使用item相关条件查询options
* @param customerId
* @param formCode
* @param label
* @return
*/
List<IcFormItemOptionsDTO> getOptionsByItemConditions(String customerId, String formCode, String label);
}

47
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java

@ -17,23 +17,30 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
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.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dao.IcFormItemOptionsDao;
import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.entity.IcFormItemEntity;
import com.epmet.entity.IcFormItemOptionsEntity;
import com.epmet.service.IcFormItemOptionsService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 表单项的选项
@ -44,7 +51,9 @@ import java.util.Map;
@Service
public class IcFormItemOptionsServiceImpl extends BaseServiceImpl<IcFormItemOptionsDao, IcFormItemOptionsEntity> implements IcFormItemOptionsService {
@Autowired
private IcFormItemDao icFormItemDao;
@Override
public PageData<IcFormItemOptionsDTO> page(Map<String, Object> params) {
IPage<IcFormItemOptionsEntity> page = baseDao.selectPage(
@ -61,8 +70,8 @@ public class IcFormItemOptionsServiceImpl extends BaseServiceImpl<IcFormItemOpti
return ConvertUtils.sourceToTarget(entityList, IcFormItemOptionsDTO.class);
}
private QueryWrapper<IcFormItemOptionsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<IcFormItemOptionsEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcFormItemOptionsEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -98,14 +107,40 @@ public class IcFormItemOptionsServiceImpl extends BaseServiceImpl<IcFormItemOpti
}
/**
* @Description 查询志愿者类型
* @param volunteers
* @Description 查询志愿者类型
* @author zxc
* @date 2021/11/8 10:02 上午
*/
@Override
public List<String> volunteerLabelByValues(List<String> volunteers,String customerId) {
return baseDao.volunteerLabelByValues(volunteers,customerId);
public List<String> volunteerLabelByValues(List<String> volunteers, String customerId) {
return baseDao.volunteerLabelByValues(volunteers, customerId);
}
@Override
public List<IcFormItemOptionsDTO> getOptionsByItemConditions(String customerId, String formCode, String label) {
// 查询item
LambdaQueryWrapper<IcFormItemEntity> formItemQuery = new LambdaQueryWrapper<>();
formItemQuery.eq(IcFormItemEntity::getCustomerId, customerId);
formItemQuery.eq(IcFormItemEntity::getFormCode, formCode);
formItemQuery.eq(IcFormItemEntity::getLabel, label);
IcFormItemEntity item = icFormItemDao.selectOne(formItemQuery);
if (item == null) {
return new ArrayList<>();
}
// 通过item查询options
LambdaQueryWrapper<IcFormItemOptionsEntity> query = new LambdaQueryWrapper<>();
query.eq(IcFormItemOptionsEntity::getItemId, item.getId());
query.orderByAsc(IcFormItemOptionsEntity::getSort);
// 属性拷贝
return baseDao.selectList(query).stream().map(o -> {
IcFormItemOptionsDTO oDTO = new IcFormItemOptionsDTO();
BeanUtil.copyProperties(o, oDTO);
return oDTO;
}).collect(Collectors.toList());
}
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.Value;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author wangxianzhang
* @Date 2021/12/10 5:47 下午
* @Version 1.0
*/
@Data
public class VolunteerCommonFormDTO {
/**
* 查询志愿者分布
*/
public interface GetVolunteerDistribution {
}
@NotBlank(message = "客户ID不能为空", groups = {GetVolunteerDistribution.class})
private String customerId;
}

61
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java

@ -3,7 +3,10 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 案件居民家属列表
@ -12,8 +15,66 @@ import java.util.List;
@Data
public class IcResiUserBriefDTO extends HouseUserDTO implements Serializable {
private String houseId;
private String gridId;
private String gridName;
/**
* 小区id
*/
private String villageId;
/**
* 小区名
*/
private String villageName;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 联系人
*/
private String contacts;
/**
* 联系人电话
*/
private String contactsMobile;
/**
* 志愿者类别
* key:志愿者类型英文
* value:志愿者类型中文
*/
private Map<String, String> volunteerCategories = new HashMap<>();
/**
* 同屋的其他人
*/
private List<HouseUserDTO> houseUserList;
}

36
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* @Description
* @Author wangxianzhang
* @Date 2021/12/10 5:49 下午
* @Version 1.0
*/
@Data
public class VolunteerDistributionResultDTO {
private List<Legend> legends = new ArrayList<>();
private List<Distribution> distributions = new ArrayList<>();
@Data
public static class Legend {
private String optionLabel;
private String optionValue;
}
@Data
public static class Distribution {
private Set<String> volunteerTypes;
private String epmetUserId;
private String icResiUserId;
private String longitude;
private String latitude;
}
}

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

@ -505,4 +505,17 @@ public class IcResiUserController {
ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class);
return new Result<List<DemandUserResDTO>>().ok(icResiUserService.queryDemandUsers(formDTO));
}
/**
* 根据居民id查询居民信息简介
* @param resiUserId
* @return
*/
@PostMapping("resi-brief/{resi-user-id}")
public Result<IcResiUserBriefDTO> getResiBrief(@PathVariable("resi-user-id") String resiUserId, @LoginUser TokenDto loginUser) {
String customerId = loginUser.getCustomerId();
IcResiUserBriefDTO r = icResiUserService.getResiBrief(resiUserId, customerId);
return new Result<IcResiUserBriefDTO>().ok(r);
}
}

55
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java

@ -0,0 +1,55 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.form.VolunteerCommonFormDTO;
import com.epmet.dto.result.VolunteerDistributionResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.VolunteerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description 志愿者controller
* @Author wangxianzhang
* @Date 2021/12/10 5:45 下午
* @Version 1.0
*/
@RestController
@RequestMapping("volunteer")
public class VolunteerController {
/**
* 不知道为何用注解 注入不进来暂时用构造方法注入
*/
@Autowired
private VolunteerService volunteerService;
//public VolunteerController(VolunteerService volunteerService, IcResiUserDao icResiUserDao, GovOrgOpenFeignClient govOrgOpenFeignClient) {
// this.volunteerService = volunteerService;
// System.out.println(this);
//}
/**
* 志愿者分布查询
*
* @param input
* @return
*/
@PostMapping("distribution")
public Result<VolunteerDistributionResultDTO> getVolunteerDistribution(@RequestBody VolunteerCommonFormDTO input) {
System.out.println(this);
ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.GetVolunteerDistribution.class);
String customerId = input.getCustomerId();
VolunteerDistributionResultDTO r = volunteerService.getVolunteerDistributionAndLegends(customerId);
return new Result<VolunteerDistributionResultDTO>().ok(r);
}
}

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

@ -153,4 +153,6 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId);
IcResiUserBriefDTO findFamilyMem(String icResiUserId);
IcResiUserBriefDTO getResiBrief(String resiUserId, String customerId);
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java

@ -0,0 +1,15 @@
package com.epmet.service;
import com.epmet.dto.result.VolunteerDistributionResultDTO;
/**
* @Description 志愿者service
* @Author wangxianzhang
* @Date 2021/12/10 5:48 下午
* @Version 1.0
*/
public interface VolunteerService {
VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId);
}

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

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -102,6 +103,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private RedisUtils redisUtils;
@Autowired
private UserService userService;
@Autowired
private IcResiUserDao icResiUserDao;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
@ -883,4 +886,74 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
public IcResiUserBriefDTO findFamilyMem(String icResiUserId) {
return baseDao.selectIcResuUser(icResiUserId);
}
@Override
public IcResiUserBriefDTO getResiBrief(String resiUserId, String customerId) {
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper<>();
query.eq(IcResiUserEntity::getId, resiUserId);
IcResiUserEntity resiEntity = baseDao.selectOne(query);
IcResiUserBriefDTO r = new IcResiUserBriefDTO();
BeanUtil.copyProperties(resiEntity, r);
r.setHouseId(resiEntity.getHomeId());
r.setIcResiUserId(resiEntity.getId());
r.setIcUserName(resiEntity.getName());
// 填充网格、小区名称
String errorMsg = "【居民信息简介】查询网格、小区信息失败";
IcNeighborHoodDTO neighborHood = getResultDataOrThrowsException(govOrgOpenFeignClient.getIcNeighbordhoodById(resiEntity.getVillageId()),
ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg,
errorMsg);
CustomerGridFormDTO gridInfoForm = new CustomerGridFormDTO();
gridInfoForm.setGridId(resiEntity.getGridId());
CustomerGridDTO gridInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getCustomerGridByGridId(gridInfoForm),
ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg,
errorMsg);
r.setGridName(gridInfo.getGridName());
r.setVillageName(neighborHood.getNeighborHoodName());
// 2.志愿者类型填充
List<String> volunteers = icResiUserDao.selectVolunteerByUserId(resiEntity.getId());
if (CollectionUtils.isNotEmpty(volunteers)) {
String[] vCategories = volunteers.get(0).split(",");
// 志愿者类型字典
Map<String, String> categories = getVolunteerCategoryOptions(customerId);
for (int i = 0; i < vCategories.length; i++) {
r.getVolunteerCategories().put(vCategories[i], categories.get(vCategories[i]));
}
}
return r;
}
/**
* 查询志愿者类别options
* @param customerId
* @return
*/
private Map<String, String> getVolunteerCategoryOptions(String customerId) {
IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO();
optionsQuery.setCustomerId(customerId);
optionsQuery.setFormCode("resi_base_info");
optionsQuery.setLabel("志愿者类别");
List<IcFormItemOptionsDTO> categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery),
ServiceConstant.OPER_CUSTOMIZE_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"【志愿者分布】志愿者简介-查询志愿者类别失败",
"【志愿者分布】志愿者简介-查询志愿者类别失败");
return categorieDtos.stream()
.collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel));
}
}

179
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java

@ -0,0 +1,179 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcFormOptionsQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.VolunteerDistributionResultDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.VolunteerService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description
* @Author wangxianzhang
* @Date 2021/12/10 5:48 下午
* @Version 1.0
*/
@Service
public class VolunteerServiceImpl implements VolunteerService, ResultDataResolver {
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
/**
* 查询志愿者分布以及志愿者图例
*
* @param customerId
* @return
*/
public VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId) {
// 1.查询分布
VolunteerDistributionResultDTO volunteerDistribution = getVolunteerDistribution(customerId);
// 2.补充图例
IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO();
optionsForm.setCustomerId(customerId);
optionsForm.setFormCode("resi_base_info");
optionsForm.setLabel("志愿者类别");
String errorMsg = "【志愿者分布】查询志愿者图例失败";
List<IcFormItemOptionsDTO> options = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsForm),
ServiceConstant.OPER_CUSTOMIZE_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg,
errorMsg);
List<VolunteerDistributionResultDTO.Legend> legends = options.stream().map(o -> {
VolunteerDistributionResultDTO.Legend legend = new VolunteerDistributionResultDTO.Legend();
legend.setOptionLabel(o.getOptionLabel());
legend.setOptionValue(o.getOptionValue());
return legend;
}).collect(Collectors.toList());
volunteerDistribution.setLegends(legends);
return volunteerDistribution;
}
/**
* 查询志愿者分布
*
* @param customerId
* @return
*/
public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) {
//epmetHeartOpenFeignClient.queryVolunteerPage()
// 1.分页查询出所有志愿者列表
int pageNo = 1;
int pageSize = 100;
// 志愿者epmet user id
Set<String> volunteerEpmetUserIds = new HashSet<>();
// 分页查询志愿者的epmet user id
while (true) {
VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO();
volunteerForm.setCustomerId(customerId);
volunteerForm.setPageNo(pageNo);
volunteerForm.setPageSize(pageSize);
String errorMsg = "【志愿者分布】分页查询志愿者列表失败";
List<PageVolunteerInfoResultDTO> volunteerPage = getResultDataOrThrowsException(epmetHeartOpenFeignClient.queryVolunteerPage(volunteerForm),
ServiceConstant.EPMET_HEART_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg,
errorMsg);
// 将本页userId添加到总集中去
volunteerEpmetUserIds.addAll(volunteerPage.stream().map(v -> v.getUserId()).collect(Collectors.toSet()));
if (volunteerPage.size() < pageSize) {
// 说明是最后一页了
break;
}
pageNo++;
}
VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO();
// 2.填充ic居民信息
for (String volunteerEpmetUserId : volunteerEpmetUserIds) {
VolunteerDistributionResultDTO.Distribution distribution = new VolunteerDistributionResultDTO.Distribution();
ResiUserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(volunteerEpmetUserId);
//使用身份证号查询ic resi信息
IcResiUserDTO icResiUserInfo = icResiUserDao.selectIdByIdCard(customerId, userBaseInfo.getIdNum(), null);
if (icResiUserInfo == null) {
continue;
}
List<String> volunteer = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId());
if (CollectionUtils.isEmpty(volunteer)) {
// 此人没有志愿者信息
continue;
}
// 将志愿者类型列表字符串,切割放到set中
Set<String> volunteerTypes = new HashSet();
for (String vTypesString : volunteer) {
String[] vTypes = vTypesString.split(",");
if (vTypes != null && vTypes.length > 0) {
volunteerTypes.addAll(Arrays.asList(vTypes));
}
}
String msg = "【志愿者分布】查询楼栋信息失败";
IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiUserInfo.getBuildId()),
ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
distribution.setVolunteerTypes(volunteerTypes);
distribution.setEpmetUserId(userBaseInfo.getUserId());
distribution.setIcResiUserId(icResiUserInfo.getId());
Optional.of(building).ifPresent(b -> {
distribution.setLongitude(b.getLongitude());
distribution.setLatitude(b.getLatitude());
});
r.getDistributions().add(distribution);
}
return r;
}
}
Loading…
Cancel
Save