Browse Source

修改志愿者审核通过也发通知

feature/dangjian
曲树通 5 years ago
parent
commit
5a40b19791
  1. 23
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java

23
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java

@ -325,20 +325,13 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
if (StringUtils.isBlank(volunteerInfoDTO.getFailureReason())) { if (StringUtils.isBlank(volunteerInfoDTO.getFailureReason())) {
return new Result().error("请填写原因"); return new Result().error("请填写原因");
} }
// 1、未通过审核时发送消息-用户可修改信息重新提交 sendInfo(dto, volunteerInfoDTO);
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO();
informationFormDTO.setUserId(volunteerInfoDTO.getUserId());
informationFormDTO.setContent(dto.getFailureReason());
informationFormDTO.setType(VolunteerInfoNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
informationFormDTO.setBusinessType(VolunteerInfoNoticeConstant.NOTICE__BUSINESS_TYPE_VOLUNTEER);
informationFormDTO.setBusinessId(volunteerInfoDTO.getId());
informationFormDTO.setTitle(VolunteerInfoNoticeConstant.NOTICE_CERTIFICATION_NOT_PASSED);
newsTask.insertUserInformation(informationFormDTO);
} else { } else {
//2、审核通过-新增用户标签关系表(此方法里面实现了更新redis里的userTagInfos) //2、审核通过-新增用户标签关系表(此方法里面实现了更新redis里的userTagInfos)
if (isVolunteer(volunteerInfoDTO.getUserId())) { if (isVolunteer(volunteerInfoDTO.getUserId())) {
return new Result().error("当前用户已审核通过,无法操作历史记录"); return new Result().error("当前用户已审核通过,无法操作历史记录");
} }
sendInfo(dto, volunteerInfoDTO);
userTagRelationService.addUserTagRelation(volunteerInfoDTO.getUserId(), UserTagEnum.VOLUNTEER.value()); userTagRelationService.addUserTagRelation(volunteerInfoDTO.getUserId(), UserTagEnum.VOLUNTEER.value());
} }
//3、更新志愿者信息表 //3、更新志愿者信息表
@ -346,6 +339,18 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return new Result(); return new Result();
} }
private void sendInfo(VolunteerInfoDTO dto, VolunteerInfoDTO volunteerInfoDTO) {
// 1、未通过审核时发送消息-用户可修改信息重新提交
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO();
informationFormDTO.setUserId(volunteerInfoDTO.getUserId());
informationFormDTO.setContent(dto.getFailureReason());
informationFormDTO.setType(VolunteerInfoNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
informationFormDTO.setBusinessType(VolunteerInfoNoticeConstant.NOTICE__BUSINESS_TYPE_VOLUNTEER);
informationFormDTO.setBusinessId(volunteerInfoDTO.getId());
informationFormDTO.setTitle(VolunteerInfoNoticeConstant.NOTICE_CERTIFICATION_NOT_PASSED);
newsTask.insertUserInformation(informationFormDTO);
}
private boolean isVolunteer(String userId) { private boolean isVolunteer(String userId) {
QueryWrapper<VolunteerInfoEntity> wrapper = new QueryWrapper<>(); QueryWrapper<VolunteerInfoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(UserFieldConsant.USER_ID, userId) wrapper.eq(UserFieldConsant.USER_ID, userId)

Loading…
Cancel
Save