zqy
2024-10-03 5a0f89efcca725abd41381fd74358e47b4ff3909
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.ruoyi.web.controller.zhang;
 
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.domain.ShareMore;
import com.ruoyi.domain.ZfDownload;
import com.ruoyi.service.ZfEventDownloadService;
import com.ruoyi.service.ZfEventShareService;
import com.ruoyi.service.impl.IZfPropertyDownloadServiceImpl;
import com.ruoyi.service.impl.IZfPropertyShareServiceImpl;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
import static com.ruoyi.common.core.page.TableSupport.PAGE_NO;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
 
@RestController
@RequestMapping("/family/propertyShare")
public class ZfPropertyShareController extends BaseController {
    @Resource
    IZfPropertyShareServiceImpl iZfPropertyShareService;
 
    @Resource
    IZfPropertyDownloadServiceImpl iZfPropertyDownloadService;
 
    @PostMapping("/share")
    public AjaxResult share(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2002L);
        return iZfPropertyShareService.saveZa(zfDoctor);
    }
 
    /**
     * 根据UserId和分享人shareId查看已经授权给那些人那些数据
     */
    @PostMapping("/getInfoByUserId")
    public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2002L);
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return  iZfPropertyShareService.listByFidAid(zfDoctor,pageNo,pageSize) ;
    }
 
    /**
     * 用户自己查看别人分享的数据和分享人
     */
    @GetMapping("/getInfoByShareId")
    public AjaxResult empowerGetInfo2(){
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return iZfPropertyShareService.listUserId(pageNo ,pageSize);
    }
    /**
     * 根据userId和shareId收回已经授权给那些人
     */
    @PostMapping("/deleteInfoByUserId")
    public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){
        zfDoctor.setSysMenuId(2002L);
        return iZfPropertyShareService.deleteZa(zfDoctor);
    }
 
    /**
     * 下载分享的数据
     */
    @PostMapping("/downloadDate")
    public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){
        zfDownload.setSysMenuId(2002L);
        return iZfPropertyDownloadService.addData(zfDownload);
    }
 
    /**
     * 展示下载分享的数据
     */
    @GetMapping("/all")
    public AjaxResult data(ZfDownload zfDownload){
        zfDownload.setSysMenuId(2002L);
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return iZfPropertyDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize);
    }
}