|
|
@ -20,8 +20,8 @@ package com.elink.esua.epdc.modules.events.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
@ -30,6 +30,9 @@ import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.EventIssueItemState; |
|
|
|
import com.elink.esua.epdc.constant.EventsNoticeConstant; |
|
|
|
import com.elink.esua.epdc.constant.ImageConstant; |
|
|
|
import com.elink.esua.epdc.constants.MenuCodeConstant; |
|
|
|
import com.elink.esua.epdc.dto.MenuNoticeDTO; |
|
|
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.events.*; |
|
|
|
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; |
|
|
@ -40,18 +43,18 @@ import com.elink.esua.epdc.modules.events.dao.EpdcEventsDao; |
|
|
|
import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; |
|
|
|
import com.elink.esua.epdc.modules.events.service.EpdcEventsService; |
|
|
|
import com.elink.esua.epdc.modules.events.service.ImgService; |
|
|
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.issue.entity.IssueEntity; |
|
|
|
import com.elink.esua.epdc.modules.issue.entity.IssueHandleEntity; |
|
|
|
import com.elink.esua.epdc.modules.issue.service.IssueHandleService; |
|
|
|
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|
|
|
import com.elink.esua.epdc.modules.item.service.ItemService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 事件表 事件表 |
|
|
@ -74,6 +77,12 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
@Autowired |
|
|
|
private NewsTask newsTask; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ItemService itemService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<EpdcEventsDTO> listOfPendingReviewEvents(Map<String, Object> params) { |
|
|
|
IPage<EpdcEventsDTO> page = getPage(params); |
|
|
@ -119,6 +128,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
|
|
|
|
// 保存图片
|
|
|
|
imgService.saveImages(dto.getImages(), entity.getId(), ImageConstant.TYPE_IMAGE_BIZ_EVENTS); |
|
|
|
|
|
|
|
// 发送菜单消息-议题待回应
|
|
|
|
this.sendMenuNoticeOfEventRespond(entity.getGridId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -179,10 +191,16 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
informationFormDTO.setBusinessId(issueEntity.getId()); |
|
|
|
informationFormDTO.setTitle(EventsNoticeConstant.NOTICE_EVENT_PASSED); |
|
|
|
informationFormDTO.setBusinessType(EventsNoticeConstant.NOTICE_BUSINESS_TYPE_ISSUE); |
|
|
|
|
|
|
|
// 发送菜单消息-议题待处理
|
|
|
|
issueService.sendIssueHandleMenuNotice(issueEntity.getGridId()); |
|
|
|
} |
|
|
|
|
|
|
|
// 发送消息
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
|
|
|
|
// 发送菜单消息-议题待回应
|
|
|
|
this.sendMenuNoticeOfEventRespond(eventsEntity.getGridId()); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
@ -223,6 +241,27 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
return new Result<EventAppDetailResultDTO>().ok(data); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void initMenuNotice() { |
|
|
|
Long deptId = SecurityUser.getDeptId(); |
|
|
|
// 获取部门信息
|
|
|
|
Result<SysDeptDTO> dtoResult = adminFeignClient.getSysDeptInfo(deptId); |
|
|
|
if (dtoResult.success()) { |
|
|
|
// 网格用户
|
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dtoResult.getData().getTypeKey())) { |
|
|
|
// 议题-待回应
|
|
|
|
this.sendMenuNoticeOfEventRespond(deptId); |
|
|
|
// 议题-待处理
|
|
|
|
issueService.sendIssueHandleMenuNotice(deptId); |
|
|
|
// 项目-待处理项目-网格用户
|
|
|
|
itemService.sendItemHandleMenuNotice(deptId); |
|
|
|
} else { |
|
|
|
// 项目-待处理项目-吹哨部门用户
|
|
|
|
itemService.sendWhistlingDeptItemHandleMenuNotice(Collections.singletonList(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 初始化议题 |
|
|
|
* @Params: [entity] |
|
|
@ -283,4 +322,24 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
public void updateOpposeNumSubtract(String eventId) { |
|
|
|
baseDao.updateOpposeNumSubtract(eventId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 菜单消息-议题待回应 |
|
|
|
* |
|
|
|
* @params [deptId] |
|
|
|
* @return void |
|
|
|
* @author liuchuang |
|
|
|
* @since 2019/10/29 18:05 |
|
|
|
*/ |
|
|
|
private void sendMenuNoticeOfEventRespond(Long deptId) { |
|
|
|
// 获取部门待审核事件数量
|
|
|
|
int num = baseDao.selectCountOfDeptNotice(deptId, EventIssueItemState.EVENT_PENDING_REVIEW); |
|
|
|
MenuNoticeDTO menuNoticeDTO = new MenuNoticeDTO(); |
|
|
|
menuNoticeDTO.setDeptId(deptId); |
|
|
|
menuNoticeDTO.setNum(num); |
|
|
|
menuNoticeDTO.setMenuCode(MenuCodeConstant.PARTY_GROUP_DISCUSSION_EVENT_RESPOND); |
|
|
|
// 发送菜单消息通知
|
|
|
|
newsTask.eventMenuNotice(menuNoticeDTO); |
|
|
|
} |
|
|
|
} |
|
|
|