From ac9ed0373e41b7477fe7652e00b45427912c4cfa Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 29 Jun 2020 10:01:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8A=A5=E5=90=8D=E4=BA=BA=E6=95=B0=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/activity/dao/ActivityInfoDao.java | 15 +++++++--- .../service/impl/ActivityInfoServiceImpl.java | 14 --------- .../impl/ActivityParticipantServiceImpl.java | 16 ++++++++++ .../mapper/activity/ActivityInfoDao.xml | 30 ++++++++++--------- 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActivityInfoDao.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActivityInfoDao.java index 66df872..4d5e0d7 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActivityInfoDao.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActivityInfoDao.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.dto.activity.form.ActivityInfoFormDTO; import com.elink.esua.epdc.dto.activity.result.ActivityInfoResultDTO; import com.elink.esua.epdc.modules.activity.entity.ActivityInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -36,7 +37,6 @@ import java.util.Map; @Mapper public interface ActivityInfoDao extends BaseDao { /** - * * 功能描述: 活动查询 * * @param: Map @@ -47,7 +47,6 @@ public interface ActivityInfoDao extends BaseDao { List selectListOfActivityInfo(Map params); /** - * * 功能描述: 活动查询 * * @param: formDto @@ -57,9 +56,7 @@ public interface ActivityInfoDao extends BaseDao { */ List listActivity(ActivityInfoFormDTO formDto); - /** - * * 功能描述: 活动查询 * * @param: formDto @@ -68,4 +65,14 @@ public interface ActivityInfoDao extends BaseDao { * @date: 2020/6/22 10:01 */ ActivityInfoEntity activityDetail(ActivityDetailFormDTO formDto); + + /** + * 功能描述: 活动人数更新 + * + * @param: entity + * @return: int + * @author: zhy + * @date: 2020/6/22 10:01 + */ + int signUp(@Param("id") String id); } \ No newline at end of file diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityInfoServiceImpl.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityInfoServiceImpl.java index 1c4cd1d..8f732ec 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityInfoServiceImpl.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityInfoServiceImpl.java @@ -44,7 +44,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -93,9 +92,6 @@ public class ActivityInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(1); - params.put("id", activityId); - List activityParticipantNum = activityParticipantDao.selectListOfActivityParticipant(params); - return activityParticipantNum.size(); - } } \ No newline at end of file diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityParticipantServiceImpl.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityParticipantServiceImpl.java index 222d535..ce6e145 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityParticipantServiceImpl.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActivityParticipantServiceImpl.java @@ -21,12 +21,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +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.utils.IdentityNoUtils; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.activity.ActivityParticipantDTO; import com.elink.esua.epdc.dto.activity.form.ActivityParticipantFormDTO; +import com.elink.esua.epdc.modules.activity.dao.ActivityInfoDao; import com.elink.esua.epdc.modules.activity.dao.ActivityParticipantDao; import com.elink.esua.epdc.modules.activity.entity.ActivityParticipantEntity; import com.elink.esua.epdc.modules.activity.redis.ActivityParticipantRedis; @@ -56,6 +58,9 @@ public class ActivityParticipantServiceImpl extends BaseServiceImpl page(Map params) { IPage page = getPage(params); @@ -96,12 +101,23 @@ public class ActivityParticipantServiceImpl extends BaseServiceImpl AND a.SIGN_UP_START_TIME <= NOW() AND a.ACT_END_TIME >= NOW() + AND a.PUBLISH_TIME <= NOW() AND a.ACT_END_TIME <= NOW() @@ -120,4 +115,11 @@ DEL_FLAG = '0' AND ID = #{activityId} + + UPDATE epdc_activity_info + SET SIGN_UP_NUM = SIGN_UP_NUM + 1 + WHERE + DEL_FLAG = '0' + AND ID = #{id} + \ No newline at end of file