From e95833261a5cb61c1f81ca5d784581fccab5bf82 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Fri, 20 Dec 2019 17:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=8B=E5=85=AC=E5=B3=B0=EF=BC=9A=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B4=BB=E5=8A=A8=E6=89=93=E5=8D=A1=E5=9C=B0=E7=82=B9?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiActUserRelationController.java | 15 +++++ .../feign/AppActUserRelationFeignClient.java | 11 +++- ...AppActUserRelationFeignClientFallback.java | 6 ++ .../epdc/service/ActUserRelationService.java | 9 +++ .../impl/ActUserRelationServiceImpl.java | 7 +++ .../epdc/activity/result/AppActInfoDTO.java | 61 +++++++++++++++++++ .../controller/AppActInfoController.java | 57 +++++++++++++++++ .../AppActUserClockLogController.java | 5 +- 8 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java index 8cd199d27..679148946 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; @@ -151,4 +152,18 @@ public class ApiActUserRelationController { return result1; } + + /** + * 获取活动打卡地点详情 + * + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("clockAddressDetail/{actId}") + public Result clockAddressDetail(@PathVariable("actId") String actId) { + return actUserRelationService.clockAddressDetail(actId); + + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java index ebd3879b7..34e260d49 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback; @@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.PathVariable; * @Author:wanggongfeng * @Date:2019/12/16 17:36 */ -@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class,url = "http://127.0.0.1:9060") public interface AppActUserRelationFeignClient { /** @@ -53,4 +54,12 @@ public interface AppActUserRelationFeignClient { @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") Result selectListActUserRelation(@PathVariable("actId") String actId); + /** + * 获取活动打卡地点详情 + * @param actId + * @return + */ + @GetMapping("heart/appactinfo/clockAddressDetail/{actId}") + Result clockAddressDetail(@PathVariable("actId") String actId); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java index a0d16f324..7161b8a2f 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -34,4 +35,9 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); } + @Override + public Result clockAddressDetail(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "clockAddressDetail", actId); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java index 5dd9719f4..4b32ecd69 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.utils.Result; /** @@ -44,4 +45,12 @@ public interface ActUserRelationService { */ Result getClockList(String actId); + /** + * 获取活动打卡地点详情 + * @param actId + * @Author wanggongfeng + * @return + */ + Result clockAddressDetail(String actId); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java index e1307dfb6..f17240424 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; import com.elink.esua.epdc.service.ActUserRelationService; @@ -46,4 +47,10 @@ public class ActUserRelationServiceImpl implements ActUserRelationService { return result; } + @Override + public Result clockAddressDetail(String actId) { + Result dataResult = actInfoFeignClient.clockAddressDetail(actId); + return dataResult; + } + } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java new file mode 100644 index 000000000..735ce1227 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class AppActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java new file mode 100644 index 000000000..befd6528b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("appactinfo") +public class AppActInfoController { + + @Autowired + private ActInfoService actInfoService; + + /** + * 获取活动打卡地点详情 + * @param actId + * @return + */ + @GetMapping("clockAddressDetail/{actId}") + public Result clockAddressDetail(@PathVariable("actId")String actId){ + ActInfoDTO actInfoDTO = actInfoService.get(actId); + AppActInfoDTO appActInfoDTO = ConvertUtils.sourceToTarget(actInfoDTO, AppActInfoDTO.class); + return new Result().ok(appActInfoDTO); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java index 5de36874a..909ab547a 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java @@ -24,10 +24,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /**