From 0fb38e938ff2f943a6b8cc5c3247a23fc1276d24 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期一, 11 十月 2021 16:47:18 +0800
Subject: [PATCH] 爱心义仓代码提交

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActWarehouseApplyApi.java |   64 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActWarehouseApplyApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActWarehouseApplyApi.java
index b09156e..0d8c826 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActWarehouseApplyApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActWarehouseApplyApi.java
@@ -1,18 +1,18 @@
 package com.panzhihua.service_community.api;
 
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.api.ApiController;
+import com.alibaba.fastjson.JSONObject;
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.dtos.property.CommonPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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;
-import java.io.Serializable;
-import java.util.List;
 
 /**
  * 物品申请表(ComActWarehouseApply)表控制层
@@ -41,36 +41,51 @@
     }
 
     /**
+     * 统计查询
+     *
+     * @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") Serializable id) {
-        return R.ok(this.comActWarehouseApplyService.getById(id));
+    public R selectOne(@PathVariable("id") Integer id) {
+        return this.comActWarehouseApplyService.selectById(id);
     }
 
     /**
      * 新增数据
      *
-     * @param comActWarehouseApply 实体对象
+     * @param comActWarehouseApplyVO 实体对象
      * @return 新增结果
      */
     @PostMapping
-    public R insert(@RequestBody ComActWarehouseApply comActWarehouseApply) {
+    public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) {
+        ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply();
+        BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply);
         return R.ok(this.comActWarehouseApplyService.save(comActWarehouseApply));
     }
 
     /**
      * 修改数据
      *
-     * @param comActWarehouseApply 实体对象
+     * @param comActWarehouseApplyVO 实体对象
      * @return 修改结果
      */
     @PostMapping("/update")
-    public R update(@RequestBody ComActWarehouseApply comActWarehouseApply) {
-        return R.ok(this.comActWarehouseApplyService.updateById(comActWarehouseApply));
+    public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) {
+        ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply();
+        BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply);
+        return R.ok(this.comActWarehouseApplyService.update(comActWarehouseApply));
     }
 
     /**
@@ -83,4 +98,29 @@
     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);
+    }
 }

--
Gitblit v1.7.1