Browse Source

活动详情

dev
yinzuomei 3 years ago
parent
commit
74a5bcc082
  1. 167
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDetailResultDTO.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java
  3. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  4. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  5. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

167
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDetailResultDTO.java

@ -0,0 +1,167 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 16:47
*/
@Data
public class ActDetailResultDTO implements Serializable {
private static final long serialVersionUID = 4235569576711312094L;
private String actId;
/**
* 活动标题
*/
private String title;
/**
* 封面图
*/
private String coverPic;
/**
* 活动地点
*/
private String actAddress;
/**
* 活动地点-经度
*/
private BigDecimal actLongitude;
/**
* 活动地点-纬度
*/
private BigDecimal actLatitude;
/**
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;
/**
* 活动人数
*/
private Integer actQuota;
/**
* 活动积分
*/
private Integer reward;
/**
* 报名审核true只有志愿者才可以参加活动false: 只要是居民就可以参加活动
*/
private Boolean volunteerLimit;
/**
* 报名审核 true: 需人工审核 false: 无需审核
*/
private Boolean auditSwitch;
/**
* 报名截止时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpEndTime;
/**
* 报名条件
*/
private String requirement;
/**
* 签到开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signInStartTime;
/**
* 签到结束时间: yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signInEndTime;
/**
* 签到地址
*/
private String signInAddress;
/**
* 签到地址-纬度
*/
private BigDecimal signInLatitude;
/**
* 签到地址-经度
*/
private BigDecimal signInLongitude;
/**
* 签到有效范围()
*/
private Integer signInRadius;
/**
* 主办方id
*/
private String sponsorId;
/**
* 主办方类型以网格名义grid , 以机关名义 agency
*/
private String sponsorType;
/**
* 主办方名称
*/
private String sponsorName;
/**
* 联系人
*/
private String sponsorContacts;
/**
* 联系电话
*/
private String sponsorTel;
/**
* 活动类型爱心活动heart 联建活动party
*/
@JsonIgnore
private String actType;
@JsonIgnore
private String createdBy;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* true我发布的false,其他人发布的
*/
private Boolean isMyPublish;
private List<ActPreviewContentResultDTO> actContent;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java

@ -19,7 +19,7 @@ public class ActPreviewContentResultDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -316,4 +316,15 @@ public class WorkActController {
PageData<ActPageResDTO> page = workActService.pageList(formDTO);
return new Result<PageData<ActPageResDTO>>().ok(page);
}
/**
* 数字社区查看活动详情
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("detail")
public Result<ActDetailResultDTO> queryActDetail(@LoginUser TokenDto tokenDto,@RequestBody ActIdFormDTO formDTO){
return new Result<ActDetailResultDTO>() .ok(workActService.queryActDetail(formDTO.getActId(),tokenDto.getUserId()));
}
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java

@ -156,4 +156,12 @@ public interface WorkActService {
* @return
*/
PageData<ActPageResDTO> pageList(ActPageFormDTO formDTO);
/**
* 数字社区查看活动详情
* @param actId
* @param userId
* @return
*/
ActDetailResultDTO queryActDetail(String actId, String userId);
}

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -1688,5 +1688,26 @@ public class WorkActServiceImpl implements WorkActService {
}
/**
* 数字社区查看活动详情
*
* @param actId
* @param userId
* @return
*/
@Override
public ActDetailResultDTO queryActDetail(String actId, String userId) {
ActInfoEntity actInfoEntity=actInfoDao.selectById(actId);
ActDetailResultDTO resultDTO=ConvertUtils.sourceToTarget(actInfoEntity,ActDetailResultDTO.class);
//查询活动详情
List<ActPreviewContentResultDTO> list = actContentDao.selectByActId(actId);
resultDTO.setActContent(list);
//当前活动是否是我发布的
if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
resultDTO.setIsMyPublish(true);
}else{
resultDTO.setIsMyPublish(false);
}
return resultDTO;
}
}

Loading…
Cancel
Save