zhou.xiaoning hace 5 años
padre
commit
68f3bbedcc
Se han modificado 10 ficheros con 1184 adiciones y 15 borrados
  1. 131 0
      controllers/hsby/hsby.go
  2. 300 0
      docs/docs.go
  3. 300 0
      docs/swagger.json
  4. 215 0
      docs/swagger.yaml
  5. 1 1
      models/account.go
  6. 1 1
      models/common.go
  7. 232 13
      models/hsby.go
  8. 4 0
      routers/router.go
  9. 0 0
      utils/convertUtils.go
  10. 0 0
      utils/encryptUtils.go

+ 131 - 0
controllers/hsby/hsby.go

@@ -424,3 +424,134 @@ func QueryHsbyPreGoodsDetail(c *gin.Context) {
 	logger.GetLogger().Debugln("QueryHsbyPreGoodsDetail successed: %v", goodsInfo)
 	appG.Response(http.StatusOK, e.SUCCESS, goodsInfo)
 }
+
+// QueryHsbySellMyDetailReq 查询"我的闲置"单据信息请求参数
+type QueryHsbySellMyDetailReq struct {
+	app.PageInfo
+	AccountIDs string `form:"accountIDs" binding:"required"`
+	OrderType  int    `form:"orderType"`
+}
+
+// QueryHsbySellMyDetails 查询"我的闲置"单据信息
+// @Summary 查询"我的闲置"单据信息
+// @Description 说明:已发布 - 二级市场卖挂,3:委托成功、7:部分成交; 已完成 - 二级市场成交单,包括历史数据。查询结果已按时间从近到远排序
+// @Produce json
+// @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
+// @Param accountIDs query string true "资金账户列表,格式:1,2,3"
+// @Param orderType query int false "单据类型:0 - 已发布(默认), 1 - 已完成"
+// @Success 200 {object} models.HsbySellMyDetail
+// @Failure 500 {object} app.Response
+// @Router /HSBY/QueryHsbySellMyDetails [get]
+// @Tags 定制【海商报业】
+func QueryHsbySellMyDetails(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QueryHsbySellMyDetailReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("QueryHsbySellMyDetails failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	// 获取数据
+	var orders []models.HsbySellMyDetail
+	if req.OrderType == 0 {
+		// 已发布
+		var err error
+		orders, err = models.GetHsbySellMyOrderDetails(req.AccountIDs)
+		if err != nil {
+			// 查询失败
+			logger.GetLogger().Errorf("QueryHsbySellMyDetails failed: %s", err.Error())
+			appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+			return
+		}
+	} else {
+		// 已完成
+		var err error
+		orders, err = models.GetHsbySellMyTradeDetails(req.AccountIDs)
+		if err != nil {
+			// 查询失败
+			logger.GetLogger().Errorf("QueryHsbySellMyDetails failed: %s", err.Error())
+			appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+			return
+		}
+	}
+
+	// 排序
+	sort.Slice(orders, func(i int, j int) bool {
+		return orders[i].Time.After(orders[j].Time)
+	})
+
+	// 分页
+	total := len(orders)
+	if req.PageSize > 0 {
+		rstByPage := make([]models.HsbySellMyDetail, 0)
+		// 开始上标
+		start := req.Page * req.PageSize
+		// 结束下标
+		end := start + req.PageSize
+
+		if start <= len(orders) {
+			// 判断结束下标是否越界
+			if end > len(orders) {
+				end = len(orders)
+			}
+			rstByPage = orders[start:end]
+		} else {
+			rstByPage = orders[0:0]
+		}
+
+		orders = rstByPage
+	}
+
+	// 查询成功返回
+	if req.PageSize > 0 {
+		logger.GetLogger().Debugln("QueryHsbySellMyDetails successed: %v", orders)
+		appG.ResponseByPage(http.StatusOK, e.SUCCESS, orders, app.PageInfo{Page: req.Page, PageSize: req.PageSize, Total: total})
+	} else {
+		logger.GetLogger().Debugln("QueryHsbySellMyDetails successed: %v", orders)
+		appG.Response(http.StatusOK, e.SUCCESS, orders)
+	}
+}
+
+// QueryHsbyMyPackagesReq 查询我的包裹信息请求参数
+type QueryHsbyMyPackagesReq struct {
+	AccountIDs string `form:"accountIDs" binding:"required"`
+}
+
+// QueryHsbyMyPackages 查询我的包裹信息
+// @Summary 查询我的包裹信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param accountIDs query string true "资金账户列表,格式:1,2,3"
+// @Success 200 {object} models.HsbyMyPackage
+// @Failure 500 {object} app.Response
+// @Router /HSBY/QueryHsbyMyPackages [get]
+// @Tags 定制【海商报业】
+func QueryHsbyMyPackages(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QueryHsbyMyPackagesReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("QueryHsbyMyPackages failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	// 获取数据
+	goodsInfo, err := models.GetHsbyMyPackages(req.AccountIDs)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QueryHsbyMyPackages failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功返回
+	logger.GetLogger().Debugln("QueryHsbyMyPackages successed: %v", goodsInfo)
+	appG.Response(http.StatusOK, e.SUCCESS, goodsInfo)
+}

+ 300 - 0
docs/docs.go

@@ -938,6 +938,45 @@ var doc = `{
                 }
             }
         },
+        "/HSBY/QueryHsbyMyPackages": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询我的包裹信息",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账户列表,格式:1,2,3",
+                        "name": "accountIDs",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbyMyPackage"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyPreGoodsDetail": {
             "get": {
                 "security": [
@@ -1041,6 +1080,64 @@ var doc = `{
                 }
             }
         },
+        "/HSBY/QueryHsbySellMyDetails": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "说明:已发布 - 二级市场卖挂,3:委托成功、7:部分成交; 已完成 - 二级市场成交单,包括历史数据。查询结果已按时间从近到远排序",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询\"我的闲置\"单据信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金账户列表,格式:1,2,3",
+                        "name": "accountIDs",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "单据类型:0 - 已发布(默认), 1 - 已完成",
+                        "name": "orderType",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbySellMyDetail"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyTopGoodses": {
             "get": {
                 "security": [
@@ -3917,6 +4014,128 @@ var doc = `{
                 }
             }
         },
+        "models.HsbyMyPackage": {
+            "type": "object",
+            "required": [
+                "goodscode",
+                "goodsname",
+                "takeorderid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID",
+                    "type": "integer"
+                },
+                "address": {
+                    "description": "提货人详细地址",
+                    "type": "string"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "amount": {
+                    "description": "提货金额",
+                    "type": "number"
+                },
+                "auditer": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "averageprice": {
+                    "description": "均价",
+                    "type": "number"
+                },
+                "cardnum": {
+                    "description": "提货人证件号码",
+                    "type": "string"
+                },
+                "cardtypeid": {
+                    "description": "提货人证件类型",
+                    "type": "integer"
+                },
+                "checkremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "提货人联系方式",
+                    "type": "string"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "提货数量",
+                    "type": "number"
+                },
+                "recivername": {
+                    "description": "提货人姓名",
+                    "type": "string"
+                },
+                "reqtime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "takemode": {
+                    "description": "提货方式 - 2:自提 3:配送",
+                    "type": "integer"
+                },
+                "takeorderid": {
+                    "description": "提货单号(905+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "takeorderstatus": {
+                    "description": "提货状态 - 1:待发货 2:已发货 3:已收货",
+                    "type": "integer"
+                },
+                "takeremark": {
+                    "description": "提货备注",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.HsbyPreGoods": {
             "type": "object",
             "required": [
@@ -4133,6 +4352,87 @@ var doc = `{
                 }
             }
         },
+        "models.HsbySellMyDetail": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "buyorsell",
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid",
+                "orderid",
+                "qty",
+                "time",
+                "trademode"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID[报价币种]",
+                    "type": "integer"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "amount": {
+                    "description": "金额 = 价格 * 数量 * 合约单位",
+                    "type": "number"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "orderid": {
+                    "description": "单号(已发布 - 委托单号;已完成 - 成交单号)",
+                    "type": "string"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "price": {
+                    "description": "价格",
+                    "type": "number"
+                },
+                "qty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "time": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                }
+            }
+        },
         "models.HsbyTopGoods": {
             "type": "object",
             "required": [

+ 300 - 0
docs/swagger.json

@@ -922,6 +922,45 @@
                 }
             }
         },
+        "/HSBY/QueryHsbyMyPackages": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询我的包裹信息",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账户列表,格式:1,2,3",
+                        "name": "accountIDs",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbyMyPackage"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyPreGoodsDetail": {
             "get": {
                 "security": [
@@ -1025,6 +1064,64 @@
                 }
             }
         },
+        "/HSBY/QueryHsbySellMyDetails": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "说明:已发布 - 二级市场卖挂,3:委托成功、7:部分成交; 已完成 - 二级市场成交单,包括历史数据。查询结果已按时间从近到远排序",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "定制【海商报业】"
+                ],
+                "summary": "查询\"我的闲置\"单据信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "资金账户列表,格式:1,2,3",
+                        "name": "accountIDs",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "单据类型:0 - 已发布(默认), 1 - 已完成",
+                        "name": "orderType",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.HsbySellMyDetail"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/QueryHsbyTopGoodses": {
             "get": {
                 "security": [
@@ -3901,6 +3998,128 @@
                 }
             }
         },
+        "models.HsbyMyPackage": {
+            "type": "object",
+            "required": [
+                "goodscode",
+                "goodsname",
+                "takeorderid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID",
+                    "type": "integer"
+                },
+                "address": {
+                    "description": "提货人详细地址",
+                    "type": "string"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "amount": {
+                    "description": "提货金额",
+                    "type": "number"
+                },
+                "auditer": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "averageprice": {
+                    "description": "均价",
+                    "type": "number"
+                },
+                "cardnum": {
+                    "description": "提货人证件号码",
+                    "type": "string"
+                },
+                "cardtypeid": {
+                    "description": "提货人证件类型",
+                    "type": "integer"
+                },
+                "checkremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "提货人联系方式",
+                    "type": "string"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "提货数量",
+                    "type": "number"
+                },
+                "recivername": {
+                    "description": "提货人姓名",
+                    "type": "string"
+                },
+                "reqtime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "takemode": {
+                    "description": "提货方式 - 2:自提 3:配送",
+                    "type": "integer"
+                },
+                "takeorderid": {
+                    "description": "提货单号(905+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "takeorderstatus": {
+                    "description": "提货状态 - 1:待发货 2:已发货 3:已收货",
+                    "type": "integer"
+                },
+                "takeremark": {
+                    "description": "提货备注",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.HsbyPreGoods": {
             "type": "object",
             "required": [
@@ -4117,6 +4336,87 @@
                 }
             }
         },
+        "models.HsbySellMyDetail": {
+            "type": "object",
+            "required": [
+                "accountid",
+                "buyorsell",
+                "goodscode",
+                "goodsid",
+                "goodsname",
+                "marketid",
+                "orderid",
+                "qty",
+                "time",
+                "trademode"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "账户ID[报价币种]",
+                    "type": "integer"
+                },
+                "agreeunit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "amount": {
+                    "description": "金额 = 价格 * 数量 * 合约单位",
+                    "type": "number"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "currencysign": {
+                    "description": "货币符号",
+                    "type": "string"
+                },
+                "decimalplace": {
+                    "description": "报价小数位",
+                    "type": "integer"
+                },
+                "goodscode": {
+                    "description": "商品代码(内部)",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "orderid": {
+                    "description": "单号(已发布 - 委托单号;已完成 - 成交单号)",
+                    "type": "string"
+                },
+                "picurls": {
+                    "description": "介绍图片[多张用逗号分隔]",
+                    "type": "string"
+                },
+                "price": {
+                    "description": "价格",
+                    "type": "number"
+                },
+                "qty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "time": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "trademode": {
+                    "description": "交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价",
+                    "type": "integer"
+                }
+            }
+        },
         "models.HsbyTopGoods": {
             "type": "object",
             "required": [

+ 215 - 0
docs/swagger.yaml

@@ -1390,6 +1390,97 @@ definitions:
     - goodsid
     - goodsname
     type: object
+  models.HsbyMyPackage:
+    properties:
+      accountid:
+        description: 账户ID
+        type: integer
+      address:
+        description: 提货人详细地址
+        type: string
+      agreeunit:
+        description: 合约单位
+        type: number
+      amount:
+        description: 提货金额
+        type: number
+      auditer:
+        description: 审核人
+        type: integer
+      audittime:
+        description: 审核时间
+        type: string
+      averageprice:
+        description: 均价
+        type: number
+      cardnum:
+        description: 提货人证件号码
+        type: string
+      cardtypeid:
+        description: 提货人证件类型
+        type: integer
+      checkremark:
+        description: 审核备注
+        type: string
+      currencysign:
+        description: 货币符号
+        type: string
+      decimalplace:
+        description: 报价小数位
+        type: integer
+      goodscode:
+        description: 商品代码(内部)
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      handlestatus:
+        description: 处理状态
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      phonenum:
+        description: 提货人联系方式
+        type: string
+      picurls:
+        description: 介绍图片[多张用逗号分隔]
+        type: string
+      qty:
+        description: 提货数量
+        type: number
+      recivername:
+        description: 提货人姓名
+        type: string
+      reqtime:
+        description: 更新时间
+        type: string
+      takemode:
+        description: 提货方式 - 2:自提 3:配送
+        type: integer
+      takeorderid:
+        description: 提货单号(905+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      takeorderstatus:
+        description: 提货状态 - 1:待发货 2:已发货 3:已收货
+        type: integer
+      takeremark:
+        description: 提货备注
+        type: string
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+    required:
+    - goodscode
+    - goodsname
+    - takeorderid
+    type: object
   models.HsbyPreGoods:
     properties:
       currency:
@@ -1554,6 +1645,69 @@ definitions:
     - marketid
     - trademode
     type: object
+  models.HsbySellMyDetail:
+    properties:
+      accountid:
+        description: 账户ID[报价币种]
+        type: integer
+      agreeunit:
+        description: 合约单位
+        type: number
+      amount:
+        description: 金额 = 价格 * 数量 * 合约单位
+        type: number
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
+      currencysign:
+        description: 货币符号
+        type: string
+      decimalplace:
+        description: 报价小数位
+        type: integer
+      goodscode:
+        description: 商品代码(内部)
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      marketid:
+        description: 市场ID
+        type: integer
+      orderid:
+        description: 单号(已发布 - 委托单号;已完成 - 成交单号)
+        type: string
+      picurls:
+        description: 介绍图片[多张用逗号分隔]
+        type: string
+      price:
+        description: 价格
+        type: number
+      qty:
+        description: 数量
+        type: integer
+      time:
+        description: 时间
+        type: string
+      trademode:
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
+          21:竞拍-大宗式 22:受托竞价
+        type: integer
+    required:
+    - accountid
+    - buyorsell
+    - goodscode
+    - goodsid
+    - goodsname
+    - marketid
+    - orderid
+    - qty
+    - time
+    - trademode
+    type: object
   models.HsbyTopGoods:
     properties:
       currency:
@@ -3958,6 +4112,30 @@ paths:
       summary: 查询“我的商品”信息
       tags:
       - 定制【海商报业】
+  /HSBY/QueryHsbyMyPackages:
+    get:
+      parameters:
+      - description: 资金账户列表,格式:1,2,3
+        in: query
+        name: accountIDs
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/models.HsbyMyPackage'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的包裹信息
+      tags:
+      - 定制【海商报业】
   /HSBY/QueryHsbyPreGoodsDetail:
     get:
       parameters:
@@ -4023,6 +4201,43 @@ paths:
       summary: 查询新品上市商品列表(一级市场产能预售)
       tags:
       - 定制【海商报业】
+  /HSBY/QueryHsbySellMyDetails:
+    get:
+      description: 说明:已发布 - 二级市场卖挂,3:委托成功、7:部分成交; 已完成 - 二级市场成交单,包括历史数据。查询结果已按时间从近到远排序
+      parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      - description: 资金账户列表,格式:1,2,3
+        in: query
+        name: accountIDs
+        required: true
+        type: string
+      - description: 单据类型:0 - 已发布(默认), 1 - 已完成
+        in: query
+        name: orderType
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/models.HsbySellMyDetail'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询"我的闲置"单据信息
+      tags:
+      - 定制【海商报业】
   /HSBY/QueryHsbyTopGoodses:
     get:
       description: 说明:查询结果已按Hotindex(景点热度)从大到小排序

+ 1 - 1
models/account.go

@@ -3,7 +3,7 @@ package models
 import (
 	"encoding/hex"
 	"mtp2_if/db"
-	"mtp2_if/global/utils"
+	"mtp2_if/utils"
 	"time"
 )
 

+ 1 - 1
models/common.go

@@ -4,7 +4,7 @@ import (
 	"errors"
 	"fmt"
 	"mtp2_if/db"
-	"mtp2_if/global/utils"
+	"mtp2_if/utils"
 	"strconv"
 	"time"
 )

+ 232 - 13
models/hsby.go

@@ -354,14 +354,17 @@ func GetHsbyBuyMyOrderDetails(accountIDs string, myBuyStatus int) ([]HybsMyBuyOr
 	engine := db.GetEngine()
 	// 委托状态
 	orderStatus := "0" // 单据状态,为0的时候查询全部
-	marketID := 0      // 我的订单包括一二级市场的单据,目前暂时由服务直接报相关类型的第一个市场
+	marketIDs := ""    // 我的订单包括一二级市场的单据
 	switch myBuyStatus {
 	case 1: // 抢购中 (一级市场)
 		// 获取市场ID
 		for _, v := range markets {
 			if v.Trademode == 71 { // 预售挂牌
-				marketID = int(v.Marketid)
-				break
+				if len(marketIDs) == 0 {
+					marketIDs = strconv.Itoa(int(v.Marketid))
+				} else {
+					marketIDs += "," + strconv.Itoa(int(v.Marketid))
+				}
 			}
 		}
 		orderStatus = "3,7"
@@ -369,16 +372,32 @@ func GetHsbyBuyMyOrderDetails(accountIDs string, myBuyStatus int) ([]HybsMyBuyOr
 		// 获取市场ID
 		for _, v := range markets {
 			if v.Trademode == 16 { // 挂牌点选
-				marketID = int(v.Marketid)
-				break
+				if len(marketIDs) == 0 {
+					marketIDs = strconv.Itoa(int(v.Marketid))
+				} else {
+					marketIDs += "," + strconv.Itoa(int(v.Marketid))
+				}
 			}
 		}
 		orderStatus = "3,7"
 	case 3: // 已完成
 		orderStatus = "8,9"
 	}
+	// 默认取 TradeMode = 16 or 71 的市场
+	if len(marketIDs) == 0 {
+		for _, v := range markets {
+			if v.Trademode == 16 || v.Trademode == 71 {
+				if len(marketIDs) == 0 {
+					marketIDs = strconv.Itoa(int(v.Marketid))
+				} else {
+					marketIDs += "," + strconv.Itoa(int(v.Marketid))
+				}
+			}
+		}
+	}
 
 	hybsMyBuyOrderDetails := make([]HybsMyBuyOrderDetail, 0)
+	// "我的订单"都是买委托
 	session := engine.Table("TRADE_ORDERDETAIL").
 		Select(`to_char(TRADE_ORDERDETAIL.ORDERID) ORDERID, TRADE_ORDERDETAIL.*, 
 				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
@@ -391,11 +410,8 @@ func GetHsbyBuyMyOrderDetails(accountIDs string, myBuyStatus int) ([]HybsMyBuyOr
 		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
 		Join("LEFT", "MARKET", "MARKET.MARKETID = TRADE_ORDERDETAIL.MARKETID").
 		Join("LEFT", "HSBY_SUPPLIERINFO", "HSBY_SUPPLIERINFO.VENDORID = HSBY_GOODSEX.VENDORID").
-		Where(fmt.Sprintf("TRADE_ORDERDETAIL.ACCOUNTID in (%s)", accountIDs))
-	// 是否过滤市场(抢购中、求购中)
-	if marketID > 0 {
-		session = session.And("TRADE_ORDERDETAIL.MARKETID = ?", marketID)
-	}
+		Where(fmt.Sprintf("TRADE_ORDERDETAIL.BUYORSELL = 0 and TRADE_ORDERDETAIL.ACCOUNTID in (%s)", accountIDs)).
+		And(fmt.Sprintf("TRADE_ORDERDETAIL.MARKETID in (%s)", marketIDs))
 	// 是否过滤状态(抢购中、求购中、已完成)
 	if orderStatus != "0" {
 		session = session.And(fmt.Sprintf("TRADE_ORDERDETAIL.ORDERSTATUS in (%s)", orderStatus))
@@ -644,6 +660,209 @@ func GetHsbyPreGoodsDetail(goodsID int) (*HsbyPreGoodsDetail, error) {
 	return &preGoodsDetail, nil
 }
 
-// type HsbyMyParcel struct {
-// 	Tradegoodspickup `xorm:"extends"`
-// }
+// HsbySellMyDetail "我的闲置"单据信息(已发布 - 二级市场卖挂,3:委托成功、7:部分成交; 已完成 - 二级市场成交单,包括历史数据)
+type HsbySellMyDetail struct {
+	Orderid   string    `json:"orderid"  xorm:"'ORDERID'" binding:"required"`     // 单号(已发布 - 委托单号;已完成 - 成交单号)
+	Marketid  int32     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`   // 市场ID
+	Goodsid   int32     `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`     // 商品ID
+	Accountid int64     `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"` // 账户ID[报价币种]
+	Buyorsell int32     `json:"buyorsell"  xorm:"'BUYORSELL'" binding:"required"` // 买卖 - 0:买 1:卖
+	Price     float64   `json:"price"  xorm:"'PRICE'"`                            // 价格
+	Qty       int64     `json:"qty"  xorm:"'QTY'" binding:"required"`             // 数量
+	Time      time.Time `json:"time"  xorm:"'TIME'" binding:"required"`           // 时间
+	Amount    float64   `json:"amount" xorm:"'AMOUNT'"`                           // 金额 = 价格 * 数量 * 合约单位
+
+	Goodscode    string  `json:"goodscode"  xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
+	Goodsname    string  `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"` // 商品名称
+	Decimalplace int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`              // 报价小数位
+	Agreeunit    float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`                    // 合约单位
+
+	Picurls string `json:"picurls"  xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
+
+	Trademode uint32 `json:"trademode"  xorm:"'TRADEMODE'" binding:"required"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
+
+	Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
+}
+
+// GetHsbySellMyOrderDetails 获取"我的闲置 - 已发布"单据信息
+// 输入 accountIDs string 资金账户列表
+// 输出 []HsbySellMyDetail "我的闲置 - 已发布"单据信息
+// 输出 error error
+func GetHsbySellMyOrderDetails(accountIDs string) ([]HsbySellMyDetail, error) {
+	// 获取市场信息
+	markets, err := GetMarkets()
+	if err != nil {
+		return nil, err
+	}
+
+	engine := db.GetEngine()
+	marketIDs := "" // 我的订单包括一二级市场的单据
+	// 默认取 TradeMode = 16 or 71 的市场
+	for _, v := range markets {
+		if v.Trademode == 16 || v.Trademode == 71 {
+			if len(marketIDs) == 0 {
+				marketIDs = strconv.Itoa(int(v.Marketid))
+			} else {
+				marketIDs += "," + strconv.Itoa(int(v.Marketid))
+			}
+		}
+	}
+
+	orderDetails := make([]HsbySellMyDetail, 0)
+	// “我的闲置 - 已发布”都是卖挂委托
+	session := engine.Table("TRADE_ORDERDETAIL").
+		Select(`to_char(TRADE_ORDERDETAIL.ORDERID) ORDERID, 
+				TRADE_ORDERDETAIL.MARKETID, TRADE_ORDERDETAIL.GOODSID, TRADE_ORDERDETAIL.ACCOUNTID, TRADE_ORDERDETAIL.BUYORSELL,
+				TRADE_ORDERDETAIL.ORDERPRICE PRICE, TRADE_ORDERDETAIL.ORDERQTY QTY, TRADE_ORDERDETAIL.ORDERTIME TIME, 
+				(TRADE_ORDERDETAIL.ORDERPRICE * TRADE_ORDERDETAIL.ORDERQTY * GOODS.AGREEUNIT) AMOUNT, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
+				HSBY_GOODSEX.PICURLS, 
+				MARKET.TRADEMODE, 
+				ENUMDICITEM.PARAM2 CURRENCYSIGN`).
+		Join("LEFT", "GOODS", "GOODS.GOODSID = TRADE_ORDERDETAIL.GOODSID").
+		Join("LEFT", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
+		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
+		Join("LEFT", "MARKET", "MARKET.MARKETID = TRADE_ORDERDETAIL.MARKETID").
+		Where(fmt.Sprintf(`TRADE_ORDERDETAIL.BUYORSELL = 1 and TRADE_ORDERDETAIL.LISTINGSELECTTYPE = 1 and (TRADE_ORDERDETAIL.ORDERSTATUS = 3 or TRADE_ORDERDETAIL.ORDERSTATUS = 7) 
+						   and TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, accountIDs)).
+		And(fmt.Sprintf("TRADE_ORDERDETAIL.MARKETID in (%s)", marketIDs))
+	if err := session.Find(&orderDetails); err != nil {
+		return nil, err
+	}
+
+	return orderDetails, nil
+}
+
+// GetHsbySellMyTradeDetails 获取"我的闲置 - 已完成"单据信息
+// 输入 accountIDs string 资金账户列表
+// 输出 []HsbySellMyDetail "我的闲置 - 已完成"单据信息
+// 输出 error error
+func GetHsbySellMyTradeDetails(accountIDs string) ([]HsbySellMyDetail, error) {
+	// 获取市场信息
+	markets, err := GetMarkets()
+	if err != nil {
+		return nil, err
+	}
+
+	engine := db.GetEngine()
+	marketIDs := "" // 我的订单包括一二级市场的单据
+	// 默认取 TradeMode = 16 or 71 的市场
+	for _, v := range markets {
+		if v.Trademode == 16 || v.Trademode == 71 {
+			if len(marketIDs) == 0 {
+				marketIDs = strconv.Itoa(int(v.Marketid))
+			} else {
+				marketIDs += "," + strconv.Itoa(int(v.Marketid))
+			}
+		}
+	}
+
+	orders := make([]HsbySellMyDetail, 0)
+
+	// 当前成交单
+	curOrders := make([]HsbySellMyDetail, 0)
+	if err := engine.Table("TRADE_TRADEDETAIL").
+		Select(`to_char(TRADE_TRADEDETAIL.TRADEID) ORDERID, 
+				TRADE_TRADEDETAIL.MARKETID, TRADE_TRADEDETAIL.GOODSID, TRADE_TRADEDETAIL.ACCOUNTID, TRADE_TRADEDETAIL.BUYORSELL,
+				TRADE_TRADEDETAIL.TRADEPRICE PRICE, TRADE_TRADEDETAIL.TRADEQTY QTY, TRADE_TRADEDETAIL.TRADETIME TIME, TRADE_TRADEDETAIL.TRADEAMOUNT AMOUNT, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
+				HSBY_GOODSEX.PICURLS, 
+				MARKET.TRADEMODE, 
+				ENUMDICITEM.PARAM2 CURRENCYSIGN`).
+		Join("LEFT", "GOODS", "GOODS.GOODSID = TRADE_TRADEDETAIL.GOODSID").
+		Join("LEFT", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
+		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
+		Join("LEFT", "MARKET", "MARKET.MARKETID = TRADE_TRADEDETAIL.MARKETID").
+		Where(fmt.Sprintf(`TRADE_TRADEDETAIL.BUYORSELL = 1 
+						   and TRADE_TRADEDETAIL.ACCOUNTID in (%s)`, accountIDs)).
+		And(fmt.Sprintf("TRADE_TRADEDETAIL.MARKETID in (%s)", marketIDs)).Find(&curOrders); err != nil {
+		return nil, err
+	}
+	if len(curOrders) > 0 {
+		orders = append(orders, curOrders...)
+	}
+
+	// 历史成交单
+	hisOrders := make([]HsbySellMyDetail, 0)
+	if err := engine.Table("HIS_TRADE_TRADEDETAIL").
+		Select(`to_char(HIS_TRADE_TRADEDETAIL.TRADEID) ORDERID, 
+				HIS_TRADE_TRADEDETAIL.MARKETID, HIS_TRADE_TRADEDETAIL.GOODSID, HIS_TRADE_TRADEDETAIL.ACCOUNTID, HIS_TRADE_TRADEDETAIL.BUYORSELL,
+				HIS_TRADE_TRADEDETAIL.TRADEPRICE PRICE, HIS_TRADE_TRADEDETAIL.TRADEQTY QTY, HIS_TRADE_TRADEDETAIL.TRADETIME TIME, HIS_TRADE_TRADEDETAIL.TRADEAMOUNT AMOUNT, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
+				HSBY_GOODSEX.PICURLS, 
+				MARKET.TRADEMODE, 
+				ENUMDICITEM.PARAM2 CURRENCYSIGN`).
+		Join("LEFT", "GOODS", "GOODS.GOODSID = HIS_TRADE_TRADEDETAIL.GOODSID").
+		Join("LEFT", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
+		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
+		Join("LEFT", "MARKET", "MARKET.MARKETID = HIS_TRADE_TRADEDETAIL.MARKETID").
+		Where(fmt.Sprintf(`HIS_TRADE_TRADEDETAIL.BUYORSELL = 1 and HIS_TRADE_TRADEDETAIL.ISVALIDDATA = 1 
+						   and HIS_TRADE_TRADEDETAIL.ACCOUNTID in (%s)`, accountIDs)).
+		And(fmt.Sprintf("HIS_TRADE_TRADEDETAIL.MARKETID in (%s)", marketIDs)).Find(&hisOrders); err != nil {
+		return nil, err
+	}
+	if len(hisOrders) > 0 {
+		orders = append(orders, hisOrders...)
+	}
+
+	return orders, nil
+}
+
+// HsbyMyPackage 我的包裹信息
+type HsbyMyPackage struct {
+	Takeorderid     string    `json:"takeorderid"  xorm:"'TAKEORDERID'" binding:"required"` // 提货单号(905+Unix秒时间戳(10位)+xxxxxx)
+	Accountid       int64     `json:"accountid"  xorm:"'ACCOUNTID'"`                        // 账户ID
+	Goodsid         int64     `json:"goodsid"  xorm:"'GOODSID'"`                            // 商品ID
+	Userid          int64     `json:"userid"  xorm:"'USERID'"`                              // 用户ID
+	Qty             float64   `json:"qty"  xorm:"'QTY'"`                                    // 提货数量
+	Reqtime         time.Time `json:"reqtime"  xorm:"'REQTIME'"`                            // 更新时间
+	Recivername     string    `json:"recivername"  xorm:"'RECIVERNAME'"`                    // 提货人姓名
+	Cardtypeid      int32     `json:"cardtypeid"  xorm:"'CARDTYPEID'"`                      // 提货人证件类型
+	Cardnum         string    `json:"cardnum"  xorm:"'CARDNUM'"`                            // 提货人证件号码
+	Phonenum        string    `json:"phonenum"  xorm:"'PHONENUM'"`                          // 提货人联系方式
+	Takemode        int32     `json:"takemode"  xorm:"'TAKEMODE'"`                          // 提货方式 - 2:自提 3:配送
+	Address         string    `json:"address"  xorm:"'ADDRESS'"`                            // 提货人详细地址
+	Takeremark      string    `json:"takeremark"  xorm:"'TAKEREMARK'"`                      // 提货备注
+	Takeorderstatus int32     `json:"takeorderstatus"  xorm:"'TAKEORDERSTATUS'"`            // 提货状态 - 1:待发货 2:已发货 3:已收货
+	Auditer         int32     `json:"auditer"  xorm:"'AUDITER'"`                            // 审核人
+	Audittime       time.Time `json:"audittime"  xorm:"'AUDITTIME'"`                        // 审核时间
+	Checkremark     string    `json:"checkremark"  xorm:"'CHECKREMARK'"`                    // 审核备注
+	Tradedate       string    `json:"tradedate"  xorm:"'TRADEDATE'"`                        // 交易日(yyyyMMdd)
+	Marketid        int32     `json:"marketid"  xorm:"'MARKETID'"`                          // 市场ID
+	Handlestatus    int32     `json:"handlestatus"  xorm:"'HANDLESTATUS'"`                  // 处理状态
+	Amount          float64   `json:"amount"  xorm:"'AMOUNT'"`                              // 提货金额
+	Averageprice    float64   `json:"averageprice" xorm:"'AVERAGEPRICE'"`                   // 均价
+
+	Goodscode    string  `json:"goodscode"  xorm:"'GOODSCODE'" binding:"required"` // 商品代码(内部)
+	Goodsname    string  `json:"goodsname"  xorm:"'GOODSNAME'" binding:"required"` // 商品名称
+	Decimalplace int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`              // 报价小数位
+	Agreeunit    float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`                    // 合约单位
+
+	Picurls string `json:"picurls"  xorm:"'PICURLS'"` // 介绍图片[多张用逗号分隔]
+
+	Currencysign string `json:"currencysign" xorm:"'CURRENCYSIGN'"` // 货币符号
+}
+
+// GetHsbyMyPackages 获取我的包裹信息
+// 输入 accountIDs string 资金账户列表
+// 输出 []HsbyMyPackage 我的包裹信息
+// 输出 error error
+func GetHsbyMyPackages(accountIDs string) ([]HsbyMyPackage, error) {
+	engine := db.GetEngine()
+
+	myPackages := make([]HsbyMyPackage, 0)
+	if err := engine.Table("TRADE_GOODSPICKUP").
+		Select(`to_char(TRADE_GOODSPICKUP.TAKEORDERID) TAKEORDERID, TRADE_GOODSPICKUP.*, 
+				(TRADE_GOODSPICKUP.AMOUNT/TRADE_GOODSPICKUP.QTY/GOODS.AGREEUNIT) AVERAGEPRICE, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.AGREEUNIT, 
+				HSBY_GOODSEX.PICURLS, 
+				ENUMDICITEM.PARAM2 CURRENCYSIGN`).
+		Join("LEFT", "GOODS", "GOODS.GOODSID = TRADE_GOODSPICKUP.GOODSID").
+		Join("LEFT", "HSBY_GOODSEX", "HSBY_GOODSEX.GOODSID = GOODS.GOODSID").
+		Join("LEFT", "ENUMDICITEM", "GOODS.CURRENCYID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'currency'").
+		Where(fmt.Sprintf("TRADE_GOODSPICKUP.ACCOUNTID in (%s)", accountIDs)).Find(&myPackages); err != nil {
+		return nil, err
+	}
+
+	return myPackages, nil
+}

+ 4 - 0
routers/router.go

@@ -176,6 +176,10 @@ func InitRouter() *gin.Engine {
 		hsbyR.GET("/QueryHsbyPreGoodses", hsby.QueryHsbyPreGoodses)
 		// 查询一级市场(产能预售)商品信息详情
 		hsbyR.GET("/QueryHsbyPreGoodsDetail", hsby.QueryHsbyPreGoodsDetail)
+		// 查询"我的闲置"单据信息
+		hsbyR.GET("/QueryHsbySellMyDetails", hsby.QueryHsbySellMyDetails)
+		// 查询我的包裹信息
+		hsbyR.GET("/QueryHsbyMyPackages", hsby.QueryHsbyMyPackages)
 	}
 
 	return r

+ 0 - 0
global/utils/convertUtils.go → utils/convertUtils.go


+ 0 - 0
global/utils/encryptUtils.go → utils/encryptUtils.go