|
|
@ -51,7 +51,6 @@ public class NoticeServiceImpl implements NoticeService { |
|
|
|
noticeEntity.setId(noticeDto.getId()); |
|
|
|
} |
|
|
|
noticeEntity.setNoticeContent(noticeDto.getNoticeContent()); |
|
|
|
//noticeEntity.setNoticeTitle(noticeDto.getNoticeTitle()); |
|
|
|
noticeEntity.setStatus(false); |
|
|
|
noticeEntity.setPushType(noticeDto.getPushType()); |
|
|
|
noticeEntity.setNoticeType(noticeDto.getNoticeType()); |
|
|
@ -82,12 +81,14 @@ public class NoticeServiceImpl implements NoticeService { |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void createDeviceNotice(NoticeDto noticeDto) { |
|
|
|
noticeDto.setId(NanoIdUtils.randomNanoId()); |
|
|
|
|
|
|
|
Notice noticeEntity = new Notice(); |
|
|
|
noticeEntity.setId(noticeDto.getId()); |
|
|
|
if (StringUtils.isEmpty(noticeDto.getId())) { |
|
|
|
noticeDto.setId(NanoIdUtils.randomNanoId()); |
|
|
|
noticeEntity.setId(noticeDto.getId()); |
|
|
|
} else { |
|
|
|
noticeEntity.setId(noticeDto.getId()); |
|
|
|
} |
|
|
|
noticeEntity.setNoticeContent(noticeDto.getNoticeContent()); |
|
|
|
//noticeEntity.setNoticeTitle(noticeDto.getNoticeTitle()); |
|
|
|
noticeEntity.setStatus(false); |
|
|
|
noticeEntity.setPushType(noticeDto.getPushType()); |
|
|
|
Set<String> deviceInfos = noticeDto.getDeviceInfoId(); |
|
|
@ -100,6 +101,7 @@ public class NoticeServiceImpl implements NoticeService { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
map.put("Content-type", "application/json"); |
|
|
|
body.put("notice", noticeDto.getNoticeContent()); |
|
|
|
//TODO:第三方接口指定,暂时屏蔽判断第三方接口状态 |
|
|
|
// HttpResponse response = HttpUtils.doPost(url, "/IntelligentCabinetAPIServer/getNotice", "POST", map, null, body); |
|
|
|
// if (response.getStatusLine().getStatusCode() != 200) { |
|
|
|
// throw new BaseException("接口调用失败"); |
|
|
@ -127,7 +129,7 @@ public class NoticeServiceImpl implements NoticeService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object queryNoticeUser(NoticeUserCriteria criteria, Pageable pageable) { |
|
|
|
List<NoticeUsers> noticeUsersList = noticeUsersRepository.findByUserId(criteria.getUserId()); |
|
|
|
List<NoticeUsers> noticeUsersList = noticeUsersRepository.findByUserId(criteria.getUserId(), criteria.getCreateTime().get(0), criteria.getCreateTime().get(1)); |
|
|
|
noticeUsersList.sort(Comparator.comparing(NoticeUsers::getIsRead)); |
|
|
|
List<Notice> noticeList = new ArrayList<>(); |
|
|
|
for (NoticeUsers noticeUsers : noticeUsersList) { |
|
|
|