Parcourir la source

#95900 合同关闭时 利息显示为0
#95855 提货商品、期货商品、单据查询等加单位名称字段

zou.yingbin il y a 4 ans
Parent
commit
1030d908e9
6 fichiers modifiés avec 142 ajouts et 9 suppressions
  1. 20 7
      controllers/order/order.go
  2. 40 0
      docs/docs.go
  3. 40 0
      docs/swagger.json
  4. 30 0
      docs/swagger.yaml
  5. 6 2
      models/ermcpGoods.go
  6. 6 0
      models/qhj.go

+ 20 - 7
controllers/order/order.go

@@ -9,6 +9,7 @@ import (
 	"mtp2_if/global/e"
 	"mtp2_if/logger"
 	"mtp2_if/models"
+	"mtp2_if/mtpcache"
 	"mtp2_if/utils"
 	"net/http"
 	"strconv"
@@ -239,6 +240,7 @@ type QueryTradeOrderDetailRsp struct {
 	Ordersrc            int64     `json:"ordersrc"  xorm:"'ORDERSRC'"`                          // 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
 	Clienttype          int64     `json:"clienttype"  xorm:"'CLIENTTYPE'"`                      // 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
 	Operatorid          int64     `json:"operatorid"  xorm:"'OPERATORID'"`                      // 登录账号(LoginID)
+	GOODUNITID          int32     `json:"goodunitid"  xorm:"'GOODUNITID'"`                      // 商品单位id
 
 	GoodsCode       string `json:"goodscode" xorm:"GOODSCODE"`                // 商品代码
 	GoodsName       string `json:"goodsname" xorm:"GOODSNAME"`                // 商品名称
@@ -246,6 +248,7 @@ type QueryTradeOrderDetailRsp struct {
 	QTYDECIMALPLACE int    `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"` // 商品报价小数位
 	Marketname      string `json:"marketname"  xorm:"'MARKETNAME'"`           // 市场名称
 	TradeMode       int32  `json:"trademode"  xorm:"'TRADEMODE'"`             // 交易模式
+	ENUMDICNAME     string `json:"enumdicname"`                               // 单位名称
 
 	Enableqty float64 `json:"enableqty" xorm:"ENABLEQTY"` // 可用数量 = 委托数量 - 成交数量 - 撤单数量
 }
@@ -262,6 +265,7 @@ func (r *QueryTradeOrderDetailRsp) calc() {
 	fCovert(&r.Opentradeqty)
 	fCovert(&r.Closetradeqty)
 	fCovert(&r.Enableqty)
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 }
 
 // QueryTradeOrderDetail 委托单查询请求(合约市场)
@@ -296,7 +300,7 @@ func QueryTradeOrderDetail(c *gin.Context) {
 		Join("LEFT", "MARKET", "MARKET.MARKETID = TRADE_ORDERDETAIL.MARKETID").
 		Select(`to_char(TRADE_ORDERDETAIL.ORDERID) as ORDERID, to_char(TRADE_ORDERDETAIL.PREORDERID) as PREORDERID, to_char(TRADE_ORDERDETAIL.CANCELORDERID) as CANCELORDERID, to_char(TRADE_ORDERDETAIL.RELATEDID) as RELATEDID,
 				TRADE_ORDERDETAIL.*, TRADE_ORDERDETAIL.ORDERQTY - TRADE_ORDERDETAIL.TRADEQTY - TRADE_ORDERDETAIL.CANCELQTY as ENABLEQTY, 
-				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE, MARKET.MARKETNAME, MARKET.TRADEMODE`).
+				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE,GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE`).
 		Where(fmt.Sprintf(`TRADE_ORDERDETAIL.ORDERSRC != 10 and TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
 		Desc("TRADE_ORDERDETAIL.ORDERTIME")
 	if len(req.OrderStatus) > 0 {
@@ -341,8 +345,10 @@ type QueryHisTradeOrderDetailRsp struct {
 	GoodsName       string `json:"goodsname" xorm:"GOODSNAME"`                // 商品名称
 	DECIMALPLACE    int32  `json:"decimalplace"  xorm:"'DECIMALPLACE'"`       // 商品报价小数位
 	QTYDECIMALPLACE int    `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"` // 成交量小数位
+	GOODUNITID      int32  `json:"goodunitid"  xorm:"'GOODUNITID'"`           // 商品单位id
 	Marketname      string `json:"marketname"  xorm:"'MARKETNAME'"`           // 市场名称
 	TradeMode       int32  `json:"trademode"  xorm:"'TRADEMODE'"`             // 交易模式
+	ENUMDICNAME     string `json:"enumdicname"`                               // 单位名称
 }
 
 func (r *QueryHisTradeOrderDetailRsp) calc() {
@@ -356,6 +362,7 @@ func (r *QueryHisTradeOrderDetailRsp) calc() {
 	fCovert(&r.Closeqty)
 	fCovert(&r.Opentradeqty)
 	fCovert(&r.Closetradeqty)
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 }
 
 // QueryHisTradeOrderDetail 历史委托单查询请求(合约市场)
@@ -391,7 +398,7 @@ func QueryHisTradeOrderDetail(c *gin.Context) {
 		Join("LEFT", "MARKET", "MARKET.MARKETID = HIS_TRADE_ORDERDETAIL.MARKETID").
 		Select(`to_char(HIS_TRADE_ORDERDETAIL.ORDERID) as ORDERID, to_char(HIS_TRADE_ORDERDETAIL.PREORDERID) as PREORDERID, to_char(HIS_TRADE_ORDERDETAIL.CANCELORDERID) as CANCELORDERID, to_char(HIS_TRADE_ORDERDETAIL.RELATEDID) as RELATEDID,
 				HIS_TRADE_ORDERDETAIL.*, 
-				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE, MARKET.MARKETNAME, MARKET.TRADEMODE`).
+				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE,GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE`).
 		Where(fmt.Sprintf(`HIS_TRADE_ORDERDETAIL.ORDERSRC != 10 and HIS_TRADE_ORDERDETAIL.ISVALIDDATA = 1 and HIS_TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
 		Desc("HIS_TRADE_ORDERDETAIL.ORDERTIME")
 	if len(req.OrderStatus) > 0 {
@@ -443,11 +450,13 @@ type QueryTradeDetailRsp struct {
 	GoodsName         string `json:"goodsname" xorm:"GOODSNAME"`                    // 商品名称
 	DECIMALPLACE      int32  `json:"decimalplace"  xorm:"'DECIMALPLACE'"`           // 商品报价小数位
 	QTYDECIMALPLACE   int    `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`     // 商品报价小数位
+	GOODUNITID        int32  `json:"goodunitid"  xorm:"'GOODUNITID'"`               // 商品单位id
 	Marketname        string `json:"marketname"  xorm:"'MARKETNAME'"`               // 市场名称
 	TradeMode         int32  `json:"trademode"  xorm:"'TRADEMODE'"`                 // 交易模式
 	ListingSelectType int32  `json:"listingselecttype"  xorm:"'LISTINGSELECTTYPE'"` // 关联委托单挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
 
-	Charge float64 `json:"charge" xorm:"CHARGE"` // 手续费
+	Charge      float64 `json:"charge" xorm:"CHARGE"` // 手续费
+	ENUMDICNAME string  `json:"enumdicname"`          // 单位名称
 }
 
 func (r *QueryTradeDetailRsp) calc() {
@@ -457,6 +466,7 @@ func (r *QueryTradeDetailRsp) calc() {
 	fCovert(&r.Tradeqty)
 	fCovert(&r.Openqty)
 	fCovert(&r.Closeqty)
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 }
 
 // QueryTradeDetail 成交单查询(合约市场)
@@ -494,7 +504,7 @@ func QueryTradeDetail(c *gin.Context) {
 		Join("LEFT", "TRADE_ORDERDETAIL", "TRADE_ORDERDETAIL.ORDERID = TRADE_TRADEDETAIL.ORDERID").
 		Select(`to_char(TRADE_TRADEDETAIL.TRADEID) as TRADEID, to_char(TRADE_TRADEDETAIL.ORDERID) as ORDERID, 
 				TRADE_TRADEDETAIL.*, CASE TRADE_TRADEDETAIL.BUILDTYPE WHEN 1 THEN TRADE_TRADEDETAIL.OPENCHARGE ELSE TRADE_TRADEDETAIL.CLOSECHARGE END as CHARGE,
-				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE, MARKET.MARKETNAME, MARKET.TRADEMODE, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE,GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE, 
 				TRADE_ORDERDETAIL.LISTINGSELECTTYPE`).
 		Where(fmt.Sprintf("TRADE_TRADEDETAIL.TRADETYPE <= 13 and TRADE_TRADEDETAIL.ACCOUNTID in (%s)", req.AccountID)).
 		Desc("TRADE_TRADEDETAIL.TRADETIME")
@@ -552,11 +562,13 @@ type QueryHisTradeDetailRsp struct {
 	GoodsName         string `json:"goodsname" xorm:"GOODSNAME"`                    // 商品名称
 	DECIMALPLACE      int32  `json:"decimalplace"  xorm:"'DECIMALPLACE'"`           // 商品报价小数位
 	QTYDECIMALPLACE   int    `json:"qtydecimalplace"  xorm:"'QTYDECIMALPLACE'"`     // 商品报价小数位
+	GOODUNITID        int32  `json:"goodunitid"  xorm:"'GOODUNITID'"`               // 商品单位id
 	Marketname        string `json:"marketname"  xorm:"'MARKETNAME'"`               // 市场名称
 	TradeMode         int32  `json:"trademode"  xorm:"'TRADEMODE'"`                 // 交易模式
 	ListingSelectType int32  `json:"listingselecttype"  xorm:"'LISTINGSELECTTYPE'"` // 关联委托单挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
 
-	Charge float64 `json:"charge" xorm:"CHARGE"` // 手续费
+	Charge      float64 `json:"charge" xorm:"CHARGE"` // 手续费
+	ENUMDICNAME string  `json:"enumdicname"`          // 单位名称
 }
 
 func (r *QueryHisTradeDetailRsp) calc() {
@@ -566,6 +578,7 @@ func (r *QueryHisTradeDetailRsp) calc() {
 	fCovert(&r.Tradeqty)
 	fCovert(&r.Openqty)
 	fCovert(&r.Closeqty)
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 }
 
 // QueryHisTradeDetail 历史成交单查询(合约市场)
@@ -605,7 +618,7 @@ func QueryHisTradeDetail(c *gin.Context) {
 		Join("LEFT", "HIS_TRADE_ORDERDETAIL", "HIS_TRADE_ORDERDETAIL.ORDERID = HIS_TRADE_TRADEDETAIL.ORDERID").
 		Select(`to_char(HIS_TRADE_TRADEDETAIL.TRADEID) as TRADEID, to_char(HIS_TRADE_TRADEDETAIL.ORDERID) as ORDERID, 
 				HIS_TRADE_TRADEDETAIL.*, CASE HIS_TRADE_TRADEDETAIL.BUILDTYPE WHEN 1 THEN HIS_TRADE_TRADEDETAIL.OPENCHARGE ELSE HIS_TRADE_TRADEDETAIL.CLOSECHARGE END as CHARGE,
-				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE, MARKET.MARKETNAME, MARKET.TRADEMODE, 
+				GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE, GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE, 
 				HIS_TRADE_ORDERDETAIL.LISTINGSELECTTYPE`).
 		Where(fmt.Sprintf("HIS_TRADE_TRADEDETAIL.TRADETYPE <= 13 and HIS_TRADE_TRADEDETAIL.ISVALIDDATA = 1 and HIS_TRADE_TRADEDETAIL.ACCOUNTID in (%s)", req.AccountID)).
 		Desc("HIS_TRADE_TRADEDETAIL.TRADETIME")
@@ -616,7 +629,7 @@ func QueryHisTradeDetail(c *gin.Context) {
 		s = s.And("HIS_TRADE_TRADEDETAIL.ORDERID = ?", req.OrderID)
 	}
 	if req.GoodsID > 0 {
-		s = s.And("TRADE_TRADEDETAIL.GOODSID = ?", req.GoodsID)
+		s = s.And("HIS_TRADE_TRADEDETAIL.GOODSID = ?", req.GoodsID)
 	}
 	if len(req.TradeMode) > 0 {
 		s = s.And(fmt.Sprintf("MARKET.TRADEMODE in (%s)", req.TradeMode))

+ 40 - 0
docs/docs.go

@@ -17324,6 +17324,10 @@ var doc = `{
                     "description": "交割标志 - 0:不可交割  1:可交割",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "forceclosemode": {
                     "description": "定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]",
                     "type": "integer"
@@ -22862,6 +22866,10 @@ var doc = `{
         "models.QhjPickGoods": {
             "type": "object",
             "properties": {
+                "enumdicname": {
+                    "description": "单位名称(提货商品)",
+                    "type": "string"
+                },
                 "goodsid": {
                     "description": "商品id",
                     "type": "integer"
@@ -25117,6 +25125,10 @@ var doc = `{
                     "description": "商品报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "gcaccountid": {
                     "description": "账户ID[合约币种]",
                     "type": "integer"
@@ -25133,6 +25145,10 @@ var doc = `{
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "histradedate": {
                     "description": "历史交易日",
                     "type": "string"
@@ -25362,6 +25378,10 @@ var doc = `{
                     "description": "摘牌类型 - 1:价格最优 2:点选成交",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "freezecharge": {
                     "description": "冻结手续费",
                     "type": "number"
@@ -25386,6 +25406,10 @@ var doc = `{
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "histradedate": {
                     "description": "历史交易日",
                     "type": "string"
@@ -25645,6 +25669,10 @@ var doc = `{
                     "description": "商品报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "gcaccountid": {
                     "description": "账户ID[合约币种]",
                     "type": "integer"
@@ -25661,6 +25689,10 @@ var doc = `{
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "intclosepl": {
                     "description": "整型盈亏(用于交易结算试算平衡-收益权)",
                     "type": "integer"
@@ -25863,6 +25895,10 @@ var doc = `{
                     "description": "可用数量 = 委托数量 - 成交数量 - 撤单数量",
                     "type": "number"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "freezecharge": {
                     "description": "冻结手续费",
                     "type": "number"
@@ -25883,6 +25919,10 @@ var doc = `{
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "listingselecttype": {
                     "description": "挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂",
                     "type": "integer"

+ 40 - 0
docs/swagger.json

@@ -17308,6 +17308,10 @@
                     "description": "交割标志 - 0:不可交割  1:可交割",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "forceclosemode": {
                     "description": "定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]",
                     "type": "integer"
@@ -22846,6 +22850,10 @@
         "models.QhjPickGoods": {
             "type": "object",
             "properties": {
+                "enumdicname": {
+                    "description": "单位名称(提货商品)",
+                    "type": "string"
+                },
                 "goodsid": {
                     "description": "商品id",
                     "type": "integer"
@@ -25101,6 +25109,10 @@
                     "description": "商品报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "gcaccountid": {
                     "description": "账户ID[合约币种]",
                     "type": "integer"
@@ -25117,6 +25129,10 @@
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "histradedate": {
                     "description": "历史交易日",
                     "type": "string"
@@ -25346,6 +25362,10 @@
                     "description": "摘牌类型 - 1:价格最优 2:点选成交",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "freezecharge": {
                     "description": "冻结手续费",
                     "type": "number"
@@ -25370,6 +25390,10 @@
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "histradedate": {
                     "description": "历史交易日",
                     "type": "string"
@@ -25629,6 +25653,10 @@
                     "description": "商品报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "gcaccountid": {
                     "description": "账户ID[合约币种]",
                     "type": "integer"
@@ -25645,6 +25673,10 @@
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "intclosepl": {
                     "description": "整型盈亏(用于交易结算试算平衡-收益权)",
                     "type": "integer"
@@ -25847,6 +25879,10 @@
                     "description": "可用数量 = 委托数量 - 成交数量 - 撤单数量",
                     "type": "number"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "freezecharge": {
                     "description": "冻结手续费",
                     "type": "number"
@@ -25867,6 +25903,10 @@
                     "description": "商品名称",
                     "type": "string"
                 },
+                "goodunitid": {
+                    "description": "商品单位id",
+                    "type": "integer"
+                },
                 "listingselecttype": {
                     "description": "挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂",
                     "type": "integer"

+ 30 - 0
docs/swagger.yaml

@@ -5857,6 +5857,9 @@ definitions:
       deliveryflag:
         description: 交割标志 - 0:不可交割  1:可交割
         type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
       forceclosemode:
         description: 定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]
         type: integer
@@ -10014,6 +10017,9 @@ definitions:
     type: object
   models.QhjPickGoods:
     properties:
+      enumdicname:
+        description: 单位名称(提货商品)
+        type: string
       goodsid:
         description: 商品id
         type: integer
@@ -11681,6 +11687,9 @@ definitions:
       decimalplace:
         description: 商品报价小数位
         type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
       gcaccountid:
         description: 账户ID[合约币种]
         type: integer
@@ -11693,6 +11702,9 @@ definitions:
       goodsname:
         description: 商品名称
         type: string
+      goodunitid:
+        description: 商品单位id
+        type: integer
       histradedate:
         description: 历史交易日
         type: string
@@ -11868,6 +11880,9 @@ definitions:
       delistingtype:
         description: 摘牌类型 - 1:价格最优 2:点选成交
         type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
       freezecharge:
         description: 冻结手续费
         type: number
@@ -11886,6 +11901,9 @@ definitions:
       goodsname:
         description: 商品名称
         type: string
+      goodunitid:
+        description: 商品单位id
+        type: integer
       histradedate:
         description: 历史交易日
         type: string
@@ -12089,6 +12107,9 @@ definitions:
       decimalplace:
         description: 商品报价小数位
         type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
       gcaccountid:
         description: 账户ID[合约币种]
         type: integer
@@ -12101,6 +12122,9 @@ definitions:
       goodsname:
         description: 商品名称
         type: string
+      goodunitid:
+        description: 商品单位id
+        type: integer
       intclosepl:
         description: 整型盈亏(用于交易结算试算平衡-收益权)
         type: integer
@@ -12257,6 +12281,9 @@ definitions:
       enableqty:
         description: 可用数量 = 委托数量 - 成交数量 - 撤单数量
         type: number
+      enumdicname:
+        description: 单位名称
+        type: string
       freezecharge:
         description: 冻结手续费
         type: number
@@ -12272,6 +12299,9 @@ definitions:
       goodsname:
         description: 商品名称
         type: string
+      goodunitid:
+        description: 商品单位id
+        type: integer
       listingselecttype:
         description: 挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
         type: integer

+ 6 - 2
models/ermcpGoods.go

@@ -5,6 +5,7 @@ package models
 import (
 	"fmt"
 	"mtp2_if/db"
+	"mtp2_if/mtpcache"
 	"time"
 )
 
@@ -75,7 +76,8 @@ type ErmcpGoods struct {
 
 	Relatedgoodsid int32 `json:"relatedgoodsid"  xorm:"RELATEDGOODSID"` // 关联参考商品ID
 
-	Trademode int32 `json:"trademode"  xorm:"'TRADEMODE'"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
+	Trademode   int32  `json:"trademode"  xorm:"'TRADEMODE'"` // 交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
+	ENUMDICNAME string `json:"enumdicname"`                   // 单位名称
 }
 
 // GetErmcpGoodses 企业风管专用获取商品信息的方法
@@ -98,7 +100,9 @@ func GetErmcpGoodses(lastUpdateTime string) ([]ErmcpGoods, error) {
 	if err := session.Find(&goodses); err != nil {
 		return nil, err
 	}
-
+	for i := range goodses {
+		goodses[i].ENUMDICNAME = mtpcache.GetEnumDicitemName(int32(goodses[i].Goodunitid))
+	}
 	return goodses, nil
 }
 

+ 6 - 0
models/qhj.go

@@ -93,6 +93,10 @@ func (r *QhjContract) calc() {
 	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 	// 已付(已付货款) = 已追缴保证金  + 初始保证金
 	r.PAYAMOUNT = r.RECOVEREDMARGIN + r.INITMARGIN
+	if r.SCFCONTRACTSTATUS == 10 || r.SCFCONTRACTSTATUS == 11 {
+		// 当合同关闭时, 利息重置为0
+		r.TOTALINTEREST = 0
+	}
 }
 
 func (r *QhjContract) buildSql() string {
@@ -632,6 +636,7 @@ type QhjPickGoods struct {
 
 	MODIFIERNAME string `json:"modifiername"` // 修改人名称
 	FilterStatus string `json:"-"`            // 状态过淲
+	ENUMDICNAME  string `json:"enumdicname"`  // 单位名称(提货商品)
 }
 
 func (r *QhjPickGoods) calc() {
@@ -643,6 +648,7 @@ func (r *QhjPickGoods) calc() {
 	if r.MODIFIERNAME == "" {
 		r.MODIFIERNAME = mtpcache.GetUserNameByUserId(r.MODIFIERID)
 	}
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.PICKUPGOODSUNITID)
 }
 
 func (r *QhjPickGoods) buildSql() string {