|
@@ -1,8 +1,10 @@
|
|
|
package com.jeeplus.flowable.service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.jeeplus.core.domain.BaseEntity;
|
|
|
+import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.flowable.mapper.MyNoticeListMapper;
|
|
|
import com.jeeplus.flowable.model.Flow;
|
|
|
import com.jeeplus.flowable.model.MyNoticeList;
|
|
@@ -41,18 +43,19 @@ public class MyNoticeService {
|
|
|
public Page<MyNoticeList> noticeList(Page<MyNoticeList> page, String type, String title, String taskName){
|
|
|
// 获取当前登录人名称查询出未查看通知列表
|
|
|
String userName = UserUtils.getCurrentUserDTO ().getName ();
|
|
|
- LambdaQueryWrapper<MyNoticeList> wrapper = new LambdaQueryWrapper<MyNoticeList>();
|
|
|
- wrapper.eq(MyNoticeList::getNoticeName, userName).orderByDesc(BaseEntity::getCreateDate);
|
|
|
+ QueryWrapper<MyNoticeList> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("a.notice_id", UserUtils.getCurrentUserDTO ().getId());
|
|
|
+ queryWrapper.orderByDesc("a.create_date");
|
|
|
if (StringUtils.isNotEmpty(type)) {
|
|
|
- wrapper.eq(MyNoticeList::getType, Integer.parseInt(type));
|
|
|
+ queryWrapper.eq("a.type", Integer.parseInt(type));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(title)) {
|
|
|
- wrapper.like(MyNoticeList::getTitle, title);
|
|
|
+ queryWrapper.like("a.title", title);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(taskName)) {
|
|
|
- wrapper.eq(MyNoticeList::getTaskName, taskName);
|
|
|
+ queryWrapper.eq("a.task_name", taskName);
|
|
|
}
|
|
|
- Page<MyNoticeList> listPage = mapper.selectPage(page, wrapper);
|
|
|
+ Page<MyNoticeList> listPage = mapper.selectPage(page, queryWrapper);
|
|
|
if (CollectionUtils.isNotEmpty(listPage.getRecords())) {
|
|
|
for (MyNoticeList notice : listPage.getRecords()) {
|
|
|
notice.setType("0".equals(notice.getType())? "未读":"已读");
|
|
@@ -61,7 +64,7 @@ public class MyNoticeService {
|
|
|
return listPage;
|
|
|
}
|
|
|
|
|
|
- public String add(String taskId, String title, String defId, String taskName, String createName, String createDate, String noticeName) throws Exception{
|
|
|
+ public String add(String taskId, String title, String defId, String taskName, String createName, String createDate, String noticeName, String noticeId) throws Exception{
|
|
|
MyNoticeList notice = new MyNoticeList();
|
|
|
//是否已保存
|
|
|
LambdaQueryWrapper<MyNoticeList> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -107,6 +110,11 @@ public class MyNoticeService {
|
|
|
} else {
|
|
|
notice.setNoticeName(userDTO.getName());
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(noticeId)) {
|
|
|
+ notice.setNoticeId(noticeId);
|
|
|
+ } else {
|
|
|
+ notice.setNoticeId(userDTO.getId());
|
|
|
+ }
|
|
|
// 创建时间格式化处理
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
notice.setCreateTime(format.parse(createDate));
|