Java Code Examples for org.jeecg.modules.system.entity.SysAnnouncementSend#setReadTime()

The following examples show how to use org.jeecg.modules.system.entity.SysAnnouncementSend#setReadTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysAnnouncementServiceImpl.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
@Transactional
@Override
public void saveAnnouncement(SysAnnouncement sysAnnouncement) {
	if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
		sysAnnouncementMapper.insert(sysAnnouncement);
	}else {
		// 1.插入通告表记录
		sysAnnouncementMapper.insert(sysAnnouncement);
		// 2.插入用户通告阅读标记表记录
		String userId = sysAnnouncement.getUserIds();
		String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
		String anntId = sysAnnouncement.getId();
		Date refDate = new Date();
		for(int i=0;i<userIds.length;i++) {
			SysAnnouncementSend announcementSend = new SysAnnouncementSend();
			announcementSend.setAnntId(anntId);
			announcementSend.setUserId(userIds[i]);
			announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
			announcementSend.setReadTime(refDate);
			sysAnnouncementSendMapper.insert(announcementSend);
		}
	}
}
 
Example 2
Source File: SysAnnouncementServiceImpl.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
@Transactional
@Override
public void saveAnnouncement(SysAnnouncement sysAnnouncement) {
	if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
		sysAnnouncementMapper.insert(sysAnnouncement);
	}else {
		// 1.插入通告表记录
		sysAnnouncementMapper.insert(sysAnnouncement);
		// 2.插入用户通告阅读标记表记录
		String userId = sysAnnouncement.getUserIds();
		String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
		String anntId = sysAnnouncement.getId();
		Date refDate = new Date();
		for(int i=0;i<userIds.length;i++) {
			SysAnnouncementSend announcementSend = new SysAnnouncementSend();
			announcementSend.setAnntId(anntId);
			announcementSend.setUserId(userIds[i]);
			announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
			announcementSend.setReadTime(refDate);
			sysAnnouncementSendMapper.insert(announcementSend);
		}
	}
}
 
Example 3
Source File: SysAnnouncementServiceImpl.java    From teaching with Apache License 2.0 6 votes vote down vote up
@Transactional
@Override
public void saveAnnouncement(SysAnnouncement sysAnnouncement) {
	if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
		sysAnnouncementMapper.insert(sysAnnouncement);
	}else {
		// 1.插入通告表记录
		sysAnnouncementMapper.insert(sysAnnouncement);
		// 2.插入用户通告阅读标记表记录
		String userId = sysAnnouncement.getUserIds();
		String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
		String anntId = sysAnnouncement.getId();
		Date refDate = new Date();
		for(int i=0;i<userIds.length;i++) {
			SysAnnouncementSend announcementSend = new SysAnnouncementSend();
			announcementSend.setAnntId(anntId);
			announcementSend.setUserId(userIds[i]);
			announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
			announcementSend.setReadTime(refDate);
			sysAnnouncementSendMapper.insert(announcementSend);
		}
	}
}
 
Example 4
Source File: SysAnnouncementServiceImpl.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
@Transactional
@Override
public void saveAnnouncement(SysAnnouncement sysAnnouncement) {
	if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
		sysAnnouncementMapper.insert(sysAnnouncement);
	}else {
		// 1.插入通告表记录
		sysAnnouncementMapper.insert(sysAnnouncement);
		// 2.插入用户通告阅读标记表记录
		String userId = sysAnnouncement.getUserIds();
		String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
		String anntId = sysAnnouncement.getId();
		Date refDate = new Date();
		for(int i=0;i<userIds.length;i++) {
			SysAnnouncementSend announcementSend = new SysAnnouncementSend();
			announcementSend.setAnntId(anntId);
			announcementSend.setUserId(userIds[i]);
			announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
			announcementSend.setReadTime(refDate);
			sysAnnouncementSendMapper.insert(announcementSend);
		}
	}
}