|
|
@ -45,10 +45,12 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListCountResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; |
|
|
|
import com.elink.esua.epdc.entity.VlounteerTeamRealationEntity; |
|
|
|
import com.elink.esua.epdc.entity.VolunteerInfoEntity; |
|
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
|
import com.elink.esua.epdc.service.UserTagRelationService; |
|
|
|
import com.elink.esua.epdc.service.VlounteerTeamRealationService; |
|
|
|
import com.elink.esua.epdc.service.VolunteerInfoService; |
|
|
|
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -84,6 +86,9 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
@Autowired |
|
|
|
private VlounteerTeamRealationDao vlounteerTeamRealationDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private VlounteerTeamRealationService vlounteerTeamRealationService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据查询条件,返回首页 志愿者信息列表 |
|
|
|
* |
|
|
@ -120,7 +125,9 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public VolunteerInfoDTO getVolunteerDetail(String id) { |
|
|
|
return baseDao.getVolunteerDetail(id); |
|
|
|
VolunteerInfoDTO result = baseDao.getVolunteerDetail(id); |
|
|
|
result.setTeamIdList(vlounteerTeamRealationDao.selectIdsByVoId(result.getId())); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -172,6 +179,39 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
tagDto.setVolunteerId(dto.getId()); |
|
|
|
tagDto.setTagId(dto.getTagId()); |
|
|
|
volunteerTagRelationService.insertOrUpdateVolunteerTag(tagDto); |
|
|
|
|
|
|
|
//更新志愿团队信息
|
|
|
|
//查询已加入的团队
|
|
|
|
List<VlounteerTeamRealationEntity> havedInfo = vlounteerTeamRealationDao.selectByVolunteerId(entity.getId()); |
|
|
|
//删除未选中的团队
|
|
|
|
for(VlounteerTeamRealationEntity have : havedInfo){ |
|
|
|
Boolean isHave = false; |
|
|
|
for(String teamId : dto.getTeamIdList()){ |
|
|
|
if(have.getTeamId().equals(teamId)){ |
|
|
|
isHave = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isHave){ |
|
|
|
vlounteerTeamRealationDao.deleteById(have.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 新增录入的团队
|
|
|
|
for(String teamId : dto.getTeamIdList()){ |
|
|
|
Boolean isHave = false; |
|
|
|
for(VlounteerTeamRealationEntity have : havedInfo){ |
|
|
|
if(have.getTeamId().equals(teamId)){ |
|
|
|
isHave = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isHave){ |
|
|
|
VlounteerTeamRealationEntity newEntity = new VlounteerTeamRealationEntity(); |
|
|
|
newEntity.setTeamId(teamId); |
|
|
|
newEntity.setVolunteerId(entity.getId()); |
|
|
|
vlounteerTeamRealationDao.insert(newEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -465,7 +505,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value()); |
|
|
|
} |
|
|
|
//更新志愿者的志愿团队信息
|
|
|
|
// updateVolunteerTeam(volunteerEntity,formDTO);
|
|
|
|
updateVolunteerTeam(volunteerEntity,formDTO); |
|
|
|
// 更新志愿者标签
|
|
|
|
VolunteerTagRelationDTO tagDto = new VolunteerTagRelationDTO(); |
|
|
|
tagDto.setVolunteerId(volunteerEntity.getId()); |
|
|
@ -475,15 +515,39 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
return new Result().ok(NumConstant.ONE); |
|
|
|
} |
|
|
|
|
|
|
|
// private void updateVolunteerTeam(VolunteerInfoEntity volunteerEntity, EpdcCompleteVolunteerInfoV2FormDTO dto) {
|
|
|
|
// vlounteerTeamRealationDao.deleteByVolunteerId(volunteerEntity.getId());
|
|
|
|
// if(StringUtils.isNotBlank(dto.getTeamId())){
|
|
|
|
// VlounteerTeamRealationEntity entity = new VlounteerTeamRealationEntity();
|
|
|
|
// entity.setVolunteerId(volunteerEntity.getId());
|
|
|
|
// entity.setTeamId(dto.getTeamId());
|
|
|
|
// vlounteerTeamRealationDao.insert(entity);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
private void updateVolunteerTeam(VolunteerInfoEntity volunteerEntity, EpdcCompleteVolunteerInfoV2FormDTO dto) { |
|
|
|
//查询已加入的团队
|
|
|
|
List<VlounteerTeamRealationEntity> havedInfo = vlounteerTeamRealationDao.selectByVolunteerId(volunteerEntity.getId()); |
|
|
|
//删除未选中的团队
|
|
|
|
for(VlounteerTeamRealationEntity have : havedInfo){ |
|
|
|
Boolean isHave = false; |
|
|
|
for(String teamId : dto.getTeamIdList()){ |
|
|
|
if(have.getTeamId().equals(teamId)){ |
|
|
|
isHave = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isHave){ |
|
|
|
vlounteerTeamRealationDao.deleteById(have.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 新增录入的团队
|
|
|
|
for(String teamId : dto.getTeamIdList()){ |
|
|
|
Boolean isHave = false; |
|
|
|
for(VlounteerTeamRealationEntity have : havedInfo){ |
|
|
|
if(have.getTeamId().equals(teamId)){ |
|
|
|
isHave = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isHave){ |
|
|
|
VlounteerTeamRealationEntity newEntity = new VlounteerTeamRealationEntity(); |
|
|
|
newEntity.setTeamId(teamId); |
|
|
|
newEntity.setVolunteerId(volunteerEntity.getId()); |
|
|
|
vlounteerTeamRealationDao.insert(newEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto) { |
|
|
|