Browse Source

historicalact接口修改

master
yinzuomei 5 years ago
parent
commit
34fd7a3642
  1. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java
  3. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  4. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

4
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;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java

@ -119,7 +119,7 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
* @description 根据userId查询参与活动记录
* @Date 2020/7/23 16:46
**/
List<UserHistoricalActInfoDTO> selectAllByUserId(String userId);
List<UserHistoricalActInfoDTO> selectAllByUserId(@Param("userId") String userId,@Param("currentActId") String currentActId);
/**
* @return java.util.List<com.epmet.dto.ActUserRelationDTO>

8
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<UserHistoricalActInfoDTO> actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId());
for(UserHistoricalActInfoDTO userHistoricalActInfoDTO:actInfoList){
}
List<UserHistoricalActInfoDTO> actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId(),formDTO.getCurrentActId());
resultDTO.setActInfoList(actInfoList);
return resultDTO;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

@ -137,8 +137,8 @@
</select>
<!-- 根据userId,查询参与活动记录 -->
<select id="selectAllByUserId" resultType="com.epmet.dto.result.work.UserHistoricalActInfoDTO" parameterType="java.lang.String">
SELECT
<select id="selectAllByUserId" resultType="com.epmet.dto.result.work.UserHistoricalActInfoDTO" parameterType="map">
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
</select>

Loading…
Cancel
Save