Pārlūkot izejas kodu

1.查询现货商品详情增加关联期货商品信息
2.查询合同增加增值税率字段

zou.yingbin 4 gadi atpakaļ
vecāks
revīzija
f56a3a9b8c
4 mainītis faili ar 82 papildinājumiem un 2 dzēšanām
  1. 19 0
      docs/docs.go
  2. 19 0
      docs/swagger.json
  3. 14 0
      docs/swagger.yaml
  4. 30 2
      models/ermcp3.go

+ 19 - 0
docs/docs.go

@@ -18527,6 +18527,10 @@ var doc = `{
                     "description": "所属机构ID",
                     "type": "integer"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -19655,6 +19659,10 @@ var doc = `{
                     "description": "更新时间",
                     "type": "string"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -20195,6 +20203,10 @@ var doc = `{
                     "description": "机构ID",
                     "type": "integer"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -34740,6 +34752,13 @@ var doc = `{
                     "description": "单位名称",
                     "type": "string"
                 },
+                "gplst": {
+                    "description": "期货品种列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.TBGoodsGroup"
+                    }
+                },
                 "middlegoodscode": {
                     "description": "套保品种代码",
                     "type": "string"

+ 19 - 0
docs/swagger.json

@@ -18511,6 +18511,10 @@
                     "description": "所属机构ID",
                     "type": "integer"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -19639,6 +19643,10 @@
                     "description": "更新时间",
                     "type": "string"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -20179,6 +20187,10 @@
                     "description": "机构ID",
                     "type": "integer"
                 },
+                "vatrate": {
+                    "description": "增值税率",
+                    "type": "number"
+                },
                 "wrstandardcode": {
                     "description": "品类代码",
                     "type": "string"
@@ -34724,6 +34736,13 @@
                     "description": "单位名称",
                     "type": "string"
                 },
+                "gplst": {
+                    "description": "期货品种列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.TBGoodsGroup"
+                    }
+                },
                 "middlegoodscode": {
                     "description": "套保品种代码",
                     "type": "string"

+ 14 - 0
docs/swagger.yaml

@@ -3939,6 +3939,9 @@ definitions:
       userid:
         description: 所属机构ID
         type: integer
+      vatrate:
+        description: 增值税率
+        type: number
       wrstandardcode:
         description: 品类代码
         type: string
@@ -4778,6 +4781,9 @@ definitions:
       updatetime:
         description: 更新时间
         type: string
+      vatrate:
+        description: 增值税率
+        type: number
       wrstandardcode:
         description: 品类代码
         type: string
@@ -5180,6 +5186,9 @@ definitions:
       userid:
         description: 机构ID
         type: integer
+      vatrate:
+        description: 增值税率
+        type: number
       wrstandardcode:
         description: 品类代码
         type: string
@@ -16029,6 +16038,11 @@ definitions:
       enumdicname:
         description: 单位名称
         type: string
+      gplst:
+        description: 期货品种列表
+        items:
+          $ref: '#/definitions/models.TBGoodsGroup'
+        type: array
       middlegoodscode:
         description: 套保品种代码
         type: string

+ 30 - 2
models/ermcp3.go

@@ -648,6 +648,7 @@ type Ermcp3Contract struct {
 	CURRENCYID        int32   `json:"currencyid"  xorm:"'CURRENCYID'"`               // 币种id
 	SUBJECTID         string  `json:"subjectid"  xorm:"'SUBJECTID'"`                 // 交易主体ID
 	SUBJECTNAME       string  `json:"subjectname"  xorm:"'SUBJECTNAME'"`             // 交易主体名称
+	VATRATE           float64 `json:"vatrate"  xorm:"'VATRATE'"`                     // 增值税率
 
 	SELLNICKNAME       string `json:"sellnickname"`       // 采购方昵称
 	BUYNICKNAME        string `json:"buynickname"`        // 销售方昵称
@@ -733,6 +734,7 @@ SELECT to_char(t.SPOTCONTRACTID) SPOTCONTRACTID,
        gb.dgfactoryitemvalue brandname,
        w.wrstandardname,
        w.wrstandardcode,
+       w.vatrate,
        w.unitid,
        t.tradeuserid,
        t.saleuserid,
@@ -842,6 +844,7 @@ type Ermcp3SellBuyContract struct {
 	CURRENCYID         int32   `json:"currencyid"  xorm:"'CURRENCYID'"`                 // 币种id
 	SUBJECTID          string  `json:"subjectid"  xorm:"'SUBJECTID'"`                   // 交易主体ID
 	SUBJECTNAME        string  `json:"subjectname"  xorm:"'SUBJECTNAME'"`               // 交易主体名称
+	VATRATE            float64 `json:"vatrate"  xorm:"'VATRATE'"`                       // 增值税率
 
 	NICKNAME           string `json:"nickname"`           // 账户昵称
 	TRADEUSERLOGINCODE string `json:"tradeuserlogincode"` // 交易员登录代码
@@ -939,7 +942,8 @@ select t.contractno,
        g.deliverygoodsname,
        wr.wrstandardid,
        wr.wrstandardname,
-       wr.wrstandardcode,
+       wr.wrstandardcode, 
+       wr.vatrate,
        g2.goodscode,
        g2.goodsname,
        e.enumdicname,
@@ -1933,6 +1937,7 @@ type Ermcp3HedgePlan struct {
 	AUDITSRC          int32   `json:"auditsrc"  xorm:"'AUDITSRC'"`                   // 审核来源 1-管理端 2-终端
 	AUDITREMARK       string  `json:"auditremark"  xorm:"'auditremark'"`             // 审核备注
 	AUDITNAME         string  `json:"auditname"  xorm:"'AUDITNAME'"`                 // 审核人名称
+	VATRATE           float64 `json:"vatrate"  xorm:"'VATRATE'"`                     // 增值税率
 
 	WRUNITIDNAME  string `json:"wrunitidame"`   // 品类单位名称
 	TRADEUSERNAME string `json:"tradeusername"` // 交易用户名称
@@ -1977,6 +1982,7 @@ func (r *Ermcp3HedgePlan) buildSql(status string) string {
 		"       w.wrstandardcode," +
 		"       w.wrstandardname," +
 		"       w.unitid wrunitid," +
+		"       w.vatrate," +
 		"       t.accountid," +
 		"       t.tradeuserid," +
 		"       t.currencyid," +
@@ -2537,10 +2543,13 @@ type XHMiddleGoods struct {
 	MIDDLEGOODSNAME string  `json:"middlegoodsname"  xorm:"'MIDDLEGOODSNAME'"`    // 套保品种名称
 	ENUMDICNAME     string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`            // 单位名称
 	UNITID          int64   `json:"unitid"  xorm:"'UNITID'"`                      // 单位id
+	GOODSGROUPID    int64   `json:"-"  xorm:"'GOODSGROUPID'"`                     // 关联期货商品组id
+
+	GPLST []TBGoodsGroup // 期货品种列表
 }
 
 func (r *XHMiddleGoods) calc() {
-
+	r.GPLST = make([]TBGoodsGroup, 0)
 }
 
 func (r *XHMiddleGoods) buildSql() string {
@@ -2552,6 +2561,7 @@ select w.wrstandardid,
        m.middlegoodscode,
        m.middlegoodsname,
        m.goodsunitid unitid,
+       m.goodsgroupid,
        e.enumdicname
   from wrstandard w
  inner join erms2_wrsconvertdetail c
@@ -2575,9 +2585,27 @@ func (r *XHMiddleGoods) GetDataEx() (interface{}, error) {
 	for i := range sData {
 		sData[i].calc()
 	}
+	if len(sData) > 0 {
+		// 获取关联期货品种
+		m1 := TBGoodsGroup{}
+		if d1, err := m1.GetDataEx(); err == nil {
+			gpLst := d1.([]TBGoodsGroup)
+			for i := range sData {
+				sData[i].addGpLst(gpLst)
+			}
+		}
+	}
 	return sData, err
 }
 
+func (r *XHMiddleGoods) addGpLst(lst []TBGoodsGroup) {
+	for i := range lst {
+		if r.GOODSGROUPID == lst[i].DESTGOODSGROUPID {
+			r.GPLST = append(r.GPLST, lst[i])
+		}
+	}
+}
+
 // TBMiddleGoods 商品信息-套保品种
 type TBMiddleGoods struct {
 	AREAUSERID         int64   `json:"areauserid"  xorm:"'AREAUSERID'" form:"areauserid"`          // 机构用户ID