From 34fd7a3642b656f4e8553118bcfe66e9e0e047aa Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Jul 2020 16:04:56 +0800 Subject: [PATCH] =?UTF-8?q?historicalact=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/work/UserHistoricalActFormDTO.java | 4 ++++ .../src/main/java/com/epmet/dao/ActUserRelationDao.java | 2 +- .../com/epmet/service/impl/WorkActUserServiceImpl.java | 8 +++----- .../src/main/resources/mapper/ActUserRelationDao.xml | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java index 26e2944e35..951b7ce3a6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java @@ -19,4 +19,8 @@ public class UserHistoricalActFormDTO implements Serializable { */ @NotBlank(message = "居民端用户id不能为空", groups = {AddUserInternalGroup.class}) private String userId; + + @NotBlank(message = "当前活动id不能为空", groups = {AddUserInternalGroup.class}) + private String currentActId; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 46affbe03e..b60d5f9b4a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -119,7 +119,7 @@ public interface ActUserRelationDao extends BaseDao { * @description 根据userId,查询参与活动记录 * @Date 2020/7/23 16:46 **/ - List selectAllByUserId(String userId); + List selectAllByUserId(@Param("userId") String userId,@Param("currentActId") String currentActId); /** * @return java.util.List diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 4efe296e17..aea287bb50 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -356,13 +356,11 @@ public class WorkActUserServiceImpl implements WorkActUserService { //参与活动统计值 HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId()); resultDTO.setSignInActNum(historicalActInfo.getSignInActNum()); - resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()); + //减去当前的 + resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()-1); resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum()); //历史活动列表 - List actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId()); - for(UserHistoricalActInfoDTO userHistoricalActInfoDTO:actInfoList){ - - } + List actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId(),formDTO.getCurrentActId()); resultDTO.setActInfoList(actInfoList); return resultDTO; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 343f3babd3..6d53c1f139 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -137,8 +137,8 @@ - + SELECT acr.ACT_ID AS actId, ACR.USER_ID AS userId, ai.TITLE AS title, @@ -169,6 +169,7 @@ WHERE acr.DEL_FLAG = '0' AND acr.USER_ID =#{userId} + and acr.act_id !=#{currentActId} ORDER BY acr.CREATED_TIME DESC