diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java index 05b36b7a8..e63f6ab67 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java @@ -66,5 +66,9 @@ public class EpdcAppActUserClockLogDTO implements Serializable { * 打卡类型(0-打卡,1-更新打卡) */ private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java index c89b468d8..9551fad19 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java @@ -74,6 +74,11 @@ public class ActUserClockLogDTO implements Serializable { */ private String clockDesc; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + /** * 乐观锁 */ diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java index 83eab4473..3b4471a36 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java @@ -66,5 +66,9 @@ public class AppActUserClockLogDTO implements Serializable { * 打卡类型(0-打卡,1-更新打卡) */ private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; } \ 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/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java index 9aa38d2ab..8baf1a43f 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java @@ -67,4 +67,14 @@ public class AppActUserRelationController { return actUserRelationService.selectListActUserRelation(actId); } + /** + * 活动时间到自动审核通过未审核的报名人员 + * @param actId + * @return + */ + @GetMapping("AutoAuditActUser/{actId}") + public Result AutoAuditActUser(@PathVariable("actId")String actId){ + return actUserRelationService.updateAuditDefaultStatus(actId); + } + } \ 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/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java index 87d7e94a5..c05093bc0 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java @@ -74,4 +74,11 @@ public interface ActUserRelationDao extends BaseDao { * @Date: 2019/9/5 19:42 */ List getActUserRelationPageFromPC(Map params); + + /** + * 自动审核 + * @param actId + * @return + */ + List selectListActUserInfo(@Param("actId")String actId); } \ 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/entity/ActUserClockLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java index 83335f9da..f4c15b077 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java @@ -74,4 +74,9 @@ public class ActUserClockLogEntity extends BaseEpdcEntity { */ private String clockDesc; + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + } \ 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/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java index 75189ca99..0be463bcc 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java @@ -150,5 +150,13 @@ public interface ActUserRelationService extends BaseService selectListActUserRelation(String actId); + /** + * 默认活动报名审核通过 + * + * @param actId + * @author wanggongfeng + * @date 2019-12-16 + */ + Result updateAuditDefaultStatus(String actId); } \ 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/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java index 06f730271..55a3826d9 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java @@ -237,4 +237,35 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl().ok(appClockListDTO); } + /** + * 自动审核 + * @param actId + * @return + */ + @Override + public Result updateAuditDefaultStatus(String actId) { + //查询已报名未审核的志愿者 + List data = baseDao.selectListActUserInfo(actId); + if(data != null && data.size() > 0){ + for(int i = 0 ; i < data.size() ; i++){ + //更新人员活动关系表 + ActUserRelationDTO actUserRelationDTO = data.get(i); + actUserRelationDTO.setStatus("1");//审核通过 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + //存储活动日志表 + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActId(actUserRelationDTO.getActId()); + actUserLogDTO.setUserId(actUserRelationDTO.getUserId()); + actUserLogDTO.setOperationType("1");//审核通过 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + } + }else{ + return new Result().error("该活动暂时没有未审核的志愿者"); + } + + return new Result().ok("该活动对已报名的志愿者自动审核成功"); + } + } \ 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/volunteer/controller/AppVolunteerRankController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java index 71aba7d6e..e7e699609 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java @@ -18,12 +18,11 @@ package com.elink.esua.epdc.modules.volunteer.controller; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -55,9 +54,9 @@ public class AppVolunteerRankController { * 定时更新排行榜 * @return */ - @GetMapping(value="generateRankingList" ,produces = "application/json;charset=utf-8") - public Result generateRankingList() { - return volunteerRankService.generateRankingList(); + @PostMapping(value="generateRankingList") + public Result generateRankingList(@RequestBody List list) { + return volunteerRankService.generateRankingList(list); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java index 3ca1f2fe4..757a41d68 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.modules.volunteer.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; import com.elink.esua.epdc.volunteer.VolunteerRankDTO; @@ -107,7 +108,7 @@ public interface VolunteerRankService extends BaseService { * @Author wanggongfeng * @return */ - Result generateRankingList(); + Result generateRankingList(List list); } \ 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/volunteer/service/impl/VolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java index 1bd8fc3b5..5b8434bd8 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java @@ -25,7 +25,6 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; -import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.volunteer.dao.VolunteerRankDao; import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; import com.elink.esua.epdc.modules.volunteer.redis.VolunteerRankRedis; @@ -53,9 +52,6 @@ public class VolunteerRankServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -125,9 +121,7 @@ public class VolunteerRankServiceImpl extends BaseServiceImpl> result = userFeignClient.getRankingList(); - List list = result.getData(); + public Result generateRankingList(List list){ if(list != null && list.size() > 0){ for(int i = 0 ; i < list.size(); i++ ){ EpdcGetVolunteerRankDTO epdcGetVolunteerRankDTO = list.get(i); @@ -136,7 +130,7 @@ public class VolunteerRankServiceImpl extends BaseServiceImpl + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml index 1bd888898..65c2e075d 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-client/pom.xml @@ -18,6 +18,11 @@ epdc-commons-tools 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java new file mode 100644 index 000000000..6f9753902 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java @@ -0,0 +1,40 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.fallback.HeartFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = HeartFeignClientFallback.class,url = "http://127.0.0.1:9060") +public interface HeartFeignClient { + + /** + * 更新当日排行榜 + * + * @return + */ + @PostMapping("heart/volunteer/generateRankingList") + Result generateRankingList(List list); + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @GetMapping("heart/appactuserrelation/AutoAuditActUser/{actId}") + Result AutoAuditActUser(@PathVariable("actId") String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java similarity index 84% rename from esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index b7d4d429e..55d147934 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -1,9 +1,9 @@ -package com.elink.esua.epdc.modules.feign; +package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; -import com.elink.esua.epdc.modules.feign.fallback.UserFeignClientFallback; +import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -20,7 +20,7 @@ import java.util.List; public interface UserFeignClient { /** - * 获取排行榜 + * 获取当日排行榜 * * @return */ diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java new file mode 100644 index 000000000..0bcf90b3f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java @@ -0,0 +1,39 @@ +package com.elink.esua.epdc.feign.fallback; + +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; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.HeartFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class HeartFeignClientFallback implements HeartFeignClient { + + /** + * 更新排行榜 + * + * @return + */ + @Override + public Result generateRankingList(List list) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "generateRankingList",list); + } + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @Override + public Result AutoAuditActUser(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "AutoAuditActUser",actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java similarity index 86% rename from esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index caacee3a3..a5de593e8 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -1,10 +1,10 @@ -package com.elink.esua.epdc.modules.feign.fallback; +package com.elink.esua.epdc.feign.fallback; 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; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; -import com.elink.esua.epdc.modules.feign.UserFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; import org.springframework.stereotype.Component; import java.util.List; diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java new file mode 100644 index 000000000..44fee92f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ActivityService { + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + Result AutoAuditActUser(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java new file mode 100644 index 000000000..ce6343dd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface VolunteerService { + + /** + * 生成排行榜 + * @Author wanggongfeng + * @return + */ + Result generateRankingList(); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java new file mode 100644 index 000000000..ba4cc19b9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.HeartFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.service.ActivityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ActivityServiceImpl implements ActivityService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private HeartFeignClient heartFeignClient; + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + @Override + public Result AutoAuditActUser(String actId){ + return heartFeignClient.AutoAuditActUser(actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java new file mode 100644 index 000000000..dfb6eabfa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.HeartFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.service.VolunteerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class VolunteerServiceImpl implements VolunteerService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private HeartFeignClient heartFeignClient; + + /** + * 更新排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result generateRankingList(){ + Result> result = userFeignClient.getRankingList(); + List list = result.getData(); + return heartFeignClient.generateRankingList(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java new file mode 100644 index 000000000..44aca3e46 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java @@ -0,0 +1,31 @@ +/** + * 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.task.activity; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface AutoAuditActUserTask { + + void run(String actId); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java new file mode 100644 index 000000000..649ddb8b2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTaskImpl.java @@ -0,0 +1,43 @@ +/** + * 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.task.activity; + +import com.elink.esua.epdc.service.ActivityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 自动审核通过未审核的报名人员 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component("AutoAuditActUserTask") +public class AutoAuditActUserTaskImpl implements AutoAuditActUserTask { + + @Autowired + private ActivityService activityService; + + @Override + public void run(String actId){ + //活动时间到自动审核通过未审核的报名人员 + activityService.AutoAuditActUser(actId); + } + + +} \ 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/volunteer/task/UpdateVolunteerRankTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java similarity index 92% rename from esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/task/UpdateVolunteerRankTask.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java index 0a9fda3a3..fcba26c11 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/task/UpdateVolunteerRankTask.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.modules.volunteer.task; +package com.elink.esua.epdc.task.volunteer; /** * 志愿者排名 @@ -25,7 +25,7 @@ package com.elink.esua.epdc.modules.volunteer.task; */ public interface UpdateVolunteerRankTask { - void run(); + void run(String param); } \ 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/volunteer/task/UpdateVolunteerRankTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java similarity index 78% rename from esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/task/UpdateVolunteerRankTaskImpl.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java index cdb5abc71..667b19a78 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/task/UpdateVolunteerRankTaskImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTaskImpl.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.modules.volunteer.task; +package com.elink.esua.epdc.task.volunteer; -import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import com.elink.esua.epdc.service.VolunteerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -27,16 +27,16 @@ import org.springframework.stereotype.Component; * @author qu qu@elink-cn.com * @since v1.0.0 2019-12-19 */ -@Component("UpdateVolunteerRank") +@Component("UpdateVolunteerRankTask") public class UpdateVolunteerRankTaskImpl implements UpdateVolunteerRankTask { @Autowired - private VolunteerRankService volunteerRankService; + private VolunteerService volunteerService; @Override - public void run(){ + public void run(String param){ //每日定时更新排行榜 - volunteerRankService.generateRankingList(); + volunteerService.generateRankingList(); }