Selaa lähdekoodia

增加广钻相关接口

zhou.xiaoning 3 vuotta sitten
vanhempi
commit
ab56de5ee1

+ 6 - 6
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.88"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test203"/>
+    <DbUser value="mtp2_test201"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.203"/>
+    <Address value="192.168.31.201"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.31.203:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.201:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.203"/>
+    <HostName value="192.168.31.201"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,8 +38,8 @@
   <MySQLSetting>
     <Host value="192.168.30.72"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test203"/>
-    <Username value="quote_test203"/>
+    <DBName value="historyquote_test201"/>
+    <Username value="quote_test201"/>
     <Password value="123456"/>
   </MySQLSetting>
 </Configuration>

+ 5 - 3
controllers/ermcp/qryWarehouse.go

@@ -7,16 +7,18 @@
 package ermcp
 
 import (
-	"github.com/gin-gonic/gin"
 	"mtp2_if/global/app"
 	"mtp2_if/models"
 	"mtp2_if/mtpcache"
+
+	"github.com/gin-gonic/gin"
 )
 
 // QryWarehouseReq 仓库查询请求参数
 type QryWarehouseReq struct {
-	UserId int64  `form:"userid" binding:"required"` //用户ID
-	Status string `form:"status"`                    // 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
+	UserId            int64  `form:"userid" binding:"required"` //用户ID
+	Status            string `form:"status"`                    // 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
+	IsIncludeExchange bool   `form:"isincludeexchange"`         // 是返回交易所仓库
 }
 
 // QryWarehouseRsp 仓库查询响应

+ 28 - 0
controllers/guangzuan/warehouse.go

@@ -0,0 +1,28 @@
+package guangzuan
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/models"
+
+	"github.com/gin-gonic/gin"
+)
+
+// QueryWarehouseInfo
+// @Summary 查询仓库信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
+// @Param userid query int true "用户ID"
+// @Param status query string false "仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝"
+// @Param isincludeexchange query bool false "是返回交易所仓库"
+// @Success 200 {array} models.GZWarehouseinfo
+// @Failure 500 {object} app.Response
+// @Router /Guangzuan/QueryWarehouseInfo [get]
+// @Tags 广钻
+func QueryWarehouseInfo(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GZWarehouseinfo{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 29 - 0
controllers/guangzuan/wrposition.go

@@ -0,0 +1,29 @@
+package guangzuan
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/models"
+
+	"github.com/gin-gonic/gin"
+)
+
+// QueryMyWRPosition
+// @Summary 查询我的库存
+// @Produce json
+// @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
+// @Param wruserid query int true "登录用户ID"
+// @Param zsallproperties query string false "商品(查询字段-模糊查询)"
+// @Param zscategory query int false "钻石分类枚举ID"
+// @Param warehouseid query int false "仓库ID"
+// @Success 200 {array} models.GZWarehouseinfo
+// @Failure 500 {object} app.Response
+// @Router /Guangzuan/QueryMyWRPosition [get]
+// @Tags 广钻
+func QueryMyWRPosition(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.MyWRPosition{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 4 - 1
controllers/wrTrade2/qryWrTrade.go

@@ -447,6 +447,8 @@ func QueryWrScfContractInterest(c *gin.Context) {
 // @Summary 查询提货申请
 // @Produce json
 // @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
 // @Param userid query int true "用户id"
 // @Param begindate query string false "开始交易日(yyyymmdd)"
 // @Param enddate query string false "结束交易日(yyyymmdd)"
@@ -458,7 +460,8 @@ func QueryWrOutInApply(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
 	m := models.WrOutInApply{}
 	a.DoBindReq(&m)
-	a.DoGetDataI(&m)
+	// a.DoGetDataI(&m)
+	a.DoGetDataByPage(&m)
 }
 
 // QueryWrDeliveryDetail

+ 223 - 0
docs/docs.go

@@ -7492,6 +7492,144 @@ var doc = `{
                 }
             }
         },
+        "/Guangzuan/QueryMyWRPosition": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询我的库存",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "登录用户ID",
+                        "name": "wruserid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "商品(查询字段-模糊查询)",
+                        "name": "zsallproperties",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "钻石分类枚举ID",
+                        "name": "zscategory",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "仓库ID",
+                        "name": "warehouseid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GZWarehouseinfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/QueryWarehouseInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询仓库信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝",
+                        "name": "status",
+                        "in": "query"
+                    },
+                    {
+                        "type": "boolean",
+                        "description": "是返回交易所仓库",
+                        "name": "isincludeexchange",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GZWarehouseinfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/GetHsbyMyCount": {
             "get": {
                 "security": [
@@ -14984,6 +15122,18 @@ var doc = `{
                 "parameters": [
                     {
                         "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "用户id",
                         "name": "userid",
                         "in": "query",
@@ -28939,6 +29089,79 @@ var doc = `{
                 }
             }
         },
+        "models.GZWarehouseinfo": {
+            "type": "object",
+            "properties": {
+                "address": {
+                    "description": "详细地址",
+                    "type": "string"
+                },
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "autoid": {
+                    "description": "自增ID",
+                    "type": "integer"
+                },
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "contactname": {
+                    "description": "联系人",
+                    "type": "string"
+                },
+                "contactnum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "区",
+                    "type": "integer"
+                },
+                "hasvideo": {
+                    "description": "是否有视频 - 0:无 1:有",
+                    "type": "integer"
+                },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "videourl": {
+                    "description": "视频地址",
+                    "type": "string"
+                },
+                "warehousecode": {
+                    "description": "仓库代码",
+                    "type": "string"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "warehousestatus": {
+                    "description": "仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝",
+                    "type": "integer"
+                },
+                "warehousetype": {
+                    "description": "仓库类型 - 1 厂库  2 自有库  3 合作库",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Goods": {
             "type": "object",
             "required": [

+ 223 - 0
docs/swagger.json

@@ -7476,6 +7476,144 @@
                 }
             }
         },
+        "/Guangzuan/QueryMyWRPosition": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询我的库存",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "登录用户ID",
+                        "name": "wruserid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "商品(查询字段-模糊查询)",
+                        "name": "zsallproperties",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "钻石分类枚举ID",
+                        "name": "zscategory",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "仓库ID",
+                        "name": "warehouseid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GZWarehouseinfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Guangzuan/QueryWarehouseInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询仓库信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝",
+                        "name": "status",
+                        "in": "query"
+                    },
+                    {
+                        "type": "boolean",
+                        "description": "是返回交易所仓库",
+                        "name": "isincludeexchange",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GZWarehouseinfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/GetHsbyMyCount": {
             "get": {
                 "security": [
@@ -14968,6 +15106,18 @@
                 "parameters": [
                     {
                         "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "用户id",
                         "name": "userid",
                         "in": "query",
@@ -28923,6 +29073,79 @@
                 }
             }
         },
+        "models.GZWarehouseinfo": {
+            "type": "object",
+            "properties": {
+                "address": {
+                    "description": "详细地址",
+                    "type": "string"
+                },
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "autoid": {
+                    "description": "自增ID",
+                    "type": "integer"
+                },
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "contactname": {
+                    "description": "联系人",
+                    "type": "string"
+                },
+                "contactnum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "区",
+                    "type": "integer"
+                },
+                "hasvideo": {
+                    "description": "是否有视频 - 0:无 1:有",
+                    "type": "integer"
+                },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "videourl": {
+                    "description": "视频地址",
+                    "type": "string"
+                },
+                "warehousecode": {
+                    "description": "仓库代码",
+                    "type": "string"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "warehousestatus": {
+                    "description": "仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝",
+                    "type": "integer"
+                },
+                "warehousetype": {
+                    "description": "仓库类型 - 1 厂库  2 自有库  3 合作库",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Goods": {
             "type": "object",
             "required": [

+ 150 - 0
docs/swagger.yaml

@@ -9590,6 +9590,60 @@ definitions:
     required:
     - resourcecode
     type: object
+  models.GZWarehouseinfo:
+    properties:
+      address:
+        description: 详细地址
+        type: string
+      areauserid:
+        description: 所属机构
+        type: integer
+      autoid:
+        description: 自增ID
+        type: integer
+      cityid:
+        description: 市
+        type: integer
+      contactname:
+        description: 联系人
+        type: string
+      contactnum:
+        description: 联系电话
+        type: string
+      countryid:
+        description: 国家
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      districtid:
+        description: 区
+        type: integer
+      hasvideo:
+        description: 是否有视频 - 0:无 1:有
+        type: integer
+      provinceid:
+        description: 省
+        type: integer
+      remark:
+        description: 审核备注
+        type: string
+      videourl:
+        description: 视频地址
+        type: string
+      warehousecode:
+        description: 仓库代码
+        type: string
+      warehousename:
+        description: 仓库名称
+        type: string
+      warehousestatus:
+        description: 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+        type: integer
+      warehousetype:
+        description: 仓库类型 - 1 厂库  2 自有库  3 合作库
+        type: integer
+    type: object
   models.Goods:
     properties:
       agreeunit:
@@ -26607,6 +26661,94 @@ paths:
       summary: 客户信息查询
       tags:
       - 风险管理v3
+  /Guangzuan/QueryMyWRPosition:
+    get:
+      parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      - description: 登录用户ID
+        in: query
+        name: wruserid
+        required: true
+        type: integer
+      - description: 商品(查询字段-模糊查询)
+        in: query
+        name: zsallproperties
+        type: string
+      - description: 钻石分类枚举ID
+        in: query
+        name: zscategory
+        type: integer
+      - description: 仓库ID
+        in: query
+        name: warehouseid
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GZWarehouseinfo'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的库存
+      tags:
+      - 广钻
+  /Guangzuan/QueryWarehouseInfo:
+    get:
+      parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
+        in: query
+        name: status
+        type: string
+      - description: 是返回交易所仓库
+        in: query
+        name: isincludeexchange
+        type: boolean
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GZWarehouseinfo'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询仓库信息
+      tags:
+      - 广钻
   /HSBY/GetHsbyMyCount:
     get:
       description: 说明: 不包括已完成的数量。
@@ -31332,6 +31474,14 @@ paths:
   /WrTrade2/QueryWrOutInApply:
     get:
       parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
       - description: 用户id
         in: query
         name: userid

+ 212 - 0
models/guangzuan.go

@@ -0,0 +1,212 @@
+package models
+
+import (
+	"mtp2_if/db"
+	"mtp2_if/utils"
+	"time"
+)
+
+// Warehouseinfo 仓库信息表
+type GZWarehouseinfo struct {
+	AUTOID          int64     `json:"autoid" xorm:"AUTOID"`                   // 自增ID
+	WAREHOUSECODE   string    `json:"warehousecode" xorm:"WAREHOUSECODE"`     // 仓库代码
+	WAREHOUSENAME   string    `json:"warehousename" xorm:"WAREHOUSENAME"`     // 仓库名称
+	WAREHOUSETYPE   int32     `json:"warehousetype" xorm:"WAREHOUSETYPE"`     // 仓库类型 - 1 厂库  2 自有库  3 合作库
+	AREAUSERID      int64     `json:"areauserid" xorm:"AREAUSERID"`           // 所属机构
+	WAREHOUSESTATUS int32     `json:"warehousestatus" xorm:"WAREHOUSESTATUS"` // 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+	COUNTRYID       int32     `json:"countryid" xorm:"COUNTRYID"`             // 国家
+	PROVINCEID      int32     `json:"provinceid" xorm:"PROVINCEID"`           // 省
+	CITYID          int32     `json:"cityid" xorm:"CITYID"`                   // 市
+	DISTRICTID      int32     `json:"districtid" xorm:"DISTRICTID"`           // 区
+	ADDRESS         string    `json:"address" xorm:"ADDRESS"`                 // 详细地址
+	REMARK          string    `json:"remark" xorm:"REMARK"`                   // 审核备注
+	CREATETIME      time.Time `json:"createtime" xorm:"CREATETIME"`           // 创建时间
+	HASVIDEO        int32     `json:"hasvideo" xorm:"HASVIDEO"`               // 是否有视频 - 0:无 1:有
+	VIDEOURL        string    `json:"videourl" xorm:"VIDEOURL"`               // 视频地址
+	CONTACTNAME     string    `json:"contactname" xorm:"CONTACTNAME"`         // 联系人
+	CONTACTNUM      string    `json:"contactnum" xorm:"CONTACTNUM"`           // 联系电话
+
+	PageEx `xorm:"extends"` // 页码信息
+
+	UserId            int64  `json:"-" form:"userid" binding:"required"` // 用户ID
+	Status            string `json:"-" form:"status"`                    // 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
+	IsIncludeExchange bool   `json:"-" form:"isincludeexchange"`         // 是返回交易所仓库
+}
+
+// TableName is WAREHOUSEINFO
+func (r *GZWarehouseinfo) TableName() string {
+	return "WAREHOUSEINFO"
+}
+
+func (r *GZWarehouseinfo) calc() {
+
+}
+
+func (r *GZWarehouseinfo) buildSql() string {
+	var sqlId utils.SQLVal = `SELECT t.AUTOID, 
+		t.WAREHOUSECODE, 
+		t.WAREHOUSENAME, 
+		t.WAREHOUSETYPE, 
+		t.AREAUSERID, 
+		t.WAREHOUSESTATUS, 
+		t.COUNTRYID, 
+		t.PROVINCEID, 
+		t.CITYID, 
+		t.DISTRICTID, 
+		t.ADDRESS, 
+		t.REMARK, 
+		to_char(t.CREATETIME,'yyyy-mm-dd hh24:mi:ss') CREATETIME, 
+		t.HASVIDEO, 
+		t.VIDEOURL, 
+		t.CONTACTNAME, 
+		t.CONTACTNUM 
+	FROM WAREHOUSEINFO t 
+	WHERE (t.AREAUSERID = %v) `
+
+	sqlId.FormatParam(r.UserId)
+	if r.IsIncludeExchange {
+		sqlId.Join(" OR (t.AREAUSERID IS NULL) OR (t.AREAUSERID = 1)")
+	}
+	if len(r.Status) > 0 {
+		sqlId.JoinFormat(" and (t.WAREHOUSESTATUS in (%v))", r.Status)
+	}
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+// GetDataByPage 获取团队订单
+func (r *GZWarehouseinfo) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]GZWarehouseinfo, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
+// MyWRPosition 我的库存
+type MyWRPosition struct {
+	ZSALLPROPERTIES            string  `json:"-" xorm:"ZSALLPROPERTIES" form:"zsallproperties"`              // 商品(查询字段-模糊查询)
+	SELLUSERNAME               string  `json:"sellusername" xorm:"SELLUSERNAME"`                             // 账户名称(机构名称)
+	SELLMOBILE                 string  `json:"sellmobile" xorm:"SELLMOBILE"`                                 // 手机号码(加密存储)
+	ZSCATEGORYDISPLAY          string  `json:"zscategorydisplay" xorm:"ZSCATEGORYDISPLAY"`                   //
+	ZSCURRENCYTYPEDISPLAY      string  `json:"zscurrencytypedisplay" xorm:"ZSCURRENCYTYPEDISPLAY"`           //
+	ZSCURRENCYTYPEDISPLAYUNIT  string  `json:"zscurrencytypedisplayunit" xorm:"ZSCURRENCYTYPEDISPLAYUNIT"`   //
+	WAREHOUSENAMEDISPLAY       string  `json:"warehousenamedisplay" xorm:"WAREHOUSENAMEDISPLAY"`             //
+	ZSSHAPETYPEDISPLAY         string  `json:"zsshapetypedisplay" xorm:"ZSSHAPETYPEDISPLAY"`                 //
+	ZSCOLORTYPE1DISPLAY        string  `json:"zscolortype1display" xorm:"ZSCOLORTYPE1DISPLAY"`               //
+	ZSCOLORTYPE2DISPLAY        string  `json:"zscolortype2display" xorm:"ZSCOLORTYPE2DISPLAY"`               //
+	ZSCLARITYTYPE1DISPLAY      string  `json:"zsclaritytype1display" xorm:"ZSCLARITYTYPE1DISPLAY"`           //
+	ZSCLARITYTYPE2DISPLAY      string  `json:"zsclaritytype2display" xorm:"ZSCLARITYTYPE2DISPLAY"`           //
+	ZSCUTTYPE1DISPLAY          string  `json:"zscuttype1display" xorm:"ZSCUTTYPE1DISPLAY"`                   //
+	ZSCUTTYPE2DISPLAY          string  `json:"zscuttype2display" xorm:"ZSCUTTYPE2DISPLAY"`                   //
+	ZSSYMMETRYTYPE1DISPLAY     string  `json:"zssymmetrytype1display" xorm:"ZSSYMMETRYTYPE1DISPLAY"`         //
+	ZSSYMMETRYTYPE2DISPLAY     string  `json:"zssymmetrytype2display" xorm:"ZSSYMMETRYTYPE2DISPLAY"`         //
+	ZSPOLISHTYPE1DISPLAY       string  `json:"zspolishtype1display" xorm:"ZSPOLISHTYPE1DISPLAY"`             //
+	ZSPOLISHTYPE2DISPLAY       string  `json:"zspolishtype2display" xorm:"ZSPOLISHTYPE2DISPLAY"`             //
+	ZSFLUORESCENCETYPE1DISPLAY string  `json:"zsfluorescencetype1display" xorm:"ZSFLUORESCENCETYPE1DISPLAY"` //
+	ZSFLUORESCENCETYPE2DISPLAY string  `json:"zsfluorescencetype2display" xorm:"ZSFLUORESCENCETYPE2DISPLAY"` //
+	ZSCERTTYPEDISPLAY          string  `json:"zscerttypedisplay" xorm:"ZSCERTTYPEDISPLAY"`                   //
+	ZSCRYSTALTYPEDISPLAY       string  `json:"zscrystaltypedisplay" xorm:"ZSCRYSTALTYPEDISPLAY"`             //
+	ZSSTYLETYPEDISPLAY         string  `json:"zsstyletypedisplay" xorm:"ZSSTYLETYPEDISPLAY"`                 //
+	ZSCZCOLOR1TYPEDISPLAY      string  `json:"zsczcolor1typedisplay" xorm:"ZSCZCOLOR1TYPEDISPLAY"`           //
+	ZSCZCOLOR2TYPEDISPLAY      string  `json:"zsczcolor2typedisplay" xorm:"ZSCZCOLOR2TYPEDISPLAY"`           //
+	ZSCZCOLOR3TYPEDISPLAY      string  `json:"zsczcolor3typedisplay" xorm:"ZSCZCOLOR3TYPEDISPLAY"`           //
+	WRSTANDARDID               int64   `json:"wrstandardid" xorm:"WRSTANDARDID"`                             // 现货商品ID
+	USERID                     int64   `json:"userid" xorm:"USERID"`                                         // 用户ID
+	ZSCATEGORY                 int32   `json:"zscategory" xorm:"ZSCATEGORY" form:"zscategory"`               // 钻石分类 - 枚举”ZSCategory“
+	ZSCURRENCYTYPE             int32   `json:"zscurrencytype" xorm:"ZSCURRENCYTYPE"`                         // 货币类型 - 枚举“ZSCurrencyType”
+	GOODSNO                    string  `json:"goodsno" xorm:"GOODSNO"`                                       // 商品编号
+	WAREHOUSEID                int64   `json:"warehouseid" xorm:"WAREHOUSEID" form:"warehouseid"`            // 仓库ID
+	MARKETPRICE                string  `json:"marketprice" xorm:"MARKETPRICE"`                               // 市场价
+	IMAGEPATH                  string  `json:"imagepath" xorm:"IMAGEPATH"`                                   // 商品照片(相对地址)
+	WRPATH                     string  `json:"wrpath" xorm:"WRPATH"`                                         // 仓单扫描件(相对地址)
+	REMARK                     string  `json:"remark" xorm:"REMARK"`                                         // 备注
+	PRICE                      float64 `json:"price" xorm:"PRICE"`                                           // 总价(价格) - 类型:1,2,3,4,5
+	WEIGHT                     float64 `json:"weight" xorm:"WEIGHT"`                                         // 总重量(克拉重量) - 类型:1,2,3,4,5
+	WEIGHTAVG                  float64 `json:"weightavg" xorm:"WEIGHTAVG"`                                   // 平均单颗重量 - 类型:1,3
+	PRICEPER                   string  `json:"priceper" xorm:"PRICEPER"`                                     // 克拉单价 - 类型:1,2,3,5
+	ZSSHAPETYPE                string  `json:"zsshapetype" xorm:"ZSSHAPETYPE"`                               // 形状 - 枚举”ZSShapeType“ - 类型:1,2,4,5 ;(1为多个,逗号分隔)
+	ZSCOLORTYPE1               int32   `json:"zscolortype1" xorm:"ZSCOLORTYPE1"`                             // 颜色1 - 枚举”ZSColorType“ - 类型:1,2,3,4
+	ZSCOLORTYPE2               int32   `json:"zscolortype2" xorm:"ZSCOLORTYPE2"`                             // 颜色2 - 枚举”ZSColorType“ -  类型:1,3
+	ZSCLARITYTYPE1             int32   `json:"zsclaritytype1" xorm:"ZSCLARITYTYPE1"`                         // 净度1 - 枚举”ZSClarityType“ - 类型:1,2,3,4,5
+	ZSCLARITYTYPE2             int32   `json:"zsclaritytype2" xorm:"ZSCLARITYTYPE2"`                         // 净度2 - 枚举”ZSClarityType“ - 类型:1,3
+	ZSCUTTYPE1                 int32   `json:"zscuttype1" xorm:"ZSCUTTYPE1"`                                 // 切工1 - 枚举”ZSCutType“ - 类型:1,2,4,5
+	ZSCUTTYPE2                 int32   `json:"zscuttype2" xorm:"ZSCUTTYPE2"`                                 // 切工2 - 枚举”ZSCutType“ - 类型:1
+	ZSSYMMETRYTYPE1            int32   `json:"zssymmetrytype1" xorm:"ZSSYMMETRYTYPE1"`                       // 对称度1 - 枚举”ZSSymmetryType“ - 类型:1,2,4,5
+	ZSSYMMETRYTYPE2            int32   `json:"zssymmetrytype2" xorm:"ZSSYMMETRYTYPE2"`                       // 对称度2 - 枚举”ZSSymmetryType“ - 类型:1
+	ZSPOLISHTYPE1              int32   `json:"zspolishtype1" xorm:"ZSPOLISHTYPE1"`                           // 抛光度1 - 枚举”ZSPolishType“ - 类型:1,2,4,5
+	ZSPOLISHTYPE2              int32   `json:"zspolishtype2" xorm:"ZSPOLISHTYPE2"`                           // 抛光度2 - 枚举”ZSPolishType“ - 类型:1
+	ZSFLUORESCENCETYPE1        int32   `json:"zsfluorescencetype1" xorm:"ZSFLUORESCENCETYPE1"`               // 荧光1 - 枚举”ZSFluorescenceType“ - 类型:1,2,3,4,5
+	ZSFLUORESCENCETYPE2        int32   `json:"zsfluorescencetype2" xorm:"ZSFLUORESCENCETYPE2"`               // 荧光2 - 枚举”ZSFluorescenceType” - 类型:1,3
+	SIZE1                      string  `json:"size1" xorm:"SIZE1"`                                           // 尺寸1 - 类型:2,4,5
+	SIZE2                      string  `json:"size2" xorm:"SIZE2"`                                           // 尺寸2 - 类型:2,4,5
+	SIZE3                      string  `json:"size3" xorm:"SIZE3"`                                           // 尺寸3 - 类型:2,4,5
+	ZSCERTTYPE                 int32   `json:"zscerttype" xorm:"ZSCERTTYPE"`                                 // 证书类型 - 枚举”ZSCertType“ - 类型:2,4,5
+	CERNO                      string  `json:"cerno" xorm:"CERNO"`                                           // 证书编号 - 类型:2,4,5
+	ZSCRYSTALTYPE              string  `json:"zscrystaltype" xorm:"ZSCRYSTALTYPE"`                           // 晶型范围 - 枚举“ZSCrystalType“ - 类型:3, 多个,逗号分隔
+	CPCERTNO                   string  `json:"cpcertno" xorm:"CPCERTNO"`                                     // 金伯利证书编号 - 类型:3
+	ORIGIN                     string  `json:"origin" xorm:"ORIGIN"`                                         // 原产地 - 类型:3
+	KPWEIGHT                   string  `json:"kpweight" xorm:"KPWEIGHT"`                                     // 金伯利证书重量 - 类型:3
+	KPPATH                     string  `json:"kppath" xorm:"KPPATH"`                                         // 金伯利证书图片(相对地址) - 类型:3
+	ZSSTYLETYPE                int32   `json:"zsstyletype" xorm:"ZSSTYLETYPE"`                               // 款式 - 类型:4
+	STONEDESC                  string  `json:"stonedesc" xorm:"STONEDESC"`                                   // 配石描述 - 类型:4
+	SETTINGMATERIAL            string  `json:"settingmaterial" xorm:"SETTINGMATERIAL"`                       // 镶嵌材料 - 类型:4
+	ZSCZCOLOR1TYPE             int32   `json:"zsczcolor1type" xorm:"ZSCZCOLOR1TYPE"`                         // 彩钻颜色1 - 枚举”ZSCZColor1Type“ - 类型:5
+	ZSCZCOLOR2TYPE             int32   `json:"zsczcolor2type" xorm:"ZSCZCOLOR2TYPE"`                         // 彩钻颜色2 - 枚举”ZSCZColor2Type“ - 类型:5
+	ZSCZCOLOR3TYPE             int32   `json:"zsczcolor3type" xorm:"ZSCZCOLOR3TYPE"`                         // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
+	ISVALID                    int32   `json:"isvalid" xorm:"ISVALID"`                                       // 是否有效 - 0:无效 1:有效
+
+	TOTALQTY   int64    `json:"-" xorm:"TOTALQTY"`
+	FREEZEQTY  int64    `json:"-" xorm:"FREEZEQTY"`
+	FTOTALQTY  SFLOAT64 `json:"ftotalqty"`  // 库存数量:WRPosition表:TOTALQTY /100 , 保留两位小数
+	FFREEZEQTY SFLOAT64 `json:"ffreezeqty"` // 冻结数量:WRPosition表:FREEZEQTY/100 , 保留两位小数
+
+	PageEx `xorm:"extends"` // 页码信息
+
+	WRUSERID int64 `json:"wruserid" xorm:"WRUSERID" form:"wruserid" binding:"required"` // 登录用户ID
+}
+
+func (r *MyWRPosition) calc() {
+	if r.TOTALQTY != 0 {
+		r.FTOTALQTY = SFLOAT64(r.TOTALQTY / 100)
+		r.FTOTALQTY.Round(2)
+	}
+	if r.FREEZEQTY != 0 {
+		r.FFREEZEQTY = SFLOAT64(r.FREEZEQTY / 100)
+		r.FFREEZEQTY.Round(2)
+	}
+}
+
+func (r *MyWRPosition) buildSql() string {
+	var sqlId utils.SQLVal = `
+	SELECT 
+		t.*, 
+		wr.* 
+	FROM WRPosition t
+	INNER JOIN WRFactorType ft ON t.wrfactortypeid = ft.wrfactortypeid
+	INNER JOIN View_GZ_WRStandard_Ex_Query wr ON ft.wrstandardid = wr.wrstandardid 
+	WHERE t.wruserid = %v
+	`
+
+	sqlId.FormatParam(r.WRUSERID)
+	sqlId.AndEx("wr.ZSCATEGORY", r.ZSCATEGORY, r.ZSCATEGORY > 0)
+	sqlId.AndLike("wr.ZSALLPROPERTIES", r.ZSALLPROPERTIES)
+	sqlId.AndEx("wr.WAREHOUSEID", r.WAREHOUSEID, r.WAREHOUSEID > 0)
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+// GetDataByPage 获取团队订单
+func (r *MyWRPosition) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]MyWRPosition, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}

+ 15 - 0
models/wrTrade2.go

@@ -2929,6 +2929,8 @@ type WrOutInApply struct {
 
 	BEGINDATE string `json:"begindate" form:"begindate"` // 开始交易日(yyyymmdd)
 	ENDDATE   string `json:"enddate" form:"enddate"`     // 结束交易日(yyyymmdd)
+
+	PageEx `xorm:"extends"` // 页码信息
 }
 
 func (r *WrOutInApply) calc() {
@@ -2989,6 +2991,7 @@ func (r *WrOutInApply) buildSql() string {
 		sqlId.JoinFormat(" and t.TRADEDATE <= '%v'", r.ENDDATE)
 	}
 	sqlId.Join(" order by t.applytime desc")
+	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()
 }
 
@@ -3002,6 +3005,18 @@ func (r *WrOutInApply) GetDataEx() (interface{}, error) {
 	return sData, err
 }
 
+// GetDataEx 获取出入库申请(提货) - 分页
+func (r *WrOutInApply) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]WrOutInApply, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
 // WrDeliveryDetail 交收
 type WrDeliveryDetail struct {
 	DELIVERYID          string  `json:"deliveryid"  xorm:"'DELIVERYID'"`                 //交割单号(121+Unix秒时间戳(10位)+xxxxxx)

+ 8 - 0
routers/router.go

@@ -11,6 +11,7 @@ import (
 	"mtp2_if/controllers/ermcp8"
 	"mtp2_if/controllers/erms2"
 	"mtp2_if/controllers/erms3"
+	"mtp2_if/controllers/guangzuan"
 	"mtp2_if/controllers/hsby"
 	"mtp2_if/controllers/market"
 	"mtp2_if/controllers/order"
@@ -648,6 +649,13 @@ func InitRouter() *gin.Engine {
 		zjR.GET("GetCusBankChannels", zj.GetCusBankChannels)
 	}
 
+	// **************************广钻*************************
+	guangzuanR := apiR.Group("Guangzuan")
+	guangzuanR.Use()
+	{
+		guangzuanR.GET("QueryWarehouseInfo", guangzuan.QueryWarehouseInfo)
+	}
+
 	return r
 }