mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
package com.panzhihua.service_community.api;
 
 
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO;
import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO;
import com.panzhihua.service_community.entity.ComActWarehouseApply;
import com.panzhihua.service_community.service.ComActWarehouseApplyService;
import com.panzhihua.service_community.util.QRCodeUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * 物品申请表(ComActWarehouseApply)表控制层
 *
 * @author makejava
 * @since 2021-10-09 17:13:53
 */
@RestController
@RequestMapping("comActWarehouseApply")
public class ComActWarehouseApplyApi {
    /**
     * 服务对象
     */
    @Resource
    private ComActWarehouseApplyService comActWarehouseApplyService;
 
    /**
     * 分页查询所有数据
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @PostMapping("queryAll")
    public R selectAll(@RequestBody CommonPage commonPage) {
        return this.comActWarehouseApplyService.pageList(commonPage);
    }
 
    /**
     * 统计查询
     *
     * @param communityId
     * @return 所有数据
     */
    @GetMapping("selectStatics")
    public R selectAll(@RequestParam("communityId") Long communityId) {
        return this.comActWarehouseApplyService.selectStatics(communityId);
    }
 
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("{id}")
    public R selectOne(@PathVariable("id") Integer id) {
        return this.comActWarehouseApplyService.selectById(id);
    }
 
    /**
     * 新增数据
     *
     * @param comActWarehouseApplyVO 实体对象
     * @return 新增结果
     */
    @PostMapping
    public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) {
        ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply();
        BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply);
        return R.ok(this.comActWarehouseApplyService.save(comActWarehouseApply));
    }
 
    /**
     * 修改数据
     *
     * @param comActWarehouseApplyVO 实体对象
     * @return 修改结果
     */
    @PostMapping("/update")
    public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) {
        ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply();
        BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply);
        return this.comActWarehouseApplyService.update(comActWarehouseApply);
    }
 
    /**
     * 删除数据
     *
     * @param id 主键结合
     * @return 删除结果
     */
    @GetMapping("del")
    public R delete(@RequestParam("id") Long id) {
        return R.ok(this.comActWarehouseApplyService.removeById(id));
    }
 
    /**
     * 生成二维码
     * @param qrCodeVO
     * @return
     */
    @PostMapping("/getQRCode")
    public R getQRCode(@RequestBody QRCodeVO qrCodeVO){
        return R.ok(QRCodeUtil.getBase64QRCode(JSONObject.toJSONString(qrCodeVO)));
    }
    /**
     * 社区团队权限校验
     */
    @GetMapping("/check")
    public R check(@RequestParam("phone") String phone){
        return this.comActWarehouseApplyService.check(phone);
    }
 
    /**
     * 导出数据
     */
    @PostMapping("/export")
    public R export(@RequestBody CommonPage commonPage){
        return this.comActWarehouseApplyService.export(commonPage);
    }
}