| | |
| | | import org.springblade.modules.desk.wrapper.NoticeWrapper; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | |
| | | private final INoticeService noticeService; |
| | | |
| | | private final IDeptService iDeptService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | //新增 |
| | | status = noticeService.save(notice); |
| | | notice.setIsDeleted(0); |
| | | if (status) { |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into blade_notice(id,title,category,release_time,content,create_user,create_dept,create_time,is_deleted,dept_id,cover_url,type) " + |
| | |
| | | "'" + notice.getDeptId() + "'" + "," + |
| | | "'" + notice.getCoverUrl() + "'" + "," + |
| | | "'" +notice.getType() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //修改 |
| | | status = noticeService.updateById(notice); |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update blade_notice set title = " + "'" + notice.getTitle() + "'" + |
| | |
| | | ",cover_url = " + "'" + notice.getCoverUrl() + "'" + |
| | | ",type = " + "'" + notice.getType() + "'" + |
| | | " " +"where id = " + "'" + notice.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | return R.status(status); |
| | | } |
| | |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from blade_notice where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); |
| | | return R.status(temp); |