|
@ -52,6 +52,7 @@ import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
import com.elink.esua.epdc.service.UserTagRelationService; |
|
|
import com.elink.esua.epdc.service.UserTagRelationService; |
|
|
import com.elink.esua.epdc.service.VolunteerInfoService; |
|
|
import com.elink.esua.epdc.service.VolunteerInfoService; |
|
|
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|
|
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -65,6 +66,7 @@ import java.util.*; |
|
|
* @author qu qu@elink-cn.com |
|
|
* @author qu qu@elink-cn.com |
|
|
* @since v1.0.0 2019-12-11 |
|
|
* @since v1.0.0 2019-12-11 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
@Service |
|
|
@Service |
|
|
public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, VolunteerInfoEntity> implements VolunteerInfoService { |
|
|
public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, VolunteerInfoEntity> implements VolunteerInfoService { |
|
|
|
|
|
|
|
@ -430,7 +432,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO) { |
|
|
public Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO) { |
|
|
|
|
|
log.info("insertV2VolunteerInfo=dto:"+formDTO); |
|
|
VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class); |
|
|
VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class); |
|
|
|
|
|
|
|
|
// 补全其他字段
|
|
|
// 补全其他字段
|
|
@ -462,7 +464,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value()); |
|
|
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value()); |
|
|
} |
|
|
} |
|
|
//更新志愿者的志愿团队信息
|
|
|
//更新志愿者的志愿团队信息
|
|
|
updateVolunteerTeam(volunteerEntity,dto); |
|
|
updateVolunteerTeam(volunteerEntity,formDTO); |
|
|
// 更新志愿者标签
|
|
|
// 更新志愿者标签
|
|
|
VolunteerTagRelationDTO tagDto = new VolunteerTagRelationDTO(); |
|
|
VolunteerTagRelationDTO tagDto = new VolunteerTagRelationDTO(); |
|
|
tagDto.setVolunteerId(volunteerEntity.getId()); |
|
|
tagDto.setVolunteerId(volunteerEntity.getId()); |
|
@ -472,7 +474,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
return new Result().ok(NumConstant.ONE); |
|
|
return new Result().ok(NumConstant.ONE); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void updateVolunteerTeam(VolunteerInfoEntity volunteerEntity, VolunteerInfoDTO dto) { |
|
|
private void updateVolunteerTeam(VolunteerInfoEntity volunteerEntity, EpdcCompleteVolunteerInfoV2FormDTO dto) { |
|
|
vlounteerTeamRealationDao.deleteByVolunteerId(volunteerEntity.getId()); |
|
|
vlounteerTeamRealationDao.deleteByVolunteerId(volunteerEntity.getId()); |
|
|
if(StringUtils.isNotBlank(dto.getTeamId())){ |
|
|
if(StringUtils.isNotBlank(dto.getTeamId())){ |
|
|
VlounteerTeamRealationEntity entity = new VlounteerTeamRealationEntity(); |
|
|
VlounteerTeamRealationEntity entity = new VlounteerTeamRealationEntity(); |
|
|