From e899d2709f21b322232fb64778fef296233be3f0 Mon Sep 17 00:00:00 2001 From: fei <791364011@qq.com> Date: 星期一, 25 八月 2025 14:39:41 +0800 Subject: [PATCH] 修改了代码 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java | 61 ++++++++++++++++++++++++++++-- 1 files changed, 57 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java index e024e87..132c6f0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java @@ -3,6 +3,11 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.domain.Archiverecordstouser; import com.ruoyi.service.IArchiverecordstouserService; import org.springframework.security.access.prepost.PreAuthorize; @@ -22,6 +27,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; /** * 銆愯濉啓鍔熻兘鍚嶇О銆慍ontroller @@ -36,16 +45,36 @@ @Autowired private IArchiverecordstouserService archiverecordstouserService; + + @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:edit')") + + @PutMapping("/authUserToArchive") + public AjaxResult selectRecordToUser(String recordId, Long[] userIds) + { + for(Long userId:userIds) + { + if(archiverecordstouserService.queryArchiverecordstouserByRecordId(recordId, userId)==1) + { + return toAjax(0); + } + } + //鍒ゆ柇鏄惁鎺堟潈缁欏埆浜轰簡 + if(archiverecordstouserService.selectArchiveRecordUsers(recordId)) + return toAjax(0); + archiverecordstouserService.insertRecordToUsers(recordId, userIds); + return toAjax(200); + } /** * 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */ @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:list')") @GetMapping("/list") - public TableDataInfo list(Archiverecordstouser archiverecordstouser) + public AjaxResult list(Archiverecordstouser archiverecordstouser) { - startPage(); - List<Archiverecordstouser> list = archiverecordstouserService.selectArchiverecordstouserList(archiverecordstouser); - return getDataTable(list); + Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return archiverecordstouserService.selectDataList(archiverecordstouser, pageNum, pageSize); + } /** @@ -103,4 +132,28 @@ { return toAjax(archiverecordstouserService.deleteArchiverecordstouserByIds(ids)); } + /** + * 鏍规嵁鐢ㄦ埛id鍜宺ecordId杩涜鍒犻櫎 + */ + @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:remove')") + @DeleteMapping("/deleteByRidUid") + public AjaxResult removeByRecordIdAndUserId(String recordId, Long userId) + { + return toAjax(archiverecordstouserService.deleteArchiverecordstouserByRecordId(recordId, userId)); + } + + + @PreAuthorize("@ss.hasPermi('system:archiverecordstouser:query')") + @GetMapping("/getByRidUid") + public AjaxResult getByRecordIdAndUserId(String recordId, Long userId) + { + return toAjax(archiverecordstouserService.queryArchiverecordstouserByRecordId(recordId, userId)); + } + + + + + + + } -- Gitblit v1.9.1