瀏覽代碼

1.增加查询提货申请接口

zou.yingbin 4 年之前
父節點
當前提交
7f1767ad94
共有 6 個文件被更改,包括 460 次插入4 次删除
  1. 17 1
      controllers/wrTrade2/qryWrTrade.go
  2. 136 1
      docs/docs.go
  3. 136 1
      docs/swagger.json
  4. 96 1
      docs/swagger.yaml
  5. 74 0
      models/wrTrade2.go
  6. 1 0
      routers/router.go

+ 17 - 1
controllers/wrTrade2/qryWrTrade.go

@@ -204,7 +204,7 @@ func QueryHoldLB(c *gin.Context) {
 }
 
 // QueryFilterItem
-// @Summary 查询筛选框列表
+// @Summary 查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)
 // @Produce json
 // @Security ApiKeyAuth
 // @Param itype query string true "类型(可多选,逗号隔开) 1-品种 2-品类(商品) 3-仓库"
@@ -397,3 +397,19 @@ func QueryWrScfContractInterest(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryWrOutInApply
+// @Summary 查询提货申请
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户id"
+// @Success 200 {array} models.WrOutInApply
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrOutInApply [get]
+// @Tags 仓单贸易v2
+func QueryWrOutInApply(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrOutInApply{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 136 - 1
docs/docs.go

@@ -10989,7 +10989,7 @@ var doc = `{
                 "tags": [
                     "仓单贸易v2"
                 ],
-                "summary": "查询筛选框列表",
+                "summary": "查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)",
                 "parameters": [
                     {
                         "type": "string",
@@ -11690,6 +11690,48 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryWrOutInApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询提货申请",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrOutInApply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPerformancePlanStep": {
             "get": {
                 "security": [
@@ -31038,6 +31080,99 @@ var doc = `{
                 }
             }
         },
+        "models.WrOutInApply": {
+            "type": "object",
+            "properties": {
+                "applyid": {
+                    "description": "申请单id",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待初审 2:初审通过 3:初审拒绝 4:初审失败 5复审通过 6:复审拒绝 7:复审失败 8:已撤销",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "applytype": {
+                    "description": "申请类型 - 1:预约入库 2:预约出库 3:入库注册 4:出库注销",
+                    "type": "integer"
+                },
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "expresscompany": {
+                    "description": "物流公司",
+                    "type": "string"
+                },
+                "expressnum": {
+                    "description": "物流单号",
+                    "type": "string"
+                },
+                "minivalue": {
+                    "description": "现货商品最小变动值",
+                    "type": "integer"
+                },
+                "optioncompare": {
+                    "description": "选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "wrfactortypename": {
+                    "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "wrtypename": {
+                    "description": "商品",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrPerformancePlan": {
             "type": "object",
             "required": [

+ 136 - 1
docs/swagger.json

@@ -10973,7 +10973,7 @@
                 "tags": [
                     "仓单贸易v2"
                 ],
-                "summary": "查询筛选框列表",
+                "summary": "查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)",
                 "parameters": [
                     {
                         "type": "string",
@@ -11674,6 +11674,48 @@
                 }
             }
         },
+        "/WrTrade2/QueryWrOutInApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询提货申请",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrOutInApply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPerformancePlanStep": {
             "get": {
                 "security": [
@@ -31022,6 +31064,99 @@
                 }
             }
         },
+        "models.WrOutInApply": {
+            "type": "object",
+            "properties": {
+                "applyid": {
+                    "description": "申请单id",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待初审 2:初审通过 3:初审拒绝 4:初审失败 5复审通过 6:复审拒绝 7:复审失败 8:已撤销",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "applytype": {
+                    "description": "申请类型 - 1:预约入库 2:预约出库 3:入库注册 4:出库注销",
+                    "type": "integer"
+                },
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "expresscompany": {
+                    "description": "物流公司",
+                    "type": "string"
+                },
+                "expressnum": {
+                    "description": "物流单号",
+                    "type": "string"
+                },
+                "minivalue": {
+                    "description": "现货商品最小变动值",
+                    "type": "integer"
+                },
+                "optioncompare": {
+                    "description": "选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "wrfactortypename": {
+                    "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "wrtypename": {
+                    "description": "商品",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrPerformancePlan": {
             "type": "object",
             "required": [

+ 96 - 1
docs/swagger.yaml

@@ -14125,6 +14125,75 @@ definitions:
         description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
         type: string
     type: object
+  models.WrOutInApply:
+    properties:
+      applyid:
+        description: 申请单id
+        type: string
+      applystatus:
+        description: 申请状态 - 1:待初审 2:初审通过 3:初审拒绝 4:初审失败 5复审通过 6:复审拒绝 7:复审失败 8:已撤销
+        type: integer
+      applytime:
+        description: 申请时间
+        type: string
+      applytype:
+        description: 申请类型 - 1:预约入库 2:预约出库 3:入库注册 4:出库注销
+        type: integer
+      deliverygoodscode:
+        description: 品种代码
+        type: string
+      deliverygoodsid:
+        description: 品种ID
+        type: integer
+      deliverygoodsname:
+        description: 品种名称
+        type: string
+      enumdicname:
+        description: 单位名称
+        type: string
+      expresscompany:
+        description: 物流公司
+        type: string
+      expressnum:
+        description: 物流单号
+        type: string
+      minivalue:
+        description: 现货商品最小变动值
+        type: integer
+      optioncompare:
+        description: 选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+        type: string
+      qty:
+        description: 数量
+        type: integer
+      userid:
+        description: 用户id
+        type: integer
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      warehousename:
+        description: 仓库名称
+        type: string
+      wrfactortypeid:
+        description: 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      wrfactortypename:
+        description: 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+        type: string
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 商品名称
+        type: string
+      wrtypename:
+        description: 商品
+        type: string
+    type: object
   models.WrPerformancePlan:
     properties:
       amount:
@@ -23846,7 +23915,7 @@ paths:
             $ref: '#/definitions/app.Response'
       security:
       - ApiKeyAuth: []
-      summary: 查询筛选框列表
+      summary: 查询筛选框列表 - 作废(以前给pcweb简单筛选框用的,后来改版了)
       tags:
       - 仓单贸易v2
   /WrTrade2/QueryFtDeliveryGoods:
@@ -24277,6 +24346,32 @@ paths:
       summary: 查询仓单委托单(挂单)
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrOutInApply:
+    get:
+      parameters:
+      - description: 用户id
+        in: query
+        name: userid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrOutInApply'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询提货申请
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrPerformancePlanStep:
     get:
       parameters:

+ 74 - 0
models/wrTrade2.go

@@ -2352,3 +2352,77 @@ func (r *WrScfContractInterest) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrOutInApply 出入库申请(提货)
+type WrOutInApply struct {
+	APPLYID        string `json:"applyid"  xorm:"'APPLYID'"`               // 申请单id
+	APPLYTYPE      int32  `json:"applytype"  xorm:"'APPLYTYPE'"`           // 申请类型 - 1:预约入库 2:预约出库 3:入库注册 4:出库注销
+	USERID         int64  `json:"userid"  xorm:"'USERID'" form:"userid"`   // 用户id
+	APPLYTIME      string `json:"applytime"  xorm:"'APPLYTIME'"`           // 申请时间
+	APPLYSTATUS    int32  `json:"applystatus"  xorm:"'APPLYSTATUS'"`       // 申请状态 - 1:待初审 2:初审通过 3:初审拒绝 4:初审失败 5复审通过 6:复审拒绝 7:复审失败 8:已撤销
+	QTY            int64  `json:"qty"  xorm:"'QTY'"`                       // 数量
+	EXPRESSNUM     string `json:"expressnum"  xorm:"'EXPRESSNUM'"`         // 物流单号
+	EXPRESSCOMPANY string `json:"expresscompany"  xorm:"'EXPRESSCOMPANY'"` // 物流公司
+	Wr2FactorType  `xorm:"extends"`
+}
+
+func (r *WrOutInApply) calc() {
+	r.Wr2FactorType.Calc()
+}
+
+func (r *WrOutInApply) buildSql() string {
+	var sqlId utils.SQLVal = "with tmp as" +
+		" (select to_char(t.wrfactortypeid) wrfactortypeid," +
+		"         t.wrfactortypename2 wrfactortypename," +
+		"         t.wrstandardid," +
+		"         t.deliverygoodsid," +
+		"         g.deliverygoodscode," +
+		"         g.deliverygoodsname," +
+		"         w.wrstandardcode," +
+		"         w.wrstandardname," +
+		"         w.minivalue," +
+		"         h.warehousecode," +
+		"         h.warehousename," +
+		"         e.enumdicname," +
+		"         w.wrstandardname || t.wrfactortypename2 as wrtypename" +
+		"    from wrfactortype t" +
+		"    left join deliverygoods g" +
+		"      on t.deliverygoodsid = g.deliverygoodsid" +
+		"    left join wrstandard w" +
+		"      on t.wrstandardid = w.wrstandardid" +
+		"    left join warehouseinfo h" +
+		"      on t.warehouseid = h.autoid" +
+		"    left join enumdicitem e" +
+		"      on w.unitid = e.enumitemname" +
+		"     and e.enumdiccode = 'goodsunit')" +
+		"select to_char(t.applyid) applyid," +
+		"       t.applytype," +
+		"       t.userid," +
+		"       to_char(t.applytime, 'yyyy-mm-dd hh24:mi:ss') applytime," +
+		"       decode(t.applytype, 2, t.applystatus, 4, t.applystatus2) applystatus," +
+		"       decode(t.applytype, 2, t.inqty, 4, t.inrealqty) qty," +
+		"       d.wrfactortypeid," +
+		"       e.expressnum," +
+		"       e.expresscompany," +
+		"       k.*" +
+		"  from WROutInApply t" +
+		"  left join wroutindetail d" +
+		"    on t.applyid = d.applyid" +
+		"  left join wroutinexpress e" +
+		"    on t.applyid = e.applyid" +
+		"  left join tmp k" +
+		"    on d.wrfactortypeid = k.wrfactortypeid" +
+		" where t.applytype in (2, 4)"
+	sqlId.AndEx("t.USERID", r.USERID, r.USERID > 0)
+	return sqlId.String()
+}
+
+// GetDataEx 获取出入库申请(提货)
+func (r *WrOutInApply) GetDataEx() (interface{}, error) {
+	sData := make([]WrOutInApply, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -539,6 +539,7 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryWrScfContract", wrTrade2.QueryWrScfContract)
 		wrTrade2R.GET("QueryWrBuybackDetail", wrTrade2.QueryWrBuybackDetail)
 		wrTrade2R.GET("QueryWrScfContractInterest", wrTrade2.QueryWrScfContractInterest)
+		wrTrade2R.GET("QueryWrOutInApply", wrTrade2.QueryWrOutInApply)
 	}
 
 	return r