+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodUserDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActPeriodUserDTO.java
new file mode 100644
index 00000000..8fa36c55
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java
index e365873d..44eee3a1 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java
+++ b/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;
-}
\ No newline at end of file
+ /**
+ * 活动详细时间段
+ */
+ private List periods;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java
index 336779df..164ed79a 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java
+++ b/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;
-}
\ No newline at end of file
+ /**
+ * 活动主办方
+ */
+ private String sponsor;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcActSignupFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcActSignupFormDTO.java
new file mode 100644
index 00000000..109feb09
--- /dev/null
+++ b/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 actPeriodId;
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java
index 3dd7800b..78ffbf31 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java
+++ b/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 periods;
}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml
index b59a9355..bde6fb53 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml
+++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml
@@ -156,10 +156,10 @@
9060
- 2
- 114.215.125.123
- 9603
- epdc!redis@master1405
+ 11
+ r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com
+ 10001
+ elink!888
@@ -188,10 +188,10 @@
11012
- 2
- 114.215.125.123
- 9603
- epdc!redis@master1405
+ 11
+ r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com
+ 10001
+ elink!888
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
index 9050fea9..5fd0657b 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
+++ b/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 page = actInfoService.getActInfoPageFromPC(params);
return new Result>().ok(page);
}
@@ -137,4 +136,4 @@ public class ActInfoController {
ValidatorUtils.validateEntity(formDto);
return actInfoService.modifyActTopFlag(formDto);
}
-}
\ No newline at end of file
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodController.java
new file mode 100644
index 00000000..917356e4
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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> page(@RequestParam Map params){
+ PageData page = actPeriodService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ ActPeriodDTO data = actPeriodService.get(id);
+ return new Result().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();
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodUserController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActPeriodUserController.java
new file mode 100644
index 00000000..4f51b20e
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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> page(@RequestParam Map params){
+ PageData page = actPeriodUserService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ ActPeriodUserDTO data = actPeriodUserService.get(id);
+ return new Result().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();
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
index 56369dd3..c4640f2b 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
+++ b/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 selectListActUserRelation(@PathVariable("actId")String actId){
+ public Result 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>
+ * @author lc
+ * @since 2021/9/3 15:54
+ */
+ @GetMapping("getActPeriods/{actId}")
+ public Result> getActPeriods(@PathVariable("actId") String actId) {
+ List data = actUserRelationService.listOfActPeriods(actId);
+ return new Result>().ok(data);
+ }
+
}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodDao.java
new file mode 100644
index 00000000..86d40f20
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 {
+
+ /**
+ * 查询活动已报名的时间段
+ *
+ * @param actId
+ * @return java.util.List
+ * @author lc
+ * @since 2021/9/2 16:02
+ */
+ List 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
+ * @author lc
+ * @since 2021/9/2 16:29
+ */
+ List selectListOfActPeriodsByActId(String actId);
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodUserDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActPeriodUserDao.java
new file mode 100644
index 00000000..0be7135c
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 {
+
+ /**
+ * 获取用户报名时间段
+ *
+ * @param actUserRelationId
+ * @return java.util.List
+ * @author lc
+ * @since 2021/9/2 20:06
+ */
+ List selectListOfSignInActPeriodsByActUserRelationId(String actUserRelationId);
+
+ /**
+ * 删除参与活动时间段记录
+ *
+ * @param actUserRelationId
+ * @return void
+ * @author lc
+ * @since 2021/9/3 15:47
+ */
+ void modifyActPeriodUserDelFlagByActUserRelationId(String actUserRelationId);
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodEntity.java
new file mode 100644
index 00000000..93b15538
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodUserEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActPeriodUserEntity.java
new file mode 100644
index 00000000..68f186f8
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActPeriodService.java
new file mode 100644
index 00000000..abf4986f
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 implements ActPeriodService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ActPeriodDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ActPeriodDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper 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 periods = baseDao.selectPeriodsAlreadySignIn(actId);
+ if (CollectionUtil.isNotEmpty(periods)) {
+ throw new RenException("活动时间段已有人报名,不能修改");
+ }
+ baseDao.modifyDelFlagByActId(actId);
+ }
+
+ @Override
+ public List listOfActPeriodsByActId(String actId) {
+ return baseDao.selectListOfActPeriodsByActId(actId);
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActPeriodUserServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActPeriodUserServiceImpl.java
new file mode 100644
index 00000000..40898c17
--- /dev/null
+++ b/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
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 implements ActPeriodUserService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ActPeriodUserDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ActPeriodUserDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper 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 listOfSignInActPeriodsByActUserRelationId(String actUserRelationId) {
+ return baseDao.selectListOfSignInActPeriodsByActUserRelationId(actUserRelationId);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void removeActPeriodUserByActUserRelationId(String actUserRelationId) {
+ baseDao.modifyActPeriodUserDelFlagByActUserRelationId(actUserRelationId);
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
index a5815b36..9364b23d 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
+++ b/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 page(Map params) {
IPage page = baseDao.selectPage(
@@ -149,7 +152,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl 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 listOfActPeriods(String actId) {
+ return actPeriodService.listOfActPeriodsByActId(actId);
+ }
+
}
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
index c7589eba..9b1fd355 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
+++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
@@ -191,6 +191,9 @@
AND actInfo.ID = #{actId}
+
+ AND actInfo.SPONSOR like concat('%', #{sponsor}, '%')
+
#{timestamp}
@@ -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'
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml
new file mode 100644
index 00000000..81e0933d
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodDao.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+ update epdc_act_period set del_flag = '1' where act_id = #{actId}
+
+
+
+
+
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodUserDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodUserDao.xml
new file mode 100644
index 00000000..7cb63ffd
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActPeriodUserDao.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+ update epdc_act_period_user set del_flag = '1' where ACT_USER_RELATION_ID = #{actUserRelationId}
+
+
+
diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
index 58587ffb..874e2def 100644
--- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
+++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
@@ -42,6 +42,10 @@
+
+
+
+