|
|
@ -1,9 +1,16 @@ |
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils; |
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.UserTagInfo; |
|
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.feign.AppVolunteerRankFeignClient; |
|
|
|
import com.elink.esua.epdc.service.AppVolunteerRankService; |
|
|
|
import com.elink.esua.epdc.volunteer.AppVolunteerApplyDTO; |
|
|
|
import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; |
|
|
|
import com.elink.esua.epdc.volunteer.VolunteerOrgDTO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -22,10 +29,14 @@ public class AppVolunteerRankServiceImpl implements AppVolunteerRankService { |
|
|
|
@Autowired |
|
|
|
private AppVolunteerRankFeignClient appVolunteerRankFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取排行榜 |
|
|
|
* @Author wanggongfeng |
|
|
|
* |
|
|
|
* @return |
|
|
|
* @Author wanggongfeng |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Result<List<EpdcVolunteerRankDTO>> leaderboard() { |
|
|
@ -33,4 +44,55 @@ public class AppVolunteerRankServiceImpl implements AppVolunteerRankService { |
|
|
|
return dataResult; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<VolunteerOrgDTO>> getAppVolunteerOrgList() { |
|
|
|
return appVolunteerRankFeignClient.getAppVolunteerOrgList(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result applyVolunteer(TokenDto userDetail, AppVolunteerApplyDTO formDto) { |
|
|
|
if (null == userDetail) { |
|
|
|
return new Result().error("获取用户信息失败"); |
|
|
|
} |
|
|
|
//获取所有上级机构名称和ID拼接
|
|
|
|
Result<ParentAndAllDeptDTO> dtoResult = adminFeignClient.getParentAndAllDept(userDetail.getGridId()); |
|
|
|
ParentAndAllDeptDTO deptDTO = dtoResult.getData(); |
|
|
|
// 父所有部门
|
|
|
|
formDto.setParentDeptIds(deptDTO.getParentDeptIds()); |
|
|
|
formDto.setParentDeptNames(deptDTO.getParentDeptNames()); |
|
|
|
// 所有部门
|
|
|
|
formDto.setAllDeptIds(deptDTO.getAllDeptIds()); |
|
|
|
formDto.setAllDeptNames(deptDTO.getAllDeptNames()); |
|
|
|
// 网格
|
|
|
|
formDto.setDept(deptDTO.getGrid()); |
|
|
|
formDto.setDeptId(deptDTO.getGridId()); |
|
|
|
|
|
|
|
formDto.setUserId(userDetail.getUserId()); |
|
|
|
formDto.setFaceImg(userDetail.getFaceImg()); |
|
|
|
//判断党员标识
|
|
|
|
if (!CollectionUtils.isEmpty(userDetail.getUserTagInfos())) { |
|
|
|
Boolean flag = false; |
|
|
|
for (UserTagInfo ut : userDetail.getUserTagInfos()) { |
|
|
|
if ("partymember".equals(ut.getTagCode())) { |
|
|
|
flag = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
formDto.setPartyFlag(flag == true ? 1 : 0); |
|
|
|
} else { |
|
|
|
formDto.setPartyFlag(0); |
|
|
|
} |
|
|
|
return appVolunteerRankFeignClient.applyVolunteer(formDto); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result getVolunteerDetail(TokenDto userDetail) { |
|
|
|
if (null == userDetail) { |
|
|
|
return new Result().error("获取用户信息失败"); |
|
|
|
} |
|
|
|
AppVolunteerApplyDTO formDto = new AppVolunteerApplyDTO(); |
|
|
|
formDto.setUserId(userDetail.getUserId()); |
|
|
|
return appVolunteerRankFeignClient.getVolunteerDetail(formDto); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|