@ -621,7 +621,7 @@ public class WorkActServiceImpl implements WorkActService {
public void cancelAct ( CancelActFormDTO formDTO ) {
ActInfoDTO actInfoDTO = actInfoService . get ( formDTO . getActId ( ) ) ;
if ( null = = actInfoDTO ) {
logger . error ( "act_info is null" ) ;
logger . error ( "act_info is null actId= " + formDTO . getActId ( ) ) ;
return ;
}
if ( ! actInfoDTO . getCreatedBy ( ) . equals ( loginUserUtil . getLoginUserId ( ) ) ) {
@ -809,7 +809,7 @@ public class WorkActServiceImpl implements WorkActService {
public void finishAct ( String actId ) {
ActInfoDTO actInfoDTO = actInfoService . get ( actId ) ;
if ( null = = actInfoDTO ) {
logger . error ( "act_info is null" ) ;
logger . error ( "act_info is null actId= " + actId ) ;
return ;
}
//校验是否可以结束
@ -826,9 +826,18 @@ public class WorkActServiceImpl implements WorkActService {
//发放积分调用事件
if ( actInfoDTO . getReward ( ) > 0 ) {
this . grantActPoints ( actInfoDTO ) ;
} else {
logger . info ( "活动积分为" + actInfoDTO . getReward ( ) + "无需发放积分" ) ;
}
}
/ * *
* @return void
* @param actInfoDTO
* @author yinzuomei
* @description 活动发放积分
* @Date 2020 / 7 / 31 13 : 12
* * /
private void grantActPoints ( ActInfoDTO actInfoDTO ) {
//查询已经给分的用户
QueryWrapper < ActUserRelationEntity > wrapper = new QueryWrapper < > ( ) ;
@ -837,7 +846,7 @@ public class WorkActServiceImpl implements WorkActService {
. eq ( "REWARD_FLAG" , ActConstant . ACT_USER_STATUS_AGREE ) ;
List < ActUserRelationEntity > actUserRelationEntityList = actUserRelationDao . selectList ( wrapper ) ;
if ( null = = actUserRelationEntityList | | actUserRelationEntityList . size ( ) < 1 ) {
logger . info ( "不存在给分的记录,无需发送消息时间" ) ;
logger . info ( String . format ( "活动%s, 不存在给分的记录,无需发送消息时间" , actInfoDTO . getId ( ) ) ) ;
return ;
}
//查询当前用户所属组织信息
@ -879,7 +888,7 @@ public class WorkActServiceImpl implements WorkActService {
actGrantPointLogEntity . setResponseMsg ( JSON . toJSONString ( result ) ) ;
actGrantPointLogDao . insert ( actGrantPointLogEntity ) ;
if ( ! result . success ( ) ) {
logger . error ( "活动积分发放失败" ) ;
logger . error ( "活动积分发放失败,act_grant_point_log.id= " + actGrantPointLogEntity . getId ( ) ) ;
}
}
@ -925,6 +934,13 @@ public class WorkActServiceImpl implements WorkActService {
logger . info ( "积分发方成功" ) ;
}
/ * *
* @return void
* @param actInfoDTO
* @author yinzuomei
* @description //发放爱心时长、参与活动并获得积分的次数
* @Date 2020 / 7 / 31 13 : 15
* * /
private void updateHeartUserInfo ( ActInfoDTO actInfoDTO ) {
List < ActUserRelationDTO > actUserRelationDTOList = actUserRelationService . getUserList ( actInfoDTO . getId ( ) , StrConstant . EPMETY_STR ) ;
for ( ActUserRelationDTO actUserRelation : actUserRelationDTOList ) {
@ -932,23 +948,36 @@ public class WorkActServiceImpl implements WorkActService {
if ( null = = heartUserInfoDTO ) {
continue ;
}
if ( ActConstant . ACT_USER_STATUS_AGREE . equals ( actUserRelation . getRewardFlag ( ) ) ) {
heartUserInfoDTO . setObtainPointNum ( heartUserInfoDTO . getObtainPointNum ( ) + 1 ) ;
}
//爱心时长发放(签到的。未签到但是有积分的)
if ( ActConstant . ACT_USER_STATUS_SIGNED_IN . equals ( actUserRelation . getSignInFlag ( ) ) ) {
//已签到的
heartUserInfoDTO . setKindnessTime ( heartUserInfoDTO . getKindnessTime ( ) + actInfoDTO . getServiceMin ( ) ) ;
} else {
//未签到,但是有积分的
if ( actInfoDTO . getReward ( ) > 0 ) {
if ( ActConstant . ACT_USER_STATUS_AGREE . equals ( actUserRelation . getRewardFlag ( ) ) ) {
heartUserInfoDTO . setObtainPointNum ( heartUserInfoDTO . getObtainPointNum ( ) + 1 ) ;
}
}
if ( actInfoDTO . getServiceMin ( ) > 0 ) {
//爱心时长发放(签到的。未签到但是有积分的)
if ( ActConstant . ACT_USER_STATUS_SIGNED_IN . equals ( actUserRelation . getSignInFlag ( ) ) ) {
//已签到的
heartUserInfoDTO . setKindnessTime ( heartUserInfoDTO . getKindnessTime ( ) + actInfoDTO . getServiceMin ( ) ) ;
} else {
//未签到,但是有积分的
if ( ActConstant . ACT_USER_STATUS_AGREE . equals ( actUserRelation . getRewardFlag ( ) ) ) {
heartUserInfoDTO . setKindnessTime ( heartUserInfoDTO . getKindnessTime ( ) + actInfoDTO . getServiceMin ( ) ) ;
}
}
}
heartUserInfoService . update ( heartUserInfoDTO ) ;
if ( actInfoDTO . getReward ( ) > 0 | | actInfoDTO . getServiceMin ( ) > 0 ) {
heartUserInfoService . update ( heartUserInfoDTO ) ;
}
}
}
/ * *
* @return void
* @param actId
* @author yinzuomei
* @description 活动结束后生成统计表
* @Date 2020 / 7 / 31 13 : 15
* * /
private void saveActStatistical ( String actId ) {
ActStatisticalDTO actStatisticalDTO = new ActStatisticalDTO ( ) ;
actStatisticalDTO . setActId ( actId ) ;
@ -971,6 +1000,13 @@ public class WorkActServiceImpl implements WorkActService {
actStatisticalService . save ( actStatisticalDTO ) ;
}
/ * *
* @return void
* @param actId
* @author yinzuomei
* @description 保存活动结束日志
* @Date 2020 / 7 / 31 13 : 16
* * /
private void saveActOperationRec ( String actId ) {
ActOperationRecEntity actOperationRecEntity = new ActOperationRecEntity ( ) ;
actOperationRecEntity . setActId ( actId ) ;
@ -980,6 +1016,13 @@ public class WorkActServiceImpl implements WorkActService {
actOperationRecDao . insert ( actOperationRecEntity ) ;
}
/ * *
* @return com . epmet . dto . ActInfoDTO
* @param actInfoDTO
* @author yinzuomei
* @description 校验是否可以结束
* @Date 2020 / 7 / 31 13 : 16
* * /
private ActInfoDTO checkActInfoDTO ( ActInfoDTO actInfoDTO ) {
//只有我发布的活动,我可以就结束
if ( ! actInfoDTO . getCreatedBy ( ) . equals ( loginUserUtil . getLoginUserId ( ) ) ) {
@ -1012,7 +1055,7 @@ public class WorkActServiceImpl implements WorkActService {
public void summaryAct ( SummaryActFormDTO formDTO ) {
ActInfoDTO actInfoDTO = actInfoService . get ( formDTO . getActId ( ) ) ;
if ( null = = actInfoDTO ) {
logger . info ( "act_info is null" ) ;
logger . error ( "act_info is null actId= " + formDTO . getActId ( ) ) ;
return ;
}
if ( ! actInfoDTO . getActStatus ( ) . equals ( ActConstant . ACT_STATUS_FINISHED ) ) {
@ -1127,7 +1170,7 @@ public class WorkActServiceImpl implements WorkActService {
//删除所有的草稿
this . deleteDraft ( ) ;
publishActResultDTO . setActId ( rePublishFormDTO . getActId ( ) ) ;
//发送消息通知-暂时不做了
//发送消息通知-暂时不做了,前端默认串的是不通知
/ * if ( rePublishFormDTO . getNoticePassedPeople ( ) ) {
this . noticePassedPeople ( originalActInfo , newActInfoEntity ) ;
} * /
@ -1135,14 +1178,4 @@ public class WorkActServiceImpl implements WorkActService {
}
private void noticePassedPeople ( ActInfoDTO originalActInfo , ActInfoEntity newActInfoEntity ) {
/ * List < ActUserRelationDTO > actUserRelationDTOList = actUserRelationDao . selectAuditingAndPassedList ( originalActInfo . getId ( ) ) ;
if ( null = = actUserRelationDTOList | | actUserRelationDTOList . size ( ) < 1 ) {
logger . info ( "不存在待审核人员、已经审核用户,无需发送站内信" ) ;
return ;
}
String originalTitle = originalActInfo . getTitle ( ) ;
//活动地点、活动预计开始时间、活动预计结束时间、活动积分、签到时间开始、签到结束时间、签到地点*/
}
}