From 66a014290fe3f7540ea460467c80bceea03c12a4 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 22 Dec 2020 14:54:33 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
index 946c378..149a2da 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
@@ -1,18 +1,23 @@
 package com.matrix.system.app.action;
 
+import com.matrix.core.constance.MatrixConstance;
 import com.matrix.core.pojo.AjaxResult;
+import com.matrix.core.tools.WebUtil;
 import com.matrix.system.app.dto.VipInfoListDto;
 import com.matrix.system.app.vo.VipInfoListVo;
+import com.matrix.system.common.bean.SysUsers;
+import com.matrix.system.common.tools.DataAuthUtil;
+import com.matrix.system.hive.bean.SysVipLevel;
 import com.matrix.system.hive.service.SysVipInfoService;
+import com.matrix.system.hive.service.SysVipLevelService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * @author wzy
@@ -26,6 +31,9 @@
     @Autowired
     private SysVipInfoService sysVipInfoService;
 
+    @Autowired
+    private SysVipLevelService sysVipLevelService;
+
     @ApiOperation(value = "获取会员通讯录列表", notes = "获取会员通讯录列表")
     @ApiResponses({
             @ApiResponse(code = 200, message = "ok", response = VipInfoListVo.class)
@@ -35,4 +43,24 @@
         return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipAddressBook(vipInfoListDto));
     }
 
+    @ApiOperation(value = "根据手机号查询用户信息", notes = "根据手机号查询用户信息")
+    @GetMapping(value = "/findVipInfoByPhone/{phone}")
+    public AjaxResult findVipInfoByPhone(@PathVariable("phone") String phone) {
+        return null;
+    }
+
+    @ApiOperation(value = "查询会员类型", notes = "查询会员类型")
+    @ApiResponses(
+            @ApiResponse(code = 200, message = "ok", response = SysVipLevel.class)
+    )
+    @GetMapping(value = "/findVipType")
+    public AjaxResult findVipType() {
+        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+        SysVipLevel sysVipLevel = new SysVipLevel();
+        if(!DataAuthUtil.hasAllShopAuth()) {
+            sysVipLevel.setShopId(sysUsers.getShopId());
+        }
+
+        return AjaxResult.buildSuccessInstance(sysVipLevelService.findByModel(sysVipLevel));
+    }
 }

--
Gitblit v1.9.1