Browse Source

报名条件不必填,如果没有填写默认无

dev_shibei_match
yinzuomei 5 years ago
parent
commit
cf236e9ee5
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  4. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  5. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  6. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.2__updateactinfo.sql

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java

@ -75,4 +75,6 @@ public interface StrConstant {
String EPMETY_STR=""; String EPMETY_STR="";
String NULL_STR="null"; String NULL_STR="null";
String NOT_FILLED = "无";
} }

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -120,8 +120,7 @@ public class PublishActInfoFormDTO implements Serializable {
/** /**
* 报名条件 * 报名条件
*/ */
@NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) @Length(max=500,message = "报名条件限500字以内", groups = {AddUserShowGroup.class})
@Length(min=1, max=500,message = "报名条件限500字以内", groups = {AddUserShowGroup.class})
private String requirement; private String requirement;
/** /**

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -126,8 +126,7 @@ public class RePublishFormDTO implements Serializable {
/** /**
* 报名条件 * 报名条件
*/ */
@NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) @Length(max=500,message = "报名条件限500字以内", groups = {AddUserShowGroup.class})
@Length(min=1, max=500,message = "报名条件限500字以内", groups = {AddUserShowGroup.class})
private String requirement; private String requirement;
/** /**

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

@ -1,5 +1,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActContentDTO;
@ -182,7 +183,11 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setSignUpEndTime(signUpEndTime); latestActInfoDTO.setSignUpEndTime(signUpEndTime);
} }
//招募要求 //招募要求
if(StringUtils.isNotBlank(formDTO.getRequirement())){
latestActInfoDTO.setRequirement(formDTO.getRequirement()); latestActInfoDTO.setRequirement(formDTO.getRequirement());
}else{
latestActInfoDTO.setRequirement(StrConstant.NOT_FILLED);
}
//活动预计开始时间 //活动预计开始时间
if(StringUtils.isNotBlank(formDTO.getActStartTime())){ if(StringUtils.isNotBlank(formDTO.getActStartTime())){
Date actStartTime= DateUtils.minStrToSecondDate(formDTO.getActStartTime()); Date actStartTime= DateUtils.minStrToSecondDate(formDTO.getActStartTime());

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

@ -332,6 +332,9 @@ public class WorkActServiceImpl implements WorkActService {
}else{ }else{
actInfoEntity.setPid(StrConstant.EPMETY_STR); actInfoEntity.setPid(StrConstant.EPMETY_STR);
} }
if(StringUtils.isBlank(actInfoEntity.getRequirement())){
actInfoEntity.setRequirement(StrConstant.NOT_FILLED);
}
return actInfoEntity; return actInfoEntity;
} }
@ -375,6 +378,9 @@ public class WorkActServiceImpl implements WorkActService {
}else{ }else{
actInfoEntity.setPid(StrConstant.EPMETY_STR); actInfoEntity.setPid(StrConstant.EPMETY_STR);
} }
if(StringUtils.isBlank(actInfoEntity.getRequirement())){
actInfoEntity.setRequirement(StrConstant.NOT_FILLED);
}
return actInfoEntity; return actInfoEntity;
} }

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.2__updateactinfo.sql

@ -0,0 +1 @@
alter table act_info MODIFY column REQUIREMENT VARCHAR(512) DEFAULT '' COMMENT '招募要求';
Loading…
Cancel
Save