Browse Source

客户资料、套保计划、合同 增加创建时间字段

zou.yingbin 4 years ago
parent
commit
28016f378b
4 changed files with 14 additions and 6 deletions
  1. 2 0
      models/ermcp.go
  2. 6 5
      models/ermcpExposure.go
  3. 3 1
      models/ermcpHedgePlan.go
  4. 3 0
      models/ermcpUser.go

+ 2 - 0
models/ermcp.go

@@ -187,6 +187,7 @@ type ErmcpModel struct {
 	BUYUSERID          int64   `json:"-"  xorm:"'BUYUSERID'"`                           // 采购方ID
 	SELLUSERID         int64   `json:"-"  xorm:"'SELLUSERID'"`                          // 销售方ID
 	AUDITTIME          string  `json:"audittime"  xorm:"'AUDITTIME'"`                   // 审核时间
+	CREATETIME         string  `json:"createtime"  xorm:"'CREATETIME'"`                 // 创建时间
 }
 
 func (r *ErmcpModel) calc() {
@@ -251,6 +252,7 @@ func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
 		"       t.Price," +
 		"       t.ReckonedAmount," +
 		"       to_char(t.audittime,'yyyy-mm-dd hh24:mi:ss') audittime," +
+		"       to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
 		"       t.pricedamount + t.ReckonAdjustAmount as LoanAmount" +
 		"  from ermcp_spotcontract t" +
 		"  left join useraccount u" +

+ 6 - 5
models/ermcpExposure.go

@@ -265,6 +265,7 @@ type ErmcpAreaSpotDetailModel struct {
 	Strtime        string  `json:"strtime"  xorm:"'strtime'"`               // 时间
 	Enumdicname    string  `json:"enumdicname"`                             // 现货商品单位名称
 	Recordname     string  `json:"recordname"`                              // 类型名称
+	CREATETIME     string  `json:"createtime"  xorm:"'CREATETIME'"`         // 创建时间
 	Unitid         int32   `json:"-"  xorm:"'UNITID'"`                      // 单位ID
 	UserId         int     `json:"-"`                                       // 所属用户ID
 	WrstandardId   int32   `json:"-"`                                       // 现货商品ID
@@ -280,7 +281,7 @@ func (r *ErmcpAreaSpotDetailModel) buildSql() string {
 		"       w.wrstandardcode," +
 		"       t.planqty qty," +
 		"        w.unitid," +
-		"       to_char(t.createtime, 'yyyy-mm-dd hh:mi:ss') strtime" +
+		"       to_char(t.createtime, 'yyyy-mm-dd hh:mi:ss') createtime" +
 		"  from ermcp_hedgeplan t" +
 		"  left join wrstandard w" +
 		"    on t.wrstandardid = w.wrstandardid" +
@@ -295,7 +296,7 @@ func (r *ErmcpAreaSpotDetailModel) buildSql() string {
 		"       w.wrstandardcode," +
 		"       t.qty," +
 		"       w.unitid," +
-		"       to_char(t.createtime, 'yyyy-mm-dd hh:mi:ss') strtime" +
+		"       to_char(t.createtime, 'yyyy-mm-dd hh:mi:ss') createtime" +
 		"  from ermcp_spotcontract t" +
 		"  left join wrstandard w" +
 		"    on t.wrstandardid = w.wrstandardid" +
@@ -318,7 +319,7 @@ func (r *ErmcpAreaSpotDetailModel) Calc() {
 		contractTypeName = "采购"
 	} else {
 		contractTypeName = "销售"
-		if r.Qty > 0{
+		if r.Qty > 0 {
 			// 销售的数量转为负数
 			r.Qty = r.Qty * -1
 		}
@@ -645,7 +646,7 @@ type ErmcpHedgePositionDetail struct {
 }
 
 func (r *ErmcpHedgePositionDetail) Calc() {
-	if r.BUYORSELL == 1 && r.TRADEQTY > 0{
+	if r.BUYORSELL == 1 && r.TRADEQTY > 0 {
 		r.TRADEQTY = r.TRADEQTY * -1
 	}
 }
@@ -695,4 +696,4 @@ func (r *ErmcpHedgePositionDetail) GetDataEx() (interface{}, error) {
 		sData[i].Calc()
 	}
 	return sData, err
-}
+}

+ 3 - 1
models/ermcpHedgePlan.go

@@ -29,6 +29,7 @@ type ErmcpHedgePlan struct {
 	Plantime          string  `json:"plantime"  xorm:"'Plantime'"`                   //计划时间
 	Hedgeplanstatus   int     `json:"hedgeplanstatus"  xorm:"'Hedgeplanstatus'"`     //套保计划状态 -  0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 	Remark            string  `json:"remark"  xorm:"'Remark'"`                       //备注
+	CREATETIME        string `json:"createtime"  xorm:"'CREATETIME'"`                //创建时间
 }
 
 func (r *ErmcpHedgePlan) buildSql(status string) string {
@@ -43,7 +44,8 @@ func (r *ErmcpHedgePlan) buildSql(status string) string {
 		"       t.Spotgoodsdesc," +
 		"       t.Planqty," +
 		"       t.Convertfactor," +
-		"       t.Plantime," +
+		"       to_char(t.Plantime,'yyyy-mm-dd hh24:mi:ss') Plantime," +
+		"       to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
 		"       t.Hedgeplanstatus," +
 		"       t.Remark" +
 		"  from ermcp_hedgeplan t" +

+ 3 - 0
models/ermcpUser.go

@@ -34,6 +34,7 @@ type ErmcpUserModel struct {
 	COUNTRYID         int32  `json:"countryid"  xorm:"'COUNTRYID'"`                 // 国家
 	PROVINCEID        int32  `json:"provinceid"  xorm:"'PROVINCEID'"`               // 省
 	CITYID            int32  `json:"cityid"  xorm:"'CITYID'"`                       // 市
+	CREATETIME        string `json:"createtime"  xorm:"'CREATETIME'"`               // 创建时间
 }
 
 func (r *ErmcpUserModel) buildWskhSql(accStatus string) string {
@@ -53,6 +54,7 @@ func (r *ErmcpUserModel) buildWskhSql(accStatus string) string {
 		"       t.userstate         status," +
 		"       t.countryid," +
 		"       t.provinceid," +
+		"       to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
 		"       t.cityid" +
 		"  from wskh_userinfo t" +
 		"  left join enumdicitem e" +
@@ -81,6 +83,7 @@ func (r *ErmcpUserModel) buildSql(accStatus string) string {
 		"       t.accountstatus     status," +
 		"       u.countryid," +
 		"       u.provinceid," +
+		"       to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
 		"       u.cityid" +
 		"  from useraccount t" +
 		"  left join userinfo u" +