|
|
@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.async.NewsTask; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.utils.DeptEntityUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; |
|
|
@ -219,28 +220,44 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result<Integer> insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { |
|
|
|
|
|
|
|
VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(epdcCompleteVolunteerInfoFormDTO, VolunteerInfoEntity.class); |
|
|
|
|
|
|
|
// 补全其他字段
|
|
|
|
volunteerEntity.setRegistTime(new Date());// 注册时间
|
|
|
|
volunteerEntity.setAuditStatus("1"); // 审核状态 默认审核通过
|
|
|
|
volunteerEntity.setAuditTime(new Date()); // 审核时间
|
|
|
|
volunteerEntity.setAuditStatus(NumConstant.ONE_STR); // 审核状态 默认审核通过
|
|
|
|
volunteerEntity.setAuditTime(volunteerEntity.getRegistTime()); // 审核时间
|
|
|
|
String address = volunteerEntity.getRoad() |
|
|
|
.concat(StringUtils.isNotBlank(volunteerEntity.getVillageName()) ? volunteerEntity.getVillageName() : "") |
|
|
|
.concat(StringUtils.isNotBlank(volunteerEntity.getDwellingPlace()) ? volunteerEntity.getDwellingPlace() : ""); |
|
|
|
.concat(StringUtils.isNotBlank(volunteerEntity.getVillageName()) ? volunteerEntity.getVillageName() : StringUtils.EMPTY) |
|
|
|
.concat(StringUtils.isNotBlank(volunteerEntity.getDwellingPlace()) ? volunteerEntity.getDwellingPlace() : StringUtils.EMPTY); |
|
|
|
volunteerEntity.setAddress(address); // 居住地址
|
|
|
|
|
|
|
|
// 获取部门信息
|
|
|
|
Result<ParentAndAllDeptDTO> dtoResult = adminFeignClient.getParentAndAllDept(volunteerEntity.getGridId() + ""); |
|
|
|
ParentAndAllDeptDTO parentAndAllDeptDTO = dtoResult.getData(); |
|
|
|
|
|
|
|
volunteerEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); // 父所有部门ID
|
|
|
|
volunteerEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());// 父所有部门
|
|
|
|
volunteerEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); // 所有部门ID
|
|
|
|
volunteerEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); // 所有部门
|
|
|
|
Result<ParentAndAllDeptDTO> dtoResult = adminFeignClient.getParentAndAllDept(String.valueOf(volunteerEntity.getGridId())); |
|
|
|
|
|
|
|
// 机构信息
|
|
|
|
DeptEntityUtils.loadDeptInfo( |
|
|
|
ConvertUtils.sourceToTarget(dtoResult.getData(), DeptEntityUtils.DeptDto.class), |
|
|
|
volunteerEntity |
|
|
|
); |
|
|
|
|
|
|
|
deleteVolunteerByUserId(volunteerEntity.getUserId()); |
|
|
|
insert(volunteerEntity); |
|
|
|
return new Result<Integer>().ok(1); |
|
|
|
return new Result().ok(NumConstant.ONE); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 清除志愿者认证历史 |
|
|
|
* |
|
|
|
* @param userId |
|
|
|
* @return void |
|
|
|
* @author work@yujt.net.cn |
|
|
|
* @date 2020/4/3 16:11 |
|
|
|
*/ |
|
|
|
private void deleteVolunteerByUserId(String userId) { |
|
|
|
QueryWrapper<VolunteerInfoEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(UserFieldConsant.USER_ID, userId); |
|
|
|
baseDao.delete(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|