zhou.xiaoning преди 5 години
родител
ревизия
575163c252
променени са 2 файла, в които са добавени 12 реда и са изтрити 46 реда
  1. 0 34
      controllers/erms3/spotContract.go
  2. 12 12
      models/erms3.go

+ 0 - 34
controllers/erms3/spotContract.go

@@ -497,42 +497,8 @@ func QuerySpotContractDetail(c *gin.Context) {
 	}
 
 	// 查询数据.
-<<<<<<< HEAD
-	type spotContractDetail struct {
-		models.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'"` // 交割商品名称
-	}
-
-	datas := make([]spotContractDetail, 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 = ?", req.ContractType, req.ContractMode, req.Status).
-		In("ERMS3_SPOTCONTRACT.ACCOUNTID", accountids).
-		Desc("ERMS3_SPOTCONTRACTDETAIL.SPOTCONTRACTID")
-	if err := s.Find(&datas); err != nil {
-=======
 	datas, err := models.QueryErms3SpotContractInfo(accountids, req.ContractType, req.ContractMode, req.Status)
 	if err != nil {
->>>>>>> 795100720a8d8ab7efd84b43650bcc07c35ad118
 		// 查询失败
 		logger.GetLogger().Errorf("QuerySpotContract failed: %s", err.Error())
 		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)

+ 12 - 12
models/erms3.go

@@ -55,18 +55,18 @@ func (Erms3Spotcontractdetail) TableName() string {
 // 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'"` // 交割商品名称
+	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 现货合同申请表