Browse Source

活动新增活动参与时间段

feature/screenDataPush
liuchuang 4 years ago
parent
commit
1d87cc03d0
  1. 16
      esua-epdc/epdc-admin/epdc-admin-server/pom.xml
  2. 16
      esua-epdc/epdc-auth/pom.xml
  3. 20
      esua-epdc/epdc-gateway/pom.xml
  4. 43
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java
  5. 18
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java
  6. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java
  7. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java
  8. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java
  9. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java
  10. 86
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodDTO.java
  11. 81
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodUserDTO.java
  12. 8
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java
  13. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java
  14. 29
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcActSignupFormDTO.java
  15. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java
  16. 16
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml
  17. 5
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
  18. 84
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodController.java
  19. 87
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodUserController.java
  20. 21
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
  21. 66
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodDao.java
  22. 56
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodUserDao.java
  23. 56
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodEntity.java
  24. 51
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodUserEntity.java
  25. 115
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodService.java
  26. 116
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodUserService.java
  27. 11
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  28. 84
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  29. 117
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActPeriodServiceImpl.java
  30. 111
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActPeriodUserServiceImpl.java
  31. 31
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  32. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
  33. 37
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml
  34. 40
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodUserDao.xml
  35. 17
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

16
esua-epdc/epdc-admin/epdc-admin-server/pom.xml

@ -145,10 +145,10 @@
<server.port>9092</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/js_esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
@ -188,10 +188,10 @@
<server.port>11002</server.port>
<spring.profiles.active>test</spring.profiles.active>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/js_esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>

16
esua-epdc/epdc-auth/pom.xml

@ -107,10 +107,10 @@
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
@ -128,10 +128,10 @@
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>

20
esua-epdc/epdc-gateway/pom.xml

@ -93,16 +93,16 @@
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<!-- gateway routes -->
<gateway.routes.epdc-auth-server.uri>lb://epdc-auth-server</gateway.routes.epdc-auth-server.uri>
<!-- <gateway.routes.epdc-auth-server.uri>http://127.0.0.1:9091</gateway.routes.epdc-auth-server.uri>-->
<!-- <gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>-->
<gateway.routes.epdc-admin-server.uri>http://127.0.0.1:9092</gateway.routes.epdc-admin-server.uri>
<gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>
<!-- <gateway.routes.epdc-admin-server.uri>http://127.0.0.1:9092</gateway.routes.epdc-admin-server.uri>-->
<gateway.routes.epdc-activiti-server.uri>lb://epdc-activiti-server
</gateway.routes.epdc-activiti-server.uri>
<gateway.routes.epdc-api-server.uri>lb://epdc-api-server</gateway.routes.epdc-api-server.uri>
@ -158,10 +158,10 @@
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<!-- gateway routes -->
<gateway.routes.epdc-auth-server.uri>lb://epdc-auth-server</gateway.routes.epdc-auth-server.uri>

43
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java

@ -1,9 +1,8 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import cn.hutool.core.collection.CollectionUtil;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.form.EpdcActSignupFormDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
@ -26,7 +25,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* APP活动相关接口
@ -54,10 +55,8 @@ public class ApiActUserRelationController {
* @date 2019/12/13 14:41
*/
@PostMapping("signup")
public Result activitySignUp(@LoginUser TokenDto tokenDto, String actId) {
if (StringUtils.isBlank(actId)) {
return new Result().error("活动id不能为空");
}
public Result activitySignUp(@LoginUser TokenDto tokenDto, @RequestBody EpdcActSignupFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
//验证是否为志愿者
Result isVolunteer = appUserService.getVolunteerCountById(tokenDto);
int code = isVolunteer.getCode();
@ -69,7 +68,7 @@ public class ApiActUserRelationController {
EpdcUserInfoResultDTO epdcUserInfoResultDTO = userInfo.getData();
ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO();
actUserRelationDTO.setActId(actId);
actUserRelationDTO.setActId(formDto.getActId());
actUserRelationDTO.setUserId(tokenDto.getUserId());
actUserRelationDTO.setNickname(tokenDto.getNickname());
actUserRelationDTO.setFaceImg(tokenDto.getFaceImg());
@ -79,6 +78,19 @@ public class ApiActUserRelationController {
actUserRelationDTO.setPartyFlag(YesOrNoEnum.NO.value());
}
// 参与活动时间段
if (CollectionUtil.isEmpty(formDto.getActPeriodId())) {
return new Result().error("请选择参与活动时间段");
}
List<ActPeriodDTO> periods = new ArrayList<>();
for (String actPeriodId:
formDto.getActPeriodId()) {
ActPeriodDTO period = new ActPeriodDTO();
period.setActId(actPeriodId);
periods.add(period);
}
actUserRelationDTO.setPeriods(periods);
String identityNo = epdcUserInfoResultDTO.getIdentityNo();
String identityNoVerification = IdentityNoUtils.IdentityNoVerification(identityNo);
@ -183,4 +195,17 @@ public class ApiActUserRelationController {
return actUserRelationService.clockAddressDetail(actId);
}
/**
* 获取活动可参与时间段
*
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>>
* @author lc
* @since 2021/9/3 15:54
*/
@GetMapping("getActPeriods")
public Result<List<ActPeriodDTO>> getActPeriods(String actId) {
return actUserRelationService.listOfActPeriods(actId);
}
}

18
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java

@ -1,9 +1,6 @@
package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -14,6 +11,8 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
/**
*
* 活动报名管理
@ -72,4 +71,15 @@ public interface AppActUserRelationFeignClient {
**/
@GetMapping(value = "heart/appactuserrelation/selectListV2ActUserRelation",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<AppClockListDTO> selectListV2ActUserRelation(EpdcClockListV2FormDTO epdcClockListV2FormDTO);
/**
* 获取活动可参与时间段
*
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>>
* @author lc
* @since 2021/9/3 15:54
*/
@GetMapping(value = "heart/appactuserrelation/getActPeriods/{actId}",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<List<ActPeriodDTO>> getActPeriods(@PathVariable("actId") String actId);
}

12
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java

@ -1,9 +1,6 @@
package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
@ -12,6 +9,8 @@ import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO;
import com.elink.esua.epdc.feign.AppActUserRelationFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Authorwanggongfeng
* @Date2019/12/16 15:11
@ -48,4 +47,9 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListV2ActUserRelation", epdcClockListV2FormDTO);
}
@Override
public Result<List<ActPeriodDTO>> getActPeriods(String actId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getActPeriods", actId);
}
}

17
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java

@ -1,13 +1,12 @@
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO;
import java.util.List;
/**
* @author wanggongfeng
* @date 2019/12/17 9:50
@ -61,4 +60,14 @@ public interface ActUserRelationService {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.activity.AppClockListDTO>
**/
Result<AppClockListDTO> getV2ClockList(EpdcClockListV2FormDTO epdcClockListV2FormDTO);
/**
* 获取活动可参与时间段
*
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>>
* @author lc
* @since 2021/9/3 15:55
*/
Result<List<ActPeriodDTO>> listOfActPeriods(String actId);
}

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java

@ -1,9 +1,6 @@
package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO;
@ -13,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author wanggongfeng
@ -58,6 +57,12 @@ public class ActUserRelationServiceImpl implements ActUserRelationService {
@Override
public Result<AppClockListDTO> getV2ClockList(EpdcClockListV2FormDTO epdcClockListV2FormDTO) {
Result<AppClockListDTO> result = actInfoFeignClient.selectListV2ActUserRelation(epdcClockListV2FormDTO);
return result; }
return result;
}
@Override
public Result<List<ActPeriodDTO>> listOfActPeriods(String actId) {
return actInfoFeignClient.getActPeriods(actId);
}
}

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java

@ -22,6 +22,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 活动信息表
@ -249,4 +250,9 @@ public class ActInfoDTO implements Serializable {
* 置顶人
*/
private String topUserName;
/**
* 活动详细时间段
*/
private List<ActPeriodDTO> periods;
}

86
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodDTO.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Data
public class ActPeriodDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 活动开始时间
*/
private Date actPeriodStartTime;
/**
* 活动结束时间
*/
private Date actPeriodEndTime;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 0未删除 1删除
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

81
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodUserDTO.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Data
public class ActPeriodUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动详细时间段表ID
*/
private String actPeriodId;
/**
* 活动用户关系表ID
*/
private String actUserRelationId;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 0未删除 1删除
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

8
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -134,4 +135,9 @@ public class ActUserRelationDTO implements Serializable {
*/
private Date updatedTime;
}
/**
* 活动详细时间段
*/
private List<ActPeriodDTO> periods;
}

7
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java

@ -65,4 +65,9 @@ public class ActInfoAppFormDTO implements Serializable {
*/
private String actId;
}
/**
* 活动主办方
*/
private String sponsor;
}

29
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcActSignupFormDTO.java

@ -0,0 +1,29 @@
package com.elink.esua.epdc.activity.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 活动报名
*/
@Data
public class EpdcActSignupFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
@NotBlank(message = "活动ID不能为空")
private String actId;
/**
* 参与活动时间段
*/
@NotNull(message = "参与活动时间段不能为空")
private List<String> actPeriodId;
}

7
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java

@ -17,10 +17,12 @@
package com.elink.esua.epdc.activity.result;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -125,4 +127,9 @@ public class ActUserRelationResultDTO implements Serializable {
* 报名时间 "2020-10-15 10:56:20"
*/
private String signupTimeString;
/**
* 活动详细时间段
*/
private List<ActPeriodDTO> periods;
}

16
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml

@ -156,10 +156,10 @@
<server.port>9060</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<spring.datasource.druid.url>
@ -188,10 +188,10 @@
<server.port>11012</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.redis.index>11</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/js_esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>

5
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java

@ -53,7 +53,7 @@ import java.util.Map;
@RestController
@RequestMapping("actinfo")
public class ActInfoController {
@Autowired
private ActInfoService actInfoService;
@ -64,7 +64,6 @@ public class ActInfoController {
if(SecurityUser.getDeptId() != null){
params.put("deptId", SecurityUser.getDeptId());
}
System.out.println(params);
PageData<ActInfoResultDTO> page = actInfoService.getActInfoPageFromPC(params);
return new Result<PageData<ActInfoResultDTO>>().ok(page);
}
@ -137,4 +136,4 @@ public class ActInfoController {
ValidatorUtils.validateEntity(formDto);
return actInfoService.modifyActTopFlag(formDto);
}
}
}

84
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodController.java

@ -0,0 +1,84 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.modules.activity.service.ActPeriodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@RestController
@RequestMapping("actperiod")
public class ActPeriodController {
@Autowired
private ActPeriodService actPeriodService;
@GetMapping("page")
public Result<PageData<ActPeriodDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActPeriodDTO> page = actPeriodService.page(params);
return new Result<PageData<ActPeriodDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActPeriodDTO> get(@PathVariable("id") String id){
ActPeriodDTO data = actPeriodService.get(id);
return new Result<ActPeriodDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ActPeriodDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actPeriodService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActPeriodDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actPeriodService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actPeriodService.delete(ids);
return new Result();
}
}

87
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodUserController.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActPeriodUserDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.modules.activity.service.ActPeriodUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@RestController
@RequestMapping("actperioduser")
public class ActPeriodUserController {
@Autowired
private ActPeriodUserService actPeriodUserService;
@GetMapping("page")
public Result<PageData<ActPeriodUserDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActPeriodUserDTO> page = actPeriodUserService.page(params);
return new Result<PageData<ActPeriodUserDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActPeriodUserDTO> get(@PathVariable("id") String id){
ActPeriodUserDTO data = actPeriodUserService.get(id);
return new Result<ActPeriodUserDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ActPeriodUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actPeriodUserService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActPeriodUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actPeriodUserService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actPeriodUserService.delete(ids);
return new Result();
}
}

21
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java

@ -17,6 +17,7 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
@ -27,6 +28,8 @@ import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户活动关系表
*
@ -67,7 +70,7 @@ public class AppActUserRelationController {
* @return
*/
@GetMapping("selectListActUserRelation/{actId}")
public Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId")String actId){
public Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId") String actId){
return actUserRelationService.selectListActUserRelation(actId);
}
@ -87,8 +90,22 @@ public class AppActUserRelationController {
* @return
*/
@GetMapping("AutoAuditActUser/{actId}")
public Result AutoAuditActUser(@PathVariable("actId")String actId){
public Result AutoAuditActUser(@PathVariable("actId") String actId){
return actUserRelationService.updateAuditDefaultStatus(actId);
}
/**
* 获取活动可参与时间段
*
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>>
* @author lc
* @since 2021/9/3 15:54
*/
@GetMapping("getActPeriods/{actId}")
public Result<List<ActPeriodDTO>> getActPeriods(@PathVariable("actId") String actId) {
List<ActPeriodDTO> data = actUserRelationService.listOfActPeriods(actId);
return new Result<List<ActPeriodDTO>>().ok(data);
}
}

66
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodDao.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Mapper
public interface ActPeriodDao extends BaseDao<ActPeriodEntity> {
/**
* 查询活动已报名的时间段
*
* @param actId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/2 16:02
*/
List<ActPeriodDTO> selectPeriodsAlreadySignIn(String actId);
/**
* 删除活动时间段
*
* @param actId
* @return void
* @author lc
* @since 2021/9/2 15:30
*/
void modifyDelFlagByActId(String actId);
/**
* 获取活动时间段
*
* @param actId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/2 16:29
*/
List<ActPeriodDTO> selectListOfActPeriodsByActId(String actId);
}

56
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodUserDao.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Mapper
public interface ActPeriodUserDao extends BaseDao<ActPeriodUserEntity> {
/**
* 获取用户报名时间段
*
* @param actUserRelationId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/2 20:06
*/
List<ActPeriodDTO> selectListOfSignInActPeriodsByActUserRelationId(String actUserRelationId);
/**
* 删除参与活动时间段记录
*
* @param actUserRelationId
* @return void
* @author lc
* @since 2021/9/3 15:47
*/
void modifyActPeriodUserDelFlagByActUserRelationId(String actUserRelationId);
}

56
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodEntity.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_act_period")
public class ActPeriodEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
private String actId;
/**
* 活动开始时间
*/
private Date actPeriodStartTime;
/**
* 活动结束时间
*/
private Date actPeriodEndTime;
}

51
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodUserEntity.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_act_period_user")
public class ActPeriodUserEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动详细时间段表ID
*/
private String actPeriodId;
/**
* 活动用户关系表ID
*/
private String actUserRelationId;
}

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

@ -0,0 +1,115 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity;
import java.util.List;
import java.util.Map;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
public interface ActPeriodService extends BaseService<ActPeriodEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActPeriodDTO>
* @author generator
* @date 2021-09-02
*/
PageData<ActPeriodDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActPeriodDTO>
* @author generator
* @date 2021-09-02
*/
List<ActPeriodDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActPeriodDTO
* @author generator
* @date 2021-09-02
*/
ActPeriodDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-02
*/
void save(ActPeriodDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-02
*/
void update(ActPeriodDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-02
*/
void delete(String[] ids);
/**
* 删除活动时间段
*
* @param actId
* @return void
* @author lc
* @since 2021/9/2 15:28
*/
void removeActPeriodsByActId(String actId);
/**
* 获取活动时间段
*
* @param actId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/2 16:13
*/
List<ActPeriodDTO> listOfActPeriodsByActId(String actId);
}

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

@ -0,0 +1,116 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.activity.ActPeriodUserDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity;
import java.util.List;
import java.util.Map;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
public interface ActPeriodUserService extends BaseService<ActPeriodUserEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActPeriodUserDTO>
* @author generator
* @date 2021-09-02
*/
PageData<ActPeriodUserDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActPeriodUserDTO>
* @author generator
* @date 2021-09-02
*/
List<ActPeriodUserDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActPeriodUserDTO
* @author generator
* @date 2021-09-02
*/
ActPeriodUserDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-02
*/
void save(ActPeriodUserDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-02
*/
void update(ActPeriodUserDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-02
*/
void delete(String[] ids);
/**
* 获取用户报名时间段
*
* @param actUserRelationId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/2 20:05
*/
List<ActPeriodDTO> listOfSignInActPeriodsByActUserRelationId(String actUserRelationId);
/**
* 删除参与活动时间段记录
*
* @param actUserRelationId
* @return void
* @author lc
* @since 2021/9/3 15:45
*/
void removeActPeriodUserByActUserRelationId(String actUserRelationId);
}

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

@ -17,6 +17,7 @@
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
@ -183,4 +184,14 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.activity.AppClockListDTO>
**/
Result<AppClockListDTO> selectListV2ActUserRelation(EpdcClockListV2FormDTO formDTO);
/**
* 获取活动可参与时间段
*
* @param actId
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO>
* @author lc
* @since 2021/9/3 16:00
*/
List<ActPeriodDTO> listOfActPeriods(String actId);
}

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

@ -17,12 +17,10 @@
package com.elink.esua.epdc.modules.activity.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.ActUserReadDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.form.ActSignInListFormDTO;
@ -54,12 +52,10 @@ import com.elink.esua.epdc.dto.ScheduleJobDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO;
import com.elink.esua.epdc.modules.activity.dao.*;
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity;
import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import com.elink.esua.epdc.modules.activity.entity.*;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import com.elink.esua.epdc.modules.activity.service.ActPeriodService;
import com.elink.esua.epdc.modules.activity.service.ActUserReadService;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
@ -109,6 +105,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Autowired
private ActUserReadService actUserReadService;
@Autowired
private ActPeriodService actPeriodService;
@Override
public PageData<ActInfoDTO> page(Map<String, Object> params) {
@ -145,12 +143,18 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Override
public ActInfoDTO get(String id) {
ActInfoEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActInfoDTO.class);
// 获取活动时间段
List<ActPeriodDTO> periods = actPeriodService.listOfActPeriodsByActId(id);
ActInfoDTO dto = ConvertUtils.sourceToTarget(entity, ActInfoDTO.class);
dto.setPeriods(periods);
return dto;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result save(ActInfoDTO dto) {
// 校验活动详细时间段
this.checkActPeriods(dto);
//内容审核 - start
Boolean isConReview = null;
String userName = null;
@ -193,6 +197,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//内容审核 - end
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class);
if (insert(entity)) {
// 保存活动时间段
this.saveOrUpdateActPeriods(dto.getPeriods(), entity.getId());
// 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过)
this.saveActToScheduleJob(entity.getId(), dto.getActStartTime());
@ -243,6 +249,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Override
@Transactional(rollbackFor = Exception.class)
public Result updateWithContent(ActInfoDTO dto) {
// 校验活动详细时间段
this.checkActPeriods(dto);
//内容审核 - start
Boolean isConReview = null;
String userName = null;
@ -287,6 +295,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//如果更新了公益时长,则更新相关确认积分的志愿者的公益时长
updateKindnessTime(dto);
updateById(entity);
// 修改活动时间段
this.saveOrUpdateActPeriods(dto.getPeriods(), entity.getId());
//内容审核- 开始
try {
//接口异常,保存至待审核信息
@ -851,4 +861,60 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
return new Result();
}
/**
* 校验活动详细时间段
*
* @param dto
* @return void
* @author lc
* @since 2021/9/2 14:51
*/
private void checkActPeriods(ActInfoDTO dto) {
if (CollectionUtil.isEmpty(dto.getPeriods())) {
ActPeriodDTO periodDto = new ActPeriodDTO();
periodDto.setActPeriodStartTime(dto.getActStartTime());
periodDto.setActPeriodEndTime(dto.getActEndTime());
dto.setPeriods(Collections.singletonList(periodDto));
}
Date periodEndTimeTmp = null;
for (int i=0; i<dto.getPeriods().size(); i++) {
Date periodStartTime = dto.getPeriods().get(i).getActPeriodStartTime();
Date periodEndTime = dto.getPeriods().get(i).getActPeriodEndTime();
if (periodStartTime.compareTo(dto.getActStartTime()) < 0
|| periodStartTime.compareTo(dto.getActEndTime()) > 0
|| periodEndTime.compareTo(dto.getActStartTime()) < 0
|| periodEndTime.compareTo(dto.getActEndTime()) > 0
|| periodEndTime.compareTo(periodStartTime) < 0) {
throw new RenException("活动时间段需在活动开始至活动结束时间内,且活动时间段结束时间需在活动时间段开始时间之后");
}
if (i>0) {
if (periodStartTime.compareTo(periodEndTimeTmp) < 0) {
throw new RenException("活动时间段之间有重复时间,请调整后重新提交");
}
}
periodEndTimeTmp = periodEndTime;
}
}
/**
* 保存/修改活动时间段
*
* @param periods
* @param actId
* @return void
* @author lc
* @since 2021/9/2 15:27
*/
private void saveOrUpdateActPeriods(List<ActPeriodDTO> periods, String actId) {
// 删除活动已有的时间段
actPeriodService.removeActPeriodsByActId(actId);
// 保存活动时间段
for (ActPeriodDTO dto:
periods) {
dto.setActId(actId);
actPeriodService.save(dto);
}
}
}

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

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.activity.dao.ActPeriodDao;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity;
import com.elink.esua.epdc.modules.activity.service.ActPeriodService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 活动详细时间段表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Service
public class ActPeriodServiceImpl extends BaseServiceImpl<ActPeriodDao, ActPeriodEntity> implements ActPeriodService {
@Override
public PageData<ActPeriodDTO> page(Map<String, Object> params) {
IPage<ActPeriodEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActPeriodDTO.class);
}
@Override
public List<ActPeriodDTO> list(Map<String, Object> params) {
List<ActPeriodEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActPeriodDTO.class);
}
private QueryWrapper<ActPeriodEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActPeriodEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActPeriodDTO get(String id) {
ActPeriodEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActPeriodDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActPeriodDTO dto) {
ActPeriodEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActPeriodDTO dto) {
ActPeriodEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void removeActPeriodsByActId(String actId) {
// 校验活动是否已有人报名,有人报名后不能修改活动时间段
List<ActPeriodDTO> periods = baseDao.selectPeriodsAlreadySignIn(actId);
if (CollectionUtil.isNotEmpty(periods)) {
throw new RenException("活动时间段已有人报名,不能修改");
}
baseDao.modifyDelFlagByActId(actId);
}
@Override
public List<ActPeriodDTO> listOfActPeriodsByActId(String actId) {
return baseDao.selectListOfActPeriodsByActId(actId);
}
}

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

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActPeriodDTO;
import com.elink.esua.epdc.activity.ActPeriodUserDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.activity.dao.ActPeriodUserDao;
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity;
import com.elink.esua.epdc.modules.activity.service.ActPeriodUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 活动详细时间段用户关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-02
*/
@Service
public class ActPeriodUserServiceImpl extends BaseServiceImpl<ActPeriodUserDao, ActPeriodUserEntity> implements ActPeriodUserService {
@Override
public PageData<ActPeriodUserDTO> page(Map<String, Object> params) {
IPage<ActPeriodUserEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActPeriodUserDTO.class);
}
@Override
public List<ActPeriodUserDTO> list(Map<String, Object> params) {
List<ActPeriodUserEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActPeriodUserDTO.class);
}
private QueryWrapper<ActPeriodUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActPeriodUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActPeriodUserDTO get(String id) {
ActPeriodUserEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActPeriodUserDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActPeriodUserDTO dto) {
ActPeriodUserEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodUserEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActPeriodUserDTO dto) {
ActPeriodUserEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodUserEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<ActPeriodDTO> listOfSignInActPeriodsByActUserRelationId(String actUserRelationId) {
return baseDao.selectListOfSignInActPeriodsByActUserRelationId(actUserRelationId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void removeActPeriodUserByActUserRelationId(String actUserRelationId) {
baseDao.modifyActPeriodUserDelFlagByActUserRelationId(actUserRelationId);
}
}

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

@ -55,9 +55,7 @@ import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import com.elink.esua.epdc.modules.activity.service.*;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.feign.PointsFeignClient;
@ -101,6 +99,11 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Autowired
private NewsTask newsTask;
@Autowired
private ActPeriodUserService actPeriodUserService;
@Autowired
public ActPeriodService actPeriodService;
@Override
public PageData<ActUserRelationDTO> page(Map<String, Object> params) {
IPage<ActUserRelationEntity> page = baseDao.selectPage(
@ -149,7 +152,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Override
public ActUserRelationDTO get(String id) {
ActUserRelationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class);
List<ActPeriodDTO> periods = actPeriodUserService.listOfSignInActPeriodsByActUserRelationId(id);
ActUserRelationDTO dto = ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class);
dto.setPeriods(periods);
return dto;
}
@Override
@ -179,7 +185,6 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
updateEntity.setFailureReason(dto.getFailureReason());
updateEntity.setAuditTime(new Date());
updateById(updateEntity);
// 未通过时 活动表报名数减一
if (ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT.equals(dto.getStatus())) {
actInfoService.minusSignUpNum(entity.getActId());
}
@ -264,6 +269,17 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
} else {
insert(entity);
}
// 删除历史报名活动时间段
actPeriodUserService.removeActPeriodUserByActUserRelationId(entity.getId());
// 保存活动参与时间段
for (ActPeriodDTO period:
actUserRelationDTO.getPeriods()) {
ActPeriodUserDTO periodUser = new ActPeriodUserDTO();
periodUser.setActPeriodId(period.getId());
periodUser.setActUserRelationId(entity.getId());
actPeriodUserService.save(periodUser);
}
// 活动报名人数+1
actInfoService.addSignUpNum(actUserRelationDTO.getActId());
//存储活动日志表
@ -596,4 +612,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
newsTask.insertUserInformation(informationFormDTO);
}
@Override
public List<ActPeriodDTO> listOfActPeriods(String actId) {
return actPeriodService.listOfActPeriodsByActId(actId);
}
}

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

@ -191,6 +191,9 @@
<if test='actId != null and actId != "" '>
AND actInfo.ID = #{actId}
</if>
<if test='sponsor != null and sponsor != "" '>
AND actInfo.SPONSOR like concat('%', #{sponsor}, '%')
</if>
<if test='actType != null and actType != "" and actType == "1"'>
<![CDATA[ AND DATE_FORMAT(actInfo.SIGNUP_END_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
@ -503,6 +506,7 @@
eai.PUNISHMENT_POINTS as punishmentPoints,
eai.REQUIREMENT as requirement,
eai.ACT_CONTENT as actContent,
eai.SPONSOR as sponsor,
ACT_NEWS_CONTENT as actNewsContent
from epdc_act_info eai
where eai.DEL_FLAG='0'

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

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.activity.dao.ActPeriodDao">
<select id="selectPeriodsAlreadySignIn" resultType="com.elink.esua.epdc.activity.ActPeriodDTO">
SELECT
p.ID
FROM
epdc_act_period p
LEFT JOIN epdc_act_period_user pu ON pu.ACT_PERIOD_ID = p.ID
WHERE
p.DEL_FLAG = '0'
AND pu.DEL_FLAG = '0'
AND ACT_ID = #{actId}
</select>
<update id="modifyDelFlagByActId">
update epdc_act_period set del_flag = '1' where act_id = #{actId}
</update>
<select id="selectListOfActPeriodsByActId" resultType="com.elink.esua.epdc.activity.ActPeriodDTO">
SELECT
ID,
ACT_ID,
ACT_PERIOD_START_TIME,
ACT_PERIOD_END_TIME
FROM
epdc_act_period
WHERE
DEL_FLAG = '0'
AND ACT_ID = #{actId}
ORDER BY
ACT_PERIOD_START_TIME
</select>
</mapper>

40
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodUserDao.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.activity.dao.ActPeriodUserDao">
<select id="selectListOfSignInActPeriodsByActUserRelationId" resultType="com.elink.esua.epdc.activity.ActPeriodDTO">
SELECT
CASE
WHEN
p.ACT_PERIOD_START_TIME IS NULL THEN
t.ACT_START_TIME ELSE p.ACT_PERIOD_START_TIME
END AS actPeriodStartTime,
CASE
WHEN p.ACT_PERIOD_END_TIME IS NULL THEN
t.ACT_END_TIME ELSE p.ACT_PERIOD_END_TIME
END AS actPeriodEndTime
FROM
(
SELECT
ur.ID,
ai.ACT_START_TIME,
ai.ACT_END_TIME
FROM
epdc_act_user_relation ur
LEFT JOIN epdc_act_info ai ON ai.ID = ur.ACT_ID
WHERE
ur.ID = #{actUserRelationId}
) t
LEFT JOIN epdc_act_period_user pu ON pu.ACT_USER_RELATION_ID = t.ID
AND pu.DEL_FLAG = '0'
LEFT JOIN epdc_act_period p ON p.ID = pu.ACT_PERIOD_ID
AND p.DEL_FLAG = '0'
ORDER BY actPeriodStartTime
</select>
<update id="modifyActPeriodUserDelFlagByActUserRelationId">
update epdc_act_period_user set del_flag = '1' where ACT_USER_RELATION_ID = #{actUserRelationId}
</update>
</mapper>

17
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -42,6 +42,10 @@
<result property="auditTime" column="AUDIT_TIME"/>
<result property="signupTime" column="SIGNUP_TIME"/>
<result property="actStatus" column="ACT_STATUS"/>
<collection property="periods" ofType="com.elink.esua.epdc.activity.ActPeriodDTO">
<result property="actPeriodStartTime" column="actPeriodStartTime"/>
<result property="actPeriodEndTime" column="actPeriodEndTime"/>
</collection>
</resultMap>
<select id="isSignUp" resultType="int" parameterType="String">
@ -85,10 +89,21 @@
relation.SIGNUP_TIME,
eai.ACT_STATUS,
date_format(relation.SIGNUP_TIME,'%Y-%m-%d %H:%i:%S') signupTimeString,
date_format(relation.AUDIT_TIME,'%Y-%m-%d %H:%i:%S') auditTimeString
date_format(relation.AUDIT_TIME,'%Y-%m-%d %H:%i:%S') auditTimeString,
case when t.ACT_PERIOD_START_TIME is null then eai.ACT_START_TIME else t.ACT_PERIOD_START_TIME end as actPeriodStartTime,
case when t.ACT_PERIOD_END_TIME is null then eai.ACT_END_TIME else t.ACT_PERIOD_END_TIME end as actPeriodEndTime
FROM
epdc_act_user_relation relation
left join epdc_act_info eai on eai.ID = relation.ACT_ID
left join (SELECT
pu.ACT_USER_RELATION_ID,
p.ACT_PERIOD_START_TIME,
p.ACT_PERIOD_END_TIME
FROM
epdc_act_period_user pu
LEFT JOIN epdc_act_period p ON p.ID = pu.ACT_PERIOD_ID AND p.DEL_FLAG = '0'
WHERE
pu.DEL_FLAG = '0') t on t.ACT_USER_RELATION_ID = relation.id
WHERE
relation.DEL_FLAG = '0' and eai.DEL_FLAG='0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">

Loading…
Cancel
Save