Browse Source

Merge remote-tracking branch 'origin/dev_heart' into dev_heart

dev_shibei_match
yinzuomei 5 years ago
parent
commit
a0276e69dc
  1. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java
  2. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java
  4. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java
  5. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  6. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  7. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java
  8. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java
  9. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java
  10. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  11. 61
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
  12. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  13. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
  14. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java

@ -28,18 +28,18 @@ public class ResiActCaculateDistanceFormDTO implements Serializable {
/** /**
* 经度 * 经度
*/ */
@NotBlank(message = "经度不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @NotBlank(message = "经度不能为空", groups = { AddUserInternalGroup.class })
private Double longitude; private Double longitude;
/** /**
* 纬度 * 纬度
*/ */
@NotBlank(message = "纬度不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @NotBlank(message = "纬度不能为空", groups = { AddUserInternalGroup.class })
private Double latitude; private Double latitude;
/** /**
* 用户id * 用户id
*/ */
@NotBlank(message = "活动ID不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class })
private String actId; private String actId;
} }

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java

@ -29,13 +29,13 @@ public class ResiActContentFormDTO implements Serializable {
/** /**
* 活动Id * 活动Id
*/ */
@NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @NotBlank(message = "活动Id不能为空", groups = { AddUserInternalGroup.class })
private String actId; private String actId;
/** /**
* 页码从1开始 * 页码从1开始
*/ */
@Min(value = 1, message = "页码必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class })
private Integer pageNo; private Integer pageNo;
/** /**

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java

@ -28,7 +28,7 @@ public class ResiActDetailFormDTO implements Serializable {
/** /**
* 活动Id * 活动Id
*/ */
@NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) @NotBlank(message = "活动Id不能为空", groups = { AddUserInternalGroup.class })
private String actId; private String actId;
/** /**

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java

@ -20,7 +20,6 @@ package com.epmet.dto.form.resi;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 居民端-活动相关api * 居民端-活动相关api
@ -51,6 +52,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list") @PostMapping("list")
public Result<List<ResiActInfoResultDTO>> listAct(@LoginUser TokenDto tokenDto, @RequestBody ResiActBaseFormDTO formDto) { public Result<List<ResiActInfoResultDTO>> listAct(@LoginUser TokenDto tokenDto, @RequestBody ResiActBaseFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActBaseFormDTO.AddUserInternalGroup.class);
return actInfoService.listAct(tokenDto, formDto); return actInfoService.listAct(tokenDto, formDto);
} }
@ -66,6 +68,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list/auditing") @PostMapping("list/auditing")
public Result<List<ResiMyActResultDTO>> listAuditing(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { public Result<List<ResiMyActResultDTO>> listAuditing(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class);
return actInfoService.myActListAuditing(tokenDto, formDto); return actInfoService.myActListAuditing(tokenDto, formDto);
} }
@ -80,6 +83,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list/refused") @PostMapping("list/refused")
public Result<List<ResiMyActResultDTO>> listRefused(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { public Result<List<ResiMyActResultDTO>> listRefused(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class);
return actInfoService.myActListRefused(tokenDto, formDto); return actInfoService.myActListRefused(tokenDto, formDto);
} }
@ -94,6 +98,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list/passed") @PostMapping("list/passed")
public Result<List<ResiMyActResultDTO>> listPassed(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { public Result<List<ResiMyActResultDTO>> listPassed(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class);
return actInfoService.myActListPassed(tokenDto, formDto); return actInfoService.myActListPassed(tokenDto, formDto);
} }
@ -108,6 +113,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list/canceld") @PostMapping("list/canceld")
public Result<List<ResiMyActResultDTO>> listcanceld(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { public Result<List<ResiMyActResultDTO>> listcanceld(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class);
return actInfoService.myActListCanceld(tokenDto, formDto); return actInfoService.myActListCanceld(tokenDto, formDto);
} }
@ -121,6 +127,7 @@ public class ResiActListController {
**/ **/
@PostMapping("list/latestact") @PostMapping("list/latestact")
public Result<List<ResiLatestActResultDTO>> latestAct(@RequestBody ResiLatestActFormDTO formDto) { public Result<List<ResiLatestActResultDTO>> latestAct(@RequestBody ResiLatestActFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiLatestActFormDTO.AddUserInternalGroup.class);
return actInfoService.latestAct(formDto); return actInfoService.latestAct(formDto);
} }
@ -147,6 +154,7 @@ public class ResiActListController {
**/ **/
@PostMapping("actlookback") @PostMapping("actlookback")
public Result<List<ResiLookBackActResultDTO>> actLookBack(@RequestBody ResiActBaseFormDTO formDto) { public Result<List<ResiLookBackActResultDTO>> actLookBack(@RequestBody ResiActBaseFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActBaseFormDTO.AddUserInternalGroup.class);
return actInfoService.actLookBack(formDto); return actInfoService.actLookBack(formDto);
} }
@ -163,6 +171,7 @@ public class ResiActListController {
**/ **/
@PostMapping("detail") @PostMapping("detail")
public Result<ResiActDetailResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { public Result<ResiActDetailResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActDetailFormDTO.AddUserInternalGroup.class);
return actInfoService.actDetail(tokenDto, formDto); return actInfoService.actDetail(tokenDto, formDto);
} }
@ -177,6 +186,7 @@ public class ResiActListController {
**/ **/
@PostMapping("rejectdetail") @PostMapping("rejectdetail")
public Result<ResiActRefusedDetailResultDTO> rejectDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { public Result<ResiActRefusedDetailResultDTO> rejectDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActDetailFormDTO.AddUserInternalGroup.class);
return actInfoService.rejectDetail(tokenDto, formDto); return actInfoService.rejectDetail(tokenDto, formDto);
} }
@ -190,20 +200,21 @@ public class ResiActListController {
**/ **/
@PostMapping("summary/list") @PostMapping("summary/list")
public Result<ResiActSummaryResultDTO> summaryList(@RequestBody ResiActContentFormDTO formDto) { public Result<ResiActSummaryResultDTO> summaryList(@RequestBody ResiActContentFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActContentFormDTO.AddUserInternalGroup.class);
return actSummaryService.summaryList(formDto); return actSummaryService.summaryList(formDto);
} }
/** /**
* 活动详情-已结束-现场实况列表 * 活动详情-已结束-现场实况列表
* *
* @param actId * @param map{actId:""}
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActLiveRecResultDTO> * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActLiveRecResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 13:39 2020-07-21 * @Date 13:39 2020-07-21
**/ **/
@PostMapping("livereclist") @PostMapping("livereclist")
public Result<ResiActLiveRecResultDTO> liveRecList(@RequestBody String actId) { public Result<ResiActLiveRecResultDTO> liveRecList(@RequestBody Map<String, String> map) {
return actLiveRecService.liveRecList(actId); return actLiveRecService.liveRecList(map);
} }
// //
@ -219,7 +230,7 @@ public class ResiActListController {
**/ **/
@PostMapping("cancelsignup") @PostMapping("cancelsignup")
public Result cancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody ResiActUserCancelSignUpFormDTO formDTO) { public Result cancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody ResiActUserCancelSignUpFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiActUserCancelSignUpFormDTO.AddUserInternalGroup.class, ResiActUserCancelSignUpFormDTO.AddUserShowGroup.class);
return actUserRelationService.cancelSignUp(tokenDto, formDTO); return actUserRelationService.cancelSignUp(tokenDto, formDTO);
} }
@ -234,7 +245,7 @@ public class ResiActListController {
**/ **/
@PostMapping("checksigninaddress") @PostMapping("checksigninaddress")
public Result cancelSignUp(@RequestBody ResiActCaculateDistanceFormDTO formDTO) { public Result cancelSignUp(@RequestBody ResiActCaculateDistanceFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiActCaculateDistanceFormDTO.AddUserInternalGroup.class);
return actInfoService.checkSignInAddress(formDTO); return actInfoService.checkSignInAddress(formDTO);
} }
@ -250,7 +261,7 @@ public class ResiActListController {
**/ **/
@PostMapping("leaderboard") @PostMapping("leaderboard")
public Result<List<ResiLeaderboardResultDTO>> leaderboard(@RequestBody ResiActBaseFormDTO formDTO) { public Result<List<ResiLeaderboardResultDTO>> leaderboard(@RequestBody ResiActBaseFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiActBaseFormDTO.AddUserInternalGroup.class);
return heartUserInfoService.leaderboard(formDTO); return heartUserInfoService.leaderboard(formDTO);
} }
@ -264,7 +275,7 @@ public class ResiActListController {
**/ **/
@PostMapping("insertlive") @PostMapping("insertlive")
public Result insertLive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) { public Result insertLive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiActInsertLiveFormDTO.AddUserInternalGroup.class, ResiActInsertLiveFormDTO.AddUserShowGroup.class);
Result<String> result = actLiveRecService.insertLive(tokenDto, formDTO); Result<String> result = actLiveRecService.insertLive(tokenDto, formDTO);
return new Result(); return new Result();
} }
@ -279,7 +290,7 @@ public class ResiActListController {
**/ **/
@PostMapping("signin") @PostMapping("signin")
public Result actSignIn(@LoginUser TokenDto tokenDto, @RequestBody ResiActSignInFormDTO formDTO) { public Result actSignIn(@LoginUser TokenDto tokenDto, @RequestBody ResiActSignInFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiActSignInFormDTO.AddUserInternalGroup.class, ResiActSignInFormDTO.AddUserShowGroup.class);
return actSignInRecService.actSignIn(tokenDto, formDTO); return actSignInRecService.actSignIn(tokenDto, formDTO);
} }
@ -294,6 +305,7 @@ public class ResiActListController {
**/ **/
@PostMapping("registration") @PostMapping("registration")
public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class);
return actUserRelationService.registration(tokenDto, formDTO); return actUserRelationService.registration(tokenDto, formDTO);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -46,7 +46,7 @@ public class ResiVolunteerController {
@PostMapping("authenticate") @PostMapping("authenticate")
public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class);
return volunteerInfoService.authenticate(tokenDto, formDTO); return volunteerInfoService.authenticate(tokenDto, formDTO);
} }
} }

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

@ -178,14 +178,14 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
/** /**
* 取消报名 * 取消报名
* 根据用户id和活动id修改 用户活动关系表 * 根据用户id和活动id删除 用户活动关系表中用户的报名记录
* *
* @param entity * @param entity
* @return void * @return void
* @Author zhangyong * @Author zhangyong
* @Date 14:39 2020-07-22 * @Date 14:39 2020-07-22
**/ **/
void cancelSignUp(ActUserRelationEntity entity); void delSignUpRecord(ActUserRelationEntity entity);
/** /**
* 当前用户是否曾报名参加过该活动 * 当前用户是否曾报名参加过该活动

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java

@ -49,11 +49,11 @@ public interface HeartUserInfoDao extends BaseDao<HeartUserInfoEntity> {
* 查询用户是否是志愿者1是志愿者0不是志愿者 * 查询用户是否是志愿者1是志愿者0不是志愿者
* *
* @param userId * @param userId
* @return java.lang.Integer * @return java.lang.Boolean
* @Author zhangyong * @Author zhangyong
* @Date 13:53 2020-07-22 * @Date 13:53 2020-07-22
**/ **/
Integer selectUserVolunteerFlag(@Param("userId") String userId); Boolean selectUserVolunteerFlag(@Param("userId") String userId);
/** /**
* 爱心榜 * 爱心榜

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java

@ -24,6 +24,8 @@ import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO;
import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO;
import com.epmet.entity.ActLiveRecEntity; import com.epmet.entity.ActLiveRecEntity;
import java.util.Map;
/** /**
* 活动实况记录 * 活动实况记录
* *
@ -35,12 +37,12 @@ public interface ActLiveRecService extends BaseService<ActLiveRecEntity> {
/** /**
* 活动详情-已结束-现场实况列表 * 活动详情-已结束-现场实况列表
* *
* @param actId * @param map
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActLiveRecResultDTO> * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActLiveRecResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 13:39 2020-07-21 * @Date 13:39 2020-07-21
**/ **/
Result<ResiActLiveRecResultDTO> liveRecList(String actId); Result<ResiActLiveRecResultDTO> liveRecList(Map<String, String> map);
/** /**
* 活动-添加实况 * 活动-添加实况

31
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -199,6 +199,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Override @Override
public Result<List<ResiLookBackActResultDTO>> actLookBack(ResiActBaseFormDTO formDTO) { public Result<List<ResiLookBackActResultDTO>> actLookBack(ResiActBaseFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ResiLookBackActResultDTO> lookBackAct = baseDao.selectListLookBackAct(formDTO); List<ResiLookBackActResultDTO> lookBackAct = baseDao.selectListLookBackAct(formDTO);
return new Result<List<ResiLookBackActResultDTO>>().ok(lookBackAct); return new Result<List<ResiLookBackActResultDTO>>().ok(lookBackAct);
} }
@ -211,8 +213,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
// 获取活动内容 // 获取活动内容
detailResultDTO.setActContent(baseDao.selectListActContent(formDto.getActId())); detailResultDTO.setActContent(baseDao.selectListActContent(formDto.getActId()));
// 查询用户是否是志愿者 // 查询用户是否是志愿者
Integer volunteerFlag = heartUserInfoDao.selectUserVolunteerFlag(formDto.getUserId()); Boolean volunteerFlag = heartUserInfoDao.selectUserVolunteerFlag(formDto.getUserId());
detailResultDTO.setUserVolunteerFlag(volunteerFlag == 1); detailResultDTO.setUserVolunteerFlag(volunteerFlag);
// 获取用户报名状态 // 获取用户报名状态
String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId()); String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId());
@ -281,10 +283,11 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
} else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) {
/*报名结束,活动未开始:显示:截止报名*/ /*报名结束,活动未开始:显示:截止报名*/
return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP;
} else if (currentTime.after(actInfoEntity.getSignInStartTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { } else if (currentTime.after(actInfoEntity.getActStartTime()) && currentTime.before(actInfoEntity.getActEndTime())) {
// 活动打卡时间段内: 显示:已开始 // 活动开始-结束的时间段内: 显示:已开始
return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS; return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS;
} else { } else {
// 最后,显示:已结束
return ActConstant.CURRENT_STATUS_USER_FINISHED; return ActConstant.CURRENT_STATUS_USER_FINISHED;
} }
} }
@ -309,23 +312,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
return ActConstant.CURRENT_STATUS_USER_POINTS_CONFIRM; return ActConstant.CURRENT_STATUS_USER_POINTS_CONFIRM;
} }
if (currentTime.after(actInfoEntity.getActEndTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { if (currentTime.after(actInfoEntity.getActStartTime()) && currentTime.before(actInfoEntity.getActEndTime())) {
/*活动结束;打卡未截止*/ /* 活动开始-结束的时间段内 */
// (未审核的、审核未通过、取消报名的)- 已结束 return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS;
if (ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserStatus)
|| ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus)
|| ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) {
return ActConstant.CURRENT_STATUS_USER_FINISHED;
}
} else if (currentTime.after(actInfoEntity.getSignInStartTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) {
/* 活动打卡时间段内 */
// (未审核的、审核未通过、取消报名的)- 已开始
if (ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserStatus)
|| ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus)
|| ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) {
return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS;
}
} else if (currentTime.before(actInfoEntity.getSignUpEndTime())) { } else if (currentTime.before(actInfoEntity.getSignUpEndTime())) {
/* 报名截至时间前 */ /* 报名截至时间前 */
//(未审核、审核通过的)底部显示按钮 取消报名 //(未审核、审核通过的)底部显示按钮 取消报名

61
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java

@ -24,6 +24,8 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg;
import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils;
@ -48,6 +50,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 活动实况记录 * 活动实况记录
@ -69,37 +72,51 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
private ActLivePicDao actLivePicDao; private ActLivePicDao actLivePicDao;
@Override @Override
public Result<ResiActLiveRecResultDTO> liveRecList(String actId) { public Result<ResiActLiveRecResultDTO> liveRecList(Map<String, String> map) {
if (map.get("actId") == null){
logger.error("传参中没有活动ID");
throw new RenException("传参中没有活动ID");
}
// 数据汇总
ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO();
// 查询实况记录 // 查询实况记录
List<ActLiveRecDTO> actLives = baseDao.selectListActLives(actId); List<ActLiveRecDTO> actLives = baseDao.selectListActLives(map.get("actId"));
List<String> userIds = new ArrayList<>(); List<String> userIds = new ArrayList<>();
List<String> liveIds = new ArrayList<>(); List<String> liveIds = new ArrayList<>();
for (ActLiveRecDTO actLive : actLives){ for (ActLiveRecDTO actLive : actLives){
userIds.add(actLive.getUserId()); userIds.add(actLive.getUserId());
liveIds.add(actLive.getId()); liveIds.add(actLive.getId());
} }
// 查询用户微信基础信息 if (actLives.size() > NumConstant.ZERO){
Result<List<UserBaseInfoResultDTO>> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); // 查询用户微信基础信息
// 根据活动实况id,查询对应实况的图片集合 Result<List<UserBaseInfoResultDTO>> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
List<ActLivePicDTO> actLiveImg = baseDao.selectListActLiveImg(liveIds); if (userWxInfos.getData().size() > NumConstant.ZERO){
// 数据汇总 // 根据活动实况id,查询对应实况的图片集合
ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); List<ActLivePicDTO> actLiveImg = baseDao.selectListActLiveImg(liveIds);
List<Object> dataContainer = new ArrayList<>();
for (int k = 0; k < actLives.size(); k++) { List<Object> dataContainer = new ArrayList<>();
Map<String, Object> map = new HashMap<>(); for (int k = 0; k < actLives.size(); k++) {
map.put("nickname", userWxInfos.getData().get(k).getNickname()); Map<String, Object> base = new HashMap<>();
map.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); base.put("nickname", userWxInfos.getData().get(k).getNickname());
map.put("desc", actLives.get(k).getDesc()); base.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl());
map.put("createdTime", actLives.get(k).getCreatedTime()); base.put("desc", actLives.get(k).getDesc());
// 查询打卡对应图片 base.put("createdTime", actLives.get(k).getCreatedTime());
List<String> imgUrlList = new ArrayList<>(); // 查询打卡对应图片
for (ActLivePicDTO urlDto : actLiveImg) { List<String> imgUrlList = new ArrayList<>();
if (actLives.get(k).getId().equals(urlDto.getLiveId())) { for (ActLivePicDTO urlDto : actLiveImg) {
imgUrlList.add(urlDto.getPicUrl()); if (actLives.get(k).getId().equals(urlDto.getLiveId())) {
imgUrlList.add(urlDto.getPicUrl());
}
}
base.put("images", imgUrlList);
dataContainer.add(base);
} }
resultDto.setActLives(dataContainer);
resultDto.setActLiveNum(dataContainer.size());
} else {
logger.error("未查到用户基础信息");
throw new RenException("未查到用户基础信息");
} }
map.put("images", imgUrlList);
dataContainer.add(map);
} }
return new Result<ResiActLiveRecResultDTO>().ok(resultDto); return new Result<ResiActLiveRecResultDTO>().ok(resultDto);
} }

22
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java

@ -55,6 +55,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -262,18 +263,19 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
entity.setActId(formDTO.getActId()); entity.setActId(formDTO.getActId());
entity.setUserId(formDTO.getUserId()); entity.setUserId(formDTO.getUserId());
entity.setStatus(ActConstant.ACT_USER_STATUS_AUDITING); entity.setStatus(ActConstant.ACT_USER_STATUS_AUDITING);
Integer operationCount = baseDao.selectCountByActIdAndUserId(entity.getActId(), entity.getUserId()); // 审核开关:1报名人员需要人工审核(true) 0不需要(false)
if (operationCount == NumConstant.ZERO){ if (actInfoDTO.getAuditSwitch()){
// 用户第一次参加 这次的活动 entity.setPassedType(ActConstant.PASSEDTYPE_MANUAL);
// 5.插入用户活动关系表
baseDao.insert(entity);
} else { } else {
// 取消报名后,重新报名参加活动。修改状态 entity.setPassedType(ActConstant.PASSEDTYPE_AUTO);
// 5.修改用户活动关系表 entity.setAuditTime(new Date());
entity.setCancelReason("");
entity.setCancelTime(null);
baseDao.cancelSignUp(entity);
} }
Integer operationCount = baseDao.selectCountByActIdAndUserId(formDTO.getActId(), formDTO.getUserId());
if (operationCount > NumConstant.ZERO){
// 用户如果不是第一次参加 这次的活动,先删除关系表中的数据,在插入
baseDao.delSignUpRecord(entity);
}
baseDao.insert(entity);
} }
/** /**

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

@ -253,16 +253,10 @@
AND aur.ACT_ID = #{actId} AND aur.ACT_ID = #{actId}
</select> </select>
<update id="cancelSignUp" parameterType="com.epmet.entity.ActUserRelationEntity"> <update id="delSignUpRecord" parameterType="com.epmet.entity.ActUserRelationEntity">
UPDATE act_user_relation UPDATE act_user_relation
SET SET
<if test="status != null and status.trim() != ''"> DEL_FLAG = '1',
STATUS = #{status},
</if>
<if test="cancelReason != null">
CANCEL_TIME = #{cancelTime},
CANCEL_REASON = #{cancelReason},
</if>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
UPDATED_BY = #{userId}, UPDATED_BY = #{userId},
</if> </if>

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml

@ -32,7 +32,7 @@
<!-- 查询用户志愿者标识 --> <!-- 查询用户志愿者标识 -->
<select id="selectUserVolunteerFlag" parameterType="java.lang.String" <select id="selectUserVolunteerFlag" parameterType="java.lang.String"
resultType="java.lang.Integer"> resultType="java.lang.Boolean">
SELECT SELECT
VOLUNTEER_FLAG VOLUNTEER_FLAG
FROM heart_user_info u FROM heart_user_info u

Loading…
Cancel
Save