Explorar el Código

更新PC客户端菜单配置

zhou.xiaoning hace 3 años
padre
commit
0d33311693
Se han modificado 3 ficheros con 232 adiciones y 292 borrados
  1. 200 283
      config/pcweb_menu/pcweb_menu_qyfg.json
  2. 22 4
      models/ermcp.go
  3. 10 5
      models/ermcp8.go

+ 200 - 283
config/pcweb_menu/pcweb_menu_qyfg.json

@@ -811,7 +811,7 @@
         ]
     },
     {
-        "title": "套期",
+        "title": "套期交易",
         "rulekey": "client_pc_web_qiyefengguan_hedgeditem",
         "code": "hedgeditem",
         "path": "/hedgeditem",
@@ -820,76 +820,6 @@
         "isshow": true,
         "children": [
             {
-                "title": "敞口监控",
-                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure",
-                "code": "hedgeditem_exposure",
-                "path": "hedgeditem_exposure",
-                "component": "Main",
-                "sort": 1,
-                "isshow": true,
-                "url": "",
-                "remark": "",
-                "children": [
-                    {
-                        "title": "敞口监控",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_list",
-                        "code": "hedgeditem_exposure_list",
-                        "path": "hedgeditem_exposure_list",
-                        "component": "views/hedgeditem/exposure/list/index.vue",
-                        "sort": 1,
-                        "isshow": true,
-                        "url": "",
-                        "remark": "",
-                        "children": [
-                            {
-                                "title": "期货持仓明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_position",
-                                "code": "hedgeditem_exposure_position",
-                                "path": "",
-                                "component": "views/hedgeditem/exposure/components/position/index.vue",
-                                "sort": 1,
-                                "isshow": true,
-                                "url": "",
-                                "remark": ""
-                            },
-                            {
-                                "title": "现货变动明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_spot",
-                                "code": "hedgeditem_exposure_spot",
-                                "path": "",
-                                "component": "views/hedgeditem/exposure/components/spot/index.vue",
-                                "sort": 2,
-                                "isshow": true,
-                                "url": "",
-                                "remark": ""
-                            },
-                            {
-                                "title": "计划变动明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_plan",
-                                "code": "hedgeditem_exposure_plan",
-                                "path": "",
-                                "component": "views/hedgeditem/exposure/components/plan/index.vue",
-                                "sort": 3,
-                                "isshow": true,
-                                "url": "",
-                                "remark": ""
-                            },
-                            {
-                                "title": "期货变动明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_futures",
-                                "code": "hedgeditem_exposure_futures",
-                                "path": "",
-                                "component": "views/hedgeditem/exposure/components/futures/index.vue",
-                                "sort": 4,
-                                "isshow": true,
-                                "url": "",
-                                "remark": ""
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
                 "title": "套期交易",
                 "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade",
                 "code": "hedgeditem_trade",
@@ -1036,43 +966,115 @@
                                 "remark": ""
                             }
                         ]
-                    },
+                    }
+                ]
+            },
+            {
+                "title": "期货成交关联",
+                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures",
+                "code": "hedgeditem_futures",
+                "path": "hedgeditem_futures",
+                "component": "Main",
+                "sort": 3,
+                "isshow": true,
+                "url": "",
+                "remark": "",
+                "children": [
                     {
-                        "title": "待点价合同",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing",
-                        "code": "hedgeditem_trade_pricing",
-                        "path": "hedgeditem_trade_pricing",
-                        "component": "views/hedgeditem/trade/pricing/index.vue",
-                        "sort": 3,
-                        "isshow": false,
-                        "url": "",
-                        "remark": "",
+                        "title": "外部成交单关联",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out",
+                        "code": "hedgeditem_futures_out",
+                        "path": "hedgeditem_futures_out",
+                        "component": "views/iframe/index.vue",
+                        "sort": 1,
+                        "isshow": true,
+                        "url": "/link/patradelink/initcommonview",
+                        "remark": "管理端",
                         "auth": [
                             {
-                                "label": "期货交易",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_trade",
-                                "code": "trade",
+                                "label": "关联",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out_bind",
+                                "code": "relation",
                                 "isshow": true,
                                 "remark": ""
                             },
                             {
-                                "label": "点价登记",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_record",
-                                "code": "record",
+                                "label": "解除关联",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out_unbind",
+                                "code": "del",
                                 "isshow": true,
                                 "remark": ""
-                            },
+                            }
+                        ]
+                    },
+                    {
+                        "title": "期现单据关联",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in",
+                        "code": "hedgeditem_futures_in",
+                        "path": "hedgeditem_futures_in",
+                        "component": "views/hedgeditem/futures/in/index.vue",
+                        "sort": 2,
+                        "isshow": true,
+                        "url": "",
+                        "remark": "",
+                        "auth": [
                             {
-                                "label": "关联采购计划",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_purchase",
-                                "code": "purchase",
+                                "label": "关联",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in_bind",
+                                "code": "bind",
                                 "isshow": true,
                                 "remark": ""
-                            },
+                            }
+                        ]
+                    },
+                    {
+                        "title": "关联记录",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_record",
+                        "code": "hedgeditem_futures_record",
+                        "path": "hedgeditem_futures_record",
+                        "component": "views/iframe/index.vue",
+                        "sort": 3,
+                        "isshow": true,
+                        "url": "/link/patradelink/initcommonview",
+                        "remark": "管理端",
+                        "auth": [
+                            {
+                                "label": "解除关联",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_record_unbind",
+                                "code": "del",
+                                "isshow": true,
+                                "remark": ""
+                            }
+                        ]
+                    }
+                ]
+            },
+            {
+                "title": "套期项目关联",
+                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot",
+                "code": "hedgeditem_spot",
+                "path": "hedgeditem_spot",
+                "component": "Main",
+                "sort": 4,
+                "isshow": true,
+                "url": "",
+                "remark": "",
+                "children": [
+                    {
+                        "title": "未关联采购合同",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_purchase",
+                        "code": "hedgeditem_spot_purchase",
+                        "path": "hedgeditem_spot_purchase",
+                        "component": "views/hedgeditem/spot/contract/index.vue",
+                        "sort": 1,
+                        "isshow": true,
+                        "url": "",
+                        "remark": "",
+                        "auth": [
                             {
-                                "label": "关联现货套保",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_hedge",
-                                "code": "hedge",
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_purchase_bind",
+                                "code": "bind",
                                 "isshow": true,
                                 "remark": ""
                             },
@@ -1083,43 +1085,23 @@
                                 "isshow": true,
                                 "remark": ""
                             }
-                        ],
-                        "children": [
-                            {
-                                "title": "点价登记明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_details",
-                                "code": "hedgeditem_trade_pricing_details",
-                                "path": "",
-                                "component": "views/hedgeditem/trade/components/pricing-details/index.vue",
-                                "sort": 1,
-                                "isshow": true,
-                                "url": "",
-                                "remark": ""
-                            }
                         ]
                     },
                     {
-                        "title": "已点价合同",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced",
-                        "code": "hedgeditem_trade_performance",
-                        "path": "hedgeditem_trade_performance",
-                        "component": "views/hedgeditem/trade/priced/index.vue",
-                        "sort": 4,
-                        "isshow": false,
+                        "title": "未关联销售合同",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_sell",
+                        "code": "hedgeditem_spot_sell",
+                        "path": "hedgeditem_spot_sell",
+                        "component": "views/hedgeditem/spot/contract/index.vue",
+                        "sort": 2,
+                        "isshow": true,
                         "url": "",
                         "remark": "",
                         "auth": [
                             {
-                                "label": "关联采购计划",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced_purchase",
-                                "code": "purchase",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
-                                "label": "关联现货套保",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced_hedge",
-                                "code": "hedge",
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_sell_bind",
+                                "code": "bind",
                                 "isshow": true,
                                 "remark": ""
                             },
@@ -1130,17 +1112,24 @@
                                 "isshow": true,
                                 "remark": ""
                             }
-                        ],
-                        "children": [
+                        ]
+                    },
+                    {
+                        "title": "未关联购销计划",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_plan",
+                        "code": "hedgeditem_spot_plan",
+                        "path": "hedgeditem_spot_plan",
+                        "component": "views/hedgeditem/spot/plan/index.vue",
+                        "sort": 3,
+                        "isshow": true,
+                        "url": "",
+                        "remark": "",
+                        "auth": [
                             {
-                                "title": "点价登记明细",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced_details",
-                                "code": "exposure_realtime_index",
-                                "path": "",
-                                "component": "views/hedgeditem/trade/components/pricing-details/index.vue",
-                                "sort": 1,
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_spot_plan_bind",
+                                "code": "bind",
                                 "isshow": true,
-                                "url": "",
                                 "remark": ""
                             }
                         ]
@@ -1148,72 +1137,69 @@
                 ]
             },
             {
-                "title": "期货成交关联",
-                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures",
-                "code": "hedgeditem_futures",
-                "path": "hedgeditem_futures",
+                "title": "敞口监控",
+                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure",
+                "code": "hedgeditem_exposure",
+                "path": "hedgeditem_exposure",
                 "component": "Main",
-                "sort": 3,
+                "sort": 1,
                 "isshow": true,
                 "url": "",
                 "remark": "",
                 "children": [
                     {
-                        "title": "外部未成交单",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out",
-                        "code": "hedgeditem_futures_out",
-                        "path": "hedgeditem_futures_out",
-                        "component": "views/hedgeditem/futures/out/index.vue",
-                        "sort": 4,
+                        "title": "敞口监控",
+                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_list",
+                        "code": "hedgeditem_exposure_list",
+                        "path": "hedgeditem_exposure_list",
+                        "component": "views/hedgeditem/exposure/list/index.vue",
+                        "sort": 1,
                         "isshow": true,
                         "url": "",
                         "remark": "",
-                        "auth": [
+                        "children": [
                             {
-                                "label": "关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out_bind",
-                                "code": "bind",
+                                "title": "期货持仓明细",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_position",
+                                "code": "hedgeditem_exposure_position",
+                                "path": "",
+                                "component": "views/hedgeditem/exposure/components/position/index.vue",
+                                "sort": 1,
                                 "isshow": true,
+                                "url": "",
                                 "remark": ""
-                            }
-                        ]
-                    },
-                    {
-                        "title": "内部未关联成交单",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in",
-                        "code": "hedgeditem_futures_in",
-                        "path": "hedgeditem_futures_in",
-                        "component": "views/hedgeditem/futures/in/index.vue",
-                        "sort": 4,
-                        "isshow": true,
-                        "url": "",
-                        "remark": "",
-                        "auth": [
+                            },
                             {
-                                "label": "关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in_bind",
-                                "code": "bind",
+                                "title": "现货变动明细",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_spot",
+                                "code": "hedgeditem_exposure_spot",
+                                "path": "",
+                                "component": "views/hedgeditem/exposure/components/spot/index.vue",
+                                "sort": 2,
                                 "isshow": true,
+                                "url": "",
                                 "remark": ""
-                            }
-                        ]
-                    },
-                    {
-                        "title": "已关联成交单",
-                        "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_finish",
-                        "code": "hedgeditem_futures_finish",
-                        "path": "hedgeditem_futures_finish",
-                        "component": "views/hedgeditem/futures/finish/index.vue",
-                        "sort": 4,
-                        "isshow": true,
-                        "url": "",
-                        "remark": "",
-                        "auth": [
+                            },
                             {
-                                "label": "解除关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_finish_unbind",
-                                "code": "unbind",
+                                "title": "计划变动明细",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_plan",
+                                "code": "hedgeditem_exposure_plan",
+                                "path": "",
+                                "component": "views/hedgeditem/exposure/components/plan/index.vue",
+                                "sort": 3,
+                                "isshow": true,
+                                "url": "",
+                                "remark": ""
+                            },
+                            {
+                                "title": "期货变动明细",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_exposure_futures",
+                                "code": "hedgeditem_exposure_futures",
+                                "path": "",
+                                "component": "views/hedgeditem/exposure/components/futures/index.vue",
+                                "sort": 4,
                                 "isshow": true,
+                                "url": "",
                                 "remark": ""
                             }
                         ]
@@ -1221,7 +1207,7 @@
                 ]
             },
             {
-                "title": "现货参考价",
+                "title": "现货市场价",
                 "rulekey": "client_pc_web_qiyefengguan_spotmarket",
                 "code": "spotmarket",
                 "path": "spotmarket",
@@ -1232,7 +1218,7 @@
                 "remark": "",
                 "children": [
                     {
-                        "title": "现货参考价",
+                        "title": "现货市场价",
                         "rulekey": "client_pc_web_qiyefengguan_spotmarket_price",
                         "code": "spotmarket_price",
                         "path": "spotmarket_price",
@@ -1634,7 +1620,7 @@
                                 "remark": ""
                             },
                             {
-                                "label": "关闭",
+                                "label": "关闭计划",
                                 "rulekey": "client_pc_web_qiyefengguan_plan_running_close",
                                 "code": "close",
                                 "isshow": true,
@@ -1710,22 +1696,42 @@
                                 "remark": ""
                             }
                         ]
+                    },
+                    {
+                        "title": "已完成",
+                        "rulekey": "client_pc_web_qiyefengguan_plan_finish",
+                        "code": "plan_finish",
+                        "path": "plan_finish",
+                        "component": "views/business/plan/list/finish/index.vue",
+                        "sort": 3,
+                        "isshow": true,
+                        "url": "",
+                        "remark": "",
+                        "auth": [
+                            {
+                                "label": "详情",
+                                "rulekey": "",
+                                "code": "detail",
+                                "isshow": true,
+                                "remark": ""
+                            }
+                        ]
                     }
                 ]
             },
             {
-                "title": "套期项目关联",
+                "title": "现货查询",
                 "rulekey": "client_pc_web_qiyefengguan_search_spot",
                 "code": "search_spot",
                 "path": "search_spot",
                 "component": "Main",
                 "sort": 4,
-                "isshow": true,
+                "isshow": false,
                 "url": "",
                 "remark": "",
                 "children": [
                     {
-                        "title": "未关联采购合同",
+                        "title": "采购合同",
                         "rulekey": "client_pc_web_qiyefengguan_search_purchase",
                         "code": "search_purchase",
                         "path": "search_purchase",
@@ -1736,13 +1742,6 @@
                         "remark": "",
                         "auth": [
                             {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_search_purchase_bind",
-                                "code": "search_purchase_bind",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1752,7 +1751,7 @@
                         ]
                     },
                     {
-                        "title": "未关联销售合同",
+                        "title": "销售合同",
                         "rulekey": "client_pc_web_qiyefengguan_search_sell",
                         "code": "search_sell",
                         "path": "search_sell",
@@ -1763,13 +1762,6 @@
                         "remark": "",
                         "auth": [
                             {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_search_sell_bind",
-                                "code": "search_sell_bind",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1779,7 +1771,7 @@
                         ]
                     },
                     {
-                        "title": "未关联购销计划",
+                        "title": "购销计划",
                         "rulekey": "client_pc_web_qiyefengguan_search_plan",
                         "code": "search_plan",
                         "path": "search_plan",
@@ -1788,15 +1780,7 @@
                         "isshow": true,
                         "url": "",
                         "remark": "",
-                        "auth": [
-                            {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_search_plan_bind",
-                                "code": "search_plan_bind",
-                                "isshow": true,
-                                "remark": ""
-                            }
-                        ]
+                        "auth": []
                     }
                 ]
             },
@@ -2102,73 +2086,6 @@
                 ]
             },
             {
-                "title": "项目审核",
-                "rulekey": "client_pc_web_qiyefengguan_riskreview_project",
-                "code": "riskreview_project",
-                "path": "riskreview_project",
-                "component": "Main",
-                "sort": 2,
-                "isshow": true,
-                "url": "",
-                "remark": "",
-                "children": [
-                    {
-                        "title": "待审核",
-                        "rulekey": "client_pc_web_qiyefengguan_riskreview_project_checkpending",
-                        "code": "riskreview_project_checkpending",
-                        "path": "riskreview_project_checkpending",
-                        "component": "views/audit/project/checkpending/index.vue",
-                        "sort": 1,
-                        "isshow": true,
-                        "url": "",
-                        "remark": "",
-                        "auth": [
-                            {
-                                "label": "同意",
-                                "rulekey": "client_pc_web_qiyefengguan_riskreview_project_checkpending_submit",
-                                "code": "submit",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
-                                "label": "拒绝",
-                                "rulekey": "client_pc_web_qiyefengguan_riskreview_project_checkpending_refuse",
-                                "code": "refuse",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
-                                "label": "详情",
-                                "rulekey": "",
-                                "code": "info",
-                                "isshow": true,
-                                "remark": ""
-                            }
-                        ]
-                    },
-                    {
-                        "title": "已审核",
-                        "rulekey": "client_pc_web_qiyefengguan_riskreview_project_performance",
-                        "code": "riskreview_project_performance",
-                        "path": "riskreview_project_performance",
-                        "component": "views/audit/project/performance/index.vue",
-                        "sort": 2,
-                        "isshow": true,
-                        "url": "",
-                        "remark": "",
-                        "auth": [
-                            {
-                                "label": "详情",
-                                "rulekey": "",
-                                "code": "info",
-                                "isshow": true,
-                                "remark": ""
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
                 "title": "现货参数审核",
                 "rulekey": "client_pc_web_qiyefengguan_spot_params",
                 "code": "spot_params",
@@ -3113,7 +3030,7 @@
         "path": "/platinum",
         "component": "Layout",
         "sort": 90,
-        "isshow": true,
+        "isshow": false,
         "children": [
             {
                 "title": "客户资料",
@@ -3777,7 +3694,7 @@
         "path": "/platinum_signing",
         "component": "Layout",
         "sort": 100,
-        "isshow": true,
+        "isshow": false,
         "children": [
             {
                 "title": "签单设置",

+ 22 - 4
models/ermcp.go

@@ -18,8 +18,8 @@ import (
 // ErmcpSpotContractModel 现货合同结构(对应现货合同菜单)
 type ErmcpSpotContractModel struct {
 	SPOTCONTRACTID    string  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`       // 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-	CONTRACTNO        string  `json:"contractno"  xorm:"'CONTRACTNO'"`               // 现货合同编号
-	CONTRACTTYPE      int32   `json:"contracttype"  xorm:"'CONTRACTTYPE'"`           // 现货合同类型 - 1:采购 -1:销售
+	CONTRACTNO        string  `json:"contractno"  xorm:"'CONTRACTNO'"`               // [合同编号]现货合同编号
+	CONTRACTTYPE      int32   `json:"contracttype"  xorm:"'CONTRACTTYPE'"`           // [合同类型]现货合同类型 - 1:采购 -1:销售
 	USERID            int64   `json:"userid"  xorm:"'USERID'"`                       // 机构ID
 	BUYUSERID         int64   `json:"buyuserid"  xorm:"'BUYUSERID'"`                 // 采购方ID
 	BUYUSERName       string  `json:"buyusername"  xorm:"'BUYUSERName'"`             // 采购方名称
@@ -27,7 +27,7 @@ type ErmcpSpotContractModel struct {
 	SELLUSERNAME      string  `json:"sellusername"  xorm:"'SELLUSERNAME'"`           // 销售方名称
 	DELIVERYGOODSID   int32   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货品种ID
 	WRSTANDARDID      int32   `json:"wrstandardid"  xorm:"'wrstandardid'"`           // 现货商品ID
-	WRSTANDARDNAME    string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`       // 现货商品名称
+	WRSTANDARDNAME    string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`       // [现货商品]现货商品名称
 	WRSTANDARDCODE    string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`       // 现货商品代码
 	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
 	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
@@ -35,7 +35,7 @@ type ErmcpSpotContractModel struct {
 	CONVERTFACTOR     float64 `json:"convertfactor"  xorm:"'CONVERTFACTOR'"`         // 标仓系数
 	SPOTGOODSDESC     string  `json:"spotgoodsdesc"  xorm:"'SPOTGOODSDESC'"`         // 商品型号
 	PRICETYPE         int32   `json:"pricetype"  xorm:"'PRICETYPE'"`                 // 定价类型 - 1:一口价 2:点价 3:暂定价
-	QTY               float64 `json:"qty"  xorm:"'QTY'"`                             // 数量
+	QTY               float64 `json:"qty"  xorm:"'QTY'"`                             // [合同数量]数量
 	PRICE             float64 `json:"price"  xorm:"'PRICE'"`                         // 价格\暂定价 [1:一口价、3:暂定价]
 	AMOUNT            float64 `json:"amount"  xorm:"'AMOUNT'"`                       // 金额 [1:一口价、3:暂定价]
 	DELIVERYSTARTDATE string  `json:"deliverystartdate"  xorm:"'DELIVERYSTARTDATE'"` // 交收期(开始)
@@ -60,6 +60,18 @@ type ErmcpSpotContractModel struct {
 	BRANDNAME         string  `json:"brandname"  xorm:"'brandname'"`                 // 品牌名称
 	MODELNAME         string  `json:"modelname"  xorm:"'modelname'"`                 // 型号名称
 	ATTACHMENT        string  `json:"attachment"  xorm:"'ATTACHMENT'"`               // 附件
+	PRICEDQTY         float64 `json:"pricedqty"  xorm:"PRICEDQTY"`                   // 已定价量
+	PRICEDAMOUNT      float64 `json:"pricedamount"  xorm:"PRICEDAMOUNT"`             // 已定价金额 = (点价价格+升贴水) * 数量
+	SPOTAMOUNT        float64 `json:"spotamount"  xorm:"SPOTAMOUNT"`                 // 合同现货金额 [不含升贴水]
+	TRADEUSERID       int64   `json:"tradeuserid"  xorm:"TRADEUSERID"`               // 交易用户ID
+	ISRELATED         int32   `json:"isrelated"  xorm:"ISRELATED"`                   // 是否已关联计划项目 - 0:否 1:是
+	ISRELATED2        int32   `json:"isrelated2"  xorm:"ISRELATED2"`                 // 是否已关联现货项目 - 0:否 1:是
+
+	AccountName string `json:"accountName" xorm:"ACCOUNTNAME"` // 套期主体
+
+	UNPRICEDQTY  float64 `json:"unpricedqty" xorm:"UNPRICEDQTY"`   // 未定价量 = 合同数量 - 已定价量
+	AVGPRICE     float64 `json:"avgprice" xorm:"AVGPRICE"`         // 定价均价 = 已定价金额 / 已定价量
+	SPOTAVGPRICE float64 `json:"spotavgprice" xorm:"SPOTAVGPRICE"` // 现货均价 = 合同现货金额 / 已定价量
 }
 
 func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
@@ -106,6 +118,10 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       e.Enumdicname," +
 		"       w.wrstandardname," +
 		"       w.wrstandardcode" +
+		"       (t.QTY - t.PRICEDQTY) UNPRICEDQTY" +
+		"       DECODE(t.PRICEDQTY, 0, 0, t.PRICEDAMOUNT/t.PRICEDQTY) AVGPRICE" +
+		"       DECODE(t.PRICEDQTY, 0, 0, t.SPOTAMOUNT/t.PRICEDQTY) SPOTAVGPRICE" +
+		"       ua.ACCOUNTNAME," +
 		"  FROM ERMCP_SPOTCONTRACT t" +
 		"  left join useraccount u1" +
 		"    on t.buyuserid = u1.userid" +
@@ -122,6 +138,8 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"  left join enumdicitem e" +
 		"    on w.unitid = e.enumitemname" +
 		"   and e.enumdiccode = 'goodsunit'" +
+		"  left join useraccount ua" +
+		"    on ua.userid = t.tradeuserid" +
 		" where t.contractstatus in (%v)" +
 		"   and t.userid = %v"
 

+ 10 - 5
models/ermcp8.go

@@ -971,6 +971,7 @@ type Ermcp8HedgeditemReport struct {
 	ORIFUTUREPL         float64   `json:"orifuturepl"  xorm:"ORIFUTUREPL"`                                   // 期初期货套期损益
 
 	EnumdicName string `json:"enumdicname"  xorm:"'ENUMDICNAME'"` // 单位
+	AccountName string `json:"accountName" xorm:"ACCOUNTNAME"`    // 套期主体
 
 	USERID    int64  `form:"userid" binding:"required"`    // 用户ID
 	CYCLETYPE int32  `form:"cycletype" binding:"required"` // 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
@@ -1020,11 +1021,13 @@ func (r *Ermcp8HedgeditemReport) buildReckonSql() string {
 		t.CURPRICE,
 		t.PLANSTARTDATE,
 		t.PLANENDDATE,
-		e.ENUMDICNAME
+		e.ENUMDICNAME,
+		u.ACCOUNTNAME
 	FROM Reckon_ERMCP2_HedgedItem t
 	LEFT JOIN WRStandard wr ON wr.WRStandardID = t.WRStandardID
 	LEFT JOIN WRStandard wr ON wr.wrstandardid = t.wrstandardid
 	LEFT JOIN enumdicitem e on wr.unitid=e.enumitemname and e.enumdiccode='goodsunit'
+	LEFT JOIN useraccount u ON u.userid = t.tradeuserid
 	WHERE (t.TRADEUSERID = %v OR t.AREAUSERID = %v)
 	`
 	sqlId.FormatParam(r.USERID, r.USERID)
@@ -1066,15 +1069,17 @@ func (r *Ermcp8HedgeditemReport) buildReportSql() string {
 		t.CURPRICE,
 		t.PLANSTARTDATE,
 		t.PLANENDDATE,
-		e.ENUMDICNAME
+		e.ENUMDICNAME,
+		u.ACCOUNTNAME
 	FROM REPORT_ERMCP2_HEDGEDITEM t
 	LEFT JOIN WRStandard wr ON wr.WRStandardID = t.WRStandardID
 	LEFT JOIN WRStandard wr ON wr.wrstandardid = t.wrstandardid
 	LEFT JOIN enumdicitem e on wr.unitid=e.enumitemname and e.enumdiccode='goodsunit'
+	LEFT JOIN useraccount u ON u.userid = t.tradeuserid
+	WHERE (t.TRADEUSERID = %v OR t.AREAUSERID = %v)
 	`
-	sqlId.And("t.RECKONDATE", r.CYCLETIME)
-	sqlId.And("t.TRADEUSERID", r.USERID)
-	sqlId.And("t.AREAUSERID", r.USERID)
+	sqlId.FormatParam(r.USERID, r.USERID)
+	sqlId.And("t.CYCLETIME", r.CYCLETIME)
 	sqlId.AndEx("t.HEDGEDTYPE", r.HEDGEDTYPE, r.HEDGEDTYPE > 0)
 	sqlId.AndEx("t.HEDGEDITEMSTATUS", r.HEDGEDITEMSTATUS, r.HEDGEDITEMSTATUS > 0)
 	sqlId.AndLike("t.HEDGEDITEMNUM", r.HEDGEDITEMNUM)