Browse Source

heart-work:积分发放

dev
yinzuomei 5 years ago
parent
commit
ba87e8f8ce
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java
  3. 32
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java
  4. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  5. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  6. 119
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  7. 57
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java
  8. 51
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java
  9. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java
  10. 47
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java
  11. 67
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  12. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
  13. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java
  14. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  15. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java
  16. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java
  17. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java
  18. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java
  19. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java
  20. 43
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  21. 67
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java
  22. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java
  23. 316
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  24. 442
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  25. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  26. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml
  27. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  28. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
  29. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -54,6 +54,10 @@ public enum EpmetErrorCode {
ACT_CONTENT_TEXT_SCAN_FAILED(8116,"活动详情内容审核失败,请重新编辑"),
ACT_CONTENT_IMG_SCAN_FAILED(8117,"活动详情图片失败,请重新编辑"),
ACT_COVER_PIC_SCAN_FAILED(8118,"活动封面图片审核失败,请重新编辑"),
ACT_START_TIME_ERROR(8119,"活动预计开始时间应早于活动预计结束时间"),
ACT_SIGN_IN_START_TIME_ERROR(8120,"签到开始时间应早于签到结束时间"),
ACT_SIGN_UP_END_TIME_ERROR(8121,"活动报名截止时间应早于活动预计开始时间"),
CANNOT_AUDIT_WARM(8201, "请完善居民信息"),
NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"),

9
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java

@ -53,9 +53,14 @@ public class ActOperationRecDTO implements Serializable {
private String type;
/**
* 1通知用户0不通知
* 1通知用户0不通知取消活动时默认true
*/
private Boolean noticeUser;
private Boolean noticeUser;
/**
* 备注取消活动时此列有值
*/
private String remark;
/**
* 删除标记

32
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/26 17:23
*/
@Data
public class CancelActFormDTO implements Serializable {
private static final long serialVersionUID = -5297836691628421645L;
public interface AddUserInternalGroup {}
public interface UserShowGroup extends CustomerClientShowGroup {
}
/**
* 活动id
*/
@NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class })
private String actId;
/**
* 取消原因
*/
@NotBlank(message = "取消原因不能为空", groups = {UserShowGroup.class})
private String cancelReason;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -1,6 +1,5 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.Valid;
@ -22,9 +21,6 @@ public class DraftActInfoFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddDraftUserShowGroup extends CustomerClientShowGroup {
}
@Valid
private List<DraftActContentFormDTO> actContent;

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -43,13 +43,13 @@ public class ActPreviewResultDTO implements Serializable {
private Integer reward;
/**
* 活动开始时间yyyy-MM-dd HH:mm
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动结束时间yyyy-MM-dd HH:mm
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;

119
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java

@ -0,0 +1,119 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 已取消-活动详情
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/26 18:02
*/
@Data
public class CanceledActDetailResultDTO implements Serializable {
private static final long serialVersionUID = 4438884084461494174L;
/**
*活动id
*/
private String actId;
/**
* 活动标题
*/
private String title;
/**
* 报名截止时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpEndTime;
/**
* 活动开始时间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 String actAddress;
/**
* 活动名额
*/
private Integer actQuota;
/**
* true:固定名额 false 不限制名额
*/
private Boolean actQuotaCategory;
/**
* 联系人
*/
private String sponsorContacts;
/**
* 联系电话
*/
private String sponsorTel;
/**
* 活动积分
*/
private Integer reward;
/**
* 主办方名称
*/
private String sponsorName;
/**
* 报名条件
*/
private String requirement;
/**
* 取消时间yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cancelTime;
/**
* 取消理由
*/
private String cancelReason;
/**
* 活动详情
*/
private List<ActPreviewContentResultDTO> actContent;
@Override
public String toString() {
return "CanceledActDetailResultDTO{" +
"actId='" + actId + '\'' +
", title='" + title + '\'' +
", signUpEndTime=" + signUpEndTime +
", actStartTime=" + actStartTime +
", actEndTime=" + actEndTime +
", actAddress='" + actAddress + '\'' +
", actQuota=" + actQuota +
", actQuotaCategory=" + actQuotaCategory +
", sponsorContacts='" + sponsorContacts + '\'' +
", sponsorTel='" + sponsorTel + '\'' +
", reward=" + reward +
", sponsorName='" + sponsorName + '\'' +
", requirement='" + requirement + '\'' +
", cancelTime=" + cancelTime +
", cancelReason='" + cancelReason + '\'' +
", actContent=" + actContent +
'}';
}
}

57
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
/**
* 积分发放-已拒绝列表
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/26 19:01
*/
@Data
public class DeniedUserResultDTO implements Serializable {
private static final long serialVersionUID = 110993452055116412L;
/**
* 给分或者不给分,重新处理入参用
*/
private String actUserRelationId;
/**
* 用户id
*/
private String userId;
/**
* 活动id
*/
private String actId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 头像
*/
private String headImgUrl;
/**
* true:是志愿者 false不是志愿者
*/
private Boolean volunteerFlag;
/**
* 拒绝原因
*/
private String denyRewardReason;
}

51
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java

@ -0,0 +1,51 @@
package com.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
/**
* 积分发放-已发放列表
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/26 18:43
*/
@Data
public class ObtainedUserResultDTO implements Serializable {
private static final long serialVersionUID = 8187248601958392521L;
/**
* 给分或者不给分,重新处理入参用
*/
private String actUserRelationId;
/**
* 用户id
*/
private String userId;
/**
* 活动id
*/
private String actId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 头像
*/
private String headImgUrl;
/**
* true:是志愿者 false不是志愿者
*/
private Boolean volunteerFlag;
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java

@ -8,6 +8,16 @@ package com.epmet.constant;
*/
public interface ActMessageConstant {
String TITLE="您有一条活动消息";
/**
* 报名审核成功给居民端用户发送消息
*/
String AUDIT_PASSED="您报名的活动%s,已审核通过";
/**
* 拒绝用户的报名给居民端用户发送消息
*/
String AUDIT_REFUSED="您报名的活动%s,审核未通过,原因:%s";
/**
* 活动被取消给已经通过审核的居民端用户发送消息
*/
String ACT_CANCELED="您报名的活动%s,已取消,原因:%s";
}

47
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java

@ -4,14 +4,20 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.work.CanceledUserResultDTO;
import com.epmet.dto.result.work.DeniedUserResultDTO;
import com.epmet.dto.result.work.ObtainedUserResultDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
import com.epmet.service.GrantPointsService;
import com.epmet.service.WorkActUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 工作端-积分发放api
*
@ -23,6 +29,8 @@ import org.springframework.web.bind.annotation.RestController;
public class GrantPointsController {
@Autowired
private GrantPointsService grantPointsService;
@Autowired
private WorkActUserService workActUserService ;
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PendingUserResultDTO>
@ -78,4 +86,43 @@ public class GrantPointsController {
grantPointsService.reset(formDTO);
return new Result();
}
/**
* @param actIdFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.work.ObtainedUserResultDTO>>
* @author yinzuomei
* @description 积分发放-已发放列表
* @Date 2020/7/26 18:46
**/
@PostMapping("agreedlist")
public Result<List<ObtainedUserResultDTO>> agreedList(@RequestBody ActIdFormDTO actIdFormDTO) {
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<List<ObtainedUserResultDTO>>().ok(grantPointsService.agreedList(actIdFormDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.work.DeniedUserResultDTO>>
* @param actIdFormDTO
* @author yinzuomei
* @description 积分发放-已拒绝列表
* @Date 2020/7/26 19:02
**/
@PostMapping("deniedlist")
public Result<List<DeniedUserResultDTO>> deniedList(@RequestBody ActIdFormDTO actIdFormDTO){
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<List<DeniedUserResultDTO>>().ok(grantPointsService.deniedList(actIdFormDTO));
}
/**
* @param actIdFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.work.CanceledUserResultDTO>>
* @author yinzuomei
* @description 积分发放-已取消报名列表
* @Date 2020/7/26 19:19
**/
@PostMapping("canceleduserlist")
public Result<List<CanceledUserResultDTO>> canceledUserList(@RequestBody ActIdFormDTO actIdFormDTO) {
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<List<CanceledUserResultDTO>>().ok(workActUserService.queryCanceledUserList(actIdFormDTO));
}
}

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

@ -2,11 +2,8 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.work.*;
import com.epmet.service.WorkActService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -28,6 +25,19 @@ public class WorkActController {
@Autowired
private WorkActService workActService;
/**
* @return com.epmet.commons.tools.utils.Result
* @param
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
@PostMapping("deletedraft")
public Result deleteDraft(){
workActService.deleteDraft();
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.SponsorResultDTO>
* @param
@ -40,6 +50,26 @@ public class WorkActController {
return new Result<SponsorResultDTO>().ok(workActService.querySponsorList());
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PublishActResultDTO>
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:32
**/
@PostMapping("publish")
public Result<PublishActResultDTO> publishAct(@RequestBody PublishActInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
PublishActContentFormDTO.UserShowGroup.class,
PublishActContentFormDTO.UserInternalGroup.class
);
}
PublishActResultDTO resultDTO = workActService.publishAct(formDTO);
return new Result<PublishActResultDTO>().ok(resultDTO);
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.InProgressActResultDTO>
* @param formDTO
@ -78,4 +108,31 @@ public class WorkActController {
ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class);
return new Result<List<FinishedActResultDTO>>().ok(workActService.queryFinishedList(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @author yinzuomei
* @description 取消活动
* @Date 2020/7/26 17:26
**/
@PostMapping("cancelact")
public Result cancelAct(@RequestBody CancelActFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,CancelActFormDTO.UserShowGroup.class,CancelActFormDTO.AddUserInternalGroup.class);
workActService.cancelAct(formDTO);
return new Result();
}
/**
* @param actIdFormDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 已取消-活动详情
* @Date 2020/7/26 18:00
**/
@PostMapping("canceleddetail")
public Result<CanceledActDetailResultDTO> canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) {
ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<CanceledActDetailResultDTO>().ok(workActService.canceledDetail(actIdFormDTO.getActId()));
}
}

39
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java

@ -37,19 +37,6 @@ public class WorkActDraftController {
return new Result<PublishActInitResultDTO>().ok(initResultDTO);
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
@PostMapping("deletedraft")
public Result deleteDraft(){
workActDraftService.deleteDraft();
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.LatestdraftActInfoResultDTO>
* @param
@ -72,9 +59,8 @@ public class WorkActDraftController {
**/
@PostMapping("saveact")
public Result<SaveActDraftResultDTO> saveAct(@RequestBody DraftActInfoFormDTO formDTO){
//起码活动标题不能为空
ValidatorUtils.validateEntity(formDTO, DraftActInfoFormDTO.AddDraftUserShowGroup.class,
DraftActInfoFormDTO.AddUserInternalGroup.class);
//起码客户id不能为空
ValidatorUtils.validateEntity(formDTO,DraftActInfoFormDTO.AddUserInternalGroup.class);
//如果录入了活动内容,需要校验 content、contentType
if (null != formDTO.getActContent() && formDTO.getActContent().size() > 0) {
for(DraftActContentFormDTO actContentFormDTO:formDTO.getActContent()){
@ -102,25 +88,4 @@ public class WorkActDraftController {
return new Result<ActPreviewResultDTO>().ok(resultDTO);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PublishActResultDTO>
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:32
**/
@PostMapping("publish")
public Result<PublishActResultDTO> publishAct(@RequestBody PublishActInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
PublishActContentFormDTO.UserShowGroup.class,
PublishActContentFormDTO.UserInternalGroup.class
);
}
PublishActResultDTO resultDTO = workActDraftService.publishAct(formDTO);
return new Result<PublishActResultDTO>().ok(resultDTO);
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java

@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.work.ActPreviewContentResultDTO;
import com.epmet.entity.ActContentEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 活动内容
*
@ -29,5 +32,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActContentDao extends BaseDao<ActContentEntity> {
/**
* @return java.util.List<com.epmet.dto.result.work.ActPreviewContentResultDTO>
* @param actId
* @author yinzuomei
* @description 根据活动id查询活动详情
* @Date 2020/7/26 18:26
**/
List<ActPreviewContentResultDTO> selectByActId(String actId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -270,4 +270,13 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 2020/7/24 10:55
**/
List<CanceledUserResultDTO> queryCanceledUserList(String actId);
/**
* @return com.epmet.dto.result.work.CanceledActDetailResultDTO
* @param actId
* @author yinzuomei
* @description 工作端-查询已取消活动详情
* @Date 2020/7/26 18:29
**/
CanceledActDetailResultDTO selectCanceledActInfo(String actId);
}

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

@ -19,6 +19,8 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.result.work.DeniedUserResultDTO;
import com.epmet.dto.result.work.ObtainedUserResultDTO;
import com.epmet.dto.result.work.UserHistoricalActInfoDTO;
import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Mapper;
@ -136,4 +138,22 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
* @Date 2020/7/24 13:02
**/
List<String> selectInProgressUserIds(String actId);
/**
* @return java.util.List<com.epmet.dto.result.work.ObtainedUserResultDTO>
* @param actId
* @author yinzuomei
* @description 积分发放-已发放列表
* @Date 2020/7/26 18:48
**/
List<ObtainedUserResultDTO> selectAgreedList(String actId);
/**
* @return java.util.List<com.epmet.dto.result.work.DeniedUserResultDTO>
* @param actId
* @author yinzuomei
* @description 积分发放-已拒绝列表
* @Date 2020/7/26 19:11
**/
List<DeniedUserResultDTO> selectDeniedList(String actId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java

@ -60,4 +60,13 @@ public interface LatestActContentDao extends BaseDao<LatestActContentEntity> {
* @Date 2020/7/21 18:07
**/
List<ActPreviewContentResultDTO> previewActContent(String actId);
/**
* @return int
* @param actId
* @author yinzuomei
* @description 根据活动id删除活动详情 物理删除
* @Date 2020/7/24 16:08
**/
int deleteByActId(String actId);
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java

@ -49,8 +49,12 @@ public class ActOperationRecEntity extends BaseEpmetEntity {
private String type;
/**
* 1通知用户0不通知
* 1通知用户0不通知取消活动时默认true
*/
private Boolean noticeUser;
/**
* 备注取消活动时此列有值
*/
private String remark;
}

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

@ -1,8 +1,13 @@
package com.epmet.service;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.work.DeniedUserResultDTO;
import com.epmet.dto.result.work.ObtainedUserResultDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
import java.util.List;
/**
* 描述一下
*
@ -45,4 +50,22 @@ public interface GrantPointsService {
* @Date 2020/7/24 15:16
**/
void reset(GrantPointsFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.ObtainedUserResultDTO>
* @param actIdFormDTO
* @author yinzuomei
* @description 积分发放-已发放列表
* @Date 2020/7/26 18:47
**/
List<ObtainedUserResultDTO> agreedList(ActIdFormDTO actIdFormDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.DeniedUserResultDTO>
* @param actIdFormDTO
* @author yinzuomei
* @description 积分发放-已拒绝列表
* @Date 2020/7/26 19:02
**/
List<DeniedUserResultDTO> deniedList(ActIdFormDTO actIdFormDTO);
}

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

@ -2,8 +2,10 @@ package com.epmet.service;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
import com.epmet.dto.form.work.PublishActInfoFormDTO;
import com.epmet.dto.result.work.*;
import com.epmet.dto.result.work.ActPreviewResultDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.dto.result.work.PublishActInitResultDTO;
import com.epmet.dto.result.work.SaveActDraftResultDTO;
/**
* 工作端活动草稿
@ -22,15 +24,6 @@ public interface WorkActDraftService {
**/
PublishActInitResultDTO publishActInit();
/**
* @return void
* @param
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
void deleteDraft();
/**
* @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO
* @param
@ -58,12 +51,4 @@ public interface WorkActDraftService {
**/
ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO);
/**
* @return com.epmet.dto.result.work.PublishActResultDTO
* @param formDTO
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:33
**/
PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO);
}

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

@ -1,10 +1,9 @@
package com.epmet.service;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.dto.form.work.CancelActFormDTO;
import com.epmet.dto.form.work.PublishActInfoFormDTO;
import com.epmet.dto.result.work.*;
import java.util.List;
@ -15,6 +14,15 @@ import java.util.List;
* @date 2020/7/23 20:36
*/
public interface WorkActService {
/**
* @return void
* @param
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
void deleteDraft();
/**
* @return com.epmet.dto.result.work.SponsorResultDTO
* @param
@ -24,6 +32,15 @@ public interface WorkActService {
**/
SponsorResultDTO querySponsorList();
/**
* @return com.epmet.dto.result.work.PublishActResultDTO
* @param formDTO
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:33
**/
PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO);
/**
* @return com.epmet.dto.result.work.InProgressActResultDTO
* @param formDTO
@ -50,4 +67,22 @@ public interface WorkActService {
* @Date 2020/7/23 23:21
**/
List<FinishedActResultDTO> queryFinishedList(ActListCommonFormDTO formDTO);
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 取消活动
* @Date 2020/7/26 17:26
**/
void cancelAct(CancelActFormDTO formDTO);
/**
* @return void
* @param actId
* @author yinzuomei
* @description 已取消-活动详情
* @Date 2020/7/26 18:00
**/
CanceledActDetailResultDTO canceledDetail(String actId);
}

67
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java

@ -9,8 +9,11 @@ import com.epmet.dao.ActUserRelationDao;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.ActPointLogDTO;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.work.DeniedUserResultDTO;
import com.epmet.dto.result.work.ObtainedUserResultDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
import com.epmet.dto.result.work.UserBaseInfo;
import com.epmet.service.*;
@ -233,4 +236,68 @@ public class GrantPointsServiceImpl implements GrantPointsService {
actPointLogDTO.setEffectFlag(false);
actPointLogService.save(actPointLogDTO);
}
/**
* @param actIdFormDTO
* @return java.util.List<com.epmet.dto.result.work.ObtainedUserResultDTO>
* @author yinzuomei
* @description 积分发放-已发放列表
* @Date 2020/7/26 18:47
**/
@Override
public List<ObtainedUserResultDTO> agreedList(ActIdFormDTO actIdFormDTO) {
List<ObtainedUserResultDTO> list = actUserRelationDao.selectAgreedList(actIdFormDTO.getActId());
if (null == list || list.size() < 0) {
return new ArrayList<>();
}
List<String> userIdList = new ArrayList<>();
for (ObtainedUserResultDTO obtainedUserResultDTO : list) {
obtainedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(obtainedUserResultDTO.getUserId()));
userIdList.add(obtainedUserResultDTO.getUserId());
}
List<UserBaseInfoResultDTO> userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList);
for (ObtainedUserResultDTO obtainedUser : list) {
for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) {
if (obtainedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) {
obtainedUser.setRealName(userBaseInfoResultDTO.getRealName());
obtainedUser.setNickName(userBaseInfoResultDTO.getNickname());
obtainedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
break;
}
}
}
return list;
}
/**
* @param actIdFormDTO
* @return java.util.List<com.epmet.dto.result.work.DeniedUserResultDTO>
* @author yinzuomei
* @description 积分发放-已拒绝列表
* @Date 2020/7/26 19:02
**/
@Override
public List<DeniedUserResultDTO> deniedList(ActIdFormDTO actIdFormDTO) {
List<DeniedUserResultDTO> list = actUserRelationDao.selectDeniedList(actIdFormDTO.getActId());
if (null == list || list.size() < 0) {
return new ArrayList<>();
}
List<String> userIdList = new ArrayList<>();
for (DeniedUserResultDTO deniedUserResultDTO : list) {
deniedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(deniedUserResultDTO.getUserId()));
userIdList.add(deniedUserResultDTO.getUserId());
}
List<UserBaseInfoResultDTO> userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList);
for (DeniedUserResultDTO deniedUser : list) {
for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) {
if (deniedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) {
deniedUser.setRealName(userBaseInfoResultDTO.getRealName());
deniedUser.setNickName(userBaseInfoResultDTO.getNickname());
deniedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
break;
}
}
}
return list;
}
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java

@ -93,7 +93,7 @@ public class LatestActContentServiceImpl extends BaseServiceImpl<LatestActConten
@Transactional(rollbackFor = Exception.class)
public void saveLatestActContentDTOList(List<LatestActContentDTO> dtoList) {
//先删除之前的
this.deleteByActId(dtoList.get(0).getActId());
baseDao.deleteByActId(dtoList.get(0).getActId());
//再插入新的
for(LatestActContentDTO dto:dtoList){
LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class);

316
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -1,31 +1,13 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dao.ActContentDao;
import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActOperationRecDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.ActContentEntity;
import com.epmet.entity.ActInfoEntity;
import com.epmet.entity.ActOperationRecEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.LatestActContentService;
import com.epmet.service.LatestActInfoService;
import com.epmet.service.WorkActDraftService;
@ -33,14 +15,11 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 工作端活动草稿
@ -57,20 +36,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
private LatestActInfoService latestActInfoService;
@Autowired
private LatestActContentService latestActContentService;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Autowired
private ActInfoDao actInfoDao;
@Autowired
private ActContentDao actContentDao;
@Autowired
private ActOperationRecDao actOperationRecDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@ -96,19 +61,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
return resultDTO;
}
/**
* @return void
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
@Override
public void deleteDraft() {
String currentUserId=loginUserUtil.getLoginUserId();
if(StringUtils.isNotBlank(currentUserId)){
latestActInfoService.deleteAllDraft(currentUserId);
}
}
/**
* @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO
@ -148,7 +100,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){
//保存活动内容
List<LatestActContentDTO> actContentList=this.constructLatestActContent(formDTO.getActContent(),actDraftId);
//删除之前的内容
//删除之前的内容,保存本次的修改 物理删除
latestActContentService.saveLatestActContentDTOList(actContentList);
}
SaveActDraftResultDTO resultDTO=new SaveActDraftResultDTO();
@ -175,266 +127,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
return actPreviewResultDTO;
}
/**
* @param formDTO
* @return com.epmet.dto.result.work.PublishActResultDTO
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:33
**/
@Override
@Transactional(rollbackFor = Exception.class)
public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) {
PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
//内容审核(活动标题、招募要求、活动内容图文)
this.auditAct(formDTO);
logger.info("发布活动,审核成功");
//构造属性保存活动属性,活动内容
ActInfoEntity actInfoEntity=this.constructActInfo(formDTO);
actInfoDao.insert(actInfoEntity);
List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId());
for(ActContentEntity actContentEntity:actContentEntityList){
actContentDao.insert(actContentEntity);
}
//插入一条操作日志
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(actInfoEntity.getId());
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH);
actOperationRecEntity.setNoticeUser(false);
actOperationRecDao.insert(actOperationRecEntity);
//删除所有的草稿
this.deleteDraft();
publishActResultDTO.setActId(actInfoEntity.getId());
return publishActResultDTO;
}
/**
* @return com.epmet.entity.ActInfoEntity
* @param formDTO
* @author yinzuomei
* @description 发布活动-构造act_info
* @Date 2020/7/21 20:00
**/
private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) {
ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class);
//活动名额类型(0-不限名额,1-固定名额)
if(actInfoEntity.getActQuota()==0){
actInfoEntity.setActQuotaCategory(false);
}else{
actInfoEntity.setActQuotaCategory(true);
}
actInfoEntity.setSignUpStartTime(new Date());
actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED);
//1已经总结0未总结
actInfoEntity.setSummaryFlag(false);
if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){
//调用gov_org服务获取当前组织的上一级机关id TODO
Result<CustomerAgencyDTO> result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId());
if(result.success()&&null!=result.getData()){
actInfoEntity.setPid(result.getData().getPid());
}else{
logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId());
}
}else{
actInfoEntity.setPid("");
}
return actInfoEntity;
}
/**
* @return java.util.List<com.epmet.entity.ActContentEntity>
* @param actContent
* @param actId
* @author yinzuomei
* @description 发布活动-构造活动详情act_content
* @Date 2020/7/21 19:59
**/
private List<ActContentEntity> constructActContent(List<PublishActContentFormDTO> actContent, String actId) {
List<ActContentEntity> list=new ArrayList<>();
int orderNum=1;
for(PublishActContentFormDTO actContentFormDTO:actContent){
ActContentEntity actContentEntity=new ActContentEntity();
actContentEntity.setActId(actId);
actContentEntity.setContent(actContentFormDTO.getContent());
actContentEntity.setContentType(actContentFormDTO.getContentType());
actContentEntity.setOrderNum(orderNum);
list.add(actContentEntity);
orderNum++;
}
return list;
}
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 活动相关内容审核活动标题招募要求活动内容图文
* @Date 2020/7/21 19:20
**/
private void auditAct(PublishActInfoFormDTO formDTO) {
//1、活动标题
if (StringUtils.isNotBlank(formDTO.getTitle())) {
this.auditActTitle(formDTO.getTitle());
}
//2、活动封面
if(StringUtils.isNotBlank(formDTO.getCoverPic())){
this.auditActCoverPic(formDTO.getCoverPic());
}
//3、招募要求
if (StringUtils.isNotBlank(formDTO.getRequirement())) {
this.auditActRequirement(formDTO.getRequirement());
}
//4、活动内容
if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){
return;
}
List<String> textList=new ArrayList<>();
List<String> imgList=new ArrayList<>();
for(PublishActContentFormDTO actContent:formDTO.getActContent()){
if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){
textList.add(actContent.getContent());
}else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){
imgList.add(actContent.getContent());
}
}
this.auditActContent(textList,imgList);
}
/**
* @return void
* @param textList
* @param imgList
* @author yinzuomei
* @description 活动详情审核
* @Date 2020/7/21 19:21
**/
private void auditActContent(List<String> textList, List<String> imgList) {
//审核活动详情中的内容
if(null!=textList&&textList.size()>0){
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
textList.forEach(content -> {
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(content);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
});
Result<SyncScanResult> contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!contentSyncScanRes.success()) {
logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!contentSyncScanRes.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode());
}
}
logger.info("活动详情内容审核成功");
}
if(null!=imgList&&imgList.size()>0){
//审核活动详情中的图片
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode());
}
}
logger.info("活动详情图片审核成功");
}
}
/**
* @return void
* @param requirement
* @author yinzuomei
* @description 活动招募条件审核
* @Date 2020/7/21 19:21
**/
private void auditActRequirement(String requirement) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(requirement);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.error("活动报名条件审核失败,报名条件:",requirement);
throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode());
}
}
logger.info("活动报名条件审核成功");
}
/**
* @return void
* @param coverPic
* @author yinzuomei
* @description 活动封面图片审核
* @Date 2020/7/21 19:21
**/
private void auditActCoverPic(String coverPic) {
ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO();
ImgTaskDTO coverImgtask = new ImgTaskDTO();
coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", ""));
coverImgtask.setUrl(coverPic);
coverPicScanParamDTO.getTasks().add(coverImgtask);
Result<SyncScanResult> coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO);
if (!coverPicScanRes.success()){
logger.error("活动封面审核失败接口返回失败,返参:",JSON.toJSONString(coverPicScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!coverPicScanRes.getData().isAllPass()) {
logger.error("活动封面审核失败,封面图片地址:",coverPic);
throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode());
}
}
logger.info("活动封面审核成功");
}
/**
* @return void
* @param title
* @author yinzuomei
* @description 活动标题审核
* @Date 2020/7/21 19:21
**/
private void auditActTitle(String title) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(title);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.error("活动标题审核失败,标题内容:",title);
throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode());
}
}
logger.info("活动标题审核通过");
}
/**
* @return java.util.List<com.epmet.dto.LatestActContentDTO>
* @param actContent

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

@ -1,24 +1,57 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.dao.ActContentDao;
import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActOperationRecDao;
import com.epmet.dao.ActUserRelationDao;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.form.work.CancelActFormDTO;
import com.epmet.dto.form.work.PublishActContentFormDTO;
import com.epmet.dto.form.work.PublishActInfoFormDTO;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.ActContentEntity;
import com.epmet.entity.ActInfoEntity;
import com.epmet.entity.ActOperationRecEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ActInfoService;
import com.epmet.service.LatestActInfoService;
import com.epmet.service.WorkActService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 描述一下
@ -29,12 +62,44 @@ import java.util.List;
@Service
public class WorkActServiceImpl implements WorkActService {
private Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private ActInfoDao actInfoDao;
@Autowired
private LatestActInfoService latestActInfoService;
@Autowired
private ActContentDao actContentDao;
@Autowired
private ActOperationRecDao actOperationRecDao;
@Autowired
private ActInfoService actInfoService;
@Autowired
private ActUserRelationDao actUserRelationDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @return void
* @author yinzuomei
* @description 发布活动-删除历史活动草稿
* @Date 2020/7/20 18:15
**/
@Override
public void deleteDraft() {
String currentUserId=loginUserUtil.getLoginUserId();
if(StringUtils.isNotBlank(currentUserId)){
latestActInfoService.deleteAllDraft(currentUserId);
}
}
/**
* @return com.epmet.dto.result.work.SponsorResultDTO
@ -59,6 +124,308 @@ public class WorkActServiceImpl implements WorkActService {
return null;
}
/**
* @param formDTO
* @return com.epmet.dto.result.work.PublishActResultDTO
* @author yinzuomei
* @description 发布活动
* @Date 2020/7/21 18:33
**/
@Override
@Transactional(rollbackFor = Exception.class)
public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) {
//校验参数
this.checkPublishFormDTO(formDTO);
PublishActResultDTO publishActResultDTO=new PublishActResultDTO();
//内容审核(活动标题、招募要求、活动内容图文)
this.auditAct(formDTO);
logger.info("发布活动,审核成功");
//构造属性保存活动属性,活动内容
ActInfoEntity actInfoEntity=this.constructActInfo(formDTO);
actInfoDao.insert(actInfoEntity);
List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId());
for(ActContentEntity actContentEntity:actContentEntityList){
actContentDao.insert(actContentEntity);
}
//插入一条操作日志
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(actInfoEntity.getId());
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH);
actOperationRecEntity.setNoticeUser(false);
actOperationRecEntity.setRemark(StrConstant.EPMETY_STR);
actOperationRecDao.insert(actOperationRecEntity);
//删除所有的草稿
this.deleteDraft();
publishActResultDTO.setActId(actInfoEntity.getId());
return publishActResultDTO;
}
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description
* @Date 2020/7/24 16:45
**/
private void checkPublishFormDTO(PublishActInfoFormDTO formDTO) {
//1、活动预计开始时间、活动预计结束时间
if(formDTO.getActStartTime().compareTo(formDTO.getActEndTime())!=-1){
throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode());
}
//2、签到开始时间、签到结束时间
if(formDTO.getSignInStartTime().compareTo(formDTO.getSignInEndTime())!=-1){
throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode());
}
//3、报名截止时间(应该在活动预计开始时间之前)
if(formDTO.getSignUpEndTime().compareTo(formDTO.getActStartTime())!=-1){
throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode()));
}
}
public static void main(String[] args) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date yesterDate=format.parse("2020-07-25 13:00:00");
Date today=format.parse("2020-07-26 13:00:00");
Date tommorrow=format.parse("2020-07-27 13:00:00");
Date today1=format.parse("2020-07-26 13:00:00");
System.out.println(yesterDate.compareTo(today));
System.out.println(tommorrow.compareTo(today));
System.out.println(today.compareTo(today1));
} catch (ParseException e) {
e.printStackTrace();
}
}
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 活动相关内容审核活动标题招募要求活动内容图文
* @Date 2020/7/21 19:20
**/
private void auditAct(PublishActInfoFormDTO formDTO) {
//1、活动标题
if (StringUtils.isNotBlank(formDTO.getTitle())) {
this.auditActTitle(formDTO.getTitle());
}
//2、活动封面
if(StringUtils.isNotBlank(formDTO.getCoverPic())){
this.auditActCoverPic(formDTO.getCoverPic());
}
//3、招募要求
if (StringUtils.isNotBlank(formDTO.getRequirement())) {
this.auditActRequirement(formDTO.getRequirement());
}
//4、活动内容
if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){
return;
}
List<String> textList=new ArrayList<>();
List<String> imgList=new ArrayList<>();
for(PublishActContentFormDTO actContent:formDTO.getActContent()){
if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){
textList.add(actContent.getContent());
}else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){
imgList.add(actContent.getContent());
}
}
this.auditActContent(textList,imgList);
}
/**
* @return com.epmet.entity.ActInfoEntity
* @param formDTO
* @author yinzuomei
* @description 发布活动-构造act_info
* @Date 2020/7/21 20:00
**/
private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) {
ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class);
//活动名额类型(0-不限名额,1-固定名额)
if(actInfoEntity.getActQuota()==0){
actInfoEntity.setActQuotaCategory(false);
}else{
actInfoEntity.setActQuotaCategory(true);
}
actInfoEntity.setSignUpStartTime(new Date());
actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED);
//1已经总结0未总结
actInfoEntity.setSummaryFlag(false);
if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){
//调用gov_org服务获取当前组织的上一级机关id
Result<CustomerAgencyDTO> result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId());
if(result.success()&&null!=result.getData()){
actInfoEntity.setPid(result.getData().getPid());
}else{
logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId());
}
}else{
actInfoEntity.setPid("");
}
return actInfoEntity;
}
/**
* @return java.util.List<com.epmet.entity.ActContentEntity>
* @param actContent
* @param actId
* @author yinzuomei
* @description 发布活动-构造活动详情act_content
* @Date 2020/7/21 19:59
**/
private List<ActContentEntity> constructActContent(List<PublishActContentFormDTO> actContent, String actId) {
List<ActContentEntity> list=new ArrayList<>();
int orderNum=1;
for(PublishActContentFormDTO actContentFormDTO:actContent){
ActContentEntity actContentEntity=new ActContentEntity();
actContentEntity.setActId(actId);
actContentEntity.setContent(actContentFormDTO.getContent());
actContentEntity.setContentType(actContentFormDTO.getContentType());
actContentEntity.setOrderNum(orderNum);
list.add(actContentEntity);
orderNum++;
}
return list;
}
/**
* @return void
* @param textList
* @param imgList
* @author yinzuomei
* @description 活动详情审核
* @Date 2020/7/21 19:21
**/
private void auditActContent(List<String> textList, List<String> imgList) {
//审核活动详情中的内容
if(null!=textList&&textList.size()>0){
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
textList.forEach(content -> {
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(content);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
});
Result<SyncScanResult> contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!contentSyncScanRes.success()) {
logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!contentSyncScanRes.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode());
}
}
logger.info("活动详情内容审核成功");
}
if(null!=imgList&&imgList.size()>0){
//审核活动详情中的图片
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode());
}
}
logger.info("活动详情图片审核成功");
}
}
/**
* @return void
* @param requirement
* @author yinzuomei
* @description 活动招募条件审核
* @Date 2020/7/21 19:21
**/
private void auditActRequirement(String requirement) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(requirement);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.error("活动报名条件审核失败,报名条件:",requirement);
throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode());
}
}
logger.info("活动报名条件审核成功");
}
/**
* @return void
* @param coverPic
* @author yinzuomei
* @description 活动封面图片审核
* @Date 2020/7/21 19:21
**/
private void auditActCoverPic(String coverPic) {
ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO();
ImgTaskDTO coverImgtask = new ImgTaskDTO();
coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", ""));
coverImgtask.setUrl(coverPic);
coverPicScanParamDTO.getTasks().add(coverImgtask);
Result<SyncScanResult> coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO);
if (!coverPicScanRes.success()){
logger.error("活动封面审核失败接口返回失败,返参:", JSON.toJSONString(coverPicScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!coverPicScanRes.getData().isAllPass()) {
logger.error("活动封面审核失败,封面图片地址:",coverPic);
throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode());
}
}
logger.info("活动封面审核成功");
}
/**
* @return void
* @param title
* @author yinzuomei
* @description 活动标题审核
* @Date 2020/7/21 19:21
**/
private void auditActTitle(String title) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(title);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.error("活动标题审核失败,标题内容:",title);
throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode());
}
}
logger.info("活动标题审核通过");
}
/**
* @param formDTO
* @return com.epmet.dto.result.work.InProgressActResultDTO
@ -128,20 +495,69 @@ public class WorkActServiceImpl implements WorkActService {
return actInfoDao.selectFinishedList(formDTO.getCustomerId());
}
public static void main(String[] args) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date1=format.parse("2020-07-23 13:00:00");
Date yesterDate=format.parse("2020-07-22 13:00:00");
Date date2=format.parse("2020-07-23 13:00:00");
Date tommorrow=format.parse("2020-07-24 13:00:00");
System.out.println(new Date().compareTo(yesterDate));
System.out.println(date1.compareTo(tommorrow));
System.out.println(date1.compareTo(date2));
} catch (ParseException e) {
e.printStackTrace();
/**
* @param formDTO
* @return void
* @author yinzuomei
* @description 取消活动
* @Date 2020/7/26 17:26
**/
@Override
public void cancelAct(CancelActFormDTO formDTO) {
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId());
if(null==actInfoDTO){
logger.error("act_info is null");
return ;
}
//插入取消活动操作日志
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(formDTO.getActId());
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_CANCEL);
actOperationRecEntity.setNoticeUser(true);
actOperationRecEntity.setRemark(formDTO.getCancelReason());
actOperationRecDao.insert(actOperationRecEntity);
//更新活动标识,改为已取消
actInfoDTO.setCancelReason(formDTO.getCancelReason());
actInfoDTO.setCancelTime(actOperationRecEntity.getCreatedTime());
actInfoDTO.setActStatus(ActConstant.ACT_STATUS_CANCELED);
actInfoService.update(actInfoDTO);
//查询已经通过审核的用户,发送消息
List<String> userIdList=actUserRelationDao.selectUserIdList(formDTO.getActId(),ActConstant.ACT_USER_STATUS_PASSED);
if(null!=userIdList&&userIdList.size()>0){
List<UserMessageFormDTO> userMessageFormDTOS=new ArrayList<>();
for(String userId:userIdList){
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
userMessageFormDTO.setUserId(userId);
userMessageFormDTO.setGridId(StrConstant.STAR);
userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
userMessageFormDTO.setTitle(ActMessageConstant.TITLE);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED,
actInfoDTO.getTitle(),
formDTO.getCancelReason()));
userMessageFormDTOS.add(userMessageFormDTO);
}
Result sendMessageRes= epmetMessageOpenFeignClient.saveUserMessageList(userMessageFormDTOS);
if(sendMessageRes.success()){
logger.info("给审核通过的用户发送消息成功");
}
}
}
/**
* @param actId
* @return void
* @author yinzuomei
* @description 已取消-活动详情
* @Date 2020/7/26 18:00
**/
@Override
public CanceledActDetailResultDTO canceledDetail(String actId) {
CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId);
if(null!=canceledActDetailResultDTO){
canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId));
}
return canceledActDetailResultDTO;
}
}

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

@ -369,6 +369,10 @@ public class WorkActUserServiceImpl implements WorkActUserService {
if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){
logger.info("活动已经取消,无需处理");
return;
}
Date auditTime=new Date();
actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_PASSED);
actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL);
@ -408,6 +412,10 @@ public class WorkActUserServiceImpl implements WorkActUserService {
logger.error("查询活动为空actId="+actUserRelationEntity.getActId());
return;
}
if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){
logger.info("活动已经取消,无需处理");
return;
}
if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml

@ -17,5 +17,16 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 根据活动id查询活动详情 -->
<select id="selectByActId" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.ActPreviewContentResultDTO">
SELECT
ac.CONTENT,
ac.CONTENT_TYPE
FROM
act_content ac
WHERE
ac.DEL_FLAG = '0'
AND ac.ACT_ID = #{actId}
order by orderNum asc
</select>
</mapper>

26
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -577,4 +577,30 @@
AND aur.ACT_ID =#{actId}
order by aur.CANCEL_TIME desc
</select>
<!-- 工作端-查询已取消活动详情 -->
<select id="selectCanceledActInfo" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.CanceledActDetailResultDTO">
SELECT
ai.id AS actId,
ai.TITLE AS title,
ai.SIGN_UP_END_TIME AS signUpEndTime,
ai.ACT_START_TIME AS actStartTime,
ai.ACT_END_TIME AS actEndTime,
AI.ACT_ADDRESS AS actAddress,
ai.ACT_QUOTA AS actQuota,
ai.ACT_QUOTA_CATEGORY AS actQuotaCategory,
ai.SPONSOR_CONTACTS AS sponsorContacts,
ai.SPONSOR_TEL AS sponsorTel,
ai.REWARD AS reward,
ai.SPONSOR_NAME AS sponsorName,
ai.REQUIREMENT AS requirement,
ai.CANCEL_TIME AS cancelTime,
ai.CANCEL_REASON AS cancelReason
FROM
act_info ai
WHERE
ai.DEL_FLAG = '0'
and ai.id=#{actId}
and ai.ACT_STATUS='canceled'
</select>
</mapper>

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

@ -189,4 +189,43 @@
AND aur.PROCESS_FLAG != 'handled'
AND aur.ACT_ID = #{actId}
</select>
<!-- 积分发放-已发放列表-->
<select id="selectAgreedList" resultType="com.epmet.dto.result.work.ObtainedUserResultDTO" parameterType="java.lang.String">
SELECT
aur.id as actUserRelationId,
aur.USER_ID as userId,
aur.ACT_ID as actId,
"" as realName,
"" as nickName,
"" as headImgUrl
FROM
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
AND aur.PROCESS_FLAG = 'handled'
AND aur.REWARD_FLAG = 'agree'
AND aur.ACT_ID = #{actId}
order by aur.UPDATED_TIME desc
</select>
<!-- 积分发放-已拒绝列表 -->
<select id="selectDeniedList" resultType="com.epmet.dto.result.work.DeniedUserResultDTO" parameterType="java.lang.String">
SELECT
aur.id as actUserRelationId,
aur.USER_ID as userId,
aur.ACT_ID as actId,
aur.DENY_REWARD_REASON as denyRewardReason,
"" as realName,
"" as nickName,
"" as headImgUrl
FROM
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
AND aur.PROCESS_FLAG = 'handled'
AND aur.REWARD_FLAG = 'deny'
AND aur.ACT_ID = #{actId}
order by aur.UPDATED_TIME desc
</select>
</mapper>

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

@ -50,4 +50,9 @@
ORDER BY
lac.ORDER_NUM ASC
</select>
<!-- 根据活动id删除活动详情 物理删除 -->
<delete id="deleteByActId" parameterType="java.lang.String">
delete from latest_act_content lac where lac.ACT_ID=#{actId}
</delete>
</mapper>
Loading…
Cancel
Save