Browse Source

回复内容最多输入500字

dev
yinzuomei 4 years ago
parent
commit
1acf472b3f
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 20
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java
  3. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.14__create_info_table.sql

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

@ -107,6 +107,7 @@ public enum EpmetErrorCode {
REPLY_INFO_CONTENT_NOT_NULL(8610,"回复内容不能为空"),
PLEASE_CHOOSE_MEMBER(8611,"请选择成员"),
INFO_GROUP_NAME_EXISTS(8612,"名称已存在"),
INFO_REPLY_CONTENT_LENGTH_LIMIT(8613,"回复内容最多输入500字"),
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),

20
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java

@ -17,12 +17,12 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
@ -99,7 +99,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
Set<String> orgStaffIds=queryOrgStaffIds(formDTO.getCustomerId(),formDTO.getOrgList());
Set<String> roleStaffIds=queryRoleStaffIds(formDTO.getRoleIdList(),formDTO.getCustomerId());
Set<String> groupStaffIds = CollectionUtils.isNotEmpty(formDTO.getGroupIdList()) ? infoGroupReceiversDao.selectStaffIds(formDTO.getGroupIdList()) : Collections.EMPTY_SET;
log.info("群组选择的人:"+JSON.toJSONString(groupStaffIds,true));
//log.info("群组选择的人:"+JSON.toJSONString(groupStaffIds,true));
//3、计算接收人:
Set<String> totalReceiver=new LinkedHashSet<String>();
@ -222,10 +222,14 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
@Override
public ReplyInfoResultDTO replyInfo(ReplyInfoFormDTO formDTO) {
//1、插入回复记录、回复附件
//内容和附件 2选一
// 2、内容和附件 2选一
if(StringUtils.isBlank(formDTO.getContent())&&CollectionUtils.isEmpty(formDTO.getAttachmentList())){
throw new RenException(EpmetErrorCode.REPLY_INFO_CONTENT_NOT_NULL.getCode(), EpmetErrorCode.REPLY_INFO_CONTENT_NOT_NULL.getMsg());
}
// 3、回复内容不能超过500字
if(StringUtils.isNotBlank(formDTO.getContent())&&formDTO.getContent().length()>500){
throw new RenException(EpmetErrorCode.INFO_REPLY_CONTENT_LENGTH_LIMIT.getCode(), EpmetErrorCode.INFO_REPLY_CONTENT_LENGTH_LIMIT.getMsg());
}
InfoReplyEntity infoReplyEntity=new InfoReplyEntity();
infoReplyEntity.setInfoId(formDTO.getInfoId());
infoReplyEntity.setCustomerId(formDTO.getCustomerId());
@ -353,11 +357,11 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
OrgStaffFormDTO orgStaffFormDTO=new OrgStaffFormDTO();
orgStaffFormDTO.setCustomerId(customerId);
for(OrgCommonDTO org:orgList){
if("grid".equals(org.getOrgType())){
if(OrgTypeEnum.GRID.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getGridIds().add(org.getOrgId());
}else if("agency".equals(org.getOrgType())){
}else if(OrgTypeEnum.AGENCY.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getAgencyIds().add(org.getOrgId());
}else if("dept".equals(org.getOrgType())){
}else if(OrgTypeEnum.DEPT.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getDeptIds().add(org.getOrgId());
}
}
@ -366,7 +370,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
throw new RenException("根据组织查询工作人员异常");
}
if(CollectionUtils.isEmpty(result.getData())){
log.info("已选择的架构里没有工作人员");
log.warn("已选择的架构里没有工作人员");
return Collections.EMPTY_SET;
}
return result.getData();
@ -393,7 +397,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
throw new RenException("根据角色查询工作人员异常");
}
if(CollectionUtils.isEmpty(result.getData())){
log.info("角色下没有工作人员");
log.warn("角色下没有工作人员");
return Collections.EMPTY_SET;
}
return result.getData();

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.14__create_info_table.sql

@ -127,7 +127,7 @@ CREATE TABLE `info_reply_content` (
`ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名',
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)',
`REPLY_TYPE` varchar(64) NOT NULL COMMENT '回复的类型(文本-text、图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`CONTENT` varchar(255) NOT NULL COMMENT '如果是文本对应的是文字,如果是其他类型,对应的是url',
`CONTENT` varchar(512) NOT NULL COMMENT '如果是文本对应的是文字,如果是其他类型,对应的是url',
`SORT` int(1) NOT NULL COMMENT '排序字段',
`ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b',
`DURATION` int(11) unsigned DEFAULT '0' COMMENT '语音或视频时长,秒',

Loading…
Cancel
Save