Browse Source

志愿者自动审核 - 活动报名定时任务自动审核 消息通知

feature/syp_points
songyunpeng 6 years ago
parent
commit
24372b4a9d
  1. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  2. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartNoticeConstant.java
  3. 23
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  4. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/VolunteerInfoNoticeConstant.java
  5. 14
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  6. 1
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml

1
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -1170,6 +1170,7 @@ public class AppUserServiceImpl implements AppUserService {
formDto.setSex(IdentityNoUtils.getSex(identityNo));
formDto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN));
formDto.setUserId(tokenDto.getUserId());
formDto.setGridId(tokenDto.getGridId());
// 新增志愿者
Result<Integer> insertCountResult = userFeignClient.insertVolunteerInfo(formDto);
if (!insertCountResult.success()) {

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartNoticeConstant.java

@ -16,6 +16,12 @@ public interface HeartNoticeConstant {
*/
String NOTICE_SIGN_UP_PASSED = "您报名的活动【审核通过】";
/**
* 活动报名自动审核
*/
String AUTH_NOTICE_SIGN_UP= "自动审核";
/**
* 活动取消
*/

23
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java

@ -349,7 +349,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
//6、插入points记录
//通过动作编码获取动作信息
Result<BehaviorResultDto> behaviorCodeInfo = pointsFeignClient.getBehaviorCodeInfo(BehaviorEnum.BREAK_PROMISE.getValue());
if (!behaviorCodeInfo.success() || behaviorCodeInfo.getData()==null){
if (!behaviorCodeInfo.success() || behaviorCodeInfo.getData() == null) {
throw new RenException("获取动作编码信息异常或无此动作编码");
}
PointsLogsDTO pointsLogsDTO = new PointsLogsDTO();
@ -480,6 +480,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
actUserLog.setOperationType(actUserDefaultState);// 默认状态
actUserLog.setOperationTime(new Date());
actUserLogDao.insert(actUserLog);
//给用户发送消息通知
this.sendNotice(actUserRelationDTO, actUserDefaultState, actInfoDTO);
}
// 审核不通过,活动的报名人数减少
if (!NumConstant.ONE_STR.equals(actUserDefaultState)) {
@ -495,4 +497,23 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
return new Result().ok("该活动对已报名的志愿者自动审核成功");
}
//自动审核 定时任务 消息通知
private void sendNotice(ActUserRelationDTO actUserRelationDTO, String actUserDefaultState, ActInfoDTO actInfoDTO) {
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO();
informationFormDTO.setUserId(actUserRelationDTO.getUserId());
informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_ACT_FAILURE);
informationFormDTO.setBusinessId(actUserRelationDTO.getActId());
informationFormDTO.setRelBusinessContent(actInfoDTO.getTitle());
//审核不通过
if (!NumConstant.ONE_STR.equals(actUserDefaultState)) {
informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_NOT_PASSED);
informationFormDTO.setContent(HeartNoticeConstant.AUTH_NOTICE_SIGN_UP);
} else {
informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_PASSED);
informationFormDTO.setContent(HeartNoticeConstant.AUTH_NOTICE_SIGN_UP);
}
newsTask.insertUserInformation(informationFormDTO);
}
}

4
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/VolunteerInfoNoticeConstant.java

@ -11,6 +11,10 @@ public interface VolunteerInfoNoticeConstant {
*/
String NOTICE_CERTIFICATION_NOT_PASSED = "您的志愿者认证【审核未通过】";
String NOTICE_CERTIFICATION_PASSED = "您的志愿者认证【审核通过】";
String AUTH_NOTICE_CERTIFICATION_PASSED_CONTENT = "自动审核";
/**
* 消息所属业务类型volunteer志愿者审核
*/

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

@ -228,10 +228,22 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
deleteVolunteerByUserId(volunteerEntity.getUserId());
insert(volunteerEntity);
this.sendNotice(volunteerEntity);
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value());
return new Result().ok(NumConstant.ONE);
}
//组装发送消息
private void sendNotice(VolunteerInfoEntity volunteerInfoEntity) {
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO();
// 审核不通过
informationFormDTO.setTitle(VolunteerInfoNoticeConstant.NOTICE_CERTIFICATION_PASSED);
informationFormDTO.setContent(VolunteerInfoNoticeConstant.AUTH_NOTICE_CERTIFICATION_PASSED_CONTENT);
informationFormDTO.setUserId(volunteerInfoEntity.getUserId());
informationFormDTO.setType(VolunteerInfoNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
informationFormDTO.setBusinessType(VolunteerInfoNoticeConstant.NOTICE__BUSINESS_TYPE_VOLUNTEER);
informationFormDTO.setBusinessId(volunteerInfoEntity.getId());
newsTask.insertUserInformation(informationFormDTO);
}
/**
* 清除志愿者认证历史
*

1
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/application.yml

@ -77,7 +77,6 @@ mybatis-plus:
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
rocketmq:
name-server: @rocketmq.name.server@

Loading…
Cancel
Save