Browse Source

自动审核、审核不通过, 时间段报名人数 -1

feature/screenDataPush
zhangyongzhangyong 4 years ago
parent
commit
0b26d10d82
  1. 25
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  2. 19
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
  3. 1
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml

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

@ -186,6 +186,14 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
if (ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT.equals(dto.getStatus())) { if (ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT.equals(dto.getStatus())) {
actInfoService.minusSignUpNum(entity.getActId()); actInfoService.minusSignUpNum(entity.getActId());
List<ActPeriodDTO> signUpPeriodsByActId = actPeriodService.listOfActPeriodsByActId(entity.getActId());
List<String> periodIds = new ArrayList<>();
for (ActPeriodDTO period : signUpPeriodsByActId) {
periodIds.add(period.getId());
}
// 取消报名的所有活动时间段,活动报名人数 -1
actPeriodService.minusPeriodSignUpNum(periodIds);
// 如果活动开始未审核报名人默认状态(1-审核通过,4-审核不通过)是 4,则将 epdc_act_period 表中的,所有活动时间段状态 更改为 4 // 如果活动开始未审核报名人默认状态(1-审核通过,4-审核不通过)是 4,则将 epdc_act_period 表中的,所有活动时间段状态 更改为 4
ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO(); ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO();
periodUserDTO.setPeriodStatus(ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT); periodUserDTO.setPeriodStatus(ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT);
@ -348,6 +356,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
// 批量修改 // 批量修改
actPeriodUserService.updateBatch(periodUserDtoList); actPeriodUserService.updateBatch(periodUserDtoList);
// 取消报名的所有活动时间段,活动报名人数 -1
actPeriodService.minusPeriodSignUpNum(periodIds);
// 查询状态为:已报名的所有时间段 // 查询状态为:已报名的所有时间段
List<ActPeriodDTO> periodTime = actPeriodUserService.listOfSignInActPeriodsByActUserRelationId(actUserRelationEntity.getId()); List<ActPeriodDTO> periodTime = actPeriodUserService.listOfSignInActPeriodsByActUserRelationId(actUserRelationEntity.getId());
if (null == periodTime) { if (null == periodTime) {
@ -382,9 +393,6 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
// 活动报名人数-1 // 活动报名人数-1
actInfoService.minusSignUpNum(actUserRelationDTO.getActId()); actInfoService.minusSignUpNum(actUserRelationDTO.getActId());
// 取消报名的所有活动时间段,活动报名人数 -1
actPeriodService.minusPeriodSignUpNum(periodIds);
//2、存储活动日志表 //2、存储活动日志表
Date currentTime = new Date(); Date currentTime = new Date();
ActUserLogEntity actUserLog = new ActUserLogEntity(); ActUserLogEntity actUserLog = new ActUserLogEntity();
@ -604,10 +612,19 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
actUserLog.setOperationType(actUserDefaultState);// 默认状态 actUserLog.setOperationType(actUserDefaultState);// 默认状态
actUserLog.setOperationTime(new Date()); actUserLog.setOperationTime(new Date());
actUserLogDao.insert(actUserLog); actUserLogDao.insert(actUserLog);
// 审核不通过,活动的报名人数-1
if (!NumConstant.ONE_STR.equals(actUserDefaultState)) { if (!NumConstant.ONE_STR.equals(actUserDefaultState)) {
// 审核不通过,活动的报名人数-1
actInfoService.minusSignUpNum(actInfoDTO.getId()); actInfoService.minusSignUpNum(actInfoDTO.getId());
List<ActPeriodDTO> signUpPeriodsByActId = actPeriodService.listOfActPeriodsByActId(actInfoDTO.getId());
List<String> periodIds = new ArrayList<>();
for (ActPeriodDTO dto : signUpPeriodsByActId) {
periodIds.add(dto.getId());
}
// 取消报名的所有活动时间段,活动报名人数 -1
actPeriodService.minusPeriodSignUpNum(periodIds);
// 如果活动开始未审核报名人默认状态(1-审核通过,4-审核不通过)是 4,则将 epdc_act_period 表中的,所有活动时间段状态 更改为 4 // 如果活动开始未审核报名人默认状态(1-审核通过,4-审核不通过)是 4,则将 epdc_act_period 表中的,所有活动时间段状态 更改为 4
ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO(); ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO();
periodUserDTO.setPeriodStatus(actUserDefaultState); periodUserDTO.setPeriodStatus(actUserDefaultState);

19
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml

@ -161,7 +161,8 @@
DATE_FORMAT(actInfo.ACT_START_TIME,'%Y-%m-%d %H:%i') ACT_START_TIME, DATE_FORMAT(actInfo.ACT_START_TIME,'%Y-%m-%d %H:%i') ACT_START_TIME,
DATE_FORMAT(actInfo.ACT_END_TIME,'%Y-%m-%d %H:%i') ACT_END_TIME, DATE_FORMAT(actInfo.ACT_END_TIME,'%Y-%m-%d %H:%i') ACT_END_TIME,
actInfo.PUBLISH_TIME,actInfo.ACT_ADDRESS, actInfo.ACT_QUOTA_CATEGORY, actInfo.ACT_QUOTA, actInfo.PUBLISH_TIME,actInfo.ACT_ADDRESS, actInfo.ACT_QUOTA_CATEGORY, actInfo.ACT_QUOTA,
actInfo.SIGNUP_NUM, actInfo.CLOCK_NUM, IF(actInfo.ACT_PERIOD_SIGNUP_NUM = 0, actInfo.SIGNUP_NUM, actInfo.ACT_PERIOD_SIGNUP_NUM) SIGNUP_NUM,
actInfo.CLOCK_NUM,
case case
when <![CDATA[ DATE_FORMAT(actInfo.SIGNUP_END_TIME,'%Y-%m-%d %H:%i:%s') >= ]]> #{timestamp} when <![CDATA[ DATE_FORMAT(actInfo.SIGNUP_END_TIME,'%Y-%m-%d %H:%i:%s') >= ]]> #{timestamp}
then case then case
@ -182,7 +183,7 @@
( (
SELECT i.ID, i.TITLE, i.HEAD_PIC, i.ACT_START_TIME, i.ACT_END_TIME, i.PUBLISH_TIME, i.ACT_ADDRESS, SELECT i.ID, i.TITLE, i.HEAD_PIC, i.ACT_START_TIME, i.ACT_END_TIME, i.PUBLISH_TIME, i.ACT_ADDRESS,
i.ACT_QUOTA, i.CLOCK_NUM, i.SIGNUP_END_TIME, i.CREATED_TIME, i.ACT_QUOTA_CATEGORY, i.ACT_QUOTA, i.CLOCK_NUM, i.SIGNUP_END_TIME, i.CREATED_TIME, i.ACT_QUOTA_CATEGORY,
i.TOP_FLAG, i.DEL_FLAG, i.ACT_STATUS, i.SPONSOR, IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0) SIGNUP_NUM i.TOP_FLAG, i.DEL_FLAG, i.ACT_STATUS, i.SPONSOR, IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0) ACT_PERIOD_SIGNUP_NUM, i.SIGNUP_NUM
FROM FROM
epdc_act_info i epdc_act_info i
LEFT JOIN epdc_act_period p ON i.ID = p.ACT_ID AND p.DEL_FLAG = '0' LEFT JOIN epdc_act_period p ON i.ID = p.ACT_ID AND p.DEL_FLAG = '0'
@ -221,7 +222,7 @@
actInfo.ACT_ADDRESS, actInfo.ACT_ADDRESS,
actInfo.ACT_QUOTA_CATEGORY, actInfo.ACT_QUOTA_CATEGORY,
actInfo.ACT_QUOTA, actInfo.ACT_QUOTA,
actInfo.SIGNUP_NUM, IF(actInfo.ACT_PERIOD_SIGNUP_NUM = 0, actInfo.SIGNUP_NUM, actInfo.ACT_PERIOD_SIGNUP_NUM) SIGNUP_NUM,
actInfo.CLOCK_NUM, actInfo.CLOCK_NUM,
case case
when actInfo.ACT_STATUS = '0' when actInfo.ACT_STATUS = '0'
@ -246,7 +247,15 @@
relation.ID as actUserId, relation.ID as actUserId,
actInfo.TOP_FLAG actInfo.TOP_FLAG
FROM FROM
epdc_act_info actInfo (
SELECT i.ID, i.TITLE, i.HEAD_PIC, i.ACT_START_TIME, i.ACT_END_TIME, i.PUBLISH_TIME, i.ACT_ADDRESS,
i.ACT_QUOTA, i.CLOCK_NUM, i.SIGNUP_END_TIME, i.CREATED_TIME, i.ACT_QUOTA_CATEGORY,
i.TOP_FLAG, i.DEL_FLAG, i.ACT_STATUS, i.SPONSOR, IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0) ACT_PERIOD_SIGNUP_NUM, i.SIGNUP_NUM
FROM
epdc_act_info i
LEFT JOIN epdc_act_period p ON i.ID = p.ACT_ID AND p.DEL_FLAG = '0'
GROUP BY i.ID
) actInfo
left join epdc_act_user_relation relation on relation.DEL_FLAG = '0' left join epdc_act_user_relation relation on relation.DEL_FLAG = '0'
and relation.USER_ID = #{userId} and relation.USER_ID = #{userId}
and relation.STATUS != '3' and relation.STATUS != '3'
@ -509,7 +518,7 @@
eai.ACT_ADDRESS as actAddress, eai.ACT_ADDRESS as actAddress,
eai.ACT_QUOTA_CATEGORY as actQuotaCategory, eai.ACT_QUOTA_CATEGORY as actQuotaCategory,
eai.ACT_QUOTA as actQuota, eai.ACT_QUOTA as actQuota,
IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0) signupNum, IF(IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0) = 0, eai.SIGNUP_NUM, IFNULL(SUM(p.ACT_PERIOD_SIGNUP_NUM), 0)) signupNum,
eai.REWARD, eai.REWARD,
eai.PUNISHMENT_POINTS as punishmentPoints, eai.PUNISHMENT_POINTS as punishmentPoints,
eai.REQUIREMENT as requirement, eai.REQUIREMENT as requirement,

1
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml

@ -76,6 +76,7 @@
update epdc_act_period update epdc_act_period
set ACT_PERIOD_SIGNUP_NUM = ACT_PERIOD_SIGNUP_NUM - 1 set ACT_PERIOD_SIGNUP_NUM = ACT_PERIOD_SIGNUP_NUM - 1
where DEL_FLAG = '0' where DEL_FLAG = '0'
<![CDATA[ and ACT_PERIOD_SIGNUP_NUM > 0 ]]>
and ID in and ID in
<foreach collection="periodIds" index="index" item="periodId" open="(" separator="," close=")"> <foreach collection="periodIds" index="index" item="periodId" open="(" separator="," close=")">
#{periodId} #{periodId}

Loading…
Cancel
Save