Bläddra i källkod

增加查询履约步骤类型接口

zou.yingbin 4 år sedan
förälder
incheckning
98d9da0f6b
6 ändrade filer med 177 tillägg och 0 borttagningar
  1. 15 0
      controllers/wrTrade2/qryWrTrade.go
  2. 50 0
      docs/docs.go
  3. 50 0
      docs/swagger.json
  4. 32 0
      docs/swagger.yaml
  5. 29 0
      models/wrTrade2.go
  6. 1 0
      routers/router.go

+ 15 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -593,3 +593,18 @@ func QueryWrTradeBargainApply(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryWrPerformanceStepType
+// @Summary 查询履约步骤枚举
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} models.WrPerformanceStepType
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrPerformanceStepType [get]
+// @Tags 仓单贸易v2
+func QueryWrPerformanceStepType(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrPerformanceStepType{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 50 - 0
docs/docs.go

@@ -12162,6 +12162,39 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryWrPerformanceStepType": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询履约步骤枚举",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrPerformanceStepType"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPosition": {
             "get": {
                 "security": [
@@ -32503,6 +32536,23 @@ var doc = `{
                 }
             }
         },
+        "models.WrPerformanceStepType": {
+            "type": "object",
+            "properties": {
+                "canauto": {
+                    "description": "能否自动确认 -  0:不可自动确认 1:可自动确认  (可设置自动确认步骤: 1:买方支付 3:买方自提  5:买方确认货  7:买方确认票)",
+                    "type": "integer"
+                },
+                "steptypeid": {
+                    "description": "步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移",
+                    "type": "integer"
+                },
+                "steptypename": {
+                    "description": "步骤类型名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrPerformanceTemplateEx": {
             "type": "object",
             "properties": {

+ 50 - 0
docs/swagger.json

@@ -12146,6 +12146,39 @@
                 }
             }
         },
+        "/WrTrade2/QueryWrPerformanceStepType": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询履约步骤枚举",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrPerformanceStepType"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPosition": {
             "get": {
                 "security": [
@@ -32487,6 +32520,23 @@
                 }
             }
         },
+        "models.WrPerformanceStepType": {
+            "type": "object",
+            "properties": {
+                "canauto": {
+                    "description": "能否自动确认 -  0:不可自动确认 1:可自动确认  (可设置自动确认步骤: 1:买方支付 3:买方自提  5:买方确认货  7:买方确认票)",
+                    "type": "integer"
+                },
+                "steptypeid": {
+                    "description": "步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移",
+                    "type": "integer"
+                },
+                "steptypename": {
+                    "description": "步骤类型名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrPerformanceTemplateEx": {
             "type": "object",
             "properties": {

+ 32 - 0
docs/swagger.yaml

@@ -14792,6 +14792,18 @@ definitions:
         description: 商品
         type: string
     type: object
+  models.WrPerformanceStepType:
+    properties:
+      canauto:
+        description: '能否自动确认 -  0:不可自动确认 1:可自动确认  (可设置自动确认步骤: 1:买方支付 3:买方自提  5:买方确认货  7:买方确认票)'
+        type: integer
+      steptypeid:
+        description: 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+        type: integer
+      steptypename:
+        description: 步骤类型名称
+        type: string
+    type: object
   models.WrPerformanceTemplateEx:
     properties:
       autoid:
@@ -25100,6 +25112,26 @@ paths:
       summary: 查询履约信息详情
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrPerformanceStepType:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrPerformanceStepType'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询履约步骤枚举
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrPosition:
     get:
       description: 页面 现货仓单->现货汇总/库存汇总; 预售仓单->订单汇总

+ 29 - 0
models/wrTrade2.go

@@ -3269,3 +3269,32 @@ func (r *WRTradeBargainApply) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrPerformanceStepType 履约步骤枚举
+type WrPerformanceStepType struct {
+	STEPTYPEID   int32  `json:"steptypeid"  xorm:"STEPTYPEID" form:"steptypeid"` // 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+	STEPTYPENAME string `json:"steptypename"  xorm:"STEPTYPENAME"`               // 步骤类型名称
+	CANAUTO      int32  `json:"canauto"  xorm:"CANAUTO"`                         // 能否自动确认 -  0:不可自动确认 1:可自动确认  (可设置自动确认步骤: 1:买方支付 3:买方自提  5:买方确认货  7:买方确认票)
+}
+
+func (r *WrPerformanceStepType) calc() {
+
+}
+
+func (r *WrPerformanceStepType) buildSql() string {
+	// id 90以上的不可选
+	var sqlId utils.SQLVal = `
+select t.* from PERFORMANCESTEPTYPE t where t.STEPTYPEID < 90 order by t.STEPTYPEID
+`
+	return sqlId.String()
+}
+
+// GetDataEx 获取履约步骤枚举
+func (r *WrPerformanceStepType) GetDataEx() (interface{}, error) {
+	sData := make([]WrPerformanceStepType, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -550,6 +550,7 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryWrFriendApply", wrTrade2.QueryWrFriendApply)
 		wrTrade2R.GET("QueryPermancePlanTmp", wrTrade2.QueryPermancePlanTmp)
 		wrTrade2R.GET("QueryWrTradeBargainApply", wrTrade2.QueryWrTradeBargainApply)
+		wrTrade2R.GET("QueryWrPerformanceStepType", wrTrade2.QueryWrPerformanceStepType)
 	}
 
 	return r