|
|
@ -29,6 +29,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.comment.EventCommentDTO; |
|
|
|
import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; |
|
|
|
import com.elink.esua.epdc.dto.constant.GroupConstant; |
|
|
|
import com.elink.esua.epdc.dto.constant.GroupNoticeConstant; |
|
|
|
import com.elink.esua.epdc.dto.constant.TopicImageConstant; |
|
|
|
import com.elink.esua.epdc.dto.enums.GroupStateEnum; |
|
|
@ -123,11 +124,11 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<TopicDTO> list(Map<String, Object> params) { |
|
|
|
return baseDao.selectListTopic(params); |
|
|
|
return baseDao.selectListTopic(params); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<TopicEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
private QueryWrapper<TopicEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<TopicEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
@ -145,6 +146,7 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(TopicDTO dto) { |
|
|
|
TopicEntity entity = ConvertUtils.sourceToTarget(dto, TopicEntity.class); |
|
|
|
entity.setGroupCategory(GroupConstant.PROPERTY_GROUP_CATEGORY); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
@ -171,13 +173,14 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result saveTopic(TopicSubmitFormDTO formDto) { |
|
|
|
TopicEntity entity = ConvertUtils.sourceToTarget(formDto, TopicEntity.class); |
|
|
|
entity.setGroupCategory(GroupConstant.PROPERTY_GROUP_CATEGORY); |
|
|
|
if (insert(entity)) { |
|
|
|
// 保存图片
|
|
|
|
topicImgService.saveImages(formDto.getImages(), entity.getId(), TopicImageConstant.TYPE_IMAGE_BIZ_TOPIC); |
|
|
|
// 记录社群用户未读记录
|
|
|
|
List<GroupUserListResultDTO> groupUsers = userGroupService.listOfUserGroup(formDto.getGroupId(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); |
|
|
|
List<GroupTopicUserReadEntity> readEntities = new ArrayList<>(groupUsers.size()); |
|
|
|
for (GroupUserListResultDTO userDto: |
|
|
|
for (GroupUserListResultDTO userDto : |
|
|
|
groupUsers) { |
|
|
|
if (!formDto.getUserId().equals(userDto.getUserId())) { |
|
|
|
GroupTopicUserReadEntity readEntity = new GroupTopicUserReadEntity(); |
|
|
@ -258,7 +261,7 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
informationFormDTO.setBusinessId(topicDto.getId()); |
|
|
|
informationFormDTO.setUserId(topicDto.getUserId()); |
|
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_TOPIC_CLOSED); |
|
|
|
informationFormDTO.setRelBusinessContent("关闭原因:"+formDto.getProcessingOpinions()); |
|
|
|
informationFormDTO.setRelBusinessContent("关闭原因:" + formDto.getProcessingOpinions()); |
|
|
|
|
|
|
|
// 发送通知
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
@ -386,7 +389,7 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
noticeList.add(lordNotice); |
|
|
|
topicAuditRecordService.insert(auditRecordEntity); |
|
|
|
// 发送消息
|
|
|
|
for (EpdcInformationFormDTO information: |
|
|
|
for (EpdcInformationFormDTO information : |
|
|
|
noticeList) { |
|
|
|
newsTask.insertUserInformation(information); |
|
|
|
} |
|
|
@ -400,11 +403,10 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 话题转议题校验 |
|
|
|
* |
|
|
|
* @params [topicDto, userId] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @params [topicDto, userId] |
|
|
|
* @author liuchuang |
|
|
|
* @since 2019/11/8 11:16 |
|
|
|
*/ |
|
|
@ -433,11 +435,10 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 拷贝评论、评论的支持反对到事件 |
|
|
|
* |
|
|
|
* @params [formDto] |
|
|
|
* @return void |
|
|
|
* @params [formDto] |
|
|
|
* @author liuchuang |
|
|
|
* @since 2019/11/13 11:18 |
|
|
|
*/ |
|
|
@ -454,11 +455,10 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 发送消息 |
|
|
|
* |
|
|
|
* @params [issueId, userId] |
|
|
|
* @return void |
|
|
|
* @params [issueId, userId] |
|
|
|
* @author liuchuang |
|
|
|
* @since 2019/11/26 15:04 |
|
|
|
*/ |
|
|
@ -491,17 +491,16 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 组织机构信息处理 |
|
|
|
* |
|
|
|
* @params [dto, topicList] |
|
|
|
* @return java.util.List<com.elink.esua.epdc.modules.topic.entity.TopicEntity> |
|
|
|
* @params [dto, topicList] |
|
|
|
* @author liuchuang |
|
|
|
* @since 2020/3/7 2:14 |
|
|
|
*/ |
|
|
|
private List<TopicEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<TopicDTO> topicList) { |
|
|
|
List<TopicEntity> entities = new ArrayList<>(); |
|
|
|
for (TopicDTO topic: topicList) { |
|
|
|
for (TopicDTO topic : topicList) { |
|
|
|
TopicEntity entity = new TopicEntity(); |
|
|
|
if (StringUtils.isNotEmpty(topic.getParentDeptIds()) && StringUtils.isNotEmpty(topic.getParentDeptNames())) { |
|
|
|
List<String> parentDeptIds = Arrays.asList(topic.getParentDeptIds().split(",")); |
|
|
|