1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 06:51:23 +08:00

use pinia to modify notice add,delete,select function

This commit is contained in:
cccccyb
2023-05-13 16:10:24 +08:00
parent 1fd9f42ae8
commit 359af69fbd
11 changed files with 218 additions and 220 deletions

View File

@@ -105,12 +105,8 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
public Boolean deleteById(Long nid) {
LambdaQueryWrapper<NoticeReceive> lqw = new LambdaQueryWrapper<>();
lqw.eq(NoticeReceive::getNoticeId, nid);
List<NoticeReceive> noticeReceives = noticeReceiveMapper.selectList(lqw);
for (NoticeReceive nrc :
noticeReceives) {
noticeReceiveMapper.deleteById(nrc.getId());
}
return noticeMapper.deleteById(nid) > 0;
Boolean flag = noticeReceiveMapper.delete(lqw)>0;
return flag&&(noticeMapper.deleteById(nid) > 0);
}
@Override
@@ -118,7 +114,6 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
noticeMapper.update(null, new UpdateWrapper<Notice>().eq("id", notice.getId()).set("old", 1)); //修改原始数据
notice.setOriginId(notice.getId());
notice.setId(null); //清除id使新插入的数据id重新生成
notice.setCreateTime(null);
notice.setModifyTime(null);
notice.setOld(0);
return noticeMapper.insert(notice) > 0;