|
@@ -106,7 +106,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
Long rootOrgId = infoQuery.getRootOrgId();
|
|
|
Specification<NoticeEntity> specification = (root, query, cb) -> {
|
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
|
- predicates.add(cb.equal(root.get("rootOrgId"), infoQuery.getPublishStatus()));
|
|
|
+ predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
|
|
|
if (!StringUtils.isNullOrEmpty(infoQuery.getTitle())) {
|
|
|
predicates.add(cb.like(root.get("title"), DBUtil.toSqlSearchPattern(infoQuery.getTitle())));
|
|
|
}
|
|
@@ -267,10 +267,10 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
//通知过期年限阈值// TODO: 2019/7/10
|
|
|
int overdueYearThreshold = PropertyHolder.getInt("notice.dispose.overdue.year", 1);
|
|
|
Date now = new Date();
|
|
|
- Date lastYear=DateUtils.addYears(now,-overdueYearThreshold);
|
|
|
+ Date lastYear = DateUtils.addYears(now, -overdueYearThreshold);
|
|
|
List<NoticeEntity> overdueNoticeList = noticeRepo.findByCreationTimeBefore(lastYear);
|
|
|
- if (overdueNoticeList!=null && !overdueNoticeList.isEmpty()){
|
|
|
- for (NoticeEntity notice:overdueNoticeList){
|
|
|
+ if (overdueNoticeList != null && !overdueNoticeList.isEmpty()) {
|
|
|
+ for (NoticeEntity notice : overdueNoticeList) {
|
|
|
deleteAllRelatedNotice(notice.getId());
|
|
|
}
|
|
|
}
|
|
@@ -279,10 +279,11 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
|
|
|
/**
|
|
|
* 删除所有相关的通知数据
|
|
|
+ *
|
|
|
* @param noticeId
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public void deleteAllRelatedNotice(Long noticeId){
|
|
|
+ public void deleteAllRelatedNotice(Long noticeId) {
|
|
|
userNoticeRepo.deleteByNoticeId(noticeId);
|
|
|
noticeReceiverRuleRepo.deleteByNoticeId(noticeId);
|
|
|
noticePublishScheduleRepo.deleteByNoticeId(noticeId);
|
|
@@ -304,15 +305,13 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
throw new StatusException("501010", "读取的数据行数不得少于1行");
|
|
|
}
|
|
|
GetLimitUserIdResp getLimitUserIdResp = getSpecifiedUserIdList(rootOrgId, rowNumber, startUserId, ruleType, ruleList);
|
|
|
- //返回的下一个用户id
|
|
|
Long nextId = getLimitUserIdResp.getNextId();
|
|
|
- //满足条件集合中的最大用户id
|
|
|
Long maxUserId = getLimitUserIdResp.getMaxId();
|
|
|
//满足条件的用户id集合(可能为空)
|
|
|
List<Long> limitStudentIdList = getLimitUserIdResp.getIdList();
|
|
|
|
|
|
//如果起始id和方法返回的下次查询id相同,说明数据已经取完,否则继续查询
|
|
|
- if (startUserId == nextId) {
|
|
|
+ if (startUserId.equals(nextId)) {
|
|
|
finishNoticePublishSchedule(rootOrgId, noticeId, ruleType, publishSchedule, limitStudentIdList);
|
|
|
} else {
|
|
|
updateNoticePublishSchedule(publishSchedule, maxUserId);
|
|
@@ -393,8 +392,9 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
markWorkerReq.setWorkIds(markWorkIdList);
|
|
|
markWorkerReq.setStarId(startUserId);
|
|
|
markWorkerReq.setSize(rowNumber);
|
|
|
+ // FIXME: 2019/7/11
|
|
|
GetMarkersByWorkIdsResp markWorkerResp = markWorkCloudService.getMarkersByWorkIds(markWorkerReq);
|
|
|
-
|
|
|
+// GetMarkersByWorkIdsResp markWorkerResp = new GetMarkersByWorkIdsResp();
|
|
|
List<Long> limitUserIdList = markWorkerResp.getMarkers();
|
|
|
if (markWorkerResp.getMarkers() != null && !markWorkerResp.getMarkers().isEmpty()) {
|
|
|
resultResp.setMaxId(Collections.max(limitUserIdList));
|
|
@@ -566,6 +566,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
bean.setRootOrgId(rootOrgId);
|
|
|
bean.setStatus(1);
|
|
|
req.setMarkWorkBean(bean);
|
|
|
+ // FIXME: 2019/7/11
|
|
|
GetMarkWorkResp markWorkResp = markWorkCloudService.getMarkWork(req);
|
|
|
List<MarkWorkBean> markWorkList = markWorkResp.getMarkWorkBeanList();
|
|
|
for (Long mwId : markWorkIdList) {
|