瀏覽代碼

1.增加查询提货商品接口(pcweb)

zou.yingbin 4 年之前
父節點
當前提交
c3d4b081f9
共有 6 個文件被更改,包括 214 次插入0 次删除
  1. 19 0
      controllers/qhjPCWeb/qryQhjPCWeb.go
  2. 49 0
      docs/docs.go
  3. 49 0
      docs/swagger.json
  4. 31 0
      docs/swagger.yaml
  5. 65 0
      models/qhjPCWeb.go
  6. 1 0
      routers/router.go

+ 19 - 0
controllers/qhjPCWeb/qryQhjPCWeb.go

@@ -288,3 +288,22 @@ func QueryContract(c *gin.Context) {
 	m.FilterRiskLevel = req.RISKLEVEL
 	a.DoGetDataI(&m)
 }
+
+// QueryPickGoods
+// @Summary 查询提货商品
+// @Produce json
+// @Security ApiKeyAuth
+// @Param status query string false "状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销"
+// @Success 200 {array} models.QhjPickGoods
+// @Failure 500 {object} app.Response
+// @Router /QhjMgr/QueryPickGoods [get]
+// @Tags 大连千海金(PCWeb)
+func QueryPickGoods(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	req := struct {
+		STATUS string `form:"status"` // 用户id
+	}{}
+	a.DoBindReq(&req)
+	m := models.QhjPickGoods{FilterStatus: req.STATUS}
+	a.DoGetDataI(&m)
+}

+ 49 - 0
docs/docs.go

@@ -8177,6 +8177,47 @@ var doc = `{
                 }
             }
         },
+        "/QhjMgr/QueryPickGoods": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(PCWeb)"
+                ],
+                "summary": "查询提货商品",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销",
+                        "name": "status",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjPickGoods"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/QhjMgr/QuerySubArea": {
             "get": {
                 "security": [
@@ -25405,6 +25446,14 @@ var doc = `{
                     "description": "现货品牌ID -  存“DGFactoryItem”表\"DGFactoryItemID\"",
                     "type": "integer"
                 },
+                "visibilityforenterprise": {
+                    "description": "企业客户是否可见 - 0:不可见 1:可见",
+                    "type": "integer"
+                },
+                "visibilityforpersonal": {
+                    "description": "个人客户是否可见 - 0:不可见 1:可见",
+                    "type": "integer"
+                },
                 "wrstandardid": {
                     "description": "现货商品ID",
                     "type": "integer"

+ 49 - 0
docs/swagger.json

@@ -8161,6 +8161,47 @@
                 }
             }
         },
+        "/QhjMgr/QueryPickGoods": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(PCWeb)"
+                ],
+                "summary": "查询提货商品",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销",
+                        "name": "status",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjPickGoods"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/QhjMgr/QuerySubArea": {
             "get": {
                 "security": [
@@ -25389,6 +25430,14 @@
                     "description": "现货品牌ID -  存“DGFactoryItem”表\"DGFactoryItemID\"",
                     "type": "integer"
                 },
+                "visibilityforenterprise": {
+                    "description": "企业客户是否可见 - 0:不可见 1:可见",
+                    "type": "integer"
+                },
+                "visibilityforpersonal": {
+                    "description": "个人客户是否可见 - 0:不可见 1:可见",
+                    "type": "integer"
+                },
                 "wrstandardid": {
                     "description": "现货商品ID",
                     "type": "integer"

+ 31 - 0
docs/swagger.yaml

@@ -11309,6 +11309,12 @@ definitions:
       spotgoodsbrandid:
         description: 现货品牌ID -  存“DGFactoryItem”表"DGFactoryItemID"
         type: integer
+      visibilityforenterprise:
+        description: 企业客户是否可见 - 0:不可见 1:可见
+        type: integer
+      visibilityforpersonal:
+        description: 个人客户是否可见 - 0:不可见 1:可见
+        type: integer
       wrstandardid:
         description: 现货商品ID
         type: integer
@@ -19515,6 +19521,31 @@ paths:
       summary: 查询客户资料
       tags:
       - 大连千海金(PCWeb)
+  /QhjMgr/QueryPickGoods:
+    get:
+      parameters:
+      - description: 状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销
+        in: query
+        name: status
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjPickGoods'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询提货商品
+      tags:
+      - 大连千海金(PCWeb)
   /QhjMgr/QuerySubArea:
     get:
       parameters:

+ 65 - 0
models/qhjPCWeb.go

@@ -1138,3 +1138,68 @@ func (r *QhjMgrContract) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// QhjMgrPickGoods 提货商品
+type QhjMgrPickGoods struct {
+	PICKUPGOODSID        string  `json:"pickupgoodsid"  xorm:"PICKUPGOODSID"`               // 提货商品ID
+	PICKUPGOODSNAME      string  `json:"pickupgoodsname"  xorm:"PICKUPGOODSNAME"`           // 提货商品名称
+	PICKUPGOODSUNITID    int32   `json:"pickupgoodsunitid"  xorm:"PICKUPGOODSUNITID"`       // 单位ID
+	PICKUPGOODSAGREEUNIT float64 `json:"pickupgoodsagreeunit"  xorm:"PICKUPGOODSAGREEUNIT"` // 合约乘数
+	PICKUPGOODSDESC      string  `json:"pickupgoodsdesc"  xorm:"PICKUPGOODSDESC"`           // 描述
+	IMAGEADDRESS         string  `json:"imageaddress"  xorm:"IMAGEADDRESS"`                 // 图片
+	REMARK               string  `json:"remark"  xorm:"REMARK"`                             // 备注
+	MODIFYSRC            int32   `json:"modifysrc"  xorm:"MODIFYSRC"`                       // 修改来源 - 1:管理端 2:终端
+	MODIFIERID           int64   `json:"modifierid"  xorm:"MODIFIERID"`                     // 修改人
+	UPDATETIME           string  `json:"updatetime"  xorm:"UPDATETIME"`                     // 更新时间
+	PREPAREDAYS          int32   `json:"preparedays"  xorm:"PREPAREDAYS"`                   // 备货期(天)
+	PICKUPGOODSSTATUS    int32   `json:"pickupgoodsstatus"  xorm:"PICKUPGOODSSTATUS"`       // 状态 - 1:正常 2:停用 3:注销
+	GOODSID              int32   `json:"goodsid"  xorm:"'GOODSID'"`                         // 商品id
+	PICKUPRATIO          float64 `json:"pickupratio"  xorm:"'PICKUPRATIO'"`                 // 提货系数
+
+	MODIFIERNAME string `json:"modifiername"` // 修改人名称
+	FilterStatus string `json:"-"`            // 状态过淲
+	ENUMDICNAME  string `json:"enumdicname"`  // 单位名称(提货商品)
+}
+
+func (r *QhjMgrPickGoods) calc() {
+	if r.MODIFYSRC == 1 {
+		r.MODIFIERNAME = mtpcache.GetSystemmangerLoginCode(r.MODIFIERID)
+	} else {
+		r.MODIFIERNAME = mtpcache.GetLoginCodeByLoginId(r.MODIFIERID)
+	}
+	if r.MODIFIERNAME == "" {
+		r.MODIFIERNAME = mtpcache.GetUserNameByUserId(r.MODIFIERID)
+	}
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.PICKUPGOODSUNITID)
+}
+
+func (r *QhjMgrPickGoods) buildSql() string {
+	var sqlId utils.SQLVal = "SELECT t.PICKUPGOODSID," +
+		"       t.PICKUPGOODSNAME," +
+		"       t.PICKUPGOODSUNITID," +
+		"       t.PICKUPGOODSAGREEUNIT," +
+		"       to_char(t.PICKUPGOODSDESC) PICKUPGOODSDESC," +
+		"       to_char(t.IMAGEADDRESS) IMAGEADDRESS," +
+		"       t.REMARK," +
+		"       t.MODIFYSRC," +
+		"       t.MODIFIERID," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       t.PREPAREDAYS," +
+		"       t.PICKUPGOODSSTATUS," +
+		"  FROM PICKUPGOODS t" +
+		" WHERE 1 = 1"
+	if len(r.FilterStatus) > 0 {
+		sqlId.Join(fmt.Sprintf(" and t.PICKUPGOODSSTATUS in(%v)", r.FilterStatus))
+	}
+	return sqlId.String()
+}
+
+// GetDataEx 获取提货商品
+func (r *QhjMgrPickGoods) GetDataEx() (interface{}, error) {
+	sData := make([]QhjMgrPickGoods, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -487,6 +487,7 @@ func InitRouter() *gin.Engine {
 		qhjPCWebR.GET("QueryTradeOrderDetail", qhjPCWeb.QueryTradeOrderDetail)
 		qhjPCWebR.GET("QueryTradePayOrder", qhjPCWeb.QueryTradePayOrder)
 		qhjPCWebR.GET("QueryContract", qhjPCWeb.QueryContract)
+		qhjPCWebR.GET("QueryPickGoods", qhjPCWeb.QueryPickGoods)
 	}
 
 	// **********************千海金(协议和签约)**************************