diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java index b84d504bd3..f57e73479c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java @@ -5,20 +5,36 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; import java.io.Serializable; @Data @AllArgsConstructor @NoArgsConstructor -public class PartyUnitListbriefFormDTO extends PageFormDTO implements Serializable { +public class PartyUnitListbriefFormDTO implements Serializable { private static final long serialVersionUID = -2776705671944626707L; + /** + * 页码 + */ + @NotNull + @Min(1) + private Integer pageNo; + + /** + * 每页记录数 + */ + @NotNull + private Integer pageSize; + /** * 网格id */ - private String gridId; +// private String gridId; /** * 组织id @@ -51,5 +67,7 @@ public class PartyUnitListbriefFormDTO extends PageFormDTO implements Serializab */ private String contactMobile; + private String customerId; + } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java index e4eef93ec1..eadc99ca2a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java @@ -21,12 +21,12 @@ public class PartyUnitListbrieResultDTO implements Serializable { /** * 所属网格 */ - private String gridName; +// private String gridName; /** * 所属网格id */ - private String gridId; +// private String gridId; /** * 分类 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 133cb6200c..6677f738f6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; @@ -107,4 +108,15 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/icresidemanddict/demandoption") Result> getDemandOptions(); + + /** + * 获取客户下志愿者列表 + * + * @Param customerId + * @Return {@link Result< List< IcVolunteerPolyDTO>>} + * @Author zhaoqifeng + * @Date 2022/5/19 11:14 + */ + @PostMapping("/heart/resi/volunteer/getVolunteerList/{customerId}") + Result> getVolunteerList(@PathVariable("customerId") String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index a0af921435..d96476f4cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.AutoEvaluateDemandFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO; @@ -108,4 +109,18 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result> getDemandOptions() { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getDemandOptions", null); } + + /** + * 获取客户下志愿者列表 + * + * @param customerId + * @Param customerId + * @Return {@link Result< List< IcVolunteerPolyDTO >>} + * @Author zhaoqifeng + * @Date 2022/5/19 11:14 + */ + @Override + public Result> getVolunteerList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerList", customerId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 0cf4da7683..03bcf813ba 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -245,8 +245,9 @@ public class IcPartyUnitController { */ @PostMapping("/listbrief") public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(form); - PageData data = icPartyUnitService.getListbrief(form, tokenDto); + PageData data = icPartyUnitService.getListbrief(form); return new Result().ok(data); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 410cbdf981..5aee9461b7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -21,6 +21,7 @@ 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.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; @@ -170,4 +171,9 @@ public class ResiVolunteerController { volunteerInfoService.modifyVolunteerGrid(volunteerInfoDTO); return new Result(); } + + @PostMapping("getVolunteerList/{customerId}") + public Result> getVolunteerList(@PathVariable("customerId") String customerId) { + return new Result>().ok(volunteerInfoService.getVolunteerList(customerId)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index e9f4559434..363357e054 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -81,7 +81,7 @@ public interface IcPartyUnitDao extends BaseDao { * @author LZN * @date 2022/5/18 13:54 */ - List getListbrief(PartyUnitListbriefFormDTO form, String customerId); + List getListbrief(@Param("form") PartyUnitListbriefFormDTO form, @Param("customerId") String customerId); /** * 联建单位-按分类统计数量及占比 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 5a5cb36416..73b35af7bd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -171,7 +171,7 @@ public interface IcPartyUnitService extends BaseService { * * @param form */ - PageData getListbrief(PartyUnitListbriefFormDTO form, TokenDto tokenDto); + PageData getListbrief(PartyUnitListbriefFormDTO form); /** * 联建单位-按分类统计数量及占比 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 7cd4d30769..0c0c0e7b5e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; @@ -117,4 +118,13 @@ public interface VolunteerInfoService extends BaseService { * @param volunteerInfoDTO */ void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO); + + /** + * 获取客户下志愿者 + * @Param customerId + * @Return {@link List< IcVolunteerPolyDTO>} + * @Author zhaoqifeng + * @Date 2022/5/19 10:58 + */ + List getVolunteerList(String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index cf4f96c510..8f2db1e2ad 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -599,18 +599,18 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); + List dto = baseDao.getListbrief(form, form.getCustomerId()); // 获取gridName - for (PartyUnitListbrieResultDTO item : dto) { + /*for (PartyUnitListbrieResultDTO item : dto) { if (StringUtils.isNotEmpty(item.getGridId())) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); if (null != gridInfo) { item.setGridName(gridInfo.getGridName()); } } - } + }*/ PageInfo info = new PageInfo<>(dto); return new PageData<>(dto, info.getTotal()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 846e342657..6acc0c4e3d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -39,10 +39,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.SystemMessageType; import com.epmet.dao.VolunteerInfoDao; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.HeartUserInfoDTO; -import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; @@ -424,4 +421,35 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/5/19 10:58 + */ + @Override + public List getVolunteerList(String customerId) { + if (StringUtils.isBlank(customerId)) { + return Collections.emptyList(); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(VolunteerInfoEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + IcVolunteerPolyDTO dto = new IcVolunteerPolyDTO(); + dto.setCustomerId(item.getCustomerId()); + dto.setAgencyId(item.getPid()); + dto.setAgencyPids(item.getPids()); + dto.setUserId(item.getUserId()); + dto.setVolunteerCategory("qita"); + return dto; + }).collect(Collectors.toList()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 30925f1867..9a25ea4906 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -76,35 +76,35 @@ + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml index 617416426e..90e1558333 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -54,6 +54,10 @@ c.VOLUNTEER_CATEGORY = #{code} AND c.CUSTOMER_ID = #{customerId} - - + + delete from ic_volunteer_poly where CUSTOMER_ID = #{customerId} + + + delete from ic_volunteer_poly_category where CUSTOMER_ID = #{customerId} + \ No newline at end of file