Browse Source

PC端修改活动,去掉活动时间段校验提示

ftature/screen
liuchuang 4 years ago
parent
commit
400724b562
  1. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodService.java
  2. 18
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  3. 5
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActPeriodServiceImpl.java

2
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodService.java

@ -101,7 +101,7 @@ public interface ActPeriodService extends BaseService<ActPeriodEntity> {
* @author lc
* @since 2021/9/2 15:28
*/
void removeActPeriodsByActId(String actId);
boolean removeActPeriodsByActId(String actId);
/**
* 获取活动时间段

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

@ -923,14 +923,16 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
*/
private void saveOrUpdateActPeriods(List<ActPeriodDTO> periods, String actId, Integer actQuotaCategory) {
// 删除活动已有的时间段
actPeriodService.removeActPeriodsByActId(actId);
// 保存活动时间段
for (ActPeriodDTO dto:
periods) {
dto.setActId(actId);
dto.setActPeriodQuotaCategory(actQuotaCategory);
dto.setId(null);
actPeriodService.save(dto);
boolean result = actPeriodService.removeActPeriodsByActId(actId);
if (result) {
// 保存活动时间段
for (ActPeriodDTO dto:
periods) {
dto.setActId(actId);
dto.setActPeriodQuotaCategory(actQuotaCategory);
dto.setId(null);
actPeriodService.save(dto);
}
}
}
}

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

@ -101,13 +101,14 @@ public class ActPeriodServiceImpl extends BaseServiceImpl<ActPeriodDao, ActPerio
@Override
@Transactional(rollbackFor = Exception.class)
public void removeActPeriodsByActId(String actId) {
public boolean removeActPeriodsByActId(String actId) {
// 校验活动是否已有人报名,有人报名后不能修改活动时间段
List<ActPeriodDTO> periods = baseDao.selectPeriodsAlreadySignIn(actId);
if (CollectionUtil.isNotEmpty(periods)) {
throw new RenException("活动时间段已有人报名,不能修改");
return false;
}
baseDao.modifyDelFlagByActId(actId);
return true;
}
@Override

Loading…
Cancel
Save