zhou.xiaoning 4 лет назад
Родитель
Сommit
3d3cdc9947

+ 1 - 0
.gitignore

@@ -108,3 +108,4 @@ _UpgradeReport_Files/
 Backup*/
 UpgradeLog*.XML
 
+/Muchinfo.MTPClient/Setup

+ 18 - 18
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Modules/Muchinfo.TASClient.Quotation/Views/QuoteDataGrid.xaml.cs

@@ -236,27 +236,27 @@ namespace Muchinfo.MTPClient.Quotation.Views
                 {
                     case ContextMenuCommandType.Market_Purchase:
                         item.IsVisiable = Visibility.Visible;
-                        if (buyFunc != null)
-                        {
-                            item.IsEnable = buyFunc.IsEnabled;
-                        }
-                        else
-                        {
-                            item.IsEnable = false;
-                        }
+                        //if (buyFunc != null)
+                        //{
+                        //    item.IsEnable = buyFunc.IsEnabled;
+                        //}
+                        //else
+                        //{
+                        //    item.IsEnable = false;
+                        //}
                         break;
                     case ContextMenuCommandType.Market_SellOut:
                         item.IsVisiable = Visibility.Visible;
-                        if (tradeFunc != null)
-                        {
-                            item.IsEnable = tradeFunc.IsEnabled;
-                            bingBase = new Binding("IsEnabled");
-                            bingBase.Source = tradeFunc;
-                        }
-                        else
-                        {
-                            item.IsEnable = false;
-                        }
+                        //if (tradeFunc != null)
+                        //{
+                        //    item.IsEnable = tradeFunc.IsEnabled;
+                        //    bingBase = new Binding("IsEnabled");
+                        //    bingBase.Source = tradeFunc;
+                        //}
+                        //else
+                        //{
+                        //    item.IsEnable = false;
+                        //}
 
                         break;
                     case ContextMenuCommandType.RefreshGoodsList:

+ 31 - 0
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient.UI/ViewModels/HomeViewModel.cs

@@ -290,6 +290,20 @@ namespace Muchinfo.MTPClient.UI.ViewModels
         }
 
         /// <summary>
+        /// 是否显示期货组件
+        /// </summary>
+        private Visibility _quoteVisibility = Visibility.Hidden;
+
+        public Visibility QuoteVisibility
+        {
+            get { return _quoteVisibility; }
+            set
+            {
+                Set(() => QuoteVisibility, ref _quoteVisibility, value);
+            }
+        }
+
+        /// <summary>
         /// 是否显示WEB浏览器组件
         /// </summary>
         private Visibility _webBrowerVisibility = Visibility.Visible;
@@ -776,9 +790,24 @@ namespace Muchinfo.MTPClient.UI.ViewModels
                     break;
                 #endregion
 
+                #region 风管云平台
+                case MenuCommandType.Manage:
+                    // 现货
+                    QuoteVisibility = Visibility.Hidden;
+                    WebBrowerVisibility = Visibility.Visible;
+
+                    break;
+                #endregion
+
+
                 case MenuCommandType.MarketQuote:
                 case MenuCommandType.SelectedGoodses:
                     MessengerHelper.DefaultSend(item, MessengerTokens.ChangeMarket);
+
+                    // 期货
+                    QuoteVisibility = Visibility.Visible;
+                    WebBrowerVisibility = Visibility.Hidden;
+
                     break;
 
                 default:
@@ -1857,6 +1886,8 @@ namespace Muchinfo.MTPClient.UI.ViewModels
                 _dispatcherTimer.Stop();
             }
 
+            // 目前暂时不显示锁屏
+            time = 0;
             if (time > 0 && UserManager.IsAccountLogin)    ////配置了时间才进行锁屏
             {
                 _dispatcherTimer = new DispatcherTimer();

+ 1 - 1
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient.UI/ViewModels/LoginViewModel.cs

@@ -794,7 +794,7 @@ namespace Muchinfo.MTPClient.UI.ViewModels
             LinkManager.Instance.TradeTcpLinkProxy.StartSendBeat();
 
             // 等待1s,以免行情接入TOKEN检验失败
-            Thread.Sleep(1000);
+            Thread.Sleep(2000);
 
             //创建行情链路, 链路成功后订阅商品
             LinkManager.Instance.CreateQuoteTcpLink();

+ 4 - 3
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient.UI/Views/MainPage.xaml

@@ -243,10 +243,11 @@
                 <Border x:Name="ContentBorder" Grid.Row="1">
                     <Grid>
                         <!--  期货交易  -->
-                        <ContentControl Content="{Binding MainContent}" />
+                        <ContentControl Content="{Binding MainContent}"
+                                        Visibility="{Binding QuoteVisibility}" />
                         <!--  风管现货  -->
-                        <wv2:WebView2 Name="webView" Source="http://www.baidu.com"
-                              Visibility="{Binding WebBrowerVisibility}" />
+                        <wv2:WebView2 Name="webView" Source="http://www.baidu.com" 
+                                      Visibility="{Binding WebBrowerVisibility}" />
                     </Grid>
                 </Border>
 

+ 26 - 9
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient.UI/Views/MainPage.xaml.cs

@@ -17,6 +17,7 @@ using System.Windows.Input;
 using System.Windows.Threading;
 using Muchinfo.MTPClient.Report.Views;
 using KeyEventArgs = System.Windows.Input.KeyEventArgs;
+using Microsoft.Web.WebView2.Core;
 
 namespace Muchinfo.MTPClient.UI.Views
 {
@@ -89,16 +90,32 @@ namespace Muchinfo.MTPClient.UI.Views
             }
 
             // 获取风管Web端
-            //WebBrowserObj.ObjectForScripting = this;
-            //WebBrowserObj.Source = new Uri(ApplicationParameter.ErmcpWebUrl);
-
-            //WebGrid.Children.Clear();
-            //ChromiumWebBrowser viewer = new ChromiumWebBrowser() { Address = ApplicationParameter.ErmcpWebUrl };
-            //WebGrid.Children.Insert(0, viewer);
-
-            //webBrowser.Address = ApplicationParameter.ErmcpWebUrl;
+            InitializeAsync();
+        }
 
-            webView.Source = new Uri(ApplicationParameter.ErmcpWebUrl);
+        async void InitializeAsync()
+        {
+            // must create a data folder if running out of a secured folder that can't write like Program Files
+            //var path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MarkdownMonster_Browser");
+            //var env = await CoreWebView2Environment.CreateAsync(userDataFolder: path);
+
+            // NOTE: this waits until the first page is navigated - then continues
+            //       executing the next line of code!
+            await webView.EnsureCoreWebView2Async(null);
+
+            // Optional: Map a folder from the Executable Folder to a virtual domain
+            // NOTE: This requires a Canary preview currently (.720+)
+            //webView.CoreWebView2.SetVirtualHostNameToFolderMapping(
+            //    "test.editor", "HtmlSample",
+            //    CoreWebView2HostResourceAccessKind.Allow);
+
+            // You can then navigate the file from disk with the domain
+            var loginID = UserManager.CurrentTradeAccount.LoginID;
+            var pwd = UserManager.CurrentTradeAccount.Md5Password;
+            var url = String.Format("{0}?ACCOUNT={1}&PASSWORD={2}", ApplicationParameter.ErmcpWebUrl, loginID, pwd);
+            webView.Source = new Uri(url);
+
+            //webView.CoreWebView2.OpenDevToolsWindow();
         }
 
         private void Home_SizeChanged(object sender, SizeChangedEventArgs e)

+ 6 - 29
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient/Config/Config.xml

@@ -1,38 +1,15 @@
 <?xml version='1.0' encoding='utf-8'?>
 <Root>
   <Config>
-  <!--交易代理地址
-  <BizAddress>192.168.20.151:35001</BizAddress>
-  <QuoteAddress>192.168.20.151:35002</QuoteAddress>-->
-  
-  <!--BizAddress>192.168.31.175:5001</BizAddress>
-  <QuoteAddress>192.168.31.175:5002</QuoteAddress>-->
-    <!--uat外网环境-->
-  <!--<BizAddress>103.40.249.124:6010</BizAddress>
-  <QuoteAddress>103.40.249.124:6020</QuoteAddress>-->
-    <!--
-  <BizAddress>192.168.21.19:39001</BizAddress>
-  <QuoteAddress>192.168.21.19:39002</QuoteAddress>-->
-    <!--
-    <BizAddress>192.168.21.20:31201</BizAddress>
-    <QuoteAddress>192.168.21.20:31202</QuoteAddress>-->
-
-    <!--<BizAddress>192.168.30.113:22121</BizAddress>
-    <QuoteAddress>192.168.30.113:22122</QuoteAddress>-->
-    <!--<BizAddress>192.168.31.109:5001</BizAddress>
-    <QuoteAddress>192.168.31.109:5002</QuoteAddress>-->
-    <!--<BizAddress>192.168.31.58:17171</BizAddress>
-    <QuoteAddress>192.168.31.58:17172</QuoteAddress>-->
-
-    <!--<BizAddress>103.40.249.124:6010</BizAddress>
-    <QuoteAddress>103.40.249.124:6020</QuoteAddress>-->
-
     <BizAddress></BizAddress>
     <QuoteAddress></QuoteAddress>
     
-    <!-- 风管云平台服务地址 -->
-    <ErmcpAddress>http://192.168.31.175:8080/cfg?key=test_175</ErmcpAddress>
-    <ErmcpWebUrl>http://192.168.31.175:5035/webpc/#/login</ErmcpWebUrl>
+    <!-- 风管云平台服务地址 - 千海金 -->
+    <ErmcpAddress>http://103.40.249.123:8280/cfg?key=mtp_20</ErmcpAddress>
+    <ErmcpWebUrl>http://103.40.249.123:8090/#/platinum_pick_query/tab</ErmcpWebUrl>
+    <!-- 风管云平台服务地址 - 测试 -->
+    <!--<ErmcpAddress>http://192.168.31.175:8080/cfg?key=test_175</ErmcpAddress>
+    <ErmcpWebUrl>http://192.168.31.175:5035/webpc/#/platinum_pick_query/tab</ErmcpWebUrl>-->
 
     <!--应用程序升级地址-->
     <UpdateAddress></UpdateAddress>

+ 2 - 2
Muchinfo.MTPClient/Fx4.0/Main/03.UI/Muchinfo.TASClient/Properties/AssemblyInfo.cs

@@ -11,7 +11,7 @@ using System.Windows;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("Client")]
-[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyCopyright("Copyright © 2021")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -52,4 +52,4 @@ using System.Windows;
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("10.0.0.20")]
 [assembly: AssemblyFileVersion("10.0.0.20")]
- 
+

+ 1 - 1
Muchinfo.MTPClient/Fx4.0/Main/04.Infrastructure/Muchinfo.TASClient.Infrastructure/Cache/CacheManager.cs

@@ -604,7 +604,7 @@ namespace Muchinfo.MTPClient.Infrastructure.Cache
         public static void LoadGoodsInfoList(List<QuoteGoods> goodsEntity, GoodsFromScr goodsScr)
         {
             TaskSuppleTable();
-            if (null != goodsEntity && goodsEntity.Any())  ////交易商品
+            if (null != goodsEntity && goodsEntity.Any() && CacheAvailableMarketList != null)  ////交易商品
             {
                 //商品市场权限过滤,MTP2.0NEW
                 var result = goodsEntity.Distinct(new QuoteGoodsComparer()).Where(x => CacheAvailableMarketList.Contains(x.MarketID)).ToList();

+ 8 - 1
Muchinfo.MTPClient/Fx4.0/Main/04.Infrastructure/Muchinfo.TASClient.Infrastructure/Utilities/ApplicationParameter.cs

@@ -570,6 +570,8 @@ namespace Muchinfo.MTPClient.Infrastructure.Utilities
         /// <param name="seconds"></param>
         public static void SetSystemTime(ulong seconds)
         {
+            seconds -= 60 * 60 * 8;
+
             long lTime = long.Parse(seconds + "0000000");
             TimeSpan toNow = new TimeSpan(lTime);
             var timeNow = TimeZone.CurrentTimeZone.ToLocalTime(_basicDateTime.Add(toNow));
@@ -581,6 +583,8 @@ namespace Muchinfo.MTPClient.Infrastructure.Utilities
         /// <param name="seconds"></param>
         public static void SetSystemTime(int seconds)
         {
+            seconds -= 60 * 60 * 8;
+
             var timeNow = TimeZone.CurrentTimeZone.ToLocalTime(_basicDateTime.AddMilliseconds(seconds));
             SetServerTime(timeNow);
         }
@@ -621,7 +625,10 @@ namespace Muchinfo.MTPClient.Infrastructure.Utilities
                         if (external != null && external.Any())
                         {
                             var exchaneInfo = external.Find((externalExchange) => exchangeId == externalExchange.ExchangeId);
-                            isMarketPrice = exchaneInfo.IsMarketPrice;
+                            if (exchaneInfo != null)
+                            {
+                                isMarketPrice = exchaneInfo.IsMarketPrice;
+                            }
                         }
                     }
                 });

+ 5 - 0
Muchinfo.MTPClient/Fx4.0/Main/05.Services/Muchinfo.TASClient.Data/Enums/MenuCommandType.cs

@@ -951,6 +951,11 @@ namespace Muchinfo.MTPClient.Data.Enums
         /// </summary>
         [KindDisc("关于软件", (int)KindEnum.System)]
         AboutUs,
+        /// <summary>
+        /// 管理->管理
+        /// </summary>
+        [KindDisc("管理", (int)KindEnum.System)]
+        Manage,
 
         #endregion
 

+ 7 - 1
Muchinfo.MTPClient/Fx4.0/Main/05.Services/Muchinfo.TASClient.Data/Model/Account/TradeAccount.cs

@@ -524,7 +524,13 @@ namespace Muchinfo.MTPClient.Data.Model.Account
         /// <value>The current funds account.</value>
         public FundsAccount CurrentFundsAccount
         {
-            get { return FundsAccounts.FirstOrDefault(z => z.AccountId == FundsAccountId); }
+            get { 
+                if (FundsAccounts != null)
+                {
+                    return FundsAccounts.FirstOrDefault(z => z.AccountId == FundsAccountId);
+                }
+                return null;
+            }
 
         }
 

+ 25 - 2
Muchinfo.MTPClient/Fx4.0/Main/05.Services/Muchinfo.TASClient.Service/SystemService.cs

@@ -230,9 +230,10 @@ namespace Muchinfo.MTPClient.Service
         {
             bool isListing = accessFuncMenus.Exists((item) => item.FuncMenuCode == UserManager.GetMenuCommandValue(MenuCommandType.ListingManage));
             var result = new List<SysMenuItem>();
-            result.AddRange(BuildSystemMenu());
+            //result.AddRange(BuildSystemMenu());
             result.AddRange(BuildQuoteMenus(isListing));
-            result.AddRange(BuildTradingMenus(accessFuncMenus, command));
+            //result.AddRange(BuildTradingMenus(accessFuncMenus, command));
+            result.AddRange(BuildErmcpMenu());
             result.AddRange(BuildHelpMenus());
             return result.ToObservableCollection();
             //todo:暂时使用本地的
@@ -544,6 +545,28 @@ namespace Muchinfo.MTPClient.Service
             return result;
         }
 
+        private IEnumerable<SysMenuItem> BuildErmcpMenu()
+        {
+            var ermcpMenus = new List<SysMenuItem>();
+
+            var manage = new SysMenuItem("现货")
+            {
+                IsEnabled = true,
+            };
+            ermcpMenus.Add(manage);
+            manage.Children = new List<SysMenuItem>()
+            {
+                        new SysMenuItem("现货管理", MenuCommandType.Manage),
+                      
+                      //  new SysMenuItem(MenuNames.HelpEscapeClause, MenuCommandType.EscapeClause)
+                        //new SysMenuItem(MenuNames.HelpUserGuide , MenuCommandType.UserGuide),
+                        //new SysMenuItem(MenuNames.HelpOnlineCS, MenuCommandType.OnlineCS),
+            };
+
+
+            return ermcpMenus;
+        }
+
         /// <summary>
         /// 构建[系统]菜单
         /// </summary>