Sfoglia il codice sorgente

1.提货门店增加详细地址
2.提货单增加门店地址信息/增加收货时间字段
3.期货报表增加开/平仓均价(#95683)
4.查签约银行接口 解密相关字段

zou.yingbin 4 anni fa
parent
commit
fc70ce2466
5 ha cambiato i file con 93 aggiunte e 15 eliminazioni
  1. 17 1
      docs/docs.go
  2. 17 1
      docs/swagger.json
  3. 13 1
      docs/swagger.yaml
  4. 12 4
      models/ermcp3Report.go
  5. 34 8
      models/qhj.go

+ 17 - 1
docs/docs.go

@@ -16200,6 +16200,10 @@ var doc = `{
                     "description": "手续费",
                     "type": "number"
                 },
+                "closeavgprice": {
+                    "description": "平仓均价",
+                    "type": "number"
+                },
                 "closepl": {
                     "description": "平仓损益",
                     "type": "number"
@@ -16280,6 +16284,10 @@ var doc = `{
                     "description": "期末开仓额",
                     "type": "number"
                 },
+                "openavgprice": {
+                    "description": "开仓均价",
+                    "type": "number"
+                },
                 "oriholdamount": {
                     "description": "期初持仓额",
                     "type": "number"
@@ -22391,6 +22399,10 @@ var doc = `{
         "models.QhjPickArea": {
             "type": "object",
             "properties": {
+                "address": {
+                    "description": "详细地址",
+                    "type": "string"
+                },
                 "cityid": {
                     "description": "市",
                     "type": "integer"
@@ -22902,7 +22914,7 @@ var doc = `{
                     "type": "integer"
                 },
                 "audittime": {
-                    "description": "审核时间(发货时间)",
+                    "description": "审核时间(发货时间 | 备货完成时间 都是这个字段)",
                     "type": "string"
                 },
                 "audittradedate": {
@@ -22929,6 +22941,10 @@ var doc = `{
                     "description": "城市名称",
                     "type": "string"
                 },
+                "confirmtime": {
+                    "description": "取货时间 或 收货时间",
+                    "type": "string"
+                },
                 "countryid": {
                     "description": "国家",
                     "type": "integer"

+ 17 - 1
docs/swagger.json

@@ -16184,6 +16184,10 @@
                     "description": "手续费",
                     "type": "number"
                 },
+                "closeavgprice": {
+                    "description": "平仓均价",
+                    "type": "number"
+                },
                 "closepl": {
                     "description": "平仓损益",
                     "type": "number"
@@ -16264,6 +16268,10 @@
                     "description": "期末开仓额",
                     "type": "number"
                 },
+                "openavgprice": {
+                    "description": "开仓均价",
+                    "type": "number"
+                },
                 "oriholdamount": {
                     "description": "期初持仓额",
                     "type": "number"
@@ -22375,6 +22383,10 @@
         "models.QhjPickArea": {
             "type": "object",
             "properties": {
+                "address": {
+                    "description": "详细地址",
+                    "type": "string"
+                },
                 "cityid": {
                     "description": "市",
                     "type": "integer"
@@ -22886,7 +22898,7 @@
                     "type": "integer"
                 },
                 "audittime": {
-                    "description": "审核时间(发货时间)",
+                    "description": "审核时间(发货时间 | 备货完成时间 都是这个字段)",
                     "type": "string"
                 },
                 "audittradedate": {
@@ -22913,6 +22925,10 @@
                     "description": "城市名称",
                     "type": "string"
                 },
+                "confirmtime": {
+                    "description": "取货时间 或 收货时间",
+                    "type": "string"
+                },
                 "countryid": {
                     "description": "国家",
                     "type": "integer"

+ 13 - 1
docs/swagger.yaml

@@ -5220,6 +5220,9 @@ definitions:
       charge:
         description: 手续费
         type: number
+      closeavgprice:
+        description: 平仓均价
+        type: number
       closepl:
         description: 平仓损益
         type: number
@@ -5280,6 +5283,9 @@ definitions:
       openamount:
         description: 期末开仓额
         type: number
+      openavgprice:
+        description: 开仓均价
+        type: number
       oriholdamount:
         description: 期初持仓额
         type: number
@@ -9851,6 +9857,9 @@ definitions:
     type: object
   models.QhjPickArea:
     properties:
+      address:
+        description: 详细地址
+        type: string
       cityid:
         description: 市
         type: integer
@@ -10230,7 +10239,7 @@ definitions:
         description: 更新来源 - 1:管理端 2:终端
         type: integer
       audittime:
-        description: 审核时间(发货时间)
+        description: 审核时间(发货时间 | 备货完成时间 都是这个字段)
         type: string
       audittradedate:
         description: 审核交易日(yyyyMMdd)
@@ -10250,6 +10259,9 @@ definitions:
       cityname:
         description: 城市名称
         type: string
+      confirmtime:
+        description: 取货时间 或 收货时间
+        type: string
       countryid:
         description: 国家
         type: integer

+ 12 - 4
models/ermcp3Report.go

@@ -1990,14 +1990,22 @@ type Ermcp3TaFutuReDataReport struct {
 	GOODUNITID             int32   `json:"goodunitid"  xorm:"'GOODUNITID'"`                       // 交易合约单位id
 	ACCOUNTNAME            string  `json:"accountname"  xorm:"'ACCOUNTNAME'"`                     // 交易账号名称
 
-	ENUMDICNAME string `json:"enumdicname"` // 单位名称(现货商品)
-	QueryType   int32  `json:"-"`           // 查询类型 1-报表 2-报表明细
-	BeginDate   string `json:"begindate"`   // 开始交易日
-	EndDate     string `json:"enddate"`     // 结束交易日
+	OPENAVGPRICE  float64 `json:"openavgprice"`  // 开仓均价
+	CLOSEAVGPRICE float64 `json:"closeavgprice"` // 平仓均价
+	ENUMDICNAME   string  `json:"enumdicname"`   // 单位名称(现货商品)
+	QueryType     int32   `json:"-"`             // 查询类型 1-报表 2-报表明细
+	BeginDate     string  `json:"begindate"`     // 开始交易日
+	EndDate       string  `json:"enddate"`       // 结束交易日
 }
 
 func (r *Ermcp3TaFutuReDataReport) calc() {
+	if r.TODAYOPENQTY != 0 {
+		r.OPENAVGPRICE = r.TODAYOPENAMOUNT / r.TODAYOPENQTY
+	}
 
+	if r.TODAYCLOSEQTY != 0 {
+		r.CLOSEAVGPRICE = r.TODAYCLOSEAMOUNT / r.TODAYCLOSEQTY
+	}
 }
 func (r *Ermcp3TaFutuReDataReport) userType() int32 {
 	var userType int32 = 2

+ 34 - 8
models/qhj.go

@@ -11,6 +11,7 @@ import (
 	"mtp2_if/db"
 	"mtp2_if/mtpcache"
 	"mtp2_if/utils"
+	"strconv"
 )
 
 // 大连千海金
@@ -427,7 +428,8 @@ type QhjTradeGoodsPickup struct {
 	TAKEREMARK           string  `json:"takeremark"  xorm:"TAKEREMARK"`                     // 提货备注
 	TAKEORDERSTATUS      int32   `json:"takeorderstatus"  xorm:"TAKEORDERSTATUS"`           // 提货状态 -  1:备货中 2:待取货(自提) 3:已取货(自提) 4:待收货(邮寄) 5:已收货(邮寄) 6:自动收货(邮寄) 7:已拒绝 8:已撤销
 	AUDITER              int32   `json:"auditer"  xorm:"AUDITER"`                           // 审核人
-	AUDITTIME            string  `json:"audittime"  xorm:"AUDITTIME"`                       // 审核时间(发货时间)
+	AUDITTIME            string  `json:"audittime"  xorm:"AUDITTIME"`                       // 审核时间(发货时间 | 备货完成时间 都是这个字段)
+	CONFIRMTIME          string  `json:"confirmtime"  xorm:"'CONFIRMTIME'"`                 // 取货时间 或 收货时间
 	CHECKREMARK          string  `json:"checkremark"  xorm:"CHECKREMARK"`                   // 审核备注
 	TRADEDATE            string  `json:"tradedate"  xorm:"TRADEDATE"`                       // 交易日(yyyyMMdd)
 	MARKETID             int32   `json:"marketid"  xorm:"MARKETID"`                         // 市场ID
@@ -487,20 +489,21 @@ func (r *QhjTradeGoodsPickup) buildSql() string {
 		"       t.CARDNUM," +
 		"       t.PHONENUM," +
 		"       t.TAKEMODE," +
-		"       t.ADDRESS," +
+		"       decode(t.takemode, 3, t.address, u.address) address," +
 		"       t.TAKEREMARK," +
 		"       t.TAKEORDERSTATUS," +
 		"       t.AUDITER," +
 		"       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
+		"       to_char(t.CONFIRMTIME, 'yyyy-mm-dd hh24:mi:ss') CONFIRMTIME," +
 		"       t.CHECKREMARK," +
 		"       t.TRADEDATE," +
 		"       t.MARKETID," +
 		"       t.HANDLESTATUS," +
 		"       t.AMOUNT," +
-		"       t.COUNTRYID," +
-		"       t.PROVINCEID," +
-		"       t.CITYID," +
-		"       t.DISTRICTID," +
+		"       decode(t.takemode, 3, t.COUNTRYID, u.countryid) COUNTRYID," +
+		"       decode(t.takemode, 3, t.PROVINCEID, u.provinceid) PROVINCEID," +
+		"       decode(t.takemode, 3, t.CITYID, u.cityid) CITYID," +
+		"       decode(t.takemode, 3, t.DISTRICTID, u.districtid) DISTRICTID," +
 		"       k.PICKUPGOODSID," +
 		"       k.GOODSAGREEUNIT," +
 		"       k.PICKUPGOODSAGREEUNIT," +
@@ -517,7 +520,10 @@ func (r *QhjTradeGoodsPickup) buildSql() string {
 		"    on t.takeorderid = k.takeorderid" +
 		"  LEFT JOIN PICKUPGOODS g" +
 		"    on k.pickupgoodsid = g.pickupgoodsid" +
-		"  LEFT JOIN GOODS g2 on t.goodsid=g2.goodsid" +
+		"  LEFT JOIN GOODS g2" +
+		"    on t.goodsid = g2.goodsid" +
+		"  LEFT JOIN USERINFO u" +
+		"    on t.storeuserid = u.userid" +
 		" WHERE 1 = 1"
 	sqlId.And("t.USERID", r.USERID)
 	return sqlId.String()
@@ -617,6 +623,7 @@ type QhjPickArea struct {
 	PROVINCEID     int32  `json:"provinceid"  xorm:"PROVINCEID"` // 省
 	CITYID         int32  `json:"cityid"  xorm:"CITYID"`         // 市
 	DISTRICTID     int32  `json:"districtid"  xorm:"DISTRICTID"` // 地区
+	ADDRESS        string `json:"address"  xorm:"'ADDRESS'"`     // 详细地址
 
 	USERNAME     string `json:"username"`     // 机构用户名称(门店门称)
 	FROMUSERNAME string `json:"fromusername"` // 所属机构名称
@@ -709,7 +716,11 @@ type QhjBankAccountSign struct {
 }
 
 func (r *QhjBankAccountSign) calc() {
-
+	r.ACCOUNTNAME = DecryptField(r.ACCOUNTNAME)
+	r.BANKACCOUNTNAME = DecryptField(r.BANKACCOUNTNAME)
+	r.CARDNO = DecryptField(r.CARDNO)
+	r.BANKACCOUNTNO = DecryptField(r.BANKACCOUNTNO)
+	r.MOBILEPHONE = DecryptField(r.MOBILEPHONE)
 }
 
 func (r *QhjBankAccountSign) buildSql() string {
@@ -1370,6 +1381,21 @@ func (r *QhjAccountOutInApply) GetDataEx() (interface{}, error) {
 	return sData, err
 }
 
+type DBINT64 int64
+
+func (r *DBINT64) FromDB(bytes []byte) error {
+	d, err := strconv.ParseInt(string(bytes), 10, 64)
+	if err == nil {
+		*r = DBINT64(d)
+	}
+	return err
+}
+
+func (r *DBINT64) ToDB() ([]byte, error) {
+	d := strconv.FormatInt(int64(*r), 10)
+	return []byte(d), nil
+}
+
 // QhjPayOrder 待付款单据
 type QhjPayOrder struct {
 	OPERATETYPE    int32   `json:"operatetype"  xorm:"OPERATETYPE"`       // 买委托操作类型 - 1:正常下单 16:融资买入