|
|
@ -38,8 +38,10 @@ import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.ActStateConstant; |
|
|
|
import com.elink.esua.epdc.constant.ActUserPointsOperationTypeConstant; |
|
|
|
import com.elink.esua.epdc.constant.ActUserRelationStatusConstant; |
|
|
|
import com.elink.esua.epdc.constant.HeartNoticeConstant; |
|
|
|
import com.elink.esua.epdc.dto.UserDTO; |
|
|
|
import com.elink.esua.epdc.dto.VolunteerInfoDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.logs.PointsLogsDTO; |
|
|
|
import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; |
|
|
@ -52,6 +54,7 @@ import com.elink.esua.epdc.modules.activity.service.ActInfoService; |
|
|
|
import com.elink.esua.epdc.modules.activity.service.ActUserLogService; |
|
|
|
import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; |
|
|
|
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; |
|
|
|
import com.elink.esua.epdc.modules.async.NewsTask; |
|
|
|
import com.elink.esua.epdc.modules.feign.PointsFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -94,6 +97,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
@Autowired |
|
|
|
private PointsFeignClient pointsFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private NewsTask newsTask; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ActUserRelationDTO> page(Map<String, Object> params) { |
|
|
|
IPage<ActUserRelationEntity> page = baseDao.selectPage( |
|
|
@ -164,6 +170,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
if (ActStateConstant.ACT_USER_RELATION_STATUS_APPLY.equals(entity.getStatus())) { |
|
|
|
ActUserRelationEntity updateEntity = new ActUserRelationEntity(); |
|
|
|
updateEntity.setId(dto.getId()); |
|
|
|
updateEntity.setUserId(entity.getUserId()); |
|
|
|
updateEntity.setActId(entity.getActId()); |
|
|
|
updateEntity.setStatus(dto.getStatus()); |
|
|
|
updateEntity.setFailureReason(dto.getFailureReason()); |
|
|
|
updateEntity.setAuditTime(new Date()); |
|
|
@ -175,11 +183,41 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
actUserLogDTO.setFailureReason(dto.getFailureReason()); |
|
|
|
actUserLogDTO.setOperationTime(new Date()); |
|
|
|
actUserLogService.save(actUserLogDTO); |
|
|
|
this.insertUserInformation(updateEntity); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
return new Result().error("不可操作"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param actUserRelationEntity |
|
|
|
* @return void |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 报名审核-用户发送消息通知 |
|
|
|
* @Date 2020/2/7 20:08 |
|
|
|
**/ |
|
|
|
private void insertUserInformation(ActUserRelationEntity actUserRelationEntity) { |
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
|
// 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)
|
|
|
|
if (ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus())) { |
|
|
|
informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_PASSED); |
|
|
|
} else if (ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus())) { |
|
|
|
informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_NOT_PASSED); |
|
|
|
} else { |
|
|
|
return; |
|
|
|
} |
|
|
|
informationFormDTO.setUserId(actUserRelationEntity.getUserId()); |
|
|
|
informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); |
|
|
|
informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_ACTIVITY); |
|
|
|
informationFormDTO.setBusinessId(actUserRelationEntity.getActId()); |
|
|
|
informationFormDTO.setContent(actUserRelationEntity.getFailureReason()); |
|
|
|
ActInfoDTO actInfoDTO = actInfoService.get(actUserRelationEntity.getActId()); |
|
|
|
if (null != actInfoDTO) { |
|
|
|
informationFormDTO.setRelBusinessContent(actInfoDTO.getTitle()); |
|
|
|
} |
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void delete(String[] ids) { |
|
|
|