Browse Source

创建文章提示调整

dev
= 5 years ago
parent
commit
e572285a15
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 6
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java
  4. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java
  5. 91
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  6. 35
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java

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

@ -43,4 +43,9 @@ public interface StrConstant {
* 冒号 * 冒号
*/ */
String COLON = ":"; String COLON = ":";
/**
* 中文顿号
*/
String COMMA_ZH = "、";
} }

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

@ -67,6 +67,8 @@ public enum EpmetErrorCode {
OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"), OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"),
OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"), OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),
ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"),
CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"); CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常");

6
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java

@ -20,6 +20,7 @@ package com.epmet.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
@ -34,7 +35,6 @@ import java.util.List;
@Data @Data
public class DraftAttrFromDTO implements Serializable { public class DraftAttrFromDTO implements Serializable {
private static final long serialVersionUID = 6463906402283515172L; private static final long serialVersionUID = 6463906402283515172L;
/** /**
* 草稿ID * 草稿ID
@ -61,11 +61,13 @@ public class DraftAttrFromDTO implements Serializable {
/** /**
* 网格Id数组 * 网格Id数组
*/ */
@NotEmpty(message = "发布范围不能为空")
private List<String> gridIdList; private List<String> gridIdList;
/** /**
* 发布单位Id 类型不同 id含义不同 * 发布单位Id 类型不同 id含义不同
*/ */
@NotBlank(message = "发布单位不能为空")
private String publisher; private String publisher;
/** /**
@ -76,7 +78,7 @@ public class DraftAttrFromDTO implements Serializable {
/** /**
* 发布日期 * 发布日期
*/ */
@NotBlank(message = "发布日期不能为空") @NotBlank(message = "发布时间不能为空")
private String publishDate; private String publishDate;
/** /**

4
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java

@ -44,13 +44,13 @@ public class DraftContentFromDTO implements Serializable {
/** /**
* 文章标题 * 文章标题
*/ */
@NotBlank(message = "文章标题不能为空") @NotBlank(message = "请输入标题")
private String title; private String title;
/** /**
* 内容列表 * 内容列表
*/ */
@NotEmpty(message = "文章内容不能为空") @NotEmpty(message = "至少添加一个段落")
private List<DraftContentDTO> contentList; private List<DraftContentDTO> contentList;
@Data @Data

91
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -56,6 +56,7 @@ import com.epmet.service.*;
import com.epmet.utils.ModuleConstant; import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sun.javafx.binding.StringConstant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jsoup.helper.StringUtil; import org.jsoup.helper.StringUtil;
@ -67,6 +68,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.swing.text.StringContent;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -173,12 +175,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO)); log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO));
if (required) { if (required) {
ValidatorUtils.validateEntity(fromDTO); ValidatorUtils.validateEntity(fromDTO);
if (StringUtils.isBlank(fromDTO.getTitle())){
throw new RenException(ModuleConstant.ARTICLE_TITLE_IS_NULL);
}
if (CollectionUtils.isEmpty(fromDTO.getContentList())){
throw new RenException(ModuleConstant.ARTICLE_CONTENT_IS_NULL);
}
} }
DraftEntity draftEntity = null; DraftEntity draftEntity = null;
@ -196,7 +192,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
Result<LoginUserDetailsResultDTO> loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO); Result<LoginUserDetailsResultDTO> loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO);
if (loginUserDetails == null || loginUserDetails.getData() == null) { if (loginUserDetails == null || loginUserDetails.getData() == null) {
log.warn("saveOrUpdateContent getloginUserDetails return null"); log.warn("saveOrUpdateContent getloginUserDetails return null");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), ModuleConstant.GET_USER_DETAIL_ERROR);
} }
draftEntity = new DraftEntity(); draftEntity = new DraftEntity();
draftEntity.setTitle(fromDTO.getTitle()); draftEntity.setTitle(fromDTO.getTitle());
@ -287,23 +283,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftEntity.setIsTop(fromDTO.getIsTop()); draftEntity.setIsTop(fromDTO.getIsTop());
//发布单位 //发布单位
if (StringUtils.isNotBlank(fromDTO.getPublisher())){
String publisherType = fromDTO.getPublisherType();
String publisherName = fromDTO.getPublisherName();
if (StringUtils.isBlank(publisherType) || StringUtils.isBlank(publisherName)) {
log.warn("saveDraftAttr publisher info is illegal,publisher:{},publisherType:{},publisherName:{}",fromDTO.getPublisher(),publisherType,publisherName);
throw new RenException("发布单位不能为空");
}
}
draftEntity.setPublisherName(fromDTO.getPublisherName()); draftEntity.setPublisherName(fromDTO.getPublisherName());
draftEntity.setPublisherId(fromDTO.getPublisher()); draftEntity.setPublisherId(fromDTO.getPublisher());
draftEntity.setPublisherType(fromDTO.getPublisherType()); draftEntity.setPublisherType(fromDTO.getPublisherType());
//TODO ? 如果为机关 不设置?
if(DraftConstant.GRID.equals(fromDTO.getPublisherType())) { if(DraftConstant.GRID.equals(fromDTO.getPublisherType())) {
draftEntity.setGridId(fromDTO.getPublisher()); draftEntity.setGridId(fromDTO.getPublisher());
} }
if (StringUtils.isNotBlank(fromDTO.getPublishDate())){
draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN)); draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN));
}
//封面 //封面
DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO); DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO);
@ -319,16 +310,16 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
DraftEntity draftEntity = draftDao.selectById(draftId); DraftEntity draftEntity = draftDao.selectById(draftId);
if (draftEntity == null) { if (draftEntity == null) {
log.warn("saveDraftAttr draftId:{} is not exist in db",draftId); log.warn("saveDraftAttr draftId:{} is not exist in db",draftId);
throw new RenException("参数错误"); throw new RenException(ModuleConstant.DRAFT_ID_IS_NOT_EXIST);
} }
if (NumConstant.ONE_STR.equals(draftEntity.getDelFlag())) { if (NumConstant.ONE_STR.equals(draftEntity.getDelFlag())) {
log.warn("saveDraftAttr draftId:{} have deleted",draftId); log.warn("saveDraftAttr draftId:{} have deleted",draftId);
throw new RenException("草稿已删除"); throw new RenException(ModuleConstant.DRAFT_STATUS_IS_DEL);
} }
//只有为发布的才能保存修改 //只有未发布的和审核失败的才能修改
if (DraftConstant.AUDITING.equals(draftEntity.getStatusFlag()) || DraftConstant.PUBLISHED.equals(draftEntity.getStatusFlag())) { if (DraftConstant.AUDITING.equals(draftEntity.getStatusFlag()) || DraftConstant.PUBLISHED.equals(draftEntity.getStatusFlag())) {
log.warn("saveDraftAttr draftId:{} publishStatus have published",draftId); log.warn("saveDraftAttr draftId:{} publishStatus have published",draftId);
throw new RenException("草稿发布状态错误"); throw new RenException(ModuleConstant.DRAFT_STATUS_IS_NOT_ALLOW_MODIFY);
} }
return draftEntity; return draftEntity;
} }
@ -336,23 +327,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Override @Override
public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) {
//校验参数 //校验参数
ValidatorUtils.validateEntity(fromDTO);
if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) { if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) {
log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank"); log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank");
throw new RenException("文章封面不能为空"); throw new RenException(ModuleConstant.DRAFT_CONTENT_IS_NULL);
} }
if (CollectionUtils.isEmpty(fromDTO.getGridIdList())) { if (StringUtils.isBlank(fromDTO.getPublisherName()) || StringUtils.isBlank(fromDTO.getPublisherType())) {
log.warn("saveOrUpdateAttr gridIdList is empty"); throw new RenException(ModuleConstant.DRAFT_PUBLISHER_IS_NULL);
throw new RenException("发布范围不能为空");
} }
if (fromDTO.getIsTop() == null || fromDTO.getIsTop() > 1 || fromDTO.getIsTop() < 0) {
if (StringUtils.isBlank(fromDTO.getPublisher())) { throw new RenException(ModuleConstant.DRAFT_IS_TOP_ERROR);
log.warn("saveOrUpdateAttr publisher is blank");
throw new RenException("发布单位不能为空");
} }
if (StringUtils.isBlank(fromDTO.getPublishDate())) { if ( fromDTO.getPublisherType() != DraftConstant.AGENCY && fromDTO.getPublisherType() != DraftConstant.DEPARTMENT
log.warn("saveOrUpdateAttr publishDate is blank"); &&fromDTO.getPublisherType() != DraftConstant.GRID) {
throw new RenException("发布时间不能为空"); throw new RenException(ModuleConstant.DRAFT_PUBLISHER_TYPE_ERROR);
} }
return saveDraftAttr(tokenDto, fromDTO); return saveDraftAttr(tokenDto, fromDTO);
} }
@ -361,7 +350,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
public Boolean publish(TokenDto tokenDto, String draftId) { public Boolean publish(TokenDto tokenDto, String draftId) {
if (StringUtils.isBlank(draftId)){ if (StringUtils.isBlank(draftId)){
log.warn("publish param error draftId is blank"); log.warn("publish param error draftId is blank");
throw new RenException("草稿Id不能为空"); throw new RenException(ModuleConstant.DRAFT_ID_IS_NULL);
} }
DraftEntity draftEntity = checkDraftStatus(draftId); DraftEntity draftEntity = checkDraftStatus(draftId);
draftEntity.setStatusFlag(DraftConstant.AUDITING); draftEntity.setStatusFlag(DraftConstant.AUDITING);
@ -395,11 +384,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto); ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto);
if (articleGridResultDTO == null) { if (articleGridResultDTO == null) {
log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId());
throw new RenException("参数错误"); throw new RenException(ModuleConstant.GET_USER_CAN_SELECT_GRID_ERROR);
} }
buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO);
buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO);
draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList,"、")); draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList, StrConstant.COMMA_ZH));
return publishRangeEntityList; return publishRangeEntityList;
} }
@ -436,7 +425,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) { if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) {
gridList.forEach(grid -> { gridList.forEach(grid -> {
if (gridIdList.contains(grid.getGridId())) { if (gridIdList.contains(grid.getGridId())) {
String agencyGridName = articleGridResultDTO.getAgencyName().concat("-").concat(grid.getGridName()); String agencyGridName = articleGridResultDTO.getAgencyName().concat(StrConstant.HYPHEN).concat(grid.getGridName());
agencyGridNameList.add(agencyGridName); agencyGridNameList.add(agencyGridName);
DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity(); DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity();
draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId()); draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId());
@ -471,19 +460,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
List<DraftContentEntity> newContentList = new ArrayList<>(); List<DraftContentEntity> newContentList = new ArrayList<>();
for (int i = 0; i < contentList.size(); i++) { for (int i = NumConstant.ZERO; i < contentList.size(); i++) {
DraftContentFromDTO.DraftContentDTO content = contentList.get(i); DraftContentFromDTO.DraftContentDTO content = contentList.get(i);
DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class);
entity.setId(content.getDraftContentId()); entity.setId(content.getDraftContentId());
entity.setCustomerId(tokenDto.getCustomerId()); entity.setCustomerId(tokenDto.getCustomerId());
entity.setDraftId(fromDTO.getDraftId()); entity.setDraftId(fromDTO.getDraftId());
entity.setOrderNum(i + 1); entity.setOrderNum(i + NumConstant.ONE);
//默认通过 //默认为空
entity.setAuditStatus(""); entity.setAuditStatus("");
newContentList.add(entity); newContentList.add(entity);
} }
return newContentList; return newContentList;
} }
@ -543,16 +530,16 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
ArticleEntity entity = new ArticleEntity(); ArticleEntity entity = new ArticleEntity();
entity.setId(formDTO.getArticleId()); entity.setId(formDTO.getArticleId());
StringBuffer publishRangeDesc = new StringBuffer(); StringBuffer publishRangeDesc = new StringBuffer();
if (null == publishedList || publishedList.size() < NumConstant.ONE) { if (CollectionUtils.isEmpty(publishedList)) {
entity.setStatusFlag(ArticleConstant.OFFLINE); entity.setStatusFlag(ArticleConstant.OFFLINE);
entity.setOffLineTime(date); entity.setOffLineTime(date);
rangeEntityList.forEach(range -> { rangeEntityList.forEach(range -> {
publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : "");
publishRangeDesc.append(range.getAgencyGridName()); publishRangeDesc.append(range.getAgencyGridName());
}); });
} else { } else {
publishedList.forEach(pub -> { publishedList.forEach(pub -> {
publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : "");
publishRangeDesc.append(pub.getAgencyGridName()); publishRangeDesc.append(pub.getAgencyGridName());
}); });
} }
@ -566,7 +553,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity();
recordEntity.setCustomerId(articleEntity.getCustomerId()); recordEntity.setCustomerId(articleEntity.getCustomerId());
recordEntity.setArticleId(formDTO.getArticleId()); recordEntity.setArticleId(formDTO.getArticleId());
recordEntity.setOpUser(articleEntity.getPublisherName() + "-" + staffDTO.getRealName()); recordEntity.setOpUser(articleEntity.getPublisherName() + StrConstant.HYPHEN + staffDTO.getRealName());
//下线文案,分为全部下线和部分下线 //下线文案,分为全部下线和部分下线
String content = ""; String content = "";
if (null == publishedList || publishedList.size() < NumConstant.ONE) { if (null == publishedList || publishedList.size() < NumConstant.ONE) {
@ -574,7 +561,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} else { } else {
StringBuffer offLineRangeDesc = new StringBuffer(); StringBuffer offLineRangeDesc = new StringBuffer();
offLineList.forEach(off -> { offLineList.forEach(off -> {
offLineRangeDesc.append(offLineRangeDesc.length() > NumConstant.ZERO ? "、" : ""); offLineRangeDesc.append(offLineRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : "");
offLineRangeDesc.append(off.getAgencyGridName()); offLineRangeDesc.append(off.getAgencyGridName());
}); });
content = String.format(ArticleConstant.OFF_LINE_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle(), offLineRangeDesc); content = String.format(ArticleConstant.OFF_LINE_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle(), offLineRangeDesc);
@ -721,9 +708,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
//当前网格的所有机关id //当前网格的所有机关id
String gridPids = range.getPids() + ":" + range.getAgencyId(); String gridPids = range.getPids() + ":" + range.getAgencyId();
//当前网格的所有机关名称 //当前网格的所有机关名称
String gridAgencyNames = range.getAllParentName() + "-" + range.getAgencyGridName().substring(NumConstant.ZERO, range.getAgencyGridName().lastIndexOf("-")); String gridAgencyNames = range.getAllParentName() + StrConstant.HYPHEN + range.getAgencyGridName().substring(NumConstant.ZERO, range.getAgencyGridName().lastIndexOf(StrConstant.HYPHEN));
String[] pids = gridPids.split(":"); String[] pids = gridPids.split(":");
String[] names = gridAgencyNames.split("-"); String[] names = gridAgencyNames.split(StrConstant.HYPHEN);
//倒序遍历 //倒序遍历
for (int i = (pids.length - NumConstant.ONE); i >= NumConstant.ZERO; i--) { for (int i = (pids.length - NumConstant.ONE); i >= NumConstant.ZERO; i--) {
//遍历到当前人员所属组织的上一级组织时停止遍历 //遍历到当前人员所属组织的上一级组织时停止遍历
@ -742,7 +729,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
List<AgencyGridListResultDTO> gridList = new ArrayList<>(); List<AgencyGridListResultDTO> gridList = new ArrayList<>();
AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO();
gridDto.setGridId(range.getGridId()); gridDto.setGridId(range.getGridId());
gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf(StrConstant.HYPHEN) + NumConstant.ONE));
gridList.add(gridDto); gridList.add(gridDto);
dto.setGridList(gridList); dto.setGridList(gridList);
} }
@ -753,7 +740,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
List<AgencyGridListResultDTO> gridList = dto1.getGridList(); List<AgencyGridListResultDTO> gridList = dto1.getGridList();
AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO();
gridDto.setGridId(range.getGridId()); gridDto.setGridId(range.getGridId());
gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf(StrConstant.HYPHEN) + NumConstant.ONE));
gridList.add(gridDto); gridList.add(gridDto);
dto1.setGridList(gridList); dto1.setGridList(gridList);
map.put(pids[i], dto1); map.put(pids[i], dto1);
@ -1099,11 +1086,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (coverFail || contentFail){ if (coverFail || contentFail){
String auditMsg = ""; String auditMsg = "";
if (coverFail&&contentFail){ if (coverFail&&contentFail){
auditMsg = "内容和封面"; auditMsg = ModuleConstant.DRAFT_CONTENT_AND_COVER;
}else if (contentFail){ }else if (contentFail){
auditMsg = "内容"; auditMsg = ModuleConstant.DRAFT_CONTENT;
}else if (coverFail){ }else if (coverFail){
auditMsg = "封面"; auditMsg = ModuleConstant.DRAFT_COVER;;
} }
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(),auditMsg)); this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(),auditMsg));
} }

35
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -90,13 +90,40 @@ public interface ModuleConstant {
String MSG_ARTICLE_PUBLISH_ERROR = "您好,你发布的【%s】文章由于网络错误未发布成功,请重新发布,谢谢。"; String MSG_ARTICLE_PUBLISH_ERROR = "您好,你发布的【%s】文章由于网络错误未发布成功,请重新发布,谢谢。";
/** /**
* 文章内容不能为空 * 草稿Id不存在
* */ * */
String ARTICLE_CONTENT_IS_NULL = "文章内容不能为空"; String DRAFT_ID_IS_NOT_EXIST = "草稿ID不存在";
/** /**
* 文章标题不能为空 * 草稿已删除
* */ * */
String ARTICLE_TITLE_IS_NULL = "文章标题不能为空"; String DRAFT_STATUS_IS_DEL = "草稿已删除";
String GET_USER_DETAIL_ERROR = "获取用户详情失败";
String GET_USER_CAN_SELECT_GRID_ERROR = "获取用户可选网格失败";
String DRAFT_STATUS_IS_NOT_ALLOW_MODIFY = "草稿状态不允许修改";
String DRAFT_PUBLISHER_IS_NULL = "发布单位不能为空";
String DRAFT_PUBLISHER_TYPE_ERROR = "发布单位类型不合法";
String DRAFT_PUBLISH_RANGE_IS_NULL = "发布范围不能为空";
String DRAFT_PUBLISH_DATE_IS_NULL = "发布时间不能为空";
String DRAFT_ID_IS_NULL = "草稿ID不能为空";
String DRAFT_CONTENT_AND_COVER = "内容和封面";
String DRAFT_CONTENT = "内容";
String DRAFT_COVER = "封面";
String DRAFT_CONTENT_IS_NULL = "文章封面不能为空";
String DRAFT_IS_TOP_ERROR = "是否置顶参数不合法";
} }

Loading…
Cancel
Save