Преглед изворни кода

增加查询待审核合同接口

zou.yingbin пре 5 година
родитељ
комит
eff706bc6e

+ 1 - 1
.gitignore

@@ -7,4 +7,4 @@ mtp2_if
 QueryService
 go.sum
 mtp2_if.exe
-/.idea
+.idea

+ 3 - 3
controllers/erms3/qryContract.go

@@ -124,8 +124,8 @@ type QryAuditContractRsp struct {
 	EnumdicName       string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                                // 单位名称
 	SignDate          string  `json:"signdate"  xorm:"'SIGNDATE'"`                                      // 签订日期
 
-	deliverGoods map[int32]models.Deliverygoods // 不参与json编码,作为id转code缓存
-	wrStandards  map[int64]models.Wrstandard    // 不参与json编码,作为id转code缓存
+	deliverGoods map[int32]models.Deliverygoods     // 不参与json编码,作为id转code缓存
+	wrStandards  map[int64]models.WRStandardInfo    // 不参与json编码,作为id转code缓存
 }
 
 // 转换交割商品ID为商品代码
@@ -153,7 +153,7 @@ func (r *QryAuditContractRsp) WrStandardID2Code(id int64) string {
 
 	// init
 	if r.wrStandards == nil || len(r.wrStandards) == 0 {
-		r.wrStandards = make(map[int64]models.Wrstandard)
+		r.wrStandards = make(map[int64]models.WRStandardInfo)
 		if wg, err := models.GetWrstandards(); err == nil {
 			for _, v := range wg {
 				r.wrStandards[v.Wrstandardid] = v

+ 156 - 20
controllers/erms3/spotContract.go

@@ -10,6 +10,8 @@ import (
 	"mtp2_if/models"
 	"mtp2_if/utils"
 	"net/http"
+	"strconv"
+	"strings"
 	"time"
 
 	"github.com/gin-gonic/gin"
@@ -25,19 +27,23 @@ var SecondCount int = 0
 
 // SpotPriceOrder 定价明细
 type SpotPriceOrder struct {
-	Price  float64 `json:"price" binding:"required"`  // 价格
-	Qty    float64 `json:"qty" binding:"required"`    // 数量
-	Amount float64 `json:"amount" binding:"required"` // 金额
+	Price             float64   `json:"price" binding:"required"`  // 价格
+	Qty               float64   `json:"qty" binding:"required"`    // 数量
+	Amount            float64   `json:"amount" binding:"required"` // 金额
+	DeliveryStartDate time.Time `json:"deliverystartdate"`         // 交收开始日期
+	DeliveryEndDate   time.Time `json:"deliveryendtdate"`          // 交收结束日期
 }
 
 // SpotPointOrder 点价明细
 type SpotPointOrder struct {
-	GoodsID   int32   `json:"goodsid" binding:"required"`   // 商品ID
-	GoodsName string  `json:"goodsname"`                    // 商品名称
-	Qty       float64 `json:"qty" binding:"required"`       // 数量
-	Basic     float64 `json:"basic" binding:"required"`     // 基差
-	StartDate string  `json:"startdate" binding:"required"` // 点价开始日期
-	EndDate   string  `json:"enddate" binding:"required"`   // 点价结束日期
+	GoodsID           int32     `json:"goodsid" binding:"required"` // 商品ID
+	GoodsName         string    `json:"goodsname"`                  // 商品名称
+	Qty               float64   `json:"qty" binding:"required"`     // 数量
+	Basic             float64   `json:"basic" binding:"required"`   // 基差
+	StartDate         time.Time `json:"startdate"`                  // 点价开始日期
+	EndDate           time.Time `json:"enddate"`                    // 点价结束日期
+	DeliveryStartDate time.Time `json:"deliverystartdate"`          // 交收开始日期
+	DeliveryEndDate   time.Time `json:"deliveryendtdate"`           // 交收结束日期
 }
 
 // SoptContractDetail 合同明细信息
@@ -50,7 +56,7 @@ type SoptContractDetail struct {
 	DeliveryGoodsName    string           `json:"deliverygoodsname"`                  // 现货品种名称
 	DeliveryGoodsDesc    string           `json:"deliverygoodsdesc"`                  // 现货品种说明
 	WarehouseID          int32            `json:"warehouseid" binding:"required"`     // 仓库ID
-	WarehouseName        int32            `json:"warehousename"`                      // 仓库名称
+	WarehouseName        string           `json:"warehousename"`                      // 仓库名称
 	UnitName             string           `json:"unitname" binding:"required"`        // 单位名称
 	PointDesc            string           `json:"pointdesc"`                          // 点价描述
 	SpotPriceOrderList   []SpotPriceOrder `json:"spotPriceOrderList"`                 // 定价列表
@@ -67,7 +73,7 @@ type SoptContractDetailSum struct {
 	DeliveryGoodsName     string           `json:"deliverygoodsname"`                  // 现货品种名称
 	DeliveryGoodsDesc     string           `json:"deliverygoodsdesc"`                  // 现货品种说明
 	WarehouseID           int32            `json:"warehouseid" binding:"required"`     // 仓库ID
-	WarehouseName         int32            `json:"warehousename"`                      // 仓库名称
+	WarehouseName         string           `json:"warehousename"`                      // 仓库名称
 	UnitName              string           `json:"unitname" binding:"required"`        // 单位名称
 	PointDesc             string           `json:"pointdesc"`                          // 点价描述
 	SpotPriceOrderList    []SpotPriceOrder `json:"spotPriceOrderList"`                 // 定价列表
@@ -87,13 +93,12 @@ type AddSpotContractApplyReq struct {
 	AccountID          int64                `json:"accountid" binding:"required"`         // 资金账户ID
 	CustomerUserID     int32                `json:"customeruserid" binding:"required"`    // 客户ID
 	CustomerAccountID  int64                `json:"customeraccountid" binding:"required"` // 客户资金账户ID
-	SignDate           time.Time            `json:"signdate" binding:"required"`          // 签订日期
-	LastDate           time.Time            `json:"lastdate" binding:"required"`          // 交货时间
+	SignDate           string               `json:"signdate" binding:"required"`          // 签订日期
+	LastDate           string               `json:"lastdate"`                             // 交货时间
 	ContractAttachment string               `json:"contractattachment"`                   // 合同附件
 	OriMarginPayer     int32                `json:"orimarginpayer" binding:"required"`    // 初始保证金支付方 -1:买方 2:卖方
 	OriMargin          float64              `json:"orimargin" binding:"required"`         // 初始保证金
 	Remark             string               `json:"remark"`                               // 备注
-	MarketID           int32                `json:"marketid" binding:"required"`          // 市场ID
 	CreatorID          int32                `json:"creatorid"`                            // 申请人
 	Details            []SoptContractDetail `json:"details" binding:"required"`           // 明细
 }
@@ -129,7 +134,7 @@ func AddSpotContractApply(c *gin.Context) {
 	spotcontractid := GenSpotContractID()
 
 	// 获取当前交易日
-	tradedate, err := GetMarketTradeDate(int(req.MarketID))
+	tradedate, err := GetMarketTradeDate()
 	if err != nil {
 		// 返回失败
 		logger.GetLogger().Errorf("AddSpotContractApply get market trade date failed: %s", err.Error())
@@ -165,7 +170,6 @@ func AddSpotContractApply(c *gin.Context) {
 		DetailJSON:         detailjson,
 		ApplyStatus:        0,
 		ApplySrc:           2,
-		MarketID:           req.MarketID,
 		CreatorID:          req.CreatorID,
 	}
 
@@ -210,8 +214,8 @@ func GenSpotContractID() int64 {
 }
 
 // GetMarketTradeDate 获取市场交易日
-func GetMarketTradeDate(marketid int) (string, error) {
-	marketrun, err := models.GetMarketRun(marketid)
+func GetMarketTradeDate() (string, error) {
+	marketrun, err := models.GetMarketRun(0)
 	if err != nil {
 		return "", err
 	}
@@ -290,7 +294,7 @@ type CustomerInfo struct {
 type QuerySpotContractAppleFormRsp struct {
 	OurUser        CustomerInfo            `json:"ouruser"`        // 我方账号
 	OppositeUsers  []CustomerInfo          `json:"oppositeusers"`  // 对方账号列表
-	WrStandards    []models.Wrstandard     `json:"wrstandards"`    // 仓单标准列表
+	WrStandards    []models.WRStandardInfo `json:"wrstandards"`    // 仓单标准列表
 	WareHouseInfos []models.Warehouseinfo  `json:"warehouseinfos"` // 仓库信息列表
 	Goodses        []models.GoodsIDAndName `json:"goodses"`        // 合约列表
 }
@@ -391,7 +395,7 @@ func QuerySpotContractAppleForm(c *gin.Context) {
 	}
 
 	// 获取交易标的(仓单标准)
-	rsp.WrStandards = make([]models.Wrstandard, 0)
+	rsp.WrStandards = make([]models.WRStandardInfo, 0)
 	wrStandards, err := models.GetWrstandards()
 	if err != nil {
 		// 查询失败
@@ -427,3 +431,135 @@ func QuerySpotContractAppleForm(c *gin.Context) {
 	logger.GetLogger().Debugln("QuerySpotContractAppleForm successed: %v", rsp)
 	appG.Response(http.StatusOK, e.SUCCESS, rsp)
 }
+
+// QuerySpotContractInfoReq 查询合同明细请求.
+type QuerySpotContractInfoReq struct {
+	Accountids   string `form:"accountids" binding:"required"`   // 资金账号ID列表,逗号分隔.
+	ContractType int32  `form:"contracttype" binding:"required"` // 合同类型,1为采购合同 -1为销售合同.
+	ContractMode int32  `form:"contractmode" binding:"required"` // 合同模式,1为普通合同 2为回购销售合同.
+	Status       int32  `form:"status"`                          // 合同状态,0-履约中 1-已完成.
+}
+
+// QuerySpotContractInfoRsp 查询合同明细响应.
+type QuerySpotContractInfoRsp struct {
+	SpotContractID    string  `json:"spotcontractid"`    // 合同ID
+	CustomerName      string  `json:"customername"`      // 若合同类型为采购合同,表示采购方ID;若合同类型为销售合同,表示销售方ID.
+	AccountID         int64   `json:"accountid"`         // 表示交易员ID.
+	MatchCustomerName string  `json:"matchcustomername"` // 若合同类型为采购合同,表示销售方;若合同类型为销售合同,表示采购方ID.
+	MatchAccountID    int64   `json:"matchaccountid"`    // 表示业务员ID.
+	WRStandardName    string  `json:"wrstandardname"`    // 表示商品ID.
+	TotalQty          float64 `json:"totalqty"`          // 表示合同量.
+	PricedQty         float64 `json:"priceqty"`          // 表示定价量.
+	UnPricedQty       float64 `json:"unpricedqty"`       // 表示未定价量.
+	DeliveryQty       float64 `json:"deliveryqty"`       // 表示交收量.
+	CurDeliveryQty    float64 `json:"curdeliveryqty"`    // 表示未交收量.
+	SignDate          string  `json:"signdate"`          // 表示签订日期.
+	DeliveryGoodsID   string  `json:"deliverygoodsid"`   // 表示品种ID.
+	RelatedBizID      string  `json:"relatedbizid"`      // 表示业务ID.
+	Status            int32   `json:"status"`            // 表示状态,0-履约中 1-已完成.
+}
+
+// QuerySpotContractDetail 查询合同详细信息.
+// @Summary 查询合同详细信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param accountids query string true "资金账号ID列表,用逗号分隔"
+// @Param contracttype query int true "合同类型,1为采购合同 -1为销售合同"
+// @Param contractmode query int true "合同模式,1为普通合同 2为回购销售合同"
+// @Param status query int true "状态,0为履约中 1为已完成"
+// @Success 200 {array} QuerySpotContractInfoRsp
+// @Failure 500 {object} app.Response
+// @Router /Erms3/QuerySpotContractDetail [get]
+// @Tags 风险管理v3
+func QuerySpotContractDetail(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req QuerySpotContractInfoReq
+	err := appG.C.ShouldBindQuery(&req)
+	if err != nil {
+		logger.GetLogger().Errorf("QuerySpotContractDetail failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+
+		return
+	}
+
+	strids := strings.Split(strings.TrimSpace(req.Accountids), ",")
+	accountids := make([]int64, len(strids))
+	for i := range strids {
+		accountids[i], err = strconv.ParseInt(strids[i], 10, 64)
+		if err != nil {
+			logger.GetLogger().Errorf("ParseInt failed: %s", err.Error())
+			appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+
+			return
+		}
+	}
+
+	// 查询数据.
+	datas, err := models.QueryErms3SpotContractInfo(accountids, req.ContractType, req.ContractMode, req.Status)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QuerySpotContract failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+
+		return
+	}
+
+	if len(datas) == 0 {
+		appG.Response(http.StatusOK, e.SUCCESS, nil)
+
+		return
+	}
+
+	userids := make(map[int64]struct{})
+	for i := range datas {
+		userids[datas[i].Areauserid] = struct{}{}
+		userids[datas[i].Customeruserid] = struct{}{}
+	}
+
+	arrayids := make([]int64, 0, len(userids))
+	for k := range userids {
+		arrayids = append(arrayids, k)
+	}
+
+	// 获取所有用户信息.
+	userinfos, err := models.GetUserInfoByIDS(arrayids)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("QueryUserInfo failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+
+		return
+	}
+
+	userid2names := make(map[int64]string, len(userinfos))
+	for i := range userinfos {
+		userid2names[userinfos[i].Userid] = userinfos[i].Customername
+	}
+
+	infos := make([]QuerySpotContractInfoRsp, 0, len(datas))
+	for i := range datas {
+		infos = append(infos, QuerySpotContractInfoRsp{
+			SpotContractID:    datas[i].Spotcontractid,
+			CustomerName:      userid2names[datas[i].Areauserid],
+			AccountID:         datas[i].Accountid,
+			MatchCustomerName: userid2names[datas[i].Customeruserid],
+			MatchAccountID:    datas[i].Customeraccountid,
+			WRStandardName:    strings.Join([]string{datas[i].Wrstandardname, datas[i].Wrstandardcode}, "/"),
+			TotalQty:          datas[i].Pricedqty - datas[i].Pricedcancelledqty + datas[i].Unpricedqty - datas[i].Unpricedcancelledqty,
+			PricedQty:         datas[i].Pricedqty - datas[i].Pricedcancelledqty,
+			UnPricedQty:       datas[i].Unpricedqty - datas[i].Unpricedcancelledqty,
+			DeliveryQty:       datas[i].Deliveryqty,
+			CurDeliveryQty:    datas[i].Curdeliveryqty,
+			SignDate:          datas[i].Signdate.Format("2006-01-02"),
+			DeliveryGoodsID:   strings.Join([]string{datas[i].Deliverygoodsname, datas[i].Deliverygoodscode}, "/"),
+			RelatedBizID:      datas[i].Relatedbizid,
+			Status:            datas[i].Closestatus,
+		})
+	}
+
+	// 查询成功
+	logger.GetLogger().Debugf("QuerySpotContractDetail successed: %v", infos)
+	appG.Response(http.StatusOK, e.SUCCESS, infos)
+}

+ 1 - 1
controllers/szdz/szdz.go

@@ -77,7 +77,7 @@ func QueryRecieptOrder(c *gin.Context) {
 		Select(`GOODS.GOODSID, GOODS.GOODSCODE, GOODS.GOODSNAME, 
 				TRADE_ORDERDETAIL.BUYORSELL, to_char(TRADE_ORDERDETAIL.ORDERID) as ORDERID, TRADE_ORDERDETAIL.TRADEDATE, TRADE_ORDERDETAIL.ORDERPRICE, 
 				TRADE_ORDERDETAIL.ORDERQTY - TRADE_ORDERDETAIL.TRADEQTY - TRADE_ORDERDETAIL.CANCELQTY as ENABLEQTY, 
-				substr(USERACCOUNT.ACCOUNTNAME,0,1)||'****' as ACCOUNTNAME`).
+				(case when USERACCOUNT.ISANONYMOUS = 0 then to_char(USERACCOUNT.ACCOUNTNAME) else '*****' end) ACCOUNTNAME`).
 		Where("TRADE_ORDERDETAIL.ORDERSTATUS in (3,7,12) and GOODS.GOODSID = ?", req.GoodsID)
 	if len(req.AccountName) > 0 {
 		s = s.And("USERACCOUNT.ACCOUNTNAME = ?", req.AccountName)

+ 41 - 0
controllers/user/user.go

@@ -139,6 +139,47 @@ func GetUserAuthStatus(c *gin.Context) {
 	appG.Response(http.StatusOK, e.SUCCESS, isAuth)
 }
 
+// GetUserAccountReq 获取用户账号信息请求参数
+type GetUserAccountReq struct {
+	UserID int `form:"userID" binding:"required"` // 用户ID
+}
+
+// GetUserAccount 获取用户账号信息
+// @Summary 获取用户账号信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userID query int true "用户ID"
+// @Success 200 {object} models.Useraccount
+// @Failure 500 {object} app.Response
+// @Router /User/GetUserAccount [get]
+// @Tags 用户信息
+func GetUserAccount(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req GetUserAccountReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("GetUserAccount failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	var (
+		userAccount *models.Useraccount
+		err         error
+	)
+	if userAccount, err = models.GetUserAccount(req.UserID); err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("GetUserAccount failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功
+	logger.GetLogger().Debugln("GetUserAccount successed: %v", userAccount)
+	appG.Response(http.StatusOK, e.SUCCESS, userAccount)
+}
+
 // QueryUserFavoriteGoodsesReq 获取用户商品收藏信息请求参数
 type QueryUserFavoriteGoodsesReq struct {
 	UserID int `form:"userID" binding:"required"`

+ 17 - 29
controllers/wrtrade/wrTrade.go

@@ -6,40 +6,21 @@ import (
 	"mtp2_if/global/app"
 	"mtp2_if/global/e"
 	"mtp2_if/logger"
+	"mtp2_if/models"
 	"net/http"
 	"strconv"
 
 	"github.com/gin-gonic/gin"
 )
 
-// Deliverygoods 现货品种表
-type Deliverygoods struct {
-	Deliverygoodsid   int64   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'" binding:"required"`     // 交割商品ID(SEQ_DELIVERYGOODS)
-	Deliverygoodscode string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'" binding:"required"` // 交割商品代码
-	Deliverygoodsname string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`                    // 交割商品名称
-	Goodsunitid       int64   `json:"goodsunitid"  xorm:"'GOODSUNITID'"`                                // 交割商品单位ID
-	Deliverygoodstype int64   `json:"deliverygoodstype"  xorm:"'DELIVERYGOODSTYPE'"`                    // 交割商品类型: 1-整装不拆分 2-散装记录明细 3:整装拆分 4:散装不记录明细
-	Standardqty       int64   `json:"standardqty"  xorm:"'STANDARDQTY'"`                                // 标准数量(库位数量) [标准品特有]
-	Standardqtyrange  float64 `json:"standardqtyrange"  xorm:"'STANDARDQTYRANGE'"`                      // 标准数量偏差范围 [标准品特有]
-	Issplit           int64   `json:"issplit"  xorm:"'ISSPLIT'"`                                        // 是否拆分 - 0:不拆分 1:拆分 [整装]   0:不记录明细 1:记录明细 [散货] - 作废整装时不拆分,则标准数量=合约单位;拆分时标准数量为合约单位的整数倍;整装时必须记录明细表数据
-	Agreeunit         int64   `json:"agreeunit"  xorm:"'AGREEUNIT'"`                                    // 合约单位[散货时默认为1, 整装时默认为标准数量]
-	Qtydecimalplace   int64   `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`                        // 成交量小数位
-	Categoryid        int64   `json:"categoryid"  xorm:"'CATEGORYID'"`                                  // 类别ID(SEQ_WRCATEGORY)
-}
-
-// TableName is DELIVERYGOODS
-func (Deliverygoods) TableName() string {
-	return "DELIVERYGOODS"
-}
-
 // Wrcategory 仓单分类表
 type Wrcategory struct {
-	Categoryid       int64           `json:"categoryid"  xorm:"'CATEGORYID'" binding:"required"` // 类别ID(SEQ_WRCATEGORY)
-	Categoryname     string          `json:"categoryname"  xorm:"'CATEGORYNAME'"`                // 类别名称
-	Parentcategoryid int64           `json:"parentcategoryid"  xorm:"'PARENTCATEGORYID'"`        // 父类别ID
-	Categorydesc     string          `json:"categorydesc"  xorm:"'CATEGORYDESC'"`                // 类别描述
-	Iconurl          string          `json:"iconurl"  xorm:"'ICONURL'"`                          // 图标地址
-	Deliverygoods    []Deliverygoods // 所包含现货种类信息
+	Categoryid       int64                  `json:"categoryid"  xorm:"'CATEGORYID'" binding:"required"` // 类别ID(SEQ_WRCATEGORY)
+	Categoryname     string                 `json:"categoryname"  xorm:"'CATEGORYNAME'"`                // 类别名称
+	Parentcategoryid int64                  `json:"parentcategoryid"  xorm:"'PARENTCATEGORYID'"`        // 父类别ID
+	Categorydesc     string                 `json:"categorydesc"  xorm:"'CATEGORYDESC'"`                // 类别描述
+	Iconurl          string                 `json:"iconurl"  xorm:"'ICONURL'"`                          // 图标地址
+	Deliverygoods    []models.Deliverygoods // 所包含现货种类信息
 }
 
 // TableName is WRCATEGORY
@@ -55,13 +36,20 @@ func (Wrcategory) TableName() string {
 // @Failure 500 {object} app.Response
 // @Router /WRTrade/GetAllDeliveryGoods [get]
 // @Tags 仓单贸易
+// @Summary 获取带仓单分类的种类信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /WRTrade/GetAllDeliveryGoods [get]
+// @Tags 仓单贸易
 func GetAllDeliveryGoods(c *gin.Context) {
 	appG := app.Gin{C: c}
 
 	engine := db.GetEngine()
 
 	// 获取品种(交割商品)信息
-	deliveryGoodses := make([]Deliverygoods, 0)
+	deliveryGoodses := make([]models.Deliverygoods, 0)
 	if err := engine.Where("IsValid=1").And("categoryid<>0").Find(&deliveryGoodses); err != nil {
 		// 查询失败
 		logger.GetLogger().Errorf("GetAllDeliveryGoods failed: %s", err.Error())
@@ -74,9 +62,9 @@ func GetAllDeliveryGoods(c *gin.Context) {
 	ids := ""
 	for _, deliveryGoods := range deliveryGoodses {
 		if ids == "" {
-			ids = strconv.FormatInt(deliveryGoods.Categoryid, 10)
+			ids = strconv.FormatInt(int64(deliveryGoods.Categoryid), 10)
 		} else {
-			ids += "," + strconv.FormatInt(deliveryGoods.Categoryid, 10)
+			ids += "," + strconv.FormatInt(int64(deliveryGoods.Categoryid), 10)
 		}
 	}
 

+ 383 - 83
docs/docs.go

@@ -926,6 +926,69 @@ var doc = `{
                 }
             }
         },
+        "/Erms3/QuerySpotContractDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "风险管理v3"
+                ],
+                "summary": "查询合同详细信息",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账号ID列表,用逗号分隔",
+                        "name": "accountids",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同类型,1为采购合同 -1为销售合同",
+                        "name": "contracttype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同模式,1为普通合同 2为回购销售合同",
+                        "name": "contractmode",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态,0为履约中 1为已完成",
+                        "name": "status",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/erms3.QuerySpotContractInfoRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/GetHsbyMyCount": {
             "get": {
                 "security": [
@@ -2582,6 +2645,45 @@ var doc = `{
                 }
             }
         },
+        "/User/GetUserAccount": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "用户信息"
+                ],
+                "summary": "获取用户账号信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userID",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.Useraccount"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/User/GetUserAuthStatus": {
             "get": {
                 "security": [
@@ -2823,12 +2925,17 @@ var doc = `{
                 "security": [
                     {
                         "ApiKeyAuth": []
+                    },
+                    {
+                        "ApiKeyAuth": []
                     }
                 ],
                 "produces": [
+                    "application/json",
                     "application/json"
                 ],
                 "tags": [
+                    "仓单贸易",
                     "仓单贸易"
                 ],
                 "summary": "获取带仓单分类的种类信息",
@@ -4468,8 +4575,6 @@ var doc = `{
                 "customeraccountid",
                 "customeruserid",
                 "details",
-                "lastdate",
-                "marketid",
                 "orimargin",
                 "orimarginpayer",
                 "signdate"
@@ -4518,10 +4623,6 @@ var doc = `{
                     "description": "交货时间",
                     "type": "string"
                 },
-                "marketid": {
-                    "description": "市场ID",
-                    "type": "integer"
-                },
                 "orimargin": {
                     "description": "初始保证金",
                     "type": "number"
@@ -4693,11 +4794,76 @@ var doc = `{
                     "description": "仓单标准列表",
                     "type": "array",
                     "items": {
-                        "$ref": "#/definitions/models.Wrstandard"
+                        "$ref": "#/definitions/models.WRStandardInfo"
                     }
                 }
             }
         },
+        "erms3.QuerySpotContractInfoRsp": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "表示交易员ID.",
+                    "type": "integer"
+                },
+                "curdeliveryqty": {
+                    "description": "表示未交收量.",
+                    "type": "number"
+                },
+                "customername": {
+                    "description": "若合同类型为采购合同,表示采购方ID;若合同类型为销售合同,表示销售方ID.",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "表示品种ID.",
+                    "type": "string"
+                },
+                "deliveryqty": {
+                    "description": "表示交收量.",
+                    "type": "number"
+                },
+                "matchaccountid": {
+                    "description": "表示业务员ID.",
+                    "type": "integer"
+                },
+                "matchcustomername": {
+                    "description": "若合同类型为采购合同,表示销售方;若合同类型为销售合同,表示采购方ID.",
+                    "type": "string"
+                },
+                "priceqty": {
+                    "description": "表示定价量.",
+                    "type": "number"
+                },
+                "relatedbizid": {
+                    "description": "表示业务ID.",
+                    "type": "string"
+                },
+                "signdate": {
+                    "description": "表示签订日期.",
+                    "type": "string"
+                },
+                "spotcontractid": {
+                    "description": "合同ID",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "表示状态,0-履约中 1-已完成.",
+                    "type": "integer"
+                },
+                "totalqty": {
+                    "description": "表示合同量.",
+                    "type": "number"
+                },
+                "unpricedqty": {
+                    "description": "表示未定价量.",
+                    "type": "number"
+                },
+                "wrstandardname": {
+                    "description": "表示商品ID.",
+                    "type": "string"
+                }
+            }
+        },
         "erms3.SoptContractDetail": {
             "type": "object",
             "required": [
@@ -4757,7 +4923,7 @@ var doc = `{
                 },
                 "warehousename": {
                     "description": "仓库名称",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrstandardid": {
                     "description": "交易标的ID",
@@ -4773,16 +4939,22 @@ var doc = `{
             "type": "object",
             "required": [
                 "basic",
-                "enddate",
                 "goodsid",
-                "qty",
-                "startdate"
+                "qty"
             ],
             "properties": {
                 "basic": {
                     "description": "基差",
                     "type": "number"
                 },
+                "deliveryendtdate": {
+                    "description": "交收结束日期",
+                    "type": "string"
+                },
+                "deliverystartdate": {
+                    "description": "交收开始日期",
+                    "type": "string"
+                },
                 "enddate": {
                     "description": "点价结束日期",
                     "type": "string"
@@ -4817,6 +4989,14 @@ var doc = `{
                     "description": "金额",
                     "type": "number"
                 },
+                "deliveryendtdate": {
+                    "description": "交收结束日期",
+                    "type": "string"
+                },
+                "deliverystartdate": {
+                    "description": "交收开始日期",
+                    "type": "string"
+                },
                 "price": {
                     "description": "价格",
                     "type": "number"
@@ -6254,6 +6434,118 @@ var doc = `{
                 }
             }
         },
+        "models.Useraccount": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "accountname": {
+                    "description": "账户名称(机构名称)",
+                    "type": "string"
+                },
+                "accountstatus": {
+                    "description": "账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "audituserid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "broker": {
+                    "description": "所属经纪人ID",
+                    "type": "integer"
+                },
+                "canceltime": {
+                    "description": "销户时间",
+                    "type": "string"
+                },
+                "canceluserid": {
+                    "description": "销户人",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "hasauth": {
+                    "description": "是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝",
+                    "type": "integer"
+                },
+                "isanonymous": {
+                    "description": "是否匿名下单 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "maxinvestornum": {
+                    "description": "最大用户数(经纪会员下投资者个数)",
+                    "type": "integer"
+                },
+                "memberuserid": {
+                    "description": "所属会员ID",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "modifyremark": {
+                    "description": "变更备注",
+                    "type": "string"
+                },
+                "modifystatus": {
+                    "description": "变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "parentuserid": {
+                    "description": "所属机构ID",
+                    "type": "integer"
+                },
+                "reckonaccountid": {
+                    "description": "默认结算资金账号ID(机构分润使用) 作废",
+                    "type": "integer"
+                },
+                "refercount": {
+                    "description": "推荐总人数",
+                    "type": "integer"
+                },
+                "refereeuserid": {
+                    "description": "推荐人ID",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "子机构层级路径(逗号分隔,首尾加逗号)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "usertype": {
+                    "description": "账户类型 -  1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Userfavoritegoods": {
             "type": "object",
             "required": [
@@ -6478,6 +6770,86 @@ var doc = `{
                 }
             }
         },
+        "models.WRStandardInfo": {
+            "type": "object",
+            "required": [
+                "wrstandardid"
+            ],
+            "properties": {
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "交割商品名称",
+                    "type": "string"
+                },
+                "factoryitemjson": {
+                    "description": "要素项定义Json[{\"DGFactoryItemTypeID\": ,\"ItemTypeMode\": ,\"FactoryItemIDs\": },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem-\u003eDGFactoryItemTypeIDItemTypeMode - 要素项类型模式 --DGFactoryItem-\u003eItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem-\u003eDGFactoryItemID, 逗号分隔",
+                    "type": "string"
+                },
+                "isvalid": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "minivalue": {
+                    "description": "最小变动值",
+                    "type": "integer"
+                },
+                "minivaluedp": {
+                    "description": "最小变动值小数位",
+                    "type": "integer"
+                },
+                "realminivalue": {
+                    "description": "实际最小变动值",
+                    "type": "integer"
+                },
+                "realminivaluedp": {
+                    "description": "实际最小变动值小数位",
+                    "type": "integer"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "unitname": {
+                    "description": "单位",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "updatorid": {
+                    "description": "更新人",
+                    "type": "integer"
+                },
+                "wrsstatus": {
+                    "description": "状态 - 作废 - 0:未激活 1:正常",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "仓单标准代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "仓单标准ID(SEQ_WRSTANDARD)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "仓单标准名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.Warehouseinfo": {
             "type": "object",
             "required": [
@@ -6555,78 +6927,6 @@ var doc = `{
                 }
             }
         },
-        "models.Wrstandard": {
-            "type": "object",
-            "required": [
-                "wrstandardid"
-            ],
-            "properties": {
-                "createtime": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "creatorid": {
-                    "description": "创建人",
-                    "type": "integer"
-                },
-                "deliverygoodsid": {
-                    "description": "品种ID",
-                    "type": "integer"
-                },
-                "factoryitemjson": {
-                    "description": "要素项定义Json[{\"DGFactoryItemTypeID\": ,\"ItemTypeMode\": ,\"FactoryItemIDs\": },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem-\u003eDGFactoryItemTypeIDItemTypeMode - 要素项类型模式 --DGFactoryItem-\u003eItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem-\u003eDGFactoryItemID, 逗号分隔",
-                    "type": "string"
-                },
-                "isvalid": {
-                    "description": "是否有效 - 0:无效 1:有效",
-                    "type": "integer"
-                },
-                "minivalue": {
-                    "description": "最小变动值",
-                    "type": "integer"
-                },
-                "minivaluedp": {
-                    "description": "最小变动值小数位",
-                    "type": "integer"
-                },
-                "realminivalue": {
-                    "description": "实际最小变动值",
-                    "type": "integer"
-                },
-                "realminivaluedp": {
-                    "description": "实际最小变动值小数位",
-                    "type": "integer"
-                },
-                "unitid": {
-                    "description": "单位ID",
-                    "type": "integer"
-                },
-                "updatetime": {
-                    "description": "更新时间",
-                    "type": "string"
-                },
-                "updatorid": {
-                    "description": "更新人",
-                    "type": "integer"
-                },
-                "wrsstatus": {
-                    "description": "状态 - 作废 - 0:未激活 1:正常",
-                    "type": "integer"
-                },
-                "wrstandardcode": {
-                    "description": "仓单标准代码",
-                    "type": "string"
-                },
-                "wrstandardid": {
-                    "description": "仓单标准ID(SEQ_WRSTANDARD)",
-                    "type": "integer"
-                },
-                "wrstandardname": {
-                    "description": "仓单标准名称",
-                    "type": "string"
-                }
-            }
-        },
         "order.QueryHisTradeDetailRsp": {
             "type": "object",
             "required": [

+ 383 - 83
docs/swagger.json

@@ -910,6 +910,69 @@
                 }
             }
         },
+        "/Erms3/QuerySpotContractDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "风险管理v3"
+                ],
+                "summary": "查询合同详细信息",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "资金账号ID列表,用逗号分隔",
+                        "name": "accountids",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同类型,1为采购合同 -1为销售合同",
+                        "name": "contracttype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同模式,1为普通合同 2为回购销售合同",
+                        "name": "contractmode",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "状态,0为履约中 1为已完成",
+                        "name": "status",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/erms3.QuerySpotContractInfoRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/HSBY/GetHsbyMyCount": {
             "get": {
                 "security": [
@@ -2566,6 +2629,45 @@
                 }
             }
         },
+        "/User/GetUserAccount": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "用户信息"
+                ],
+                "summary": "获取用户账号信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userID",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/models.Useraccount"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/User/GetUserAuthStatus": {
             "get": {
                 "security": [
@@ -2807,12 +2909,17 @@
                 "security": [
                     {
                         "ApiKeyAuth": []
+                    },
+                    {
+                        "ApiKeyAuth": []
                     }
                 ],
                 "produces": [
+                    "application/json",
                     "application/json"
                 ],
                 "tags": [
+                    "仓单贸易",
                     "仓单贸易"
                 ],
                 "summary": "获取带仓单分类的种类信息",
@@ -4452,8 +4559,6 @@
                 "customeraccountid",
                 "customeruserid",
                 "details",
-                "lastdate",
-                "marketid",
                 "orimargin",
                 "orimarginpayer",
                 "signdate"
@@ -4502,10 +4607,6 @@
                     "description": "交货时间",
                     "type": "string"
                 },
-                "marketid": {
-                    "description": "市场ID",
-                    "type": "integer"
-                },
                 "orimargin": {
                     "description": "初始保证金",
                     "type": "number"
@@ -4677,11 +4778,76 @@
                     "description": "仓单标准列表",
                     "type": "array",
                     "items": {
-                        "$ref": "#/definitions/models.Wrstandard"
+                        "$ref": "#/definitions/models.WRStandardInfo"
                     }
                 }
             }
         },
+        "erms3.QuerySpotContractInfoRsp": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "表示交易员ID.",
+                    "type": "integer"
+                },
+                "curdeliveryqty": {
+                    "description": "表示未交收量.",
+                    "type": "number"
+                },
+                "customername": {
+                    "description": "若合同类型为采购合同,表示采购方ID;若合同类型为销售合同,表示销售方ID.",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "表示品种ID.",
+                    "type": "string"
+                },
+                "deliveryqty": {
+                    "description": "表示交收量.",
+                    "type": "number"
+                },
+                "matchaccountid": {
+                    "description": "表示业务员ID.",
+                    "type": "integer"
+                },
+                "matchcustomername": {
+                    "description": "若合同类型为采购合同,表示销售方;若合同类型为销售合同,表示采购方ID.",
+                    "type": "string"
+                },
+                "priceqty": {
+                    "description": "表示定价量.",
+                    "type": "number"
+                },
+                "relatedbizid": {
+                    "description": "表示业务ID.",
+                    "type": "string"
+                },
+                "signdate": {
+                    "description": "表示签订日期.",
+                    "type": "string"
+                },
+                "spotcontractid": {
+                    "description": "合同ID",
+                    "type": "string"
+                },
+                "status": {
+                    "description": "表示状态,0-履约中 1-已完成.",
+                    "type": "integer"
+                },
+                "totalqty": {
+                    "description": "表示合同量.",
+                    "type": "number"
+                },
+                "unpricedqty": {
+                    "description": "表示未定价量.",
+                    "type": "number"
+                },
+                "wrstandardname": {
+                    "description": "表示商品ID.",
+                    "type": "string"
+                }
+            }
+        },
         "erms3.SoptContractDetail": {
             "type": "object",
             "required": [
@@ -4741,7 +4907,7 @@
                 },
                 "warehousename": {
                     "description": "仓库名称",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrstandardid": {
                     "description": "交易标的ID",
@@ -4757,16 +4923,22 @@
             "type": "object",
             "required": [
                 "basic",
-                "enddate",
                 "goodsid",
-                "qty",
-                "startdate"
+                "qty"
             ],
             "properties": {
                 "basic": {
                     "description": "基差",
                     "type": "number"
                 },
+                "deliveryendtdate": {
+                    "description": "交收结束日期",
+                    "type": "string"
+                },
+                "deliverystartdate": {
+                    "description": "交收开始日期",
+                    "type": "string"
+                },
                 "enddate": {
                     "description": "点价结束日期",
                     "type": "string"
@@ -4801,6 +4973,14 @@
                     "description": "金额",
                     "type": "number"
                 },
+                "deliveryendtdate": {
+                    "description": "交收结束日期",
+                    "type": "string"
+                },
+                "deliverystartdate": {
+                    "description": "交收开始日期",
+                    "type": "string"
+                },
                 "price": {
                     "description": "价格",
                     "type": "number"
@@ -6238,6 +6418,118 @@
                 }
             }
         },
+        "models.Useraccount": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "accountname": {
+                    "description": "账户名称(机构名称)",
+                    "type": "string"
+                },
+                "accountstatus": {
+                    "description": "账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "audituserid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "broker": {
+                    "description": "所属经纪人ID",
+                    "type": "integer"
+                },
+                "canceltime": {
+                    "description": "销户时间",
+                    "type": "string"
+                },
+                "canceluserid": {
+                    "description": "销户人",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "hasauth": {
+                    "description": "是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝",
+                    "type": "integer"
+                },
+                "isanonymous": {
+                    "description": "是否匿名下单 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "maxinvestornum": {
+                    "description": "最大用户数(经纪会员下投资者个数)",
+                    "type": "integer"
+                },
+                "memberuserid": {
+                    "description": "所属会员ID",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "integer"
+                },
+                "modifyremark": {
+                    "description": "变更备注",
+                    "type": "string"
+                },
+                "modifystatus": {
+                    "description": "变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "parentuserid": {
+                    "description": "所属机构ID",
+                    "type": "integer"
+                },
+                "reckonaccountid": {
+                    "description": "默认结算资金账号ID(机构分润使用) 作废",
+                    "type": "integer"
+                },
+                "refercount": {
+                    "description": "推荐总人数",
+                    "type": "integer"
+                },
+                "refereeuserid": {
+                    "description": "推荐人ID",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "子机构层级路径(逗号分隔,首尾加逗号)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "usertype": {
+                    "description": "账户类型 -  1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Userfavoritegoods": {
             "type": "object",
             "required": [
@@ -6462,6 +6754,86 @@
                 }
             }
         },
+        "models.WRStandardInfo": {
+            "type": "object",
+            "required": [
+                "wrstandardid"
+            ],
+            "properties": {
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "交割商品名称",
+                    "type": "string"
+                },
+                "factoryitemjson": {
+                    "description": "要素项定义Json[{\"DGFactoryItemTypeID\": ,\"ItemTypeMode\": ,\"FactoryItemIDs\": },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem-\u003eDGFactoryItemTypeIDItemTypeMode - 要素项类型模式 --DGFactoryItem-\u003eItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem-\u003eDGFactoryItemID, 逗号分隔",
+                    "type": "string"
+                },
+                "isvalid": {
+                    "description": "是否有效 - 0:无效 1:有效",
+                    "type": "integer"
+                },
+                "minivalue": {
+                    "description": "最小变动值",
+                    "type": "integer"
+                },
+                "minivaluedp": {
+                    "description": "最小变动值小数位",
+                    "type": "integer"
+                },
+                "realminivalue": {
+                    "description": "实际最小变动值",
+                    "type": "integer"
+                },
+                "realminivaluedp": {
+                    "description": "实际最小变动值小数位",
+                    "type": "integer"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "unitname": {
+                    "description": "单位",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "updatorid": {
+                    "description": "更新人",
+                    "type": "integer"
+                },
+                "wrsstatus": {
+                    "description": "状态 - 作废 - 0:未激活 1:正常",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "仓单标准代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "仓单标准ID(SEQ_WRSTANDARD)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "仓单标准名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.Warehouseinfo": {
             "type": "object",
             "required": [
@@ -6539,78 +6911,6 @@
                 }
             }
         },
-        "models.Wrstandard": {
-            "type": "object",
-            "required": [
-                "wrstandardid"
-            ],
-            "properties": {
-                "createtime": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "creatorid": {
-                    "description": "创建人",
-                    "type": "integer"
-                },
-                "deliverygoodsid": {
-                    "description": "品种ID",
-                    "type": "integer"
-                },
-                "factoryitemjson": {
-                    "description": "要素项定义Json[{\"DGFactoryItemTypeID\": ,\"ItemTypeMode\": ,\"FactoryItemIDs\": },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem-\u003eDGFactoryItemTypeIDItemTypeMode - 要素项类型模式 --DGFactoryItem-\u003eItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem-\u003eDGFactoryItemID, 逗号分隔",
-                    "type": "string"
-                },
-                "isvalid": {
-                    "description": "是否有效 - 0:无效 1:有效",
-                    "type": "integer"
-                },
-                "minivalue": {
-                    "description": "最小变动值",
-                    "type": "integer"
-                },
-                "minivaluedp": {
-                    "description": "最小变动值小数位",
-                    "type": "integer"
-                },
-                "realminivalue": {
-                    "description": "实际最小变动值",
-                    "type": "integer"
-                },
-                "realminivaluedp": {
-                    "description": "实际最小变动值小数位",
-                    "type": "integer"
-                },
-                "unitid": {
-                    "description": "单位ID",
-                    "type": "integer"
-                },
-                "updatetime": {
-                    "description": "更新时间",
-                    "type": "string"
-                },
-                "updatorid": {
-                    "description": "更新人",
-                    "type": "integer"
-                },
-                "wrsstatus": {
-                    "description": "状态 - 作废 - 0:未激活 1:正常",
-                    "type": "integer"
-                },
-                "wrstandardcode": {
-                    "description": "仓单标准代码",
-                    "type": "string"
-                },
-                "wrstandardid": {
-                    "description": "仓单标准ID(SEQ_WRSTANDARD)",
-                    "type": "integer"
-                },
-                "wrstandardname": {
-                    "description": "仓单标准名称",
-                    "type": "string"
-                }
-            }
-        },
         "order.QueryHisTradeDetailRsp": {
             "type": "object",
             "required": [

+ 301 - 146
docs/swagger.yaml

@@ -392,8 +392,7 @@ definitions:
         description: 客户端流水号
         type: string
       clienttype:
-        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端
-          6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
         type: integer
       closeexchagechargevalue:
         description: 平仓交易所手续费设置值
@@ -477,9 +476,7 @@ definitions:
         description: 开仓解冻手续费(先建后平操作,需要记录)
         type: number
       operatetype:
-        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平
-          8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓
-          15:管理端协议转让
+        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
         type: integer
       operatorid:
         description: 登录账号(LoginID)
@@ -494,13 +491,10 @@ definitions:
         description: 委托数量
         type: integer
       ordersrc:
-        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平
-          9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
         type: integer
       orderstatus:
-        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交
-          9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤
-          16:成交失败违约(荷兰式竞拍专用)
+        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
         type: integer
       ordertime:
         description: 委托时间
@@ -1238,9 +1232,6 @@ definitions:
       lastdate:
         description: 交货时间
         type: string
-      marketid:
-        description: 市场ID
-        type: integer
       orimargin:
         description: 初始保证金
         type: number
@@ -1261,8 +1252,6 @@ definitions:
     - customeraccountid
     - customeruserid
     - details
-    - lastdate
-    - marketid
     - orimargin
     - orimarginpayer
     - signdate
@@ -1378,9 +1367,57 @@ definitions:
       wrstandards:
         description: 仓单标准列表
         items:
-          $ref: '#/definitions/models.Wrstandard'
+          $ref: '#/definitions/models.WRStandardInfo'
         type: array
     type: object
+  erms3.QuerySpotContractInfoRsp:
+    properties:
+      accountid:
+        description: 表示交易员ID.
+        type: integer
+      curdeliveryqty:
+        description: 表示未交收量.
+        type: number
+      customername:
+        description: 若合同类型为采购合同,表示采购方ID;若合同类型为销售合同,表示销售方ID.
+        type: string
+      deliverygoodsid:
+        description: 表示品种ID.
+        type: string
+      deliveryqty:
+        description: 表示交收量.
+        type: number
+      matchaccountid:
+        description: 表示业务员ID.
+        type: integer
+      matchcustomername:
+        description: 若合同类型为采购合同,表示销售方;若合同类型为销售合同,表示采购方ID.
+        type: string
+      priceqty:
+        description: 表示定价量.
+        type: number
+      relatedbizid:
+        description: 表示业务ID.
+        type: string
+      signdate:
+        description: 表示签订日期.
+        type: string
+      spotcontractid:
+        description: 合同ID
+        type: string
+      status:
+        description: 表示状态,0-履约中 1-已完成.
+        type: integer
+      totalqty:
+        description: 表示合同量.
+        type: number
+      unpricedqty:
+        description: 表示未定价量.
+        type: number
+      wrstandardname:
+        description: 表示商品ID.
+        type: string
+    type: object
   erms3.SoptContractDetail:
     properties:
       deliverygoodsdesc:
@@ -1419,7 +1456,7 @@ definitions:
         type: integer
       warehousename:
         description: 仓库名称
-        type: integer
+        type: string
       wrstandardid:
         description: 交易标的ID
         type: integer
@@ -1439,6 +1476,12 @@ definitions:
       basic:
         description: 基差
         type: number
+      deliveryendtdate:
+        description: 交收结束日期
+        type: string
+      deliverystartdate:
+        description: 交收开始日期
+        type: string
       enddate:
         description: 点价结束日期
         type: string
@@ -1456,16 +1499,20 @@ definitions:
         type: string
     required:
     - basic
-    - enddate
     - goodsid
     - qty
-    - startdate
     type: object
   erms3.SpotPriceOrder:
     properties:
       amount:
         description: 金额
         type: number
+      deliveryendtdate:
+        description: 交收结束日期
+        type: string
+      deliverystartdate:
+        description: 交收开始日期
+        type: string
       price:
         description: 价格
         type: number
@@ -1614,8 +1661,7 @@ definitions:
         description: 时间
         type: string
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       vendorname1:
         description: 预售商品供应商名称
@@ -1726,8 +1772,7 @@ definitions:
         description: 价格最小变动单位
         type: number
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       vendorattr:
         description: 供应商附件(多张,逗号分隔)
@@ -1946,8 +1991,7 @@ definitions:
         description: 关联交易合约ID
         type: integer
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       videourls:
         description: 介绍视频[多张用逗号分隔]
@@ -2040,8 +2084,7 @@ definitions:
         description: 价格最小变动单位
         type: number
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       vendorattr:
         description: 供应商附件(多张,逗号分隔)
@@ -2113,8 +2156,7 @@ definitions:
         description: 时间
         type: string
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       vendorname:
         description: 供应商名称
@@ -2170,8 +2212,7 @@ definitions:
         description: 行情最小变动单位 [整数,报价小数位一起使用]
         type: integer
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       videourls:
         description: 介绍视频[多张用逗号分隔]
@@ -2234,9 +2275,7 @@ definitions:
         description: 委托数量
         type: integer
       orderstatus:
-        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交
-          9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤
-          16:成交失败违约(荷兰式竞拍专用)
+        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
         type: integer
       ordertime:
         description: 委托时间
@@ -2248,8 +2287,7 @@ definitions:
         description: 挂牌商品介绍图片[多张用逗号分隔]
         type: string
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
       tradeqty:
         description: 成交数量
@@ -2393,8 +2431,7 @@ definitions:
         description: 市场名称
         type: string
       trademode:
-        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式
-          21:竞拍-大宗式 22:受托竞价
+        description: 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
         type: integer
     required:
     - goodscode
@@ -2435,8 +2472,7 @@ definitions:
         description: 是否可转出 - 0:不可 1:可 [5:花生米转交易]
         type: integer
       converttype:
-        description: 转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞(不设置) 4:交易转金点拍(不设置) 5:花生米转交易
-          6:交易转花生米(不设置)
+        description: 转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞(不设置) 4:交易转金点拍(不设置) 5:花生米转交易 6:交易转花生米(不设置)
         type: integer
       createtime:
         description: 创建时间
@@ -2549,6 +2585,89 @@ definitions:
     required:
     - autoid
     type: object
+  models.Useraccount:
+    properties:
+      accountname:
+        description: 账户名称(机构名称)
+        type: string
+      accountstatus:
+        description: 账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销
+        type: integer
+      auditremark:
+        description: 审核备注
+        type: string
+      audittime:
+        description: 审核时间
+        type: string
+      audituserid:
+        description: 审核人
+        type: integer
+      broker:
+        description: 所属经纪人ID
+        type: integer
+      canceltime:
+        description: 销户时间
+        type: string
+      canceluserid:
+        description: 销户人
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
+      hasauth:
+        description: 是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
+        type: integer
+      isanonymous:
+        description: 是否匿名下单 - 0:否 1:是
+        type: integer
+      maxinvestornum:
+        description: 最大用户数(经纪会员下投资者个数)
+        type: integer
+      memberuserid:
+        description: 所属会员ID
+        type: integer
+      modifierid:
+        description: 修改人
+        type: integer
+      modifyremark:
+        description: 变更备注
+        type: string
+      modifystatus:
+        description: 变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)
+        type: integer
+      modifytime:
+        description: 修改时间
+        type: string
+      parentuserid:
+        description: 所属机构ID
+        type: integer
+      reckonaccountid:
+        description: 默认结算资金账号ID(机构分润使用) 作废
+        type: integer
+      refercount:
+        description: 推荐总人数
+        type: integer
+      refereeuserid:
+        description: 推荐人ID
+        type: integer
+      refernum:
+        description: 推荐码
+        type: string
+      subarealevelpath:
+        description: 子机构层级路径(逗号分隔,首尾加逗号)
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+      usertype:
+        description: 账户类型 -  1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户
+        type: integer
+    required:
+    - userid
+    type: object
   models.Userfavoritegoods:
     properties:
       goodsid:
@@ -2668,8 +2787,7 @@ definitions:
         description: 昵称:默认为名称脱敏(张**) 或 手机号脱敏(139****9999)
         type: string
       openmode:
-        description: 开户方式 -  1:管理端开户 2:网上开户注册(会员官网) 3:微信开户 4:网页交易端注册 5:安卓手机端注册 6:苹果手机端注册
-          7:PC交易端注册 8:微信快速开户 9:支付宝快速开户 10:手机号快速开户
+        description: 开户方式 -  1:管理端开户 2:网上开户注册(会员官网) 3:微信开户 4:网页交易端注册 5:安卓手机端注册 6:苹果手机端注册 7:PC交易端注册 8:微信快速开户 9:支付宝快速开户 10:手机号快速开户
         type: integer
       otherurl:
         description: 其它图片地址[使用分号分隔]
@@ -2716,6 +2834,65 @@ definitions:
     required:
     - userid
     type: object
+  models.WRStandardInfo:
+    properties:
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
+      deliverygoodsid:
+        description: 品种ID
+        type: integer
+      deliverygoodsname:
+        description: 交割商品名称
+        type: string
+      factoryitemjson:
+        description: '要素项定义Json[{"DGFactoryItemTypeID": ,"ItemTypeMode": ,"FactoryItemIDs": },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem->DGFactoryItemTypeIDItemTypeMode - 要素项类型模式 --DGFactoryItem->ItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem->DGFactoryItemID, 逗号分隔'
+        type: string
+      isvalid:
+        description: 是否有效 - 0:无效 1:有效
+        type: integer
+      minivalue:
+        description: 最小变动值
+        type: integer
+      minivaluedp:
+        description: 最小变动值小数位
+        type: integer
+      realminivalue:
+        description: 实际最小变动值
+        type: integer
+      realminivaluedp:
+        description: 实际最小变动值小数位
+        type: integer
+      unitid:
+        description: 单位ID
+        type: integer
+      unitname:
+        description: 单位
+        type: string
+      updatetime:
+        description: 更新时间
+        type: string
+      updatorid:
+        description: 更新人
+        type: integer
+      wrsstatus:
+        description: 状态 - 作废 - 0:未激活 1:正常
+        type: integer
+      wrstandardcode:
+        description: 仓单标准代码
+        type: string
+      wrstandardid:
+        description: 仓单标准ID(SEQ_WRSTANDARD)
+        type: integer
+      wrstandardname:
+        description: 仓单标准名称
+        type: string
+    required:
+    - wrstandardid
+    type: object
   models.Warehouseinfo:
     properties:
       address:
@@ -2773,62 +2950,6 @@ definitions:
     - autoid
     - warehousecode
     type: object
-  models.Wrstandard:
-    properties:
-      createtime:
-        description: 创建时间
-        type: string
-      creatorid:
-        description: 创建人
-        type: integer
-      deliverygoodsid:
-        description: 品种ID
-        type: integer
-      factoryitemjson:
-        description: '要素项定义Json[{"DGFactoryItemTypeID": ,"ItemTypeMode": ,"FactoryItemIDs":
-          },{.....},]DGFactoryItemTypeID - 要素项类型ID --DGFactoryItem->DGFactoryItemTypeIDItemTypeMode
-          - 要素项类型模式 --DGFactoryItem->ItemTypeModeFactoryItemIDs - 选择项IDs--DGFactoryItem->DGFactoryItemID,
-          逗号分隔'
-        type: string
-      isvalid:
-        description: 是否有效 - 0:无效 1:有效
-        type: integer
-      minivalue:
-        description: 最小变动值
-        type: integer
-      minivaluedp:
-        description: 最小变动值小数位
-        type: integer
-      realminivalue:
-        description: 实际最小变动值
-        type: integer
-      realminivaluedp:
-        description: 实际最小变动值小数位
-        type: integer
-      unitid:
-        description: 单位ID
-        type: integer
-      updatetime:
-        description: 更新时间
-        type: string
-      updatorid:
-        description: 更新人
-        type: integer
-      wrsstatus:
-        description: 状态 - 作废 - 0:未激活 1:正常
-        type: integer
-      wrstandardcode:
-        description: 仓单标准代码
-        type: string
-      wrstandardid:
-        description: 仓单标准ID(SEQ_WRSTANDARD)
-        type: integer
-      wrstandardname:
-        description: 仓单标准名称
-        type: string
-    required:
-    - wrstandardid
-    type: object
   order.QueryHisTradeDetailRsp:
     properties:
       accountid:
@@ -2979,8 +3100,7 @@ definitions:
         description: 成交时间
         type: string
       tradetype:
-        description: '成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交
-          7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓'
+        description: '成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓'
         type: integer
     required:
     - accountid
@@ -3021,8 +3141,7 @@ definitions:
         description: 客户端流水号
         type: string
       clienttype:
-        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端
-          6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
         type: integer
       closeexchagechargevalue:
         description: 平仓交易所手续费设置值
@@ -3121,9 +3240,7 @@ definitions:
         description: 开仓解冻手续费(先建后平操作,需要记录)
         type: number
       operatetype:
-        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平
-          8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓
-          15:管理端协议转让
+        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
         type: integer
       operatorid:
         description: 登录账号(LoginID)
@@ -3141,13 +3258,10 @@ definitions:
         description: 委托数量
         type: integer
       ordersrc:
-        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平
-          9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
         type: integer
       orderstatus:
-        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交
-          9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤
-          16:成交失败违约(荷兰式竞拍专用)
+        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
         type: integer
       ordertime:
         description: 委托时间
@@ -3369,8 +3483,7 @@ definitions:
         description: 成交时间
         type: string
       tradetype:
-        description: '成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交
-          7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓'
+        description: '成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓'
         type: integer
     required:
     - accountid
@@ -3404,8 +3517,7 @@ definitions:
         description: 撤单数量
         type: integer
       clienttype:
-        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端
-          6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+        description: 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
         type: integer
       closefreezecharge:
         description: 平仓冻结手续费(先建后平操作,需要记录)
@@ -3462,9 +3574,7 @@ definitions:
         description: 开仓解冻手续费(先建后平操作,需要记录)
         type: number
       operatetype:
-        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平
-          8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓
-          15:管理端协议转让
+        description: 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
         type: integer
       operatorid:
         description: 登录账号(LoginID)
@@ -3479,13 +3589,10 @@ definitions:
         description: 委托数量
         type: integer
       ordersrc:
-        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平
-          9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+        description: 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
         type: integer
       orderstatus:
-        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交
-          9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤
-          16:成交失败违约(荷兰式竞拍专用)
+        description: 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
         type: integer
       ordertime:
         description: 委托时间
@@ -4024,16 +4131,7 @@ definitions:
         description: 资金流水号:银行端流水号
         type: integer
       operatetype:
-        description: 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻
-          106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结
-          206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结
-          305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加
-          502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结
-          603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结
-          702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款
-          801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款
-          904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费
-          1007:期权盈亏 1101:营销扣款 1102:营销收款
+        description: 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款
         type: integer
       relationorderid:
         description: 关联单号
@@ -4123,16 +4221,7 @@ definitions:
         description: 资金流水号:银行端流水号
         type: integer
       operatetype:
-        description: 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻
-          106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结
-          206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结
-          305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加
-          502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结
-          603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结
-          702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款
-          801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款
-          904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费
-          1007:期权盈亏 1101:营销扣款 1102:营销收款
+        description: 资金操作类型 (AccountFundCmdOp)- 101:入金 102:入金手续费 103:出金 104:出金冻结 105:出金解冻 106:出金手续费 107:出金手续费冻结 108:出金手续费解冻 201:交易冻结 202:交易解冻 203:交易占用 204:交易解占用 205:交易手续费冻结 206:交易手续费解冻 207:交易手续费 208:交易货款 209:交易盈亏 301:交割冻结 302:交割解冻 303:交割手续费 304:交割手续费冻结 305:交割手续费解冻 306:交割货款 307:交割税款 401:结算盈亏 402:结算递延费 403:分润收入 404:延期分润 501:授信增加 502:授信减少 503:转积分 504:转入 505:转出 506:转出冻结 507:转出解冻  601:履约金额冻结 602:履约最大冻结 603:履约金额解冻 604:履约扣款 605:履约收款 606:履约违约手续费 607:履约违约收入 608:履约最大扣款 701:供应链金融冻结 702:供应链金融解冻 703:供应链金融最大冻结 704:供应链金融利息 705:供应链金融货款 706:供应链金融押金 707:供应链金融最大扣款 801:仓单贸易冻结 802:仓单贸易解冻 803:仓单贸易首付款 804:仓单贸易最大扣款 901:商城扣款冻结 902:商城扣款解冻 903:商城扣款 904:商城收款 1001:期权冻结 1002:期权解冻 1003:期权权力金 1004:期权手续费冻结 1005:期权手续费解冻 1006:期权手续费 1007:期权盈亏 1101:营销扣款 1102:营销收款
         type: integer
       relationorderid:
         description: 关联单号
@@ -4726,6 +4815,47 @@ paths:
       summary: 查询合同申请表单数据
       tags:
       - 风险管理v3
+  /Erms3/QuerySpotContractDetail:
+    get:
+      parameters:
+      - description: 资金账号ID列表,用逗号分隔
+        in: query
+        name: accountids
+        required: true
+        type: string
+      - description: 合同类型,1为采购合同 -1为销售合同
+        in: query
+        name: contracttype
+        required: true
+        type: integer
+      - description: 合同模式,1为普通合同 2为回购销售合同
+        in: query
+        name: contractmode
+        required: true
+        type: integer
+      - description: 状态,0为履约中 1为已完成
+        in: query
+        name: status
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/erms3.QuerySpotContractInfoRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询合同详细信息
+      tags:
+      - 风险管理v3
   /HSBY/GetHsbyMyCount:
     get:
       description: 说明: 不包括已完成的数量。
@@ -5342,8 +5472,7 @@ paths:
   /Quote/QueryHistoryDatas:
     get:
       parameters:
-      - description: '周期类型, 0-秒 1: 1分钟 2: 5分钟 3: 30分钟 4: 60分钟 120: 2小时 240: 4小时 11:
-          日线 10: Tik'
+      - description: '周期类型, 0-秒 1: 1分钟 2: 5分钟 3: 30分钟 4: 60分钟 120: 2小时 240: 4小时 11: 日线 10: Tik'
         in: query
         name: cycleType
         required: true
@@ -5410,8 +5539,7 @@ paths:
   /SZDZ/QueryConvertConfig:
     get:
       parameters:
-      - description: 转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞(不设置) 4:交易转金点拍(不设置) 5:花生米转交易
-          6:交易转花生米(不设置)
+      - description: 转换类型 - 1:金点赞转交易 2:金点拍转交易 3:交易转金点赞(不设置) 4:交易转金点拍(不设置) 5:花生米转交易 6:交易转花生米(不设置)
         in: query
         name: convertType
         type: integer
@@ -5777,6 +5905,30 @@ paths:
       summary: 获取登录ID
       tags:
       - 用户信息
+  /User/GetUserAccount:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userID
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/models.Useraccount'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取用户账号信息
+      tags:
+      - 用户信息
   /User/GetUserAuthStatus:
     get:
       parameters:
@@ -5928,6 +6080,7 @@ paths:
     get:
       produces:
       - application/json
+      - application/json
       responses:
         "200":
           description: OK
@@ -5939,9 +6092,11 @@ paths:
             $ref: '#/definitions/app.Response'
       security:
       - ApiKeyAuth: []
+      - ApiKeyAuth: []
       summary: 获取带仓单分类的种类信息
       tags:
       - 仓单贸易
+      - 仓单贸易
 securityDefinitions:
   ApiKeyAuth:
     in: header

+ 15 - 3
models/account.go

@@ -168,6 +168,7 @@ type Useraccount struct {
 	Hasauth          int32     `json:"hasauth"  xorm:"'HASAUTH'"`                   // 是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
 	Refercount       int32     `json:"refercount"  xorm:"'REFERCOUNT'"`             // 推荐总人数
 	Refernum         string    `json:"refernum"  xorm:"'REFERNUM'"`                 // 推荐码
+	Isanonymous      int32     `json:"isanonymous"  xorm:"'ISANONYMOUS'"`           // 是否匿名下单 - 0:否 1:是
 }
 
 // TableName is USERACCOUNT
@@ -400,15 +401,18 @@ func GetLoginAccountByMobile(mobile string) (*Loginaccount, error) {
 // GetUserAccount 获取用户账户信息
 func GetUserAccount(userID int) (*Useraccount, error) {
 	engine := db.GetEngine()
-	var userAccount *Useraccount
+	var userAccount Useraccount
 
-	_, err := engine.Where("USERID = ?", userID).Get(userAccount)
+	has, err := engine.Where("USERID = ?", userID).Get(&userAccount)
 	if err != nil {
 		// 查询失败
 		return nil, err
 	}
+	if !has {
+		return nil, nil
+	}
 
-	return userAccount, nil
+	return &userAccount, nil
 }
 
 // GetUserInfo 获取用户信息
@@ -425,6 +429,14 @@ func GetUserInfo(userID int) (*Userinfo, error) {
 	return &userInfo, nil
 }
 
+// GetUserInfoByIDS 批量获取用户信息.
+func GetUserInfoByIDS(userids []int64) ([]Userinfo, error) {
+	engine := db.GetEngine()
+	infos := make([]Userinfo, 0)
+	err := engine.In("USERID", userids).Find(&infos)
+	return infos, err
+}
+
 // GetUserFavoriteGoodses 获取用户商品收藏信息
 func GetUserFavoriteGoodses(userID int) ([]Userfavoritegoods, error) {
 	engine := db.GetEngine()

+ 85 - 5
models/erms3.go

@@ -6,6 +6,69 @@ import (
 	"time"
 )
 
+// Erms3Spotcontractdetail 合同标的明细表
+type Erms3Spotcontractdetail struct {
+	Spotdetailid          string    `json:"spotdetailid" xorm:"SPOTDETAILID"`                   // 标的明细ID(346&#43;Unix秒时间戳(10位)&#43;xxxxxx)
+	Spotcontractid        string    `json:"spotcontractid" xorm:"SPOTCONTRACTID"`               // 现货合同ID
+	Wrstandardid          int64     `json:"wrstandardid" xorm:"WRSTANDARDID"`                   // 仓单标准ID
+	Deliverygoodsid       int64     `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"`             // 现货品种ID
+	Tradedate             string    `json:"tradedate" xorm:"TRADEDATE"`                         // 交易日(yyyyMMdd)
+	Contracttype          int32     `json:"contracttype" xorm:"CONTRACTTYPE"`                   // 现货合同类型 - 1:采购 -1:销售
+	Accountid             int64     `json:"accountid" xorm:"ACCOUNTID"`                         // 资金账户ID
+	Customeraccountid     int64     `json:"customeraccountid" xorm:"CUSTOMERACCOUNTID"`         // 客户资金账户ID
+	Producttype           int32     `json:"producttype" xorm:"PRODUCTTYPE"`                     // 产品类型 - 1:标准仓单 2:等标 3:非标
+	Deliverygoodsdesc     string    `json:"deliverygoodsdesc" xorm:"DELIVERYGOODSDESC"`         // 产品规格 - 根据此字段生成仓单标准、仓单要素类型
+	Warehouseid           int64     `json:"warehouseid" xorm:"WAREHOUSEID"`                     // 仓库ID
+	Pointdesc             string    `json:"pointdesc" xorm:"POINTDESC"`                         // 点价描述
+	Priceqty              float64   `json:"priceqty" xorm:"PRICEQTY"`                           // 指定价类总量
+	Pointqty              float64   `json:"pointqty" xorm:"POINTQTY"`                           // 点价类总量
+	Unpricedqty           float64   `json:"unpricedqty" xorm:"UNPRICEDQTY"`                     // 未确定量
+	Unpricedrelatedqty    float64   `json:"unpricedrelatedqty" xorm:"UNPRICEDRELATEDQTY"`       // 未确定量关联量
+	Unpricedavaliableqty  float64   `json:"unpricedavaliableqty" xorm:"UNPRICEDAVALIABLEQTY"`   // 未确定量可关联量
+	Unpricedcancelledqty  float64   `json:"unpricedcancelledqty" xorm:"UNPRICEDCANCELLEDQTY"`   // 未确定量撤销量(非业务)
+	Pricedqty             float64   `json:"pricedqty" xorm:"PRICEDQTY"`                         // 确定量
+	Pricedamount          float64   `json:"pricedamount" xorm:"PRICEDAMOUNT"`                   // 确定金额
+	Pricedrelatedqty      float64   `json:"pricedrelatedqty" xorm:"PRICEDRELATEDQTY"`           // 确定量关联量
+	Pricedavaliableqty    float64   `json:"pricedavaliableqty" xorm:"PRICEDAVALIABLEQTY"`       // 确定量可关联量
+	Pricedcancelledqty    float64   `json:"pricedcancelledqty" xorm:"PRICEDCANCELLEDQTY"`       // 确定量撤销量(非业务)
+	Pricedcancelledamount float64   `json:"pricedcancelledamount" xorm:"PRICEDCANCELLEDAMOUNT"` // 确定量撤销金额(非业务)
+	Deliveryqty           float64   `json:"deliveryqty" xorm:"DELIVERYQTY"`                     // 交收数量(非业务)
+	Deliveryamount        float64   `json:"deliveryamount" xorm:"DELIVERYAMOUNT"`               // 交收金额(非业务)
+	Deliveryovershortqty  float64   `json:"deliveryovershortqty" xorm:"DELIVERYOVERSHORTQTY"`   // 交收溢短数量(非业务)
+	Deliveryactualamount  float64   `json:"deliveryactualamount" xorm:"DELIVERYACTUALAMOUNT"`   // 交收实际金额(非业务)
+	Deliveryotheramount   float64   `json:"deliveryotheramount" xorm:"DELIVERYOTHERAMOUNT"`     // 交收其它费用(非业务)
+	Curdeliveryqty        float64   `json:"curdeliveryqty" xorm:"CURDELIVERYQTY"`               // 剩余交收数量
+	Curdeliveryamount     float64   `json:"curdeliveryamount" xorm:"CURDELIVERYAMOUNT"`         // 剩余交收金额
+	Remark                string    `json:"remark" xorm:"REMARK"`                               // 备注
+	Marketid              int64     `json:"marketid" xorm:"MARKETID"`                           // 市场ID
+	Handlestatus          int32     `json:"handlestatus" xorm:"HANDLESTATUS"`                   // 处理状态
+	Updatetime            time.Time `json:"updatetime" xorm:"UPDATETIME"`                       // 更新时间
+	Reckonedamount        float64   `json:"reckonedamount" xorm:"RECKONEDAMOUNT"`               // 已结金额
+	Invoicedamount        float64   `json:"invoicedamount" xorm:"INVOICEDAMOUNT"`               // 已开票金额
+}
+
+// TableName is ERMS3_SPOTCONTRACTDETAIL
+func (Erms3Spotcontractdetail) TableName() string {
+	return "ERMS3_SPOTCONTRACTDETAIL"
+}
+
+// Erms3SpotContractInfo 合同明细.
+type Erms3SpotContractInfo struct {
+	Erms3Spotcontractdetail `xorm:"extends"`
+	Areauserid              int64     `json:"areauserid" xorm:"AREAUSERID"`                  // 所属机构
+	Accountid               int64     `json:"accountid" xorm:"ACCOUNTID"`                    // 资金账户ID
+	Customeruserid          int64     `json:"customeruserid" xorm:"CUSTOMERUSERID"`          // 客户ID
+	Customeraccountid       int64     `json:"customeraccountid" xorm:"CUSTOMERACCOUNTID"`    // 客户资金账户ID
+	Signdate                time.Time `json:"signdate" xorm:"SIGNDATE"`                      // 签订日期
+	Closestatus             int32     `json:"closestatus" xorm:"CLOSESTATUS"`                // 完结状态 - 0:未完结 1:已完结
+	Relatedbizid            string    `json:"relatedbizid" xorm:"RELATEDBIZID"`              // 关联业务ID
+	Goodunit                string    `json:"goodunit" xorm:"'GOODUNIT'"`                    // 报价单位
+	Wrstandardcode          string    `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`       // 仓单标准代码
+	Wrstandardname          string    `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`       // 仓单标准名称
+	Deliverygoodscode       string    `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 交割商品代码
+	Deliverygoodsname       string    `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 交割商品名称
+}
+
 // Erms3SpotContractApply 现货合同申请表
 type Erms3SpotContractApply struct {
 	SpotContractID     int64     `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'" binging:"required"` // 现货合同ID(345+Unix秒时间戳(10位)+xxxxxx)
@@ -16,8 +79,8 @@ type Erms3SpotContractApply struct {
 	AccountID          int64     `json:"accountid"  xorm:"'ACCOUNTID'"`                              // 资金账户ID
 	CustomerUserID     int32     `json:"customeruserid"  xorm:"'CUSTOMERUSERID'"`                    // 客户ID
 	CustomerAccountID  int64     `json:"customeraccountid"  xorm:"'CUSTOMERACCOUNTID'"`              // 客户资金账户ID
-	SignDate           time.Time `json:"signdate"  xorm:"'SIGNDATE'"`                                // 签订日期
-	LastDate           time.Time `json:"lastdate"  xorm:"'LASTDATE'"`                                // 交货时间
+	SignDate           string    `json:"signdate"  xorm:"'SIGNDATE'"`                                // 签订日期
+	LastDate           string    `json:"lastdate"  xorm:"'LASTDATE'"`                                // 交货时间
 	ContractAttachment string    `json:"contractattachment"  xorm:"'CONTRACTATTACHMENT'"`            // 合同附件
 	OriMarginPayer     int32     `json:"orimarginpayer"  xorm:"'ORIMARGINPAYER'"`                    // 初始保证金支付方 -1:买方 2:卖方
 	OriMargin          float64   `json:"orimargin"  xorm:"'ORIMARGIN'"`                              // 初始保证金
@@ -60,7 +123,6 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 			  DETAILJSON,
 			  APPLYSTATUS,
 			  APPLYSRC,
-			  MARKETID,
 			  CREATORID,
 			  CREATETIME)
 			VALUES(?,
@@ -81,7 +143,6 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 				?,
 				?,
 				?,
-				?,
 				sysdate)`
 	_, err := engine.Exec(sql,
 		spotContractApply.SpotContractID,
@@ -101,8 +162,27 @@ func AddSpotContractApply(spotContractApply Erms3SpotContractApply) error {
 		spotContractApply.DetailJSON,
 		spotContractApply.ApplyStatus,
 		spotContractApply.ApplySrc,
-		spotContractApply.MarketID,
 		spotContractApply.CreatorID)
 
 	return err
 }
+
+// QueryErms3SpotContractInfo 查询现货合同信息
+func QueryErms3SpotContractInfo(accountids []int64, contracttype, contractmode, status int32) ([]Erms3SpotContractInfo, error) {
+	datas := make([]Erms3SpotContractInfo, 0)
+	engine := db.GetEngine()
+	s := engine.Table("ERMS3_SPOTCONTRACTDETAIL").
+		Join("LEFT", "ERMS3_SPOTCONTRACT", "ERMS3_SPOTCONTRACTDETAIL.SPOTCONTRACTID = ERMS3_SPOTCONTRACT.SPOTCONTRACTID").
+		Join("LEFT", "ERMS3_BIZTRADEDETAIL", "ERMS3_BIZTRADEDETAIL.SPOTDETAILID = ERMS3_SPOTCONTRACTDETAIL.SPOTDETAILID").
+		Join("LEFT", "WRSTANDARD", "WRSTANDARD.WRSTANDARDID = ERMS3_SPOTCONTRACTDETAIL.WRSTANDARDID").
+		Join("LEFT", "DELIVERYGOODS", "DELIVERYGOODS.DELIVERYGOODSID = WRSTANDARD.DELIVERYGOODSID").
+		Join("LEFT", "ENUMDICITEM", "WRSTANDARD.UNITID = ENUMDICITEM.ENUMITEMNAME AND ENUMDICITEM.ENUMDICCODE = 'goodsunit'").
+		Select(`to_char(ERMS3_SPOTCONTRACTDETAIL.SPOTCONTRACTID) SPOTCONTRACTID, ERMS3_SPOTCONTRACT.AREAUSERID, ERMS3_SPOTCONTRACT.ACCOUNTID, ERMS3_SPOTCONTRACT.CUSTOMERUSERID, 
+ERMS3_SPOTCONTRACT.CUSTOMERACCOUNTID, ERMS3_SPOTCONTRACT.CLOSESTATUS, ERMS3_SPOTCONTRACT.SIGNDATE, ERMS3_SPOTCONTRACTDETAIL.*, WRSTANDARD.WRSTANDARDNAME, WRSTANDARD.WRSTANDARDCODE, DELIVERYGOODS.DELIVERYGOODSNAME, DELIVERYGOODS.DELIVERYGOODSCODE, 
+to_char(ERMS3_BIZTRADEDETAIL.RELATEDBIZID) RELATEDBIZID, ENUMDICITEM.ENUMDICNAME GOODUNIT`).
+		Where("ERMS3_SPOTCONTRACT.CONTRACTTYPE = ? AND ERMS3_SPOTCONTRACT.CONTRACTMODE = ? AND ERMS3_SPOTCONTRACT.CLOSESTATUS = ?", contracttype, contractmode, status).
+		In("ERMS3_SPOTCONTRACT.ACCOUNTID", accountids).
+		Desc("ERMS3_SPOTCONTRACTDETAIL.SPOTCONTRACTID")
+	err := s.Find(&datas)
+	return datas, err
+}

+ 14 - 3
models/wrTrade.go

@@ -58,12 +58,23 @@ func (Warehouseinfo) TableName() string {
 	return "WAREHOUSEINFO"
 }
 
+// WRStandardInfo 仓库信息
+type WRStandardInfo struct {
+	Wrstandard `xorm:"extends"`
+
+	Unitname          string `json:"unitname" xorm:"UNITNAME"`                      // 单位
+	Deliverygoodsname string `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 交割商品名称
+}
+
 // GetWrstandards 获取有效的仓单标准
-func GetWrstandards() ([]Wrstandard, error) {
+func GetWrstandards() ([]WRStandardInfo, error) {
 	engine := db.GetEngine()
 
-	wrStandards := make([]Wrstandard, 0)
-	if err := engine.Where("ISVALID = 1").Find(&wrStandards); err != nil {
+	wrStandards := make([]WRStandardInfo, 0)
+	if err := engine.Table("WRSTANDARD").Select("WRSTANDARD.*, E1.ENUMDICNAME UNITNAME, DG.DELIVERYGOODSNAME").
+		Join("LEFT", "ENUMDICITEM E1", "E1.ENUMITEMNAME = WRSTANDARD.UNITID and E1.ENUMDICCODE = 'GOODSUNIT'").
+		Join("LEFT", "DELIVERYGOODS DG", "DG.DELIVERYGOODSID = WRSTANDARD.DELIVERYGOODSID").
+		Where("WRSTANDARD.ISVALID = 1").Find(&wrStandards); err != nil {
 		return nil, err
 	}
 

+ 5 - 2
routers/router.go

@@ -71,7 +71,8 @@ func InitRouter() *gin.Engine {
 		userR.Use(token.Auth()).GET("/QueryMessageBoard", user.QueryMessageBoard)
 		// 添加用户留言板信息
 		userR.Use(token.Auth()).POST("/AddMessageBoard", user.AddMessageBoard)
-
+		// 获取用户账号信息
+		userR.Use(token.Auth()).GET("/GetUserAccount", user.GetUserAccount)
 	}
 	// ************************ 资金账户 ************************
 	taAccountR := apiR.Group("TaAccount")
@@ -179,6 +180,8 @@ func InitRouter() *gin.Engine {
 		erms3R.POST("/AddSpotContractApply", erms3.AddSpotContractApply)
 		// 查询合同申请表单数据
 		erms3R.GET("/QuerySpotContractAppleForm", erms3.QuerySpotContractAppleForm)
+		// 查询合同详细信息.
+		erms3R.GET("/QuerySpotContractDetail", erms3.QuerySpotContractDetail)
 		// 查询待审核合同
 		erms3R.GET("/QueryPendingAuditContract", erms3.QueryPendingAuditContract)
 	}
@@ -244,7 +247,7 @@ func ginLoggerMiddleware() gin.HandlerFunc {
 		clientip := c.ClientIP()
 		method := c.Request.Method
 		statuscode := c.Writer.Status()
-		logger.GetLogger().Debugln("|%3d|%13v|%15s|%s %s",
+		logger.GetLogger().Debugf("|%3d|%13v|%15s|%s %s",
 			statuscode,
 			latency,
 			clientip,