13 changed files with 355 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.modules.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 org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 调用用户模块 |
|||
* |
|||
* @Author:wanggongfeng |
|||
* @Date:2019/12/16 17:36 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) |
|||
public interface UserFeignClient { |
|||
|
|||
/** |
|||
* 获取排行榜 |
|||
* |
|||
* @return |
|||
*/ |
|||
@GetMapping("app-user/epdc-app/volunteerinfo/getRankingList") |
|||
Result<List<EpdcGetVolunteerRankDTO>> getRankingList(); |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.elink.esua.epdc.modules.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 org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author:wanggongfeng |
|||
* @Date:2019/12/16 15:11 |
|||
*/ |
|||
@Component |
|||
public class UserFeignClientFallback implements UserFeignClient { |
|||
|
|||
/** |
|||
* 获取排行榜 |
|||
* |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Result<List<EpdcGetVolunteerRankDTO>> getRankingList() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getRankingList"); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.volunteer.task; |
|||
|
|||
/** |
|||
* 志愿者排名 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
public interface UpdateVolunteerRankTask { |
|||
|
|||
void run(); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.volunteer.task; |
|||
|
|||
import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; |
|||
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("UpdateVolunteerRank") |
|||
public class UpdateVolunteerRankTaskImpl implements UpdateVolunteerRankTask { |
|||
|
|||
@Autowired |
|||
private VolunteerRankService volunteerRankService; |
|||
|
|||
@Override |
|||
public void run(){ |
|||
volunteerRankService.generateRankingList(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,122 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.dto.epdc.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 志愿者排名 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Data |
|||
public class EpdcGetVolunteerRankDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 排名 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 志愿者ID |
|||
*/ |
|||
private String volunteerId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 头像 |
|||
*/ |
|||
private String faceImg; |
|||
|
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
private String nickname; |
|||
|
|||
/** |
|||
* 是否党员(0-否,1-是) |
|||
*/ |
|||
private String partyFlag; |
|||
|
|||
/** |
|||
* 爱心时长(单位:小时) |
|||
*/ |
|||
private BigDecimal kindnessTime; |
|||
|
|||
/** |
|||
* 参加次数 |
|||
*/ |
|||
private Integer participationNum; |
|||
|
|||
/** |
|||
* 排行生成日期 |
|||
*/ |
|||
private Date generateDate; |
|||
|
|||
/** |
|||
* 是否显示(0-不显示,1-显示) |
|||
*/ |
|||
private String showFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 删除标志 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
} |
|||
Loading…
Reference in new issue