From 0a2e558d312fce9f059550e6622859bb364ab58c Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Mon, 12 Jan 2026 16:12:09 +0800
Subject: [PATCH] vip调研票

---
 src/main/java/com/nq/controller/StockApiController.java        |   30 -
 src/main/java/com/nq/controller/backend/AdminStockVip.java     |   61 ++
 src/main/java/com/nq/controller/protol/UserController.java     |   15 
 src/main/java/com/nq/service/impl/UserPositionServiceImpl.java |  421 ++++++++++++++++--
 src/main/java/com/nq/service/IUserPositionService.java         |    4 
 src/main/java/com/nq/service/IUserService.java                 |    2 
 src/main/java/com/nq/service/StockVipService.java              |   27 +
 src/main/java/com/nq/vo/stock/StockVipVo.java                  |   38 +
 docs/VIP接口对接文档.md                                              |  407 ++++++++++++++++++
 sql/stock_vip.sql                                              |   23 +
 src/main/java/com/nq/service/impl/UserServiceImpl.java         |   19 
 src/main/resources/mapper/StockVipMapper.xml                   |   35 +
 src/main/java/com/nq/controller/UserApiController.java         |    4 
 src/main/java/com/nq/service/impl/StockVipServiceImpl.java     |  137 ++++++
 src/main/java/com/nq/controller/backend/AdminStockDz.java      |    2 
 src/main/java/com/nq/dao/StockVipMapper.java                   |   15 
 src/main/java/com/nq/pojo/StockVip.java                        |   54 ++
 17 files changed, 1,210 insertions(+), 84 deletions(-)

diff --git "a/docs/VIP\346\216\245\345\217\243\345\257\271\346\216\245\346\226\207\346\241\243.md" "b/docs/VIP\346\216\245\345\217\243\345\257\271\346\216\245\346\226\207\346\241\243.md"
new file mode 100644
index 0000000..e5274fa
--- /dev/null
+++ "b/docs/VIP\346\216\245\345\217\243\345\257\271\346\216\245\346\226\207\346\241\243.md"
@@ -0,0 +1,407 @@
+# VIP交易接口对接文档
+
+## 一、用户端接口
+
+### 1. 获取VIP交易列表
+
+**接口地址:** `/api/stock/getVipList.do`
+
+**请求方式:** POST
+
+**请求参数:** 无
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "success",
+  "data": [
+    {
+      "id": 1,
+      "stockName": "股票名称",
+      "stockCode": "000001",
+      "price": 10.50,
+      "stockType": "股票类型",
+      "stockGid": "sh000001",
+      "stockPlate": "股票板块",
+      "isLock": 0,
+      "stockNum": 100,
+      "startTime": "2024-01-01 09:00:00",
+      "endTime": "2024-01-01 15:00:00",
+      "discount": 0.95,
+      "residualShare": 1000
+    }
+  ]
+}
+```
+
+**字段说明:**
+- `id`: VIP记录ID
+- `stockName`: 股票名称
+- `stockCode`: 股票代码
+- `price`: 当前价格(已计算折扣)
+- `stockType`: 股票类型
+- `stockGid`: 股票GID
+- `stockPlate`: 股票板块
+- `isLock`: 是否锁定(0-未锁定,1-锁定)
+- `stockNum`: 最小购买数量
+- `startTime`: 开始时间
+- `endTime`: 结束时间
+- `discount`: 折扣率
+- `residualShare`: 剩余股份
+
+---
+
+### 2. VIP下单
+
+**接口地址:** `/user/buyStockVip.do`
+
+**请求方式:** POST
+
+**请求参数:**
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| stockCode | String | 是 | 股票代码 |
+| password | String | 是 | 交易密码 |
+| num | Integer | 是 | 购买数量 |
+
+**请求示例:**
+```
+POST /user/buyStockVip.do
+stockCode=000001&password=123456&num=100
+```
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "success",
+  "data": "VIP交易下单成功"
+}
+```
+
+**错误返回示例:**
+```json
+{
+  "status": 1,
+  "msg": "下单失败,请先实名认证"
+}
+```
+
+**常见错误提示:**
+- "下单失败,请先实名认证"
+- "下单失败,账户已被锁定"
+- "下单失败,系统设置错误"
+- "周末或节假日不能交易!"
+- "下单失败,密钥错误"
+- "下单失败,当前股票不能交易"
+- "频繁交易,X分钟内同一股票持仓不得超过X条"
+- "频繁交易,X分钟内不能超过X手"
+- "下单失败,购买数量最小为X股"
+- "下单失败,购买数量大于X股"
+- "报价0,请稍后再试"
+- "ST和已退市的股票不能入仓"
+- "下单失败,股票当前涨幅:X,大于最大涨幅:X"
+- "下单失败,股票当前跌幅:X,大于最大跌幅:X"
+- "下单失败,购买金额小于X元"
+- "下单失败,不能超过可用资金的X%"
+- "下单失败,融资可用金额小于X元"
+- "X天内涨幅超过 X不能交易"
+
+---
+
+### 3. VIP下单列表
+
+**接口地址:** `/user/buyStockVipList.do`
+
+**请求方式:** POST
+
+**请求参数:** 无(需要登录,从请求头获取用户信息)
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "success",
+  "data": [
+    {
+      "id": 1,
+      "positionType": 4,
+      "positionSn": "订单编号",
+      "userId": 1001,
+      "stockCode": "000001",
+      "stockName": "股票名称",
+      "buyOrderTime": "2024-01-01 10:00:00",
+      "buyOrderPrice": 10.50,
+      "orderNum": 100,
+      "orderDirection": "买涨",
+      "orderLever": 1,
+      "orderTotalPrice": 1050.00,
+      "profitAndLose": 0.00,
+      "allProfitAndLose": 0.00
+    }
+  ]
+}
+```
+
+**字段说明:**
+- `positionType`: 持仓类型(4表示VIP交易)
+- `positionSn`: 订单编号
+- `userId`: 用户ID
+- `stockCode`: 股票代码
+- `stockName`: 股票名称
+- `buyOrderTime`: 下单时间
+- `buyOrderPrice`: 买入价格
+- `orderNum`: 购买数量
+- `orderDirection`: 交易方向(买涨/买跌)
+- `orderLever`: 杠杆倍数
+- `orderTotalPrice`: 订单总金额
+- `profitAndLose`: 盈亏
+- `allProfitAndLose`: 总盈亏
+
+---
+
+## 二、后台管理接口
+
+### 1. 获取VIP列表(后台)
+
+**接口地址:** `/admin/stockVip/getVipListByAdmin.do`
+
+**请求方式:** POST/GET
+
+**请求参数:**
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| keywords | String | 否 | 搜索关键词(股票名称、代码、类型) |
+
+**请求示例:**
+```
+GET /admin/stockVip/getVipListByAdmin.do?keywords=000001
+```
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "success",
+  "data": [
+    {
+      "id": 1,
+      "stockName": "股票名称",
+      "stockCode": "000001",
+      "stockType": "股票类型",
+      "stockGid": "sh000001",
+      "stockPlate": "股票板块",
+      "isLock": 0,
+      "isShow": 1,
+      "addTime": "2024-01-01 09:00:00",
+      "spreadRate": 0.001,
+      "increaseRatio": 0.0000,
+      "stockNum": 100,
+      "password": "123456",
+      "startTime": "2024-01-01 09:00:00",
+      "endTime": "2024-01-01 15:00:00",
+      "discount": 0.95,
+      "residualShare": 1000
+    }
+  ]
+}
+```
+
+---
+
+### 2. 新增VIP
+
+**接口地址:** `/admin/stockVip/addByAdmin.do`
+
+**请求方式:** POST
+
+**请求参数:**
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| stockCode | String | 是 | 股票代码 |
+| stockNum | String | 是 | 最小购买数量 |
+| password | String | 是 | 交易密码 |
+| startTime | String | 是 | 开始时间(格式:yyyy-MM-dd HH:mm:ss) |
+| endTime | String | 是 | 结束时间(格式:yyyy-MM-dd HH:mm:ss) |
+| discount | String | 是 | 折扣率 |
+| residualShare | Integer | 否 | 剩余股份 |
+
+**请求示例:**
+```
+POST /admin/stockVip/addByAdmin.do
+stockCode=000001&stockNum=100&password=123456&startTime=2024-01-01 09:00:00&endTime=2024-01-01 15:00:00&discount=0.95&residualShare=1000
+```
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "添加成功"
+}
+```
+
+**错误返回:**
+```json
+{
+  "status": 1,
+  "msg": "参数不能为空"
+}
+```
+或
+```json
+{
+  "status": 1,
+  "msg": "股票代码不存在"
+}
+```
+
+---
+
+### 3. 删除VIP
+
+**接口地址:** `/admin/stockVip/deleteByAdmin.do`
+
+**请求方式:** POST
+
+**请求参数:**
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| id | String | 是 | VIP记录ID |
+
+**请求示例:**
+```
+POST /admin/stockVip/deleteByAdmin.do
+id=1
+```
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "删除成功"
+}
+```
+
+**错误返回:**
+```json
+{
+  "status": 1,
+  "msg": "删除失败"
+}
+```
+
+---
+
+### 4. 修改VIP
+
+**接口地址:** `/admin/stockVip/updateByAdmin.do`
+
+**请求方式:** POST
+
+**请求参数:**
+需要传递完整的StockVip对象,常用字段:
+| 参数名 | 类型 | 必填 | 说明 |
+|--------|------|------|------|
+| id | Integer | 是 | VIP记录ID |
+| stockName | String | 否 | 股票名称 |
+| stockCode | String | 否 | 股票代码 |
+| isLock | Integer | 否 | 是否锁定(0-未锁定,1-锁定) |
+| isShow | Integer | 否 | 是否显示(0-不显示,1-显示) |
+| stockNum | Integer | 否 | 最小购买数量 |
+| password | String | 否 | 交易密码 |
+| startTime | Date | 否 | 开始时间 |
+| endTime | Date | 否 | 结束时间 |
+| discount | BigDecimal | 否 | 折扣率 |
+| residualShare | Integer | 否 | 剩余股份 |
+
+**请求示例:**
+```json
+POST /admin/stockVip/updateByAdmin.do
+{
+  "id": 1,
+  "isLock": 0,
+  "isShow": 1,
+  "stockNum": 200,
+  "discount": 0.90
+}
+```
+
+**返回数据:**
+```json
+{
+  "status": 0,
+  "msg": "修改成功"
+}
+```
+
+**错误返回:**
+```json
+{
+  "status": 1,
+  "msg": "修改失败"
+}
+```
+
+---
+
+## 三、通用说明
+
+### 1. 响应格式
+
+所有接口统一返回格式:
+```json
+{
+  "status": 0,  // 0-成功,1-失败
+  "msg": "success",  // 提示信息
+  "data": {}  // 数据内容
+}
+```
+
+### 2. 用户端接口认证
+
+用户端接口(`/user/*`)需要:
+- 用户登录状态
+- 请求头中携带用户token或session信息
+
+### 3. 后台管理接口认证
+
+后台管理接口(`/admin/*`)需要:
+- 管理员登录状态
+- 相应的权限验证
+
+### 4. 时间格式
+
+所有时间字段统一使用格式:`yyyy-MM-dd HH:mm:ss`
+
+### 5. 持仓类型
+
+- `positionType = 3`: 大宗交易
+- `positionType = 4`: VIP交易
+
+### 6. 注意事项
+
+1. VIP下单需要先进行实名认证
+2. VIP下单有最小购买数量限制
+3. VIP交易有时间限制(startTime - endTime)
+4. VIP交易需要输入正确的交易密码
+5. 周末和节假日不能交易
+6. 股票涨幅/跌幅超过限制不能交易
+7. 频繁交易会被限制
+
+---
+
+## 四、接口对比
+
+VIP接口与大宗交易接口完全对应:
+
+| 功能 | 大宗交易接口 | VIP交易接口 |
+|------|------------|------------|
+| 获取列表 | `/api/stock/getDzList.do` | `/api/stock/getVipList.do` |
+| 下单 | `/user/buyStockDz.do` | `/user/buyStockVip.do` |
+| 下单列表 | `/user/buyStockDzList.do` | `/user/buyStockVipList.do` |
+| 后台列表 | `/admin/stockDz/getDzListByAdmin.do` | `/admin/stockVip/getVipListByAdmin.do` |
+| 后台新增 | `/admin/stockDz/addByAdmin.do` | `/admin/stockVip/addByAdmin.do` |
+| 后台删除 | `/admin/stockDz/deleteByAdmin.do` | `/admin/stockVip/deleteByAdmin.do` |
+| 后台修改 | `/admin/stockDz/updateByAdmin.do` | `/admin/stockVip/updateByAdmin.do` |
+
diff --git a/sql/stock_vip.sql b/sql/stock_vip.sql
new file mode 100644
index 0000000..6758d0d
--- /dev/null
+++ b/sql/stock_vip.sql
@@ -0,0 +1,23 @@
+CREATE TABLE `stock_vip` (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `stock_name` varchar(255) DEFAULT NULL COMMENT '股票名称',
+  `stock_code` varchar(50) DEFAULT NULL COMMENT '股票代码',
+  `stock_type` varchar(50) DEFAULT NULL COMMENT '股票类型',
+  `stock_gid` varchar(50) DEFAULT NULL COMMENT '股票GID',
+  `stock_plate` varchar(50) DEFAULT NULL COMMENT '股票板块',
+  `is_lock` int(11) DEFAULT '0' COMMENT '是否锁定 0-未锁定 1-锁定',
+  `is_show` int(11) DEFAULT '1' COMMENT '是否显示 0-不显示 1-显示',
+  `add_time` datetime DEFAULT NULL COMMENT '添加时间',
+  `spread_rate` decimal(10,4) DEFAULT NULL COMMENT '点差率',
+  `increase_ratio` decimal(10,4) DEFAULT '0.0000' COMMENT '涨幅比例',
+  `stock_num` int(11) DEFAULT NULL COMMENT '股票数量',
+  `password` varchar(255) DEFAULT NULL COMMENT '密码',
+  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
+  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
+  `discount` decimal(10,4) DEFAULT NULL COMMENT '折扣',
+  `residual_share` int(11) DEFAULT NULL COMMENT '剩余股份',
+  PRIMARY KEY (`id`),
+  KEY `idx_stock_code` (`stock_code`),
+  KEY `idx_is_show` (`is_show`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='VIP交易表';
+
diff --git a/src/main/java/com/nq/controller/StockApiController.java b/src/main/java/com/nq/controller/StockApiController.java
index 9ab5717..d412415 100644
--- a/src/main/java/com/nq/controller/StockApiController.java
+++ b/src/main/java/com/nq/controller/StockApiController.java
@@ -8,6 +8,7 @@
 import com.nq.service.ConvertBondService;
 import com.nq.service.IStockService;
 import com.nq.service.StockDzService;
+import com.nq.service.StockVipService;
 import com.nq.utils.CacheUtil;
 import com.nq.utils.HttpClientRequest;
 import com.nq.utils.redis.RedisShardedPoolUtils;
@@ -40,6 +41,8 @@
     IStockService iStockService;
     @Autowired
     StockDzService stockDzService;
+    @Autowired
+    StockVipService stockVipService;
     @Autowired
     private ConvertBondService converBondService;
 
@@ -228,36 +231,13 @@
         return this.stockDzService.getDzList();
     }
 
-//    /**
-//     * vip 抢筹列表
-//     */
-//    @PostMapping({"getVipList.do"})
-//    @ResponseBody
-//    public ServerResponse getVipList() {
-//        return this.iStockService.ztb();
-//    }
-
     /**
-     * vip 抢筹列表
+     *VIP交易 列表
      */
     @PostMapping({"getVipList.do"})
     @ResponseBody
     public ServerResponse getVipList() {
-        ServerResponse stockSort = this.iStockService.getStockSort(1, 15, "changepercent", 0, "hs_a");
-        if(!ObjectUtils.isEmpty(stockSort.getData())){
-            JSONArray data = (JSONArray)stockSort.getData();
-            ArrayList<HashMap> list = new ArrayList<>();
-            for(int i=0;i<data.size();i++){
-                HashMap<String, Object> map = new HashMap<>();
-                map.put("c",data.getJSONObject(i).getString("symbol").substring(2));
-                map.put("p",data.getJSONObject(i).getFloatValue("trade")*1000);
-                map.put("n",data.getJSONObject(i).getString("name"));
-                map.put("zdp",data.getJSONObject(i).getFloatValue("changepercent"));
-                list.add(map);
-            }
-            return ServerResponse.createBySuccess(list);
-        }
-        return ServerResponse.createByError();
+        return this.stockVipService.getVipList();
     }
 //    /**
 //     * vip 抢筹根据股票代码查询
diff --git a/src/main/java/com/nq/controller/UserApiController.java b/src/main/java/com/nq/controller/UserApiController.java
index 024208c..53bfaaf 100644
--- a/src/main/java/com/nq/controller/UserApiController.java
+++ b/src/main/java/com/nq/controller/UserApiController.java
@@ -70,8 +70,8 @@
     //注册
     @RequestMapping(value = {"reg.do"}, method = {RequestMethod.POST})
     @ResponseBody
-    public ServerResponse reg( @RequestParam("phone") String phone,  @RequestParam("userPwd") String userPwd, HttpServletRequest httpServletRequest) {
-        return this.iUserService.reg(phone, userPwd, httpServletRequest);
+    public ServerResponse reg(@RequestParam("agentCode") String agentCode, @RequestParam("phone") String phone, @RequestParam("userPwd") String userPwd, HttpServletRequest httpServletRequest) {
+        return this.iUserService.reg(agentCode, phone, userPwd, httpServletRequest);
     }
 
     //修改头像
diff --git a/src/main/java/com/nq/controller/backend/AdminStockDz.java b/src/main/java/com/nq/controller/backend/AdminStockDz.java
index 3c130fe..6185d3a 100644
--- a/src/main/java/com/nq/controller/backend/AdminStockDz.java
+++ b/src/main/java/com/nq/controller/backend/AdminStockDz.java
@@ -39,7 +39,7 @@
                                      @RequestParam(value = "startTime")String startTime,
                                      @RequestParam(value = "endTime")String endTime,
                                      @RequestParam(value = "discount") String discount,
-                                     @RequestParam(value = "discount") Integer residualShare) {
+                                     @RequestParam(value = "residualShare") Integer residualShare) {
         return stockDzService.addByAdmin(stockCode,stockNum,password,startTime,endTime,discount,residualShare);
     }
     /**
diff --git a/src/main/java/com/nq/controller/backend/AdminStockVip.java b/src/main/java/com/nq/controller/backend/AdminStockVip.java
new file mode 100644
index 0000000..8619b73
--- /dev/null
+++ b/src/main/java/com/nq/controller/backend/AdminStockVip.java
@@ -0,0 +1,61 @@
+package com.nq.controller.backend;
+
+import com.nq.common.ServerResponse;
+import com.nq.pojo.StockVip;
+import com.nq.service.StockVipService;
+import com.nq.vo.stock.StockVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+
+@RestController
+@RequestMapping({"/admin/stockVip/"})
+public class AdminStockVip {
+    @Autowired
+    StockVipService stockVipService;
+
+    /**
+     * @Description:  获取VIP列表
+     * @Param:
+     * @return:
+     */
+    @RequestMapping({"getVipListByAdmin.do"})
+    public ServerResponse getVipListByAdmin(String keywords) {
+        return stockVipService.getVipListByAdmin(keywords);
+    }
+    /**
+     * @Description:  新增VIP
+     * @Param:
+     * @return:
+     */
+    @RequestMapping({"addByAdmin.do"})
+    public ServerResponse addByAdmin(@RequestParam(value = "stockCode")String stockCode,
+                                     @RequestParam(value = "stockNum")String stockNum,
+                                     @RequestParam(value = "password")String password,
+                                     @RequestParam(value = "startTime")String startTime,
+                                     @RequestParam(value = "endTime")String endTime,
+                                     @RequestParam(value = "discount") String discount,
+                                     @RequestParam(value = "residualShare") Integer residualShare) {
+        return stockVipService.addByAdmin(stockCode,stockNum,password,startTime,endTime,discount,residualShare);
+    }
+    /**
+     * 删除VIP
+     */
+    @RequestMapping({"deleteByAdmin.do"})
+    public ServerResponse deleteByAdmin(@RequestParam(value = "id") String id) {
+        return stockVipService.deleteByAdmin(id);
+    }
+    /**
+     * 修改VIP
+     */
+    @RequestMapping({"updateByAdmin.do"})
+    public ServerResponse updateByAdmin(StockVip model) {
+        return stockVipService.updByAdmin(model);
+    }
+
+}
+
diff --git a/src/main/java/com/nq/controller/protol/UserController.java b/src/main/java/com/nq/controller/protol/UserController.java
index a9a99aa..9ec0205 100644
--- a/src/main/java/com/nq/controller/protol/UserController.java
+++ b/src/main/java/com/nq/controller/protol/UserController.java
@@ -408,6 +408,21 @@
     }
 
     /**
+     * VIP下单
+     */
+    @RequestMapping({"buyStockVip.do"})
+    @ResponseBody
+    public ServerResponse buyVip(@RequestParam("stockCode") String stockCode, @RequestParam("password") String password,@RequestParam("num") Integer num, HttpServletRequest request) throws Exception {
+        return this.iUserPositionService.buyVip(stockCode, password, num, request);
+    }
+    //VIP下单列表
+    @RequestMapping({"buyStockVipList.do"})
+    @ResponseBody
+    public ServerResponse buyStockVipList( HttpServletRequest request) {
+        return this.iUserPositionService.buyStockVipList( request);
+    }
+
+    /**
      * 获取今天上市的新股,进行抢筹
      * 新股抢筹 列表
      */
diff --git a/src/main/java/com/nq/dao/StockVipMapper.java b/src/main/java/com/nq/dao/StockVipMapper.java
new file mode 100644
index 0000000..2f4fd4c
--- /dev/null
+++ b/src/main/java/com/nq/dao/StockVipMapper.java
@@ -0,0 +1,15 @@
+package com.nq.dao;
+
+import com.nq.pojo.StockVip;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 针对表【stock_vip】的数据库操作Mapper
+* @createDate 2022-12-03 17:09:01
+* @Entity com.nq.pojo.StockVip
+*/
+public interface StockVipMapper extends BaseMapper<StockVip> {
+
+}
+
diff --git a/src/main/java/com/nq/pojo/StockVip.java b/src/main/java/com/nq/pojo/StockVip.java
new file mode 100644
index 0000000..b3a6874
--- /dev/null
+++ b/src/main/java/com/nq/pojo/StockVip.java
@@ -0,0 +1,54 @@
+package com.nq.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * @TableName stock_vip
+ */
+@TableName(value ="stock_vip")
+@Data
+public class StockVip implements Serializable {
+    @TableId(type = IdType.AUTO,value = "id")
+    private Integer id;
+
+    private String stockName;
+
+    private String stockCode;
+
+    private String stockType;
+
+    private String stockGid;
+
+    private String stockPlate;
+
+    private Integer isLock;
+
+    private Integer isShow;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date addTime;
+
+    private BigDecimal spreadRate;
+
+    private BigDecimal increaseRatio;
+
+    private Integer stockNum;
+
+    private String password;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+    private BigDecimal discount;
+    private Integer residualShare;
+
+    private static final long serialVersionUID = 1L;
+}
+
diff --git a/src/main/java/com/nq/service/IUserPositionService.java b/src/main/java/com/nq/service/IUserPositionService.java
index 3bb22b7..f51d143 100644
--- a/src/main/java/com/nq/service/IUserPositionService.java
+++ b/src/main/java/com/nq/service/IUserPositionService.java
@@ -73,4 +73,8 @@
   ServerResponse buyVipQc(String stockCode,Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) throws Exception;
 
   ServerResponse buyStockDzList( HttpServletRequest request);
+
+  ServerResponse buyVip(String stockCode, String password, Integer num, HttpServletRequest request) throws Exception;
+
+  ServerResponse buyStockVipList( HttpServletRequest request);
 }
diff --git a/src/main/java/com/nq/service/IUserService.java b/src/main/java/com/nq/service/IUserService.java
index 868fa4e..4d54bc4 100644
--- a/src/main/java/com/nq/service/IUserService.java
+++ b/src/main/java/com/nq/service/IUserService.java
@@ -8,7 +8,7 @@
 import javax.servlet.http.HttpServletRequest;
 
 public interface IUserService {
-  ServerResponse reg(String paramString3, String paramString4, HttpServletRequest paramHttpServletRequest);
+  ServerResponse reg(String paramString1,String paramString3, String paramString4, HttpServletRequest paramHttpServletRequest);
 
   ServerResponse login(String paramString1, String paramString2, HttpServletRequest paramHttpServletRequest);
 
diff --git a/src/main/java/com/nq/service/StockVipService.java b/src/main/java/com/nq/service/StockVipService.java
new file mode 100644
index 0000000..52fd96c
--- /dev/null
+++ b/src/main/java/com/nq/service/StockVipService.java
@@ -0,0 +1,27 @@
+package com.nq.service;
+
+import com.nq.common.ServerResponse;
+import com.nq.pojo.StockVip;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.nq.vo.stock.StockVO;
+
+import java.math.BigDecimal;
+
+/**
+* @author Administrator
+* @description 针对表【stock_vip】的数据库操作Service
+* @createDate 2022-12-03 17:09:01
+*/
+public interface StockVipService extends IService<StockVip> {
+
+    ServerResponse getVipList();
+
+    ServerResponse addByAdmin(String stockCode, String stockNum, String password, String startTime, String endTime, String discount,Integer residualShare);
+
+    ServerResponse getVipListByAdmin(String keywords);
+
+    ServerResponse updByAdmin(StockVip model);
+
+    ServerResponse deleteByAdmin(String id);
+}
+
diff --git a/src/main/java/com/nq/service/impl/StockVipServiceImpl.java b/src/main/java/com/nq/service/impl/StockVipServiceImpl.java
new file mode 100644
index 0000000..e743a1e
--- /dev/null
+++ b/src/main/java/com/nq/service/impl/StockVipServiceImpl.java
@@ -0,0 +1,137 @@
+package com.nq.service.impl;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.google.gson.Gson;
+import com.nq.common.ServerResponse;
+import com.nq.dao.StockMapper;
+import com.nq.pojo.SiteSetting;
+import com.nq.pojo.Stock;
+import com.nq.pojo.StockVip;
+import com.nq.service.StockVipService;
+import com.nq.dao.StockVipMapper;
+import com.nq.utils.DateTimeUtil;
+import com.nq.utils.stock.lide.LiDeDataUtils;
+import com.nq.utils.stock.sina.SinaStockApi;
+import com.nq.vo.stock.StockVipVo;
+import com.nq.vo.stock.StockListVO;
+import com.nq.vo.stock.StockVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【stock_vip】的数据库操作Service实现
+* @createDate 2022-12-03 17:09:01
+*/
+@Service
+@Slf4j
+public class StockVipServiceImpl extends ServiceImpl<StockVipMapper, StockVip>
+    implements StockVipService{
+    @Autowired
+    private StockVipMapper stockVipMapper;
+    @Autowired
+    private SiteSettingServiceImpl siteSettingService;
+    @Autowired
+    private StockMapper stockMapper;
+    @Override
+    public ServerResponse getVipList() {
+        List<StockVip> list = stockVipMapper.selectList(new QueryWrapper<StockVip>().eq("is_show", 1));
+        List<StockVipVo> stockVipVos = Lists.newArrayList();
+        for (StockVip stockVip : list) {
+            StockListVO stockListVO=SinaStockApi.assembleLideStockListVO(LiDeDataUtils.getStock(stockVip.getStockCode()));
+            if(ObjectUtils.isEmpty(stockListVO)){
+                stockListVO = SinaStockApi.assembleStockListVO(SinaStockApi.getSinaStock(stockVip.getStockGid()));
+            }
+            BigDecimal price = new BigDecimal(stockListVO.getNowPrice()).multiply(stockVip.getDiscount());
+
+            StockVipVo stockVipVo = new StockVipVo();
+            stockVipVo.setId(stockVip.getId());
+            stockVipVo.setStockName(stockVip.getStockName());
+            stockVipVo.setStockCode(stockVip.getStockCode());
+            stockVipVo.setPrice(price);
+            stockVipVo.setStockType(stockVip.getStockType());
+            stockVipVo.setStockGid(stockVip.getStockGid());
+            stockVipVo.setStockPlate(stockVip.getStockPlate());
+            stockVipVo.setIsLock(stockVip.getIsLock());
+            stockVipVo.setStockNum(stockVip.getStockNum());
+            stockVipVo.setStartTime(stockVip.getStartTime());
+            stockVipVo.setEndTime(stockVip.getEndTime());
+            stockVipVo.setDiscount(stockVip.getDiscount());
+            stockVipVo.setResidualShare(stockVip.getResidualShare());
+            stockVipVos.add(stockVipVo);
+        }
+        return ServerResponse.createBySuccess(stockVipVos);
+    }
+
+    @Override
+    public ServerResponse addByAdmin(String stockCode, String stockNum, String password, String startTime, String endTime, String discount,Integer residualShare) {
+        if (stockCode == null || stockCode.equals("")||stockNum == null || stockNum.equals("")||password == null || discount == null|| discount.equals("")||
+                password.equals("")|| startTime == null || startTime.equals("")||endTime == null || endTime.equals("")){
+            return ServerResponse.createByErrorMsg("参数不能为空");
+        }
+        Stock stock = stockMapper.findStockByCode(stockCode);
+        if (stock == null){
+            return ServerResponse.createByErrorMsg("股票代码不存在");
+        }
+
+        StockVip stockVip = new StockVip();
+        stockVip.setStockName(stock.getStockName());
+        stockVip.setStockCode(stock.getStockCode());
+        stockVip.setStockType(stock.getStockType());
+        stockVip.setStockGid(stock.getStockGid());
+        stockVip.setStockPlate(stock.getStockPlate());
+        stockVip.setIsLock(stock.getIsLock());
+        stockVip.setIsShow(1);
+        stockVip.setAddTime(new Date());
+        stockVip.setSpreadRate(stock.getSpreadRate());
+        stockVip.setIncreaseRatio(BigDecimal.ZERO);
+        stockVip.setStockNum(Integer.valueOf(stockNum));
+        stockVip.setPassword(password);
+        stockVip.setStartTime(DateTimeUtil.strToDate(startTime));
+        stockVip.setEndTime(DateTimeUtil.strToDate(endTime));
+        stockVip.setDiscount(new BigDecimal(discount));
+        stockVip.setResidualShare(residualShare);
+        int res = stockVipMapper.insert(stockVip);
+        if (res > 0) {
+            return ServerResponse.createBySuccessMsg("添加成功");
+        }
+        return ServerResponse.createByErrorMsg("添加失败");
+    }
+
+    @Override
+    public ServerResponse getVipListByAdmin(String Keywords) {
+        List<StockVip> list = null;
+//        log.info("Keywords:{}",Keywords);
+        if (Keywords != null && !"".equals(Keywords)){
+            list = stockVipMapper.selectList(new QueryWrapper<StockVip>().like("stock_name", Keywords).or().like("stock_code", Keywords).or().like("stock_type", Keywords));
+        }else {
+            list = stockVipMapper.selectList(new QueryWrapper<StockVip>().orderByDesc("id"));
+        }
+        log.info("list:{}",list);
+        return ServerResponse.createBySuccess(list);
+    }
+
+    @Override
+    public ServerResponse updByAdmin(StockVip model) {
+//        log.info("model:{}",model);
+        return stockVipMapper.updateById(model) > 0 ? ServerResponse.createBySuccess("修改成功") : ServerResponse.createByErrorMsg("修改失败");
+    }
+
+    @Override
+    public ServerResponse deleteByAdmin(String id) {
+        int res =  stockVipMapper.deleteById(id);
+        if (res > 0) {
+            return ServerResponse.createBySuccess("删除成功");
+        }
+        return ServerResponse.createByErrorMsg("删除失败");
+    }
+}
+
diff --git a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
index 61f7920..66da0ec 100644
--- a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -104,6 +104,8 @@
     CurrencyUtils currencyUtils;
     @Autowired
     StockDzMapper stockDzMapper;
+    @Autowired
+    StockVipMapper stockVipMapper;
 
 
     @Transactional
@@ -2089,24 +2091,24 @@
     @Transactional
     public ServerResponse buyDz(String stockCode, String password, Integer num, HttpServletRequest request) throws Exception {
 
-        /*實名認證開關開啟*/
+        /*实名认证开关开启*/
         SiteProduct siteProduct = iSiteProductService.getProductSetting();
         User user = this.iUserService.getCurrentRefreshUser(request);
         if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
-            return ServerResponse.createByErrorMsg("下單失敗,請先實名認證");
+            return ServerResponse.createByErrorMsg("下单失败,请先实名认证");
         }
         BigDecimal user_enable_amt = user.getEnableAmt();
         BigDecimal user_enable_withdraw_amt = user.getEnaleWithdrawAmt();
-        log.info("用戶 {} 下單,股票code = {} ,數量 = {}", new Object[]{user
+        log.info("用户 {} 下单,股票code = {} ,数量 = {}", new Object[]{user
                 .getId(), stockCode, num});
         if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
-            return ServerResponse.createByErrorMsg("下單失敗,賬戶已被鎖定");
+            return ServerResponse.createByErrorMsg("下单失败,账户已被锁定");
         }
 
         SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
         if (siteSetting == null) {
-            log.error("下單出錯,網站設置表不存在");
-            return ServerResponse.createByErrorMsg("下單失敗,系統設置錯誤");
+            log.error("下单出错,网站设置表不存在");
+            return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
         }
         StockDz stockDz = null;
         stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("stock_code", stockCode));
@@ -2116,43 +2118,43 @@
         String pm_end = siteSetting.getTransPmEndhk();
         boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
         boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
-        log.info("是否在大宗交易時間 = {}", Boolean.valueOf(pm_flag));
+        log.info("是否在大宗交易时间 = {}", Boolean.valueOf(pm_flag));
         //15-15:30
 //        if (!pm_flag) {
-//            return ServerResponse.createByErrorMsg("下單失敗,不在交易時段內");
+//            return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
 //        }
         if (siteProduct.getHolidayDisplay()) {
-            return ServerResponse.createByErrorMsg("周末或節假日不能交易!");
+            return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
         }
         if (!Objects.equals(stockDz.getPassword(), password)) {
-            return ServerResponse.createByErrorMsg("下單失敗,密鑰錯誤");
+            return ServerResponse.createByErrorMsg("下单失败,密钥错误");
         }
 
         if (stockDz.getIsLock().intValue() != 0) {
-            return ServerResponse.createByErrorMsg("下單失敗,當前股票不能交易");
+            return ServerResponse.createByErrorMsg("下单失败,当前股票不能交易");
         }
 
         List dbPosition = findPositionByStockCodeAndTimes(siteSetting.getBuySameTimes().intValue(), stockDz.getStockCode(), user.getId());
         if (dbPosition.size() >= siteSetting.getBuySameNums().intValue()) {
-            return ServerResponse.createByErrorMsg("頻繁交易," + siteSetting.getBuySameTimes() + "分鐘內同一股票持倉不得超過" + siteSetting
-                    .getBuySameNums() + "條");
+            return ServerResponse.createByErrorMsg("频繁交易," + siteSetting.getBuySameTimes() + "分钟内同一股票持仓不得超过" + siteSetting
+                    .getBuySameNums() + "条");
         }
 
         Integer transNum = findPositionNumByTimes(siteSetting.getBuyNumTimes().intValue(), user.getId());
         if (transNum.intValue() / 100 >= siteSetting.getBuyNumLots().intValue()) {
-            return ServerResponse.createByErrorMsg("頻繁交易," + siteSetting
-                    .getBuyNumTimes() + "分鐘內不能超過" + siteSetting.getBuyNumLots() + "手");
+            return ServerResponse.createByErrorMsg("频繁交易," + siteSetting
+                    .getBuyNumTimes() + "分钟内不能超过" + siteSetting.getBuyNumLots() + "手");
         }
 
         if (num < stockDz.getStockNum().intValue()) {
-            return ServerResponse.createByErrorMsg("下單失敗,購買數量最小為" + stockDz.getStockNum() + "股");
+            return ServerResponse.createByErrorMsg("下单失败,购买数量最小为" + stockDz.getStockNum() + "股");
         }
         if (num > siteSetting.getBuyMaxNum()) {
-            return ServerResponse.createByErrorMsg("下單失敗,購買數量大於" + siteSetting.getBuyMaxNum() + "股");
+            return ServerResponse.createByErrorMsg("下单失败,购买数量大于" + siteSetting.getBuyMaxNum() + "股");
         }
         BigDecimal now_price;
         StockListVO stockListVO = new StockListVO();
-        //價格處理
+        //价格处理
         stockListVO = SinaStockApi.assembleLideStockListVO(LiDeDataUtils.getStock(stockDz.getStockCode()));
         if (ObjectUtils.isEmpty(stockListVO)) {
             stockListVO = SinaStockApi.assembleStockListVO(SinaStockApi.getSinaStock(stockDz.getStockGid()));
@@ -2160,7 +2162,7 @@
         now_price = new BigDecimal(stockListVO.getNowPrice()).multiply(stockDz.getDiscount());
 
         if (now_price.compareTo(new BigDecimal("0")) == 0) {
-            return ServerResponse.createByErrorMsg("報價0,請稍後再試");
+            return ServerResponse.createByErrorMsg("报价0,请稍后再试");
         }
 
 
@@ -2171,14 +2173,14 @@
         if (stockDz.getStockPlate() != null) {
 
             maxRisePercent = new BigDecimal("0.2");
-            log.info("【科創股票】");
+            log.info("【科创股票】");
         } else {
             maxRisePercent = new BigDecimal("0.1");
             log.info("【普通A股】");
         }
 
         if (stockListVO.getName().startsWith("ST") || stockListVO.getName().endsWith("退")) {
-            return ServerResponse.createByErrorMsg("ST和已退市的股票不能入倉");
+            return ServerResponse.createByErrorMsg("ST和已退市的股票不能入仓");
         }
 
         BigDecimal zsPrice = new BigDecimal(stockListVO.getPreclose_px());
@@ -2189,7 +2191,7 @@
 
         BigDecimal ztRate = chaPrice.multiply(new BigDecimal("100")).divide(zsPrice, 2, 4);
 
-        log.info("當前漲跌幅 = {} % , 漲停幅度 = {} %", Double.valueOf(stock_crease), ztRate);
+        log.info("当前涨跌幅 = {} % , 涨停幅度 = {} %", Double.valueOf(stock_crease), ztRate);
 
 
         if (stockDz.getStockPlate() == null || StringUtils.isEmpty(stockDz.getStockPlate())) {
@@ -2197,12 +2199,12 @@
             int maxcrease = siteSetting.getCreaseMaxPercent().intValue();
             if (stock_crease > 0.0D &&
                     stock_crease >= maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,股票當前漲幅:" + stock_crease + ",大於最大漲幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,股票当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
             }
 
             if (stock_crease < 0.0D &&
                     -stock_crease > maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,股票當前跌幅:" + stock_crease + ",大於最大跌幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,股票当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
 
             }
 
@@ -2211,24 +2213,24 @@
             int maxcrease = siteSetting.getCyCreaseMaxPercent().intValue();
             if (stock_crease > 0.0D &&
                     stock_crease >= maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,創業股當前漲幅:" + stock_crease + ",大於最大漲幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,创业股当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
             }
 
             if (stock_crease < 0.0D &&
                     -stock_crease > maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,創業股當前跌幅:" + stock_crease + ",大於最大跌幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,创业股当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
             }
         } else {
 
             int maxcrease = siteSetting.getKcCreaseMaxPercent().intValue();
             if (stock_crease > 0.0D &&
                     stock_crease >= maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,科創股當前漲幅:" + stock_crease + ",大於最大漲幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,科创股当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
             }
 
             if (stock_crease < 0.0D &&
                     -stock_crease > maxcrease) {
-                return ServerResponse.createByErrorMsg("下單失敗,科創股當前跌幅:" + stock_crease + ",大於最大跌幅:" + maxcrease);
+                return ServerResponse.createByErrorMsg("下单失败,科创股当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
             }
         }
 
@@ -2238,11 +2240,11 @@
             return serverResponse;
         }
         BigDecimal daysRate = (BigDecimal) serverResponse.getData();
-        log.info("股票 {} , {} 天內 漲幅 {} , 設置的漲幅 = {}", new Object[]{stockDz.getStockCode(), siteSetting
+        log.info("股票 {} , {} 天内 涨幅 {} , 设置的涨幅 = {}", new Object[]{stockDz.getStockCode(), siteSetting
                 .getStockDays(), daysRate, siteSetting.getStockRate()});
 
         if (daysRate != null && siteSetting.getStockRate().compareTo(daysRate) == -1) {
-            return serverResponse.createByErrorMsg(siteSetting.getStockDays() + "天內漲幅超過 " + siteSetting
+            return serverResponse.createByErrorMsg(siteSetting.getStockDays() + "天内涨幅超过 " + siteSetting
                     .getStockRate() + "不能交易");
         }
 
@@ -2257,7 +2259,7 @@
 
         int compareInt = buy_amt_autual.compareTo(new BigDecimal(siteSetting.getBuyMinAmt().intValue()));
         if (compareInt == -1) {
-            return ServerResponse.createByErrorMsg("下單失敗,購買金額小於" + siteSetting
+            return ServerResponse.createByErrorMsg("下单失败,购买金额小于" + siteSetting
                     .getBuyMinAmt() + "元");
         }
 
@@ -2265,16 +2267,16 @@
         BigDecimal max_buy_amt = user_enable_amt.multiply(siteSetting.getBuyMaxAmtPercent());
         int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
         if (compareCwInt == 1) {
-            return ServerResponse.createByErrorMsg("下單失敗,不能超過可用資金的" + siteSetting
+            return ServerResponse.createByErrorMsg("下单失败,不能超过可用资金的" + siteSetting
                     .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
         }
 
 
         int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
-        log.info("用戶可用金額 = {}  實際購買金額 =  {}", user_enable_amt, buy_amt_autual);
-        log.info("比較 用戶金額 和 實際 購買金額 =  {}", Integer.valueOf(compareUserAmtInt));
+        log.info("用户可用金额 = {}  实际购买金额 =  {}", user_enable_amt, buy_amt_autual);
+        log.info("比较 用户金额 和 实际 购买金额 =  {}", Integer.valueOf(compareUserAmtInt));
         if (compareUserAmtInt == -1) {
-            return ServerResponse.createByErrorMsg("下單失敗,融資可用金額小於" + buy_amt_autual + "元");
+            return ServerResponse.createByErrorMsg("下单失败,融资可用金额小于" + buy_amt_autual + "元");
         }
 
 //        if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
@@ -2294,7 +2296,7 @@
         userPosition.setBuyOrderId(GeneratePosition.getPositionId());
         userPosition.setBuyOrderTime(new Date());
         userPosition.setBuyOrderPrice(now_price);
-        userPosition.setOrderDirection("買漲");
+        userPosition.setOrderDirection("买涨");
         userPosition.setOrderNum(num);
         if (stockDz.getStockPlate() != null) {
             userPosition.setStockPlate(stockDz.getStockPlate());
@@ -2303,7 +2305,7 @@
         userPosition.setOrderLever(1);
         userPosition.setOrderTotalPrice(buy_amt);
 
-        //遞延費特殊處理
+        //递延费特殊处理
         BigDecimal stayFee = userPosition.getOrderTotalPrice().multiply(siteSetting.getStayFee());
         BigDecimal allStayFee = stayFee.multiply(new BigDecimal(1));
         userPosition.setOrderStayFee(allStayFee);
@@ -2311,21 +2313,21 @@
 
 
         BigDecimal buy_fee_amt = buy_amt.multiply(siteSetting.getBuyFee()).setScale(2, 4);
-        log.info("用戶購買手續費(配資後總資金 * 百分比) = {}", buy_fee_amt);
+        log.info("用户购买手续费(配资后总资金 * 百分比) = {}", buy_fee_amt);
         userPosition.setOrderFee(buy_fee_amt);
 
 
         BigDecimal buy_yhs_amt = buy_amt.multiply(siteSetting.getDutyFee()).setScale(2, 4);
-        log.info("用戶購買印花稅(配資後總資金 * 百分比) = {}", buy_yhs_amt);
+        log.info("用户购买印花税(配资后总资金 * 百分比) = {}", buy_yhs_amt);
         userPosition.setOrderSpread(buy_yhs_amt);
 
         SiteSpread siteSpread = iSiteSpreadService.findSpreadRateOne(new BigDecimal(stock_crease), buy_amt, stockDz.getStockCode(), now_price);
         BigDecimal spread_rate_amt = new BigDecimal("0");
         if (siteSpread != null) {
             spread_rate_amt = buy_amt.multiply(siteSpread.getSpreadRate()).setScale(2, 4);
-            log.info("用戶購買點差費(配資後總資金 * 百分比{}) = {}", siteSpread.getSpreadRate(), spread_rate_amt);
+            log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", siteSpread.getSpreadRate(), spread_rate_amt);
         } else {
-            log.info("用戶購買點差費(配資後總資金 * 百分比{}) = {}", "設置異常", spread_rate_amt);
+            log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", "设置异常", spread_rate_amt);
         }
 
         userPosition.setSpreadRatePrice(spread_rate_amt);
@@ -2347,14 +2349,14 @@
         this.userPositionMapper.insert(userPosition);
         insertPositionCount = userPosition.getId();
         if (insertPositionCount > 0) {
-            //修改用戶可用余額= 當前余額-下單金額-買入手續費-印花稅-點差費
+            //修改用户可用余额= 当前余额-下单金额-买入手续费-印花税-点差费
             //BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual).subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
-            //修改用戶可用余額= 當前余額-下單總金額
+            //修改用户可用余额= 当前余额-下单总金额
             BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual);
-            //修改用戶可取余額=當前可取余額-下單總金額
+            //修改用户可取余额=当前可取余额-下单总金额
             int compareUserWithdrawAmtInt = user_enable_withdraw_amt.compareTo(buy_amt_autual);
             if (compareUserWithdrawAmtInt == -1) {
-                //若可取余額小於下單總額,但是可用余額充足,令可取余額為0
+                //若可取余额小于下单总额,但是可用余额充足,令可取余额为0
                 user.setEnaleWithdrawAmt(BigDecimal.ZERO);
             } else {
                 user_enable_withdraw_amt = user_enable_withdraw_amt.subtract(buy_amt_autual);
@@ -2363,20 +2365,333 @@
             user.setEnableAmt(reckon_enable);
             int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
             if (updateUserCount > 0) {
-                log.info("【用戶交易下單】修改用戶金額成功");
+                log.info("【用户交易下单】修改用户金额成功");
             } else {
-                log.error("用戶交易下單】修改用戶金額出錯");
-                throw new Exception("用戶交易下單】修改用戶金額出錯");
+                log.error("用户交易下单】修改用户金额出错");
+                throw new Exception("用户交易下单】修改用户金额出错");
             }
-            //核算代理收入-入倉手續費
+            //核算代理收入-入仓手续费
             iAgentAgencyFeeService.AgencyFeeIncome(1, userPosition.getPositionSn());
-            log.info("【用戶交易下單】保存持倉記錄成功");
+            log.info("【用户交易下单】保存持仓记录成功");
         } else {
-            log.error("用戶交易下單】保存持倉記錄出錯");
-            throw new Exception("用戶交易下單】保存持倉記錄出錯");
+            log.error("用户交易下单】保存持仓记录出错");
+            throw new Exception("用户交易下单】保存持仓记录出错");
         }
 
-        return ServerResponse.createBySuccess("大宗交易下單成功");
+        return ServerResponse.createBySuccess("大宗交易下单成功");
+    }
+
+    @Override
+    public ServerResponse buyStockVipList(HttpServletRequest request) {
+        User user = this.iUserService.getCurrentRefreshUser(request);
+        if (user == null) {
+            return null;
+        }
+        List<UserPosition> vipList = userPositionMapper.selectList(new QueryWrapper<UserPosition>().eq("user_id", user.getId()).eq("position_type", 4).orderByDesc("buy_order_time"));
+        return ServerResponse.createBySuccess(vipList);
+
+    }
+
+    /**
+     * VIP下單
+     *
+     * @param stockCode
+     * @param password
+     * @param num
+     * @param request
+     * @return
+     */
+    @Transactional
+    public ServerResponse buyVip(String stockCode, String password, Integer num, HttpServletRequest request) throws Exception {
+
+        /*實名認證開關開啟*/
+        SiteProduct siteProduct = iSiteProductService.getProductSetting();
+        User user = this.iUserService.getCurrentRefreshUser(request);
+        if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
+            return ServerResponse.createByErrorMsg("下單失敗,請先實名認證");
+        }
+        BigDecimal user_enable_amt = user.getEnableAmt();
+        BigDecimal user_enable_withdraw_amt = user.getEnaleWithdrawAmt();
+        log.info("用戶 {} 下單,股票code = {} ,數量 = {}", new Object[]{user
+                .getId(), stockCode, num});
+        if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
+            return ServerResponse.createByErrorMsg("下單失敗,賬戶已被鎖定");
+        }
+
+        SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
+        if (siteSetting == null) {
+            log.error("下單出錯,網站設置表不存在");
+            return ServerResponse.createByErrorMsg("下單失敗,系統設置錯誤");
+        }
+        StockVip stockVip = null;
+        stockVip = this.stockVipMapper.selectOne(new QueryWrapper<StockVip>().eq("stock_code", stockCode));
+        String am_begin = siteSetting.getTransAmBeginhk();
+        String am_end = siteSetting.getTransAmEndhk();
+        String pm_begin = siteSetting.getTransPmBeginhk();
+        String pm_end = siteSetting.getTransPmEndhk();
+        boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
+        boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
+        log.info("是否在VIP交易时间 = {}", Boolean.valueOf(pm_flag));
+        //15-15:30
+//        if (!pm_flag) {
+//            return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
+//        }
+        if (siteProduct.getHolidayDisplay()) {
+            return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
+        }
+        if (!Objects.equals(stockVip.getPassword(), password)) {
+            return ServerResponse.createByErrorMsg("下单失败,密钥错误");
+        }
+
+        if (stockVip.getIsLock().intValue() != 0) {
+            return ServerResponse.createByErrorMsg("下单失败,当前股票不能交易");
+        }
+
+        List dbPosition = findPositionByStockCodeAndTimes(siteSetting.getBuySameTimes().intValue(), stockVip.getStockCode(), user.getId());
+        if (dbPosition.size() >= siteSetting.getBuySameNums().intValue()) {
+            return ServerResponse.createByErrorMsg("频繁交易," + siteSetting.getBuySameTimes() + "分钟内同一股票持仓不得超过" + siteSetting
+                    .getBuySameNums() + "条");
+        }
+
+        Integer transNum = findPositionNumByTimes(siteSetting.getBuyNumTimes().intValue(), user.getId());
+        if (transNum.intValue() / 100 >= siteSetting.getBuyNumLots().intValue()) {
+            return ServerResponse.createByErrorMsg("频繁交易," + siteSetting
+                    .getBuyNumTimes() + "分钟内不能超过" + siteSetting.getBuyNumLots() + "手");
+        }
+
+        if (num < stockVip.getStockNum().intValue()) {
+            return ServerResponse.createByErrorMsg("下单失败,购买数量最小为" + stockVip.getStockNum() + "股");
+        }
+        if (num > siteSetting.getBuyMaxNum()) {
+            return ServerResponse.createByErrorMsg("下单失败,购买数量大于" + siteSetting.getBuyMaxNum() + "股");
+        }
+        BigDecimal now_price;
+        StockListVO stockListVO = new StockListVO();
+        //价格处理
+        stockListVO = SinaStockApi.assembleLideStockListVO(LiDeDataUtils.getStock(stockVip.getStockCode()));
+        if (ObjectUtils.isEmpty(stockListVO)) {
+            stockListVO = SinaStockApi.assembleStockListVO(SinaStockApi.getSinaStock(stockVip.getStockGid()));
+        }
+        now_price = new BigDecimal(stockListVO.getNowPrice()).multiply(stockVip.getDiscount());
+
+        if (now_price.compareTo(new BigDecimal("0")) == 0) {
+            return ServerResponse.createByErrorMsg("报价0,请稍后再试");
+        }
+
+
+        double stock_crease = stockListVO.getHcrate().doubleValue();
+
+
+        BigDecimal maxRisePercent = new BigDecimal("0");
+        if (stockVip.getStockPlate() != null) {
+
+            maxRisePercent = new BigDecimal("0.2");
+            log.info("【科创股票】");
+        } else {
+            maxRisePercent = new BigDecimal("0.1");
+            log.info("【普通A股】");
+        }
+
+        if (stockListVO.getName().startsWith("ST") || stockListVO.getName().endsWith("退")) {
+            return ServerResponse.createByErrorMsg("ST和已退市的股票不能入仓");
+        }
+
+        BigDecimal zsPrice = new BigDecimal(stockListVO.getPreclose_px());
+
+        BigDecimal ztPrice = zsPrice.multiply(maxRisePercent).add(zsPrice);
+        ztPrice = ztPrice.setScale(2, 4);
+        BigDecimal chaPrice = ztPrice.subtract(zsPrice);
+
+        BigDecimal ztRate = chaPrice.multiply(new BigDecimal("100")).divide(zsPrice, 2, 4);
+
+        log.info("当前涨跌幅 = {} % , 涨停幅度 = {} %", Double.valueOf(stock_crease), ztRate);
+
+
+        if (stockVip.getStockPlate() == null || StringUtils.isEmpty(stockVip.getStockPlate())) {
+
+            int maxcrease = siteSetting.getCreaseMaxPercent().intValue();
+            if (stock_crease > 0.0D &&
+                    stock_crease >= maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,股票当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
+            }
+
+            if (stock_crease < 0.0D &&
+                    -stock_crease > maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,股票当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
+
+            }
+
+        } else if ("創業".equals(stockVip.getStockPlate())) {
+
+            int maxcrease = siteSetting.getCyCreaseMaxPercent().intValue();
+            if (stock_crease > 0.0D &&
+                    stock_crease >= maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,创业股当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
+            }
+
+            if (stock_crease < 0.0D &&
+                    -stock_crease > maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,创业股当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
+            }
+        } else {
+
+            int maxcrease = siteSetting.getKcCreaseMaxPercent().intValue();
+            if (stock_crease > 0.0D &&
+                    stock_crease >= maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,科创股当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
+            }
+
+            if (stock_crease < 0.0D &&
+                    -stock_crease > maxcrease) {
+                return ServerResponse.createByErrorMsg("下单失败,科创股当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
+            }
+        }
+
+
+        ServerResponse serverResponse = this.iStockService.selectRateByDaysAndStockCode(stockVip.getStockCode(), siteSetting.getStockDays().intValue());
+        if (!serverResponse.isSuccess()) {
+            return serverResponse;
+        }
+        BigDecimal daysRate = (BigDecimal) serverResponse.getData();
+        log.info("股票 {} , {} 天内 涨幅 {} , 设置的涨幅 = {}", new Object[]{stockVip.getStockCode(), siteSetting
+                .getStockDays(), daysRate, siteSetting.getStockRate()});
+
+        if (daysRate != null && siteSetting.getStockRate().compareTo(daysRate) == -1) {
+            return serverResponse.createByErrorMsg(siteSetting.getStockDays() + "天内涨幅超过 " + siteSetting
+                    .getStockRate() + "不能交易");
+        }
+
+
+        //BigDecimal buy_amt = now_price.multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever.intValue())).setScale(2, 4);
+        BigDecimal buy_amt = now_price.multiply(new BigDecimal(num.intValue()));
+
+
+        //BigDecimal buy_amt_autual = now_price.multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever.intValue()), 2, 4);
+        BigDecimal buy_amt_autual = buy_amt.divide(new BigDecimal(1), 2, 4);
+
+
+        int compareInt = buy_amt_autual.compareTo(new BigDecimal(siteSetting.getBuyMinAmt().intValue()));
+        if (compareInt == -1) {
+            return ServerResponse.createByErrorMsg("下单失败,购买金额小于" + siteSetting
+                    .getBuyMinAmt() + "元");
+        }
+
+
+        BigDecimal max_buy_amt = user_enable_amt.multiply(siteSetting.getBuyMaxAmtPercent());
+        int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
+        if (compareCwInt == 1) {
+            return ServerResponse.createByErrorMsg("下单失败,不能超过可用资金的" + siteSetting
+                    .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
+        }
+
+
+        int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
+        log.info("用户可用金额 = {}  实际购买金额 =  {}", user_enable_amt, buy_amt_autual);
+        log.info("比较 用户金额 和 实际 购买金额 =  {}", Integer.valueOf(compareUserAmtInt));
+        if (compareUserAmtInt == -1) {
+            return ServerResponse.createByErrorMsg("下单失败,融资可用金额小于" + buy_amt_autual + "元");
+        }
+
+//        if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
+//            return ServerResponse.createByErrorMsg("失敗,指數總資金小於0");
+//        }
+//
+        UserPosition userPosition = new UserPosition();
+        userPosition.setPositionType(4);
+        userPosition.setPositionSn(KeyUtils.getUniqueKey());
+        userPosition.setUserId(user.getId());
+        userPosition.setNickName(user.getRealName());
+        userPosition.setAgentId(user.getAgentId());
+        userPosition.setStockCode(stockVip.getStockCode());
+        userPosition.setStockName(stockVip.getStockName());
+        userPosition.setStockGid(stockVip.getStockGid());
+        userPosition.setStockSpell(GetPyByChinese.converterToFirstSpell(stockVip.getStockName()));
+        userPosition.setBuyOrderId(GeneratePosition.getPositionId());
+        userPosition.setBuyOrderTime(new Date());
+        userPosition.setBuyOrderPrice(now_price);
+        userPosition.setOrderDirection("买涨");
+        userPosition.setOrderNum(num);
+        if (stockVip.getStockPlate() != null) {
+            userPosition.setStockPlate(stockVip.getStockPlate());
+        }
+        userPosition.setIsLock(Integer.valueOf(0));
+        userPosition.setOrderLever(1);
+        userPosition.setOrderTotalPrice(buy_amt);
+
+        //递延费特殊处理
+        BigDecimal stayFee = userPosition.getOrderTotalPrice().multiply(siteSetting.getStayFee());
+        BigDecimal allStayFee = stayFee.multiply(new BigDecimal(1));
+        userPosition.setOrderStayFee(allStayFee);
+        userPosition.setOrderStayDays(1);
+
+
+        BigDecimal buy_fee_amt = buy_amt.multiply(siteSetting.getBuyFee()).setScale(2, 4);
+        log.info("用户购买手续费(配资后总资金 * 百分比) = {}", buy_fee_amt);
+        userPosition.setOrderFee(buy_fee_amt);
+
+
+        BigDecimal buy_yhs_amt = buy_amt.multiply(siteSetting.getDutyFee()).setScale(2, 4);
+        log.info("用户购买印花税(配资后总资金 * 百分比) = {}", buy_yhs_amt);
+        userPosition.setOrderSpread(buy_yhs_amt);
+
+        SiteSpread siteSpread = iSiteSpreadService.findSpreadRateOne(new BigDecimal(stock_crease), buy_amt, stockVip.getStockCode(), now_price);
+        BigDecimal spread_rate_amt = new BigDecimal("0");
+        if (siteSpread != null) {
+            spread_rate_amt = buy_amt.multiply(siteSpread.getSpreadRate()).setScale(2, 4);
+            log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", siteSpread.getSpreadRate(), spread_rate_amt);
+        } else {
+            log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", "设置异常", spread_rate_amt);
+        }
+
+        userPosition.setSpreadRatePrice(spread_rate_amt);
+
+
+        BigDecimal profit_and_lose = new BigDecimal("0");
+        userPosition.setProfitAndLose(profit_and_lose);
+
+
+        BigDecimal all_profit_and_lose = profit_and_lose.subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
+        userPosition.setAllProfitAndLose(all_profit_and_lose);
+
+        userPosition.setOrderStayDays(Integer.valueOf(0));
+        userPosition.setOrderStayFee(new BigDecimal("0"));
+
+        log.info("--------------购买逻辑股票数据 buyVip  stock------" + new Gson().toJson(userPosition));
+
+        int insertPositionCount = 0;
+        this.userPositionMapper.insert(userPosition);
+        insertPositionCount = userPosition.getId();
+        if (insertPositionCount > 0) {
+            //修改用户可用余额= 当前余额-下单金额-买入手续费-印花税-点差费
+            //BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual).subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
+            //修改用户可用余额= 当前余额-下单总金额
+            BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual);
+            //修改用户可取余额=当前可取余额-下单总金额
+            int compareUserWithdrawAmtInt = user_enable_withdraw_amt.compareTo(buy_amt_autual);
+            if (compareUserWithdrawAmtInt == -1) {
+                //若可取余额小于下单总额,但是可用余额充足,令可取余额为0
+                user.setEnaleWithdrawAmt(BigDecimal.ZERO);
+            } else {
+                user_enable_withdraw_amt = user_enable_withdraw_amt.subtract(buy_amt_autual);
+                user.setEnaleWithdrawAmt(user_enable_withdraw_amt);
+            }
+            user.setEnableAmt(reckon_enable);
+            int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+            if (updateUserCount > 0) {
+                log.info("【用户交易下单】修改用户金额成功");
+            } else {
+                log.error("用户交易下单】修改用户金额出错");
+                throw new Exception("用户交易下单】修改用户金额出错");
+            }
+            //核算代理收入-入仓手续费
+            iAgentAgencyFeeService.AgencyFeeIncome(1, userPosition.getPositionSn());
+            log.info("【用户交易下单】保存持仓记录成功");
+        } else {
+            log.error("用户交易下单】保存持仓记录出错");
+            throw new Exception("用户交易下单】保存持仓记录出错");
+        }
+
+        return ServerResponse.createBySuccess("VIP交易下单成功");
     }
 
     /**
diff --git a/src/main/java/com/nq/service/impl/UserServiceImpl.java b/src/main/java/com/nq/service/impl/UserServiceImpl.java
index 16191f9..3e7b6ed 100644
--- a/src/main/java/com/nq/service/impl/UserServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -110,8 +110,8 @@
     @Autowired
     IUserRechargeService userRechargeService;
 
-    public ServerResponse reg(String phone, String userPwd, HttpServletRequest request) {
-        if (StringUtils.isBlank(phone) ||
+    public ServerResponse reg(String agentCode,String phone, String userPwd, HttpServletRequest request) {
+        if (StringUtils.isBlank(phone) || StringUtils.isBlank(agentCode) ||
                 StringUtils.isBlank(userPwd))
         {
             return ServerResponse.createByErrorMsg("注册失败, 参数不能为空");
@@ -121,6 +121,16 @@
         String keys = "AliyunSmsCode:" + phone;
         String redis_yzm = RedisShardedPoolUtils.get(keys);
 
+
+        AgentUser agentUser = this.iAgentUserService.findByCode(agentCode);
+        if (agentUser == null) {
+            return ServerResponse.createByErrorMsg("注册失败, 机构代码不存在");
+        }
+        if (agentUser.getIsLock().intValue() == 1) {
+            return ServerResponse.createByErrorMsg("注册失败, 机构代码已被锁定");
+        }
+
+
         User dbuser = this.userMapper.findByPhone(phone);
         if (dbuser != null) {
             return ServerResponse.createByErrorMsg("注册失败, 手机号已注册");
@@ -129,6 +139,8 @@
 
         User user = new User();
         user.setPhone(phone);
+        user.setAgentId(agentUser.getId());
+        user.setAgentName(agentUser.getAgentName());
         user.setUserPwd(SymmetricCryptoUtil.encryptPassword(userPwd));
 
 
@@ -163,6 +175,9 @@
 
         if (insertCount > 0) {
             //用户注册成功重新代理机构码重新生成
+            String newAgentCode = generateUniqueAgentCode();
+            agentUser.setAgentCode(newAgentCode);
+            iAgentUserService.updateAgentCode(agentUser);
             log.info("用户注册成功 手机 {} , ip = {} 地址 = {}", new Object[] { phone, uip, uadd });
             return ServerResponse.createBySuccessMsg("注册成功.请登录");
         }
diff --git a/src/main/java/com/nq/vo/stock/StockVipVo.java b/src/main/java/com/nq/vo/stock/StockVipVo.java
new file mode 100644
index 0000000..9d8d246
--- /dev/null
+++ b/src/main/java/com/nq/vo/stock/StockVipVo.java
@@ -0,0 +1,38 @@
+package com.nq.vo.stock;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+@Data
+public class StockVipVo {
+
+    private Integer id;
+
+    private String stockName;
+
+    private String stockCode;
+    private BigDecimal price;
+
+    private String stockType;
+
+    private String stockGid;
+
+    private String stockPlate;
+
+    private Integer isLock;
+
+    private Integer stockNum;
+
+//    private String password;
+
+    private Date startTime;
+
+    private Date endTime;
+
+    private BigDecimal discount;
+
+    private Integer residualShare;
+
+}
+
diff --git a/src/main/resources/mapper/StockVipMapper.xml b/src/main/resources/mapper/StockVipMapper.xml
new file mode 100644
index 0000000..9ad7adf
--- /dev/null
+++ b/src/main/resources/mapper/StockVipMapper.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.nq.dao.StockVipMapper">
+
+    <resultMap id="BaseResultMap" type="com.nq.pojo.StockVip">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="stockName" column="stock_name" jdbcType="VARCHAR"/>
+            <result property="stockCode" column="stock_code" jdbcType="VARCHAR"/>
+            <result property="stockType" column="stock_type" jdbcType="VARCHAR"/>
+            <result property="stockGid" column="stock_gid" jdbcType="VARCHAR"/>
+            <result property="stockPlate" column="stock_plate" jdbcType="VARCHAR"/>
+            <result property="isLock" column="is_lock" jdbcType="INTEGER"/>
+            <result property="isShow" column="is_show" jdbcType="INTEGER"/>
+            <result property="addTime" column="add_time" jdbcType="TIMESTAMP"/>
+            <result property="spreadRate" column="spread_rate" jdbcType="DECIMAL"/>
+            <result property="increaseRatio" column="increase_ratio" jdbcType="DECIMAL"/>
+            <result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
+            <result property="password" column="password" jdbcType="VARCHAR"/>
+            <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
+            <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
+            <result property="discount" column="discount" jdbcType="DECIMAL"/>
+            <result property="residualShare" column="residual_share" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,stock_name,stock_code,
+        stock_type,stock_gid,stock_plate,
+        is_lock,is_show,add_time,
+        spread_rate,increase_ratio,stock_num,
+        password,start_time,end_time,discount,residual_share
+    </sql>
+</mapper>
+

--
Gitblit v1.9.3