Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_temp

master
yinzuomei 5 years ago
parent
commit
7743947efa
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 3
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInFormDTO.java
  3. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  4. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java
  5. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

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

@ -177,7 +177,9 @@ public enum EpmetErrorCode {
GROUP_ACT_CAN_NOT_COMMENT(8910,"当前活动,不能评论"),
SIGN_IN_TIME_NOT_START(8911,"未到签到时间,不允许签到"),
SIGN_IN_TIME_PASSED(8912,"当前时间已超过签到时间"),
INVITATION_NOT_EXIST(8913,"链接不存在");
INVITATION_NOT_EXIST(8913,"链接不存在"),
NOTICE_EXPIRATION_TIME(8914,"通知过期时间不能早于当前时间"),
NOTICE_BE_OVERDUE(8915,"通知已过期不允许再次变更");
private int code;

3
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@ -30,11 +31,13 @@ public class SignInFormDTO implements Serializable {
/**
* 签到地点-经度
*/
@NotNull(message ="经度不能为空",groups = AddUserInternalGroup.class)
private BigDecimal longitude;
/**
* 签到地点-纬度
*/
@NotNull(message ="纬度不能为空",groups = AddUserInternalGroup.class)
private BigDecimal latitude;
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)

7
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java

@ -75,10 +75,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -808,6 +805,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
ActSummaryFormDTO actSummaryFormDTO=new ActSummaryFormDTO();
actSummaryFormDTO.setUserId(formDTO.getUserId());
actSummaryFormDTO.setGroupActId(formDTO.getGroupActId());
actSummaryFormDTO.setImgList(new ArrayList<>());
actSummaryFormDTO.setTextList(new ArrayList<>());
actSummaryService.submitActSummary(actSummaryFormDTO);
}
//4、插入操作日志

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java

@ -18,6 +18,7 @@
package com.epmet.modules.notice.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -63,7 +64,7 @@ public class NoticeController {
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class);
if(formDTO.getExpirationTime().before(new Date())){
throw new RenException("通知过期时间不能早于当前时间");
throw new RenException(EpmetErrorCode.NOTICE_EXPIRATION_TIME.getCode());
}
formDTO.setUserId(tokenDto.getUserId());
noticeService.add(formDTO);

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -295,10 +295,12 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
}
//通知已过期时不允许再次变更
if(entity.getChangeTime().before(new Date())){
throw new RenException("通知已过期不允许再次变更");
throw new RenException(EpmetErrorCode.NOTICE_BE_OVERDUE.getCode());
}
//通知过期时间不能早于当前时间
if(formDTO.getExpirationTime().before(new Date())){
throw new RenException("通知过期时间不能早于当前时间");
throw new RenException(EpmetErrorCode.NOTICE_EXPIRATION_TIME.getCode());
}
//2.文字、图片安全校验

Loading…
Cancel
Save