username@email.com
2023-01-05 e7b84fe17bca18fe7715c2078883fe0999a296d6
提交
4个文件已修改
267 ■■■■ 已修改文件
zhengcaioa/Crawler/Program.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Crawler/sichuan/CcgpSichuanoperation.cs 250 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Crawler/Program.cs
@@ -24,7 +24,7 @@
        public static string connection = @"server=172.26.97.184;database=WebCrawler;uid=sa;pwd=Za20222812;";
        public static string connection1 = @"server=172.26.97.184;database=zhengcaioa;uid=sa;pwd=Za20222812;";
        public static string api_domain = "http://localhost:9200";
        public static string api_domain = "http://172.26.97.184:9200";
        static void Main(string[] args)
        {
@@ -203,7 +203,7 @@
                //获取中国政采网的四川政采数据
                CcgpSichuanoperation.operations(cccontext);
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                Thread.CurrentThread.Join(1000 * 60 * 10);//阻止设定时间
            }
        }
zhengcaioa/Crawler/sichuan/CcgpSichuanoperation.cs
@@ -19,133 +19,139 @@
        {
            try
            {
                //获取更新时间
                string operationStartTime = "";
                string operationEndTime = "";
                Updatetime updatetime = _ccontext.Updatetimes.Where(x => x.Sheng == "中国政采网四川省").FirstOrDefault();
                if (updatetime != null)
                logg.WriteLog("开始判断时间", "中国政采网四川省");
                if (DateTime.Now.Hour == 0 )
                {
                    operationStartTime = updatetime.Updatetime1.ToString("yyyy-MM-dd");
                    operationEndTime = DateTime.Now.ToString("yyyy-MM-dd");
                    //updatetime.Updatetime1 = DateTime.Now.AddDays(-1);
                    //_ccontext.SaveChanges();
                    DateTime datenow = DateTime.Now.Date;
                    Updatetime updatetime = _ccontext.Updatetimes.Where(x => x.Sheng == "中国政采网四川省").FirstOrDefault();
                    logg.WriteLog("datenow="+datenow.ToString("yyyy-MM-dd HH:mm:ss"), "中国政采网四川省");
                    operationStartTime = datenow.AddDays(-1).ToString("yyyy-MM-dd");
                    operationEndTime = datenow.AddDays(-1).ToString("yyyy-MM-dd");
                    logg.WriteLog("operationStartTime=" + operationStartTime, "中国政采网四川省");
                    logg.WriteLog("operationEndTime=" + operationEndTime, "中国政采网四川省");
                    var currPage = 1;
                    string sichuanpageurll = "";
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 意向公开
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=9&dbselect=bidx&kw=%E6%84%8F%E5%90%91&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省意向公开 开始获取", "中国政采网四川省");
                    yixianggonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                    logg.WriteLog("中国政采网四川省意向公开 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 公开招标
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=1&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 公开招标 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "1", "公开招标");
                    logg.WriteLog("中国政采网四川省采购公告 公开招标 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 询价
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=2&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 询价 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "4", "询价");
                    logg.WriteLog("中国政采网四川省采购公告 询价 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 竞争性谈判
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=3&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 竞争性谈判 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "5", "竞争性谈判");
                    logg.WriteLog("中国政采网四川省采购公告 竞争性谈判 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 单一来源
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=4&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 单一来源 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "7", "单一来源");
                    logg.WriteLog("中国政采网四川省采购公告 单一来源 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 邀请招标
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=6&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 邀请招标 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "2", "邀请招标");
                    logg.WriteLog("中国政采网四川省采购公告 邀请招标 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 竞争性磋商
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=10&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省采购公告 竞争性磋商 开始获取", "中国政采网四川省");
                    caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "3", "竞争性磋商");
                    logg.WriteLog("中国政采网四川省采购公告 竞争性磋商 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 中标公告
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=7&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省中标公告 开始获取", "中国政采网四川省");
                    zhongbiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                    logg.WriteLog("中国政采网四川省中标公告 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 成交公告
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=11&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省成交公告 开始获取", "中国政采网四川省");
                    zhongbiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                    logg.WriteLog("中国政采网四川省成交公告 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 更正公告
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=8&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省更正公告 开始获取", "中国政采网四川省");
                    gengzhenggonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                    logg.WriteLog("中国政采网四川省更正公告 开始获取结束", "中国政采网四川省");
                    #endregion
                    //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                    #region 废标公告
                    currPage = 1;
                    sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=12&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                    logg.WriteLog("中国政采网四川省废标公告 开始获取", "中国政采网四川省");
                    feibiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                    logg.WriteLog("中国政采网四川省废标公告 开始获取结束", "中国政采网四川省");
                    #endregion
                    //保存最后更新时间
                    if (updatetime != null)
                    {
                        updatetime.Updatetime1 = datenow;
                        _ccontext.SaveChanges();
                    }
                    else
                    {
                        updatetime = new Updatetime();
                        updatetime.Id = Guid.NewGuid().ToString();
                        updatetime.Sheng = "中国政采网四川省";
                        updatetime.Updatetime1 = datenow;
                        _ccontext.Updatetimes.Add(updatetime);
                        _ccontext.SaveChanges();
                    }
                    Thread.CurrentThread.Join(1000 * 60 * 60);//阻止设定时间
                }
                else
                {
                    operationStartTime = "2021-12-01"; //DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
                    operationEndTime = "2022-12-01";//DateTime.Now.ToString("yyyy-MM-dd");
                }
                var currPage = 1;
                string sichuanpageurll = "";
                //Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 意向公开
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=9&dbselect=bidx&kw=%E6%84%8F%E5%90%91&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省意向公开 开始获取", "中国政采网四川省");
                yixianggonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                logg.WriteLog("中国政采网四川省意向公开 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 公开招标
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=1&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 公开招标 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "1", "公开招标");
                logg.WriteLog("中国政采网四川省采购公告 公开招标 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 询价
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=2&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 询价 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "4", "询价");
                logg.WriteLog("中国政采网四川省采购公告 询价 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 竞争性谈判
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=3&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 竞争性谈判 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "5", "竞争性谈判");
                logg.WriteLog("中国政采网四川省采购公告 竞争性谈判 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 单一来源
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=4&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 单一来源 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "7", "单一来源");
                logg.WriteLog("中国政采网四川省采购公告 单一来源 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 邀请招标
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=6&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 邀请招标 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "2", "邀请招标");
                logg.WriteLog("中国政采网四川省采购公告 邀请招标 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 竞争性磋商
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=10&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省采购公告 竞争性磋商 开始获取", "中国政采网四川省");
                caigougonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage, "3", "竞争性磋商");
                logg.WriteLog("中国政采网四川省采购公告 竞争性磋商 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 中标公告
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=7&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省中标公告 开始获取", "中国政采网四川省");
                zhongbiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                logg.WriteLog("中国政采网四川省中标公告 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 成交公告
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=11&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省成交公告 开始获取", "中国政采网四川省");
                zhongbiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                logg.WriteLog("中国政采网四川省成交公告 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 更正公告
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=8&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省更正公告 开始获取", "中国政采网四川省");
                gengzhenggonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime, currPage);
                logg.WriteLog("中国政采网四川省更正公告 开始获取结束", "中国政采网四川省");
                #endregion
                Thread.CurrentThread.Join(1000 * 60 * 30);//阻止设定时间
                #region 废标公告
                currPage = 1;
                sichuanpageurll = "http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=1&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=12&dbselect=bidx&kw=&start_time=&end_time=&timeType=6&displayZone=%E5%9B%9B%E5%B7%9D&zoneId=51&pppStatus=&agentName=";
                logg.WriteLog("中国政采网四川省废标公告 开始获取", "中国政采网四川省");
                feibiaogonggao(_ccontext, sichuanpageurll, operationStartTime, operationEndTime , currPage);
                logg.WriteLog("中国政采网四川省废标公告 开始获取结束", "中国政采网四川省");
                #endregion
                //保存最后更新时间
                if (updatetime != null)
                {
                    updatetime.Updatetime1 = DateTime.Now.AddDays(-1);
                    _ccontext.SaveChanges();
                }
                else
                {
                    updatetime = new Updatetime();
                    updatetime.Id = Guid.NewGuid().ToString();
                    updatetime.Sheng = "中国政采网四川省";
                    updatetime.Updatetime1 = DateTime.Now.AddDays(-1);
                    _ccontext.Updatetimes.Add(updatetime);
                    _ccontext.SaveChanges();
                }
                //datenow = DateTime.Now.Date.AddDays(1);
            }
            catch (Exception ex)
            {
zhengcaioa/zhengcaioa/Timer/TimedBackgroundService.cs
@@ -104,10 +104,7 @@
                    try
                    {
                        _logger.LogInformation("把超过90天还没有转化的档案客户的业务经理归为无");
                        this.ywjlguiling();
                        _logger.LogInformation("把超过90天还没有转化的档案客户的业务经理归为无执行结束");
                        _logger.LogInformation("判断是否是第五个工作日结束");
                        DateTime diwutian = this.diwugongzuori();
@@ -139,6 +136,12 @@
                        {
                            jisuangonglinggongzi();
                        }
                        _logger.LogInformation("把超过90天还没有转化的档案客户的业务经理归为无");
                        this.ywjlguiling();
                        _logger.LogInformation("把超过90天还没有转化的档案客户的业务经理归为无执行结束");
                    }
                    catch (Exception ex)
                    {
zhengcaioa/zhengcaioa/appsettings.json
@@ -13,7 +13,7 @@
    }
  },
  "AllowedHosts": "*",
  "Elasticsearchurl": "http://localhost:9200",
  "Elasticsearchurl": "http://172.26.97.184:9200",
  "SecurityKey": "superSecretKey@345",
  "Shuchengurl": "http://47.108.235.38:8085",
  "GetShopUsers": "/actionapi/Shop/GetShopUsers",