feige
3 天以前 3e6e5a5300c8b41af08f51a3932b230f9fcb9935
ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiverecordstouserController.java
@@ -3,6 +3,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.domain.Archiverecordstouser;
import com.ruoyi.service.IArchiverecordstouserService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -23,6 +25,9 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
/**
 * 【请填写功能名称】Controller
 * 
@@ -36,16 +41,33 @@
    @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);
            }
        }
        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 +125,21 @@
    {
        return toAjax(archiverecordstouserService.deleteArchiverecordstouserByIds(ids));
    }
    /**
     * 根据用户id和recordId进行删除
     */
    @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));
    }
}