diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java index 3e653e76c1..07e481fb99 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java @@ -24,4 +24,6 @@ public class AactUserDetailFormDTO implements Serializable { @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class}) private String actUserRelationId; + @NotBlank(message = "当前活动id不能为空", groups = {UserHistoricalActFormDTO.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 7b97d6cf80..1322db3c83 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 @@ -97,11 +97,12 @@ public interface ActUserRelationDao extends BaseDao { /** * @return java.lang.Integer * @param userId + * @param currentActId * @author yinzuomei * @description 报名活动个数(act_user_realation) * @Date 2020/7/23 15:57 **/ - Integer countSignUpActNum(String userId); + Integer countSignUpActNum(@Param("userId")String userId,@Param("currentActId") String currentActId); /** * @return java.lang.Integer 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 a0aa461f52..1fa1472042 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 @@ -348,7 +348,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { ) */ resultDTO.setStatus(actUserRelationDTO.getStatus()); - HistoricalActInfo historicalActInfo=this.getHistoricalActInfo(actUserRelationDTO.getUserId()); + HistoricalActInfo historicalActInfo=this.getHistoricalActInfo(actUserRelationDTO.getUserId(),formDTO.getCurrentActId()); resultDTO.setHistoricalActInfo(historicalActInfo); if(ActConstant.ACT_USER_STATUS_AUDITING.equals(resultDTO.getStatus())){ //被拒绝过,才赋值 @@ -399,7 +399,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); } //参与活动统计值 - HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId()); + HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId(),formDTO.getCurrentActId()); resultDTO.setSignInActNum(historicalActInfo.getSignInActNum()); //减去当前的 resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()); @@ -639,11 +639,12 @@ public class WorkActUserServiceImpl implements WorkActUserService { /** * @return com.epmet.dto.result.work.HistoricalActInfo * @param userId + * @param currentActId * @author yinzuomei * @description 用户历史活动情况 * @Date 2020/7/23 15:56 **/ - private HistoricalActInfo getHistoricalActInfo(String userId) { + private HistoricalActInfo getHistoricalActInfo(String userId,String currentActId) { HistoricalActInfo historicalActInfo=new HistoricalActInfo(); /** * 实际参加活动个数(已经签到的) @@ -653,7 +654,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { /** * 报名活动个数(act_user_realation) */ - Integer signUpActNum=actUserRelationDao.countSignUpActNum(userId); + Integer signUpActNum=actUserRelationDao.countSignUpActNum(userId,currentActId); historicalActInfo.setSignUpActNum(signUpActNum); /** * 获得积分活动个数 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 9d7e256b9e..618cfb76fb 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 @@ -114,7 +114,7 @@ - SELECT count( 1 ) as total FROM @@ -123,6 +123,9 @@ DEL_FLAG = '0' and acu.STATUS !='auditing' AND acu.USER_ID = #{userId} + + and acu.ACT_ID != #{currentActId} +