...
This commit is contained in:
parent
b5498b1a80
commit
aa27a8ad5a
|
@ -3,6 +3,7 @@ package io.renren.common.aspect;
|
||||||
|
|
||||||
import io.renren.common.annotation.ActivitiNoticeOperation;
|
import io.renren.common.annotation.ActivitiNoticeOperation;
|
||||||
import io.renren.modules.notice.dto.SysNoticeDTO;
|
import io.renren.modules.notice.dto.SysNoticeDTO;
|
||||||
|
import io.renren.modules.notice.enums.NoticeStatusEnum;
|
||||||
import io.renren.modules.notice.service.SysNoticeService;
|
import io.renren.modules.notice.service.SysNoticeService;
|
||||||
import io.renren.modules.sys.service.SysUserService;
|
import io.renren.modules.sys.service.SysUserService;
|
||||||
import org.activiti.engine.delegate.DelegateTask;
|
import org.activiti.engine.delegate.DelegateTask;
|
||||||
|
@ -82,10 +83,10 @@ public class ActivitiNoticeAspect {
|
||||||
dto.setContent("您发起的流程当前审核节点为:" + activitiNoticeOperation.value() + "<br>当前审核人为" + sysUserService.get(Long.valueOf(delegateTask.getAssignee())).getRealName()); // 通知内容
|
dto.setContent("您发起的流程当前审核节点为:" + activitiNoticeOperation.value() + "<br>当前审核人为" + sysUserService.get(Long.valueOf(delegateTask.getAssignee())).getRealName()); // 通知内容
|
||||||
dto.setReceiverType(1);
|
dto.setReceiverType(1);
|
||||||
dto.setReceiverTypeIds(creator);
|
dto.setReceiverTypeIds(creator);
|
||||||
dto.setStatus(1);
|
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||||
dto.setSenderName("流程系统");
|
dto.setSenderName("流程系统");
|
||||||
dto.setSenderDate(new Date());
|
dto.setSenderDate(new Date());
|
||||||
dto.setCreator(null);
|
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||||
dto.setCreateDate(new Date());
|
dto.setCreateDate(new Date());
|
||||||
sysNoticeService.save(dto);
|
sysNoticeService.save(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -16,6 +16,7 @@ import io.renren.modules.notice.enums.ReceiverTypeEnum;
|
||||||
import io.renren.modules.notice.service.SysNoticeService;
|
import io.renren.modules.notice.service.SysNoticeService;
|
||||||
import io.renren.modules.notice.service.SysNoticeUserService;
|
import io.renren.modules.notice.service.SysNoticeUserService;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
|
import io.renren.modules.sys.dto.SysUserDTO;
|
||||||
import io.renren.modules.sys.service.SysUserService;
|
import io.renren.modules.sys.service.SysUserService;
|
||||||
import io.renren.websocket.WebSocketServer;
|
import io.renren.websocket.WebSocketServer;
|
||||||
import io.renren.websocket.data.MessageData;
|
import io.renren.websocket.data.MessageData;
|
||||||
|
@ -24,13 +25,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知管理
|
* 通知管理
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNoticeEntity, SysNoticeDTO> implements SysNoticeService {
|
public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNoticeEntity, SysNoticeDTO> implements SysNoticeService {
|
||||||
|
@ -128,7 +129,15 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
||||||
webSocketServer.sendMessageAll(message);
|
webSocketServer.sendMessageAll(message);
|
||||||
|
|
||||||
} else { //选中用户
|
} else { //选中用户
|
||||||
List<Long> userIdList = sysUserService.getUserIdListByDeptId(notice.getReceiverTypeList());
|
List<Long> userIdList = new ArrayList<>();
|
||||||
|
SysUserDTO sysUserDTO =
|
||||||
|
sysUserService.get(Long.valueOf(notice.getReceiverTypeIds())); // 尝试直接查人员
|
||||||
|
if (sysUserDTO != null) {
|
||||||
|
userIdList.add(sysUserDTO.getId());
|
||||||
|
} else {
|
||||||
|
userIdList = sysUserService.getUserIdListByDeptId(notice.getReceiverTypeList());
|
||||||
|
}
|
||||||
|
|
||||||
if (userIdList.size() == 0) {
|
if (userIdList.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue