ArchivesDepotController.java
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.ruoyi.service.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.service.domain.ArchivesDepot;
import com.ruoyi.service.service.ArchivesDepotService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 上架
*
* @author ym
*/
@RestController
@RequestMapping("/service/archivesDepot")
public class ArchivesDepotController extends BaseController
{
@Resource
private ArchivesDepotService archivesDepotService;
@PreAuthorize("@ss.hasPermi('service:archivesDepot:shelve')")
@Log(title = "上架", businessType = BusinessType.UPDATE)
@PostMapping("/shelve")
public AjaxResult shelve(@Validated @RequestBody ArchivesDepot archivesDepot)
{
return AjaxResult.success(archivesDepotService.shelve(archivesDepot));
}
@PreAuthorize("@ss.hasPermi('service:archivesDepot:shelveDown')")
@Log(title = "下架", businessType = BusinessType.UPDATE)
@PostMapping("/shelveDown")
public AjaxResult shelveDown(@Validated @RequestBody ArchivesDepot archivesDepot)
{
Long[] ids=archivesDepot.getIds();
if(archivesDepotService.selectCountBox(ids)>0){
return AjaxResult.error("存在未归还文件不可下架");
}
return AjaxResult.success(archivesDepotService.shelveDown(archivesDepot));
}
}