diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 3d6c5f02d2..e78f745c40 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -1,5 +1,10 @@ package com.epmet.modules.badege.service.impl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; @@ -8,6 +13,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -23,6 +29,15 @@ public class BadgeServiceImpl implements BadgeService { @Override public List getBadgeList(BadgeListFormDTO badgeListFormDTO) { - return null; + UserBadgeListFormDTO form = ConvertUtils.sourceToTarget(badgeListFormDTO, UserBadgeListFormDTO.class); + Result> listResult = epmetUserOpenFeignClient.selectBadgeList(form); + if (!listResult.success()){ + throw new RenException("获取徽章点亮列表失败......"); + } + if (null == listResult.getData()){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(listResult.getData(), BadgeListResultDTO.class); + return result; } } 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 2c7d2555cd..e56d27287c 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 @@ -337,4 +337,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/userresiinfo/edituserinfo") Result editUserInfo(@RequestBody EditInfoFormDTO formDTO); + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + @PostMapping("/epmetuser/badge/badgelist") + Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO); + } 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 a2de76e587..46fad76aa3 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 @@ -225,4 +225,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result editUserInfo(EditInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO); } + + @Override + public Result> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectBadgeList", userBadgeListFormDTO); + } }