140 lines
5.6 KiB
C#
140 lines
5.6 KiB
C#
using NetCore.BLL;
|
||
using NetCore.Common;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Threading;
|
||
|
||
namespace NetCore.Service
|
||
{
|
||
public class Program
|
||
{
|
||
|
||
|
||
//static hg_make_up_bll _make_up = new hg_make_up_bll();
|
||
|
||
|
||
public static Dictionary<string, string> corpThread = new Dictionary<string, string>();//已有的线程
|
||
public static Dictionary<string, string> makeThread = new Dictionary<string, string>();//已有的线程
|
||
static void Main(string[] args)
|
||
{
|
||
Console.WriteLine("消息合规清洗启动=====》!");
|
||
// string content = @"【盘中分析】
|
||
//午后两市继续回落,一方面由于上方3500点套牢盘压力所致,另一方面假期因素,资金回笼资金为主,目前更多是场内存量资金博弈,短线将继续维持宽幅震荡走势
|
||
//热点方面,印度疫情发酵,刺激新冠检测、疫苗、生物制药等相关概念股走强,属于短线消息刺激,懂牛核心风口看,目前次新股和新能源汽车入选,市场热点有所退潮,操作难度加大
|
||
//目前市场唯有龙头才是最好的选择,比如懂牛软件中提前捕捉的小康股份、锦鸿集团、瑞鹄模具等等,今天均逆势涨停
|
||
//--------
|
||
//以上内容均摘自懂牛股票相关策略池、懂牛股票资讯等渠道,所有观点仅供参考,不构成操作建议。过往业绩不代表未来收益。请理性投资,控制风险,周思,投顾编号:A0100620060002";
|
||
// string key = "牛股{懂牛股票,牛股啦}";
|
||
|
||
// Console.WriteLine(content);
|
||
// Console.WriteLine(key);
|
||
// bool ss= KeyWordHelper.IsViolation(content,key);
|
||
// Console.WriteLine(ss);
|
||
// Console.WriteLine(content);
|
||
// Console.WriteLine(key);
|
||
// return;
|
||
try
|
||
{
|
||
|
||
string compaycode = ConfigHelper.GetSectionValue($"ExecService");
|
||
Console.WriteLine(compaycode);//
|
||
string[] comcodelist = compaycode.Split(',');
|
||
|
||
|
||
corpThread = new Dictionary<string, string>();
|
||
makeThread = new Dictionary<string, string>();
|
||
|
||
LogHelper.Error("消息合规清洗启动=====");
|
||
|
||
|
||
//Console.WriteLine("数据库链接:" + ConfigHelper.GetSectionValue("ConnectionStrings:crmContext"));
|
||
|
||
|
||
foreach (var comcode in comcodelist)
|
||
{
|
||
string funcconfig = ConfigHelper.GetSectionValue($"{comcode}_Config:FuncConfig");
|
||
InitDb_BLL _init_bll = new InitDb_BLL(comcode);
|
||
if (funcconfig.Contains("[QW]"))
|
||
_init_bll.InitMySqlDb();//企业微信
|
||
if (funcconfig.Contains("[RECORD]"))
|
||
_init_bll.InitMyOracleDb();//电话录音合规
|
||
if (funcconfig.Contains("[WX]"))
|
||
_init_bll.InitSQLServer();//微信数据库
|
||
|
||
MainThread manin = new MainThread() { comcode = comcode, funcconfig = funcconfig };
|
||
Thread thread = new Thread(new ThreadStart(manin.Execte));
|
||
thread.Start();
|
||
Thread.Sleep(1000);
|
||
}
|
||
}
|
||
catch (Exception e)
|
||
{
|
||
Console.WriteLine("主进程错误:" + e.ToString());
|
||
LogHelper.Error(e.ToString());
|
||
}
|
||
|
||
Console.ReadLine();
|
||
}
|
||
|
||
public static void ToFinishMan(string keyname)
|
||
{
|
||
if (corpThread.ContainsKey(keyname))
|
||
corpThread.Remove(keyname);
|
||
|
||
}
|
||
public static void ToFinishMakeUp(string keyname)
|
||
{
|
||
if (makeThread.ContainsKey(keyname))
|
||
makeThread.Remove(keyname);
|
||
|
||
}
|
||
/// <summary>
|
||
/// 随机生成字母
|
||
/// </summary>
|
||
/// <param name="Length"></param>
|
||
/// <returns></returns>
|
||
public static string GenerateRandomLetter(int Length)
|
||
{
|
||
char[] Pattern = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
||
string result = "";
|
||
int n = Pattern.Length;
|
||
Random random = new Random(~unchecked((int)DateTime.Now.Ticks));
|
||
for (int i = 0; i < Length; i++)
|
||
{
|
||
int rnd = random.Next(0, n);
|
||
result += Pattern[rnd];
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
public class DogThread
|
||
{
|
||
public string name { get; set; }
|
||
public void GoDog()
|
||
{
|
||
int times = 10;
|
||
while (times >= 0)
|
||
{
|
||
Console.WriteLine(string.Format("{0} Dog{1}程序:{2}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), name, times));
|
||
times--;
|
||
Thread.Sleep(4000);
|
||
}
|
||
}
|
||
}
|
||
public class CatThread
|
||
{
|
||
public string name { get; set; }
|
||
public void GoCat()
|
||
{
|
||
int times = 20;
|
||
while (times >= 0)
|
||
{
|
||
Console.WriteLine(string.Format("{0} Cat{1}程序:{2}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), name, times));
|
||
times--;
|
||
Thread.Sleep(3000);
|
||
}
|
||
}
|
||
}
|
||
}
|