| | |
| | | using System.Threading.Tasks; |
| | | using zhengcaioa.IService; |
| | | using zhengcaioa.Models; |
| | | using System.IdentityModel.Tokens.Jwt; |
| | | using CommonToolsCore; |
| | | |
| | | namespace zhengcaioa.Controllers |
| | | { |
| | |
| | | private readonly IUserService _userService; |
| | | private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; |
| | | private readonly ISysBaimingdanService _sysBaimingdanService; |
| | | private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService; |
| | | |
| | | public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService |
| | | , ICooperatecustomCustomerService cooperatecustomCustomerService |
| | | , ISysBaimingdanService sysBaimingdanService) |
| | | , ISysBaimingdanService sysBaimingdanService |
| | | , IFiOrderrecievemoneyService fiOrderrecievemoneyService) |
| | | { |
| | | _logger = logger; |
| | | _projectService = projectService; |
| | |
| | | _userService = userService; |
| | | _cooperatecustomCustomerService = cooperatecustomCustomerService; |
| | | _sysBaimingdanService = sysBaimingdanService; |
| | | _fiOrderrecievemoneyService = fiOrderrecievemoneyService; |
| | | } |
| | | [CheckLogin] |
| | | public IActionResult Index() |
| | |
| | | HttpResponseMessage response = client.GetAsync(address).Result; |
| | | var res = response.Content.ReadAsStringAsync().Result; |
| | | var document = parser.ParseDocument(res); |
| | | var time = document.QuerySelector("p"); |
| | | if (time != null) |
| | | if (address.StartsWith("https://zfcg.scsczt.cn/")) |
| | | { |
| | | string timestr = time.TextContent; |
| | | if (timestr.IndexOf("系统发布时间:") >= 0) |
| | | //新招标网站 |
| | | var contentList = document.All.Where(m => m.Id == "print-content"); |
| | | if (contentList != null) |
| | | { |
| | | timestr = timestr.Replace("系统发布时间:", ""); |
| | | } |
| | | projectDTO.StartTimestr = timestr; |
| | | } |
| | | var table = document.QuerySelector("table").QuerySelectorAll("tr"); |
| | | if (table != null) |
| | | { |
| | | var cDocumet = contentList.First(); |
| | | var title = cDocumet.QuerySelector("h1"); |
| | | if (title != null) |
| | | projectDTO.Name = title.TextContent.Replace("\n", "").Trim(); |
| | | |
| | | |
| | | for (int i = 0; i < table.Length; i++) |
| | | { |
| | | var select = table[i].QuerySelector("td"); |
| | | if (select != null && select.TextContent.IndexOf("项目编号") >= 0) |
| | | var time = contentList.Where(m => m.Id == "noticeTime"); |
| | | if (time != null) |
| | | { |
| | | if (table[i + 1] != null) |
| | | var time1 = contentList.First(); |
| | | var timestr = time1.QuerySelector("i"); |
| | | if (timestr != null) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | projectDTO.Number = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml |
| | | } |
| | | projectDTO.StartTimestr = timestr.TextContent; |
| | | } |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("项目名称") >= 0) |
| | | |
| | | var Numbers = cDocumet.QuerySelectorAll("h4"); |
| | | foreach(var Number in Numbers ) |
| | | { |
| | | if (table[i + 1] != null) |
| | | if(Number!=null&& Number.TextContent.Contains("项目编号")) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | projectDTO.Name = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml |
| | | } |
| | | projectDTO.Number = Number.TextContent.Replace("一、项目编号:", "").Trim(); |
| | | } |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("中标(成交)信息") >= 0) |
| | | |
| | | var Numberss = cDocumet.QuerySelectorAll("p"); |
| | | foreach (var Number in Numberss) |
| | | { |
| | | projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>(); |
| | | |
| | | if (table[i + 1] != null) |
| | | if (Number != null && Number.TextContent.Contains("项目编号")) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | projectDTO.Number = Number.TextContent.Replace("项目编号:", "").Trim(); |
| | | } |
| | | if (Number != null && Number.TextContent.Contains("预算金额")) |
| | | { |
| | | decimal caigouyusuanName = 0; |
| | | decimal.TryParse(Number.TextContent.Replace("预算金额:", "").Replace("元", "").Replace(",", "").Trim(), out caigouyusuanName); |
| | | |
| | | projectDTO.CaigouyusuanName = (caigouyusuanName/new decimal(10000)).ToString(); |
| | | } |
| | | if (Number != null && Number.TextContent.Contains("废标理由")) |
| | | { |
| | | var Fbyy = Number.QuerySelector("span"); |
| | | projectDTO.Fbyy = Fbyy.TextContent.Trim(); |
| | | } |
| | | } |
| | | var Caigourennames = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserOrgName"); |
| | | if (Caigourennames != null && Caigourennames.ToList().Count > 0) |
| | | { |
| | | var Caigourenname = Caigourennames.First(); |
| | | projectDTO.Caigourenname = Caigourenname.TextContent; |
| | | } |
| | | var Caigourenaddresss = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserOrgAddress"); |
| | | if (Caigourenaddresss != null && Caigourenaddresss.ToList().Count > 0) |
| | | { |
| | | var Caigourenaddress = Caigourenaddresss.First(); |
| | | projectDTO.Caigourenaddress = Caigourenaddress.TextContent; |
| | | } |
| | | var Caigourencontacts = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserLinkTel"); |
| | | if (Caigourencontacts != null && Caigourencontacts.ToList().Count > 0) |
| | | { |
| | | var Caigourencontact = Caigourencontacts.First(); |
| | | projectDTO.Caigourencontact = Caigourencontact.TextContent; |
| | | } |
| | | var Dailinames = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agencyName"); |
| | | if (Dailinames != null && Dailinames.ToList().Count > 0) |
| | | { |
| | | var Dailiname = Dailinames.First(); |
| | | projectDTO.Dailiname = Dailiname.TextContent; |
| | | } |
| | | var Dailiaddresss = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agentAddress"); |
| | | if (Dailiaddresss != null && Dailiaddresss.ToList().Count > 0) |
| | | { |
| | | var Dailiaddress = Dailiaddresss.First(); |
| | | projectDTO.Dailiaddress = Dailiaddress.TextContent; |
| | | } |
| | | var Dailicontacts = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agentLinkTel"); |
| | | if (Dailicontacts != null && Dailicontacts.ToList().Count > 0) |
| | | { |
| | | var Dailicontact = Dailicontacts.First(); |
| | | projectDTO.Dailicontact = Dailicontact.TextContent; |
| | | } |
| | | |
| | | var table1 = cDocumet.QuerySelectorAll("div").Where(m => m.Id == "_notice_content_noticeBidResult-noticeBidResult"); |
| | | |
| | | if (table1 != null && table1.ToList().Count > 0) |
| | | { |
| | | var table = table1.First().QuerySelectorAll("table"); |
| | | if (table != null && table.ToList().Count > 0) |
| | | { |
| | | projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>(); |
| | | for (int i = 0; i < table.Length; i++) |
| | | { |
| | | if (tds.Length > 1) |
| | | var td = table[i].QuerySelectorAll("td"); |
| | | if (td.Length >= 3) |
| | | { |
| | | string surpliername= table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | var surpliernames = surpliername.Split(','); |
| | | for(int j = 0;j< surpliernames.Length; j++) |
| | | var projectzhongbiao = new ProjectzhongbiaoDTO(); |
| | | projectzhongbiao.Names = td[0].TextContent.Trim(); |
| | | projectzhongbiao.Price = td[2].TextContent.Trim(); |
| | | projectDTO.Projectzhongbiaos.Add(projectzhongbiao); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | var zhuanjias = cDocumet.QuerySelectorAll("div").Where(m => m.ClassName == "noticeBidResult-noticeBidResult _notice_content_noticeBidResult-noticeBidResult expert dynamic-form-editor"); |
| | | if (zhuanjias != null && zhuanjias.ToList().Count > 0) |
| | | { |
| | | var zhuanjia = zhuanjias.First(); |
| | | |
| | | projectDTO.Zhuanjia = zhuanjia.TextContent.Trim();//OuterHtml |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | //旧招标网站 |
| | | var time = document.QuerySelector("p"); |
| | | if (time != null) |
| | | { |
| | | string timestr = time.TextContent; |
| | | if (timestr.IndexOf("系统发布时间:") >= 0) |
| | | { |
| | | timestr = timestr.Replace("系统发布时间:", ""); |
| | | } |
| | | projectDTO.StartTimestr = timestr; |
| | | } |
| | | var table = document.QuerySelector("table").QuerySelectorAll("tr"); |
| | | if (table != null) |
| | | { |
| | | |
| | | |
| | | for (int i = 0; i < table.Length; i++) |
| | | { |
| | | var select = table[i].QuerySelector("td"); |
| | | if (select != null && select.TextContent.IndexOf("项目编号") >= 0) |
| | | { |
| | | if (table[i + 1] != null) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | projectDTO.Number = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("项目名称") >= 0) |
| | | { |
| | | if (table[i + 1] != null) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | projectDTO.Name = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("中标(成交)信息") >= 0) |
| | | { |
| | | projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>(); |
| | | |
| | | if (table[i + 1] != null) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | if (tds.Length > 1) |
| | | { |
| | | var projectzhongbiao = new ProjectzhongbiaoDTO(); |
| | | projectzhongbiao.Names = surpliernames[j].Trim(); |
| | | //if (table[i + 2] != null) |
| | | //{ |
| | | // var tds2 = table[i + 2].QuerySelectorAll("td"); |
| | | // if (tds2 != null) |
| | | // { |
| | | // if (tds2.Length > 1) |
| | | // { |
| | | // string adress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | // var adresss = adress.Split(';'); |
| | | // if (adresss.Length == surpliernames.Length) |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j].Trim(); |
| | | // } |
| | | // else if (adresss.Length < surpliernames.Length) |
| | | // { |
| | | // if (j < adresss.Length) |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j].Trim(); |
| | | // } |
| | | // else |
| | | // { |
| | | // projectzhongbiao.Names += " "; |
| | | // } |
| | | |
| | | // } |
| | | // else if (adresss.Length % surpliernames.Length == 0) |
| | | // { |
| | | |
| | | // projectzhongbiao.Names += " " + adresss[(j + 1) * (adresss.Length / surpliernames.Length) - 1].Trim(); |
| | | |
| | | |
| | | // } |
| | | // else |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j + (adresss.Length - surpliernames.Length)].Trim(); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | if (table[i + 3] != null) |
| | | string surpliername = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | var surpliernames = surpliername.Split(','); |
| | | for (int j = 0; j < surpliernames.Length; j++) |
| | | { |
| | | var tds3 = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds3 != null) |
| | | var projectzhongbiao = new ProjectzhongbiaoDTO(); |
| | | projectzhongbiao.Names = surpliernames[j].Trim(); |
| | | //if (table[i + 2] != null) |
| | | //{ |
| | | // var tds2 = table[i + 2].QuerySelectorAll("td"); |
| | | // if (tds2 != null) |
| | | // { |
| | | // if (tds2.Length > 1) |
| | | // { |
| | | // string adress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | // var adresss = adress.Split(';'); |
| | | // if (adresss.Length == surpliernames.Length) |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j].Trim(); |
| | | // } |
| | | // else if (adresss.Length < surpliernames.Length) |
| | | // { |
| | | // if (j < adresss.Length) |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j].Trim(); |
| | | // } |
| | | // else |
| | | // { |
| | | // projectzhongbiao.Names += " "; |
| | | // } |
| | | |
| | | // } |
| | | // else if (adresss.Length % surpliernames.Length == 0) |
| | | // { |
| | | |
| | | // projectzhongbiao.Names += " " + adresss[(j + 1) * (adresss.Length / surpliernames.Length) - 1].Trim(); |
| | | |
| | | |
| | | // } |
| | | // else |
| | | // { |
| | | // projectzhongbiao.Names += " " + adresss[j + (adresss.Length - surpliernames.Length)].Trim(); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | if (table[i + 3] != null) |
| | | { |
| | | if (tds3.Length > 1) |
| | | var tds3 = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds3 != null) |
| | | { |
| | | string jine = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | var jines = jine.Split(';'); |
| | | if (jines.Length == surpliernames.Length) |
| | | if (tds3.Length > 1) |
| | | { |
| | | projectzhongbiao.Price = jines[j].Trim().Replace("中标金额","").Replace(":", "").Replace(":", "");//OuterHtml |
| | | } |
| | | else if (jines.Length < surpliernames.Length) |
| | | { |
| | | if (j < jines.Length) |
| | | string jine = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml |
| | | var jines = jine.Split(';'); |
| | | if (jines.Length == surpliernames.Length) |
| | | { |
| | | projectzhongbiao.Price = jines[j].Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | projectzhongbiao.Price = jines[j].Trim().Replace("中标金额", "").Replace(":", "").Replace(":", "");//OuterHtml |
| | | } |
| | | else if (jines.Length < surpliernames.Length) |
| | | { |
| | | if (j < jines.Length) |
| | | { |
| | | projectzhongbiao.Price = jines[j].Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | } |
| | | else |
| | | { |
| | | projectzhongbiao.Price = " "; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | projectzhongbiao.Price = " "; |
| | | if (j == 0) |
| | | { |
| | | projectzhongbiao.Price = jine.Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | } |
| | | else |
| | | { |
| | | projectzhongbiao.Price = jines[j + (jines.Length - surpliernames.Length)].Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (j == 0) |
| | | { |
| | | projectzhongbiao.Price = jine.Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | } |
| | | else |
| | | { |
| | | projectzhongbiao.Price = jines[j + (jines.Length - surpliernames.Length)].Trim().Replace("中标金额", "").Replace(":", "").Replace(":", ""); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | projectDTO.Projectzhongbiaos.Add(projectzhongbiao); |
| | | } |
| | | |
| | | projectDTO.Projectzhongbiaos.Add(projectzhongbiao); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("评审专家") >= 0) |
| | | { |
| | | if (table[i + 1] != null) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | string ssss = table[i + 1].QuerySelector("td").TextContent.Trim(); |
| | | ssss = ssss.Replace("(组长)", "").Replace("(组长)", "").Replace(",", "、").Replace("(评审组长)", "").Replace("(评审组长)", "").Replace(";", "、").Replace("评审组长:", "").Replace("组长:", "").Replace("组员:", ""); |
| | | projectDTO.Zhuanjia = ssss;//OuterHtml |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (table[i] != null && table[i].TextContent.IndexOf("采购人信息") >= 0) |
| | | { |
| | | //StringBuilder remark = new StringBuilder(); |
| | | // remark.Append("采购人信息:"); |
| | | if (table[i + 1] != null) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourenname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 2] != null) |
| | | { |
| | | var tds = table[i + 2].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourenaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 3] != null) |
| | | { |
| | | var tds = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourencontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | // remark.Append(" \n"); |
| | | // projectDTO.Remark = remark.ToString(); |
| | | } |
| | | |
| | | else if (table[i] != null && table[i].TextContent.IndexOf("采购代理机构信息") >= 0) |
| | | { |
| | | // StringBuilder remark = new StringBuilder(); |
| | | // remark.Append("采购代理机构信息:"); |
| | | if (table[i + 1] != null) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailiname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | } |
| | | if (table[i + 2] != null) |
| | | { |
| | | var tds = table[i + 2].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailiaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 3] != null) |
| | | { |
| | | var tds = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | //remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailicontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | //remark.Append(" "); |
| | | } |
| | | // remark.Append(" \n"); |
| | | //if (string.IsNullOrEmpty(projectDTO.Remark)) |
| | | //{ |
| | | // projectDTO.Remark = remark.ToString(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // projectDTO.Remark += remark.ToString(); |
| | | //} |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if (select != null && select.TextContent.IndexOf("评审专家") >= 0) |
| | | { |
| | | if (table[i + 1] != null) |
| | | { |
| | | var td1 = table[i + 1].QuerySelector("td"); |
| | | if (td1 != null) |
| | | { |
| | | string ssss = table[i + 1].QuerySelector("td").TextContent.Trim(); |
| | | ssss = ssss.Replace("(组长)", "").Replace("(组长)", "").Replace(",", "、").Replace("(评审组长)", "").Replace("(评审组长)", "").Replace(";", "、").Replace("评审组长:", "").Replace("组长:", "").Replace("组员:",""); |
| | | projectDTO.Zhuanjia = ssss;//OuterHtml |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (table[i] != null && table[i].TextContent.IndexOf("采购人信息") >= 0) |
| | | { |
| | | //StringBuilder remark = new StringBuilder(); |
| | | // remark.Append("采购人信息:"); |
| | | if (table[i + 1] != null) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourenname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 2] != null) |
| | | { |
| | | var tds = table[i + 2].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourenaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 3] != null) |
| | | { |
| | | var tds = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Caigourencontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | // remark.Append(" \n"); |
| | | // projectDTO.Remark = remark.ToString(); |
| | | } |
| | | |
| | | else if (table[i] != null && table[i].TextContent.IndexOf("采购代理机构信息") >= 0) |
| | | { |
| | | // StringBuilder remark = new StringBuilder(); |
| | | // remark.Append("采购代理机构信息:"); |
| | | if (table[i + 1] != null) |
| | | { |
| | | var tds = table[i + 1].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailiname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | } |
| | | if (table[i + 2] != null) |
| | | { |
| | | var tds = table[i + 2].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailiaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | // remark.Append(" "); |
| | | } |
| | | if (table[i + 3] != null) |
| | | { |
| | | var tds = table[i + 3].QuerySelectorAll("td"); |
| | | if (tds != null) |
| | | { |
| | | //remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml) |
| | | if (tds.Length > 1) |
| | | { |
| | | // remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml) |
| | | projectDTO.Dailicontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim(); |
| | | } |
| | | } |
| | | //remark.Append(" "); |
| | | } |
| | | // remark.Append(" \n"); |
| | | //if (string.IsNullOrEmpty(projectDTO.Remark)) |
| | | //{ |
| | | // projectDTO.Remark = remark.ToString(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // projectDTO.Remark += remark.ToString(); |
| | | //} |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return JsonConvert.SerializeObject(projectDTO); |
| | | |
| | |
| | | |
| | | try |
| | | { |
| | | string userid = ""; |
| | | var headers = Request.Headers; |
| | | if (headers != null) |
| | | { |
| | | //string SecurityKey = _configuration.GetSection("SecurityKey").Value; |
| | | var keyId = headers["Authorization"].FirstOrDefault(); |
| | | if (string.IsNullOrEmpty("keyId")) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "没有获取到权限信息"; |
| | | returnMsg.count = 0; |
| | | |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | |
| | | |
| | | JwtSecurityToken jwt = null; |
| | | var handler = new JwtSecurityTokenHandler(); |
| | | var key1 = keyId.Replace("Bearer", "").Trim(); |
| | | jwt = handler.ReadJwtToken(key1); |
| | | System.Security.Claims.Claim sss = jwt.Claims.Where(x => x.Type == "id").FirstOrDefault(); |
| | | userid = sss.Value; |
| | | |
| | | System.Security.Claims.Claim act = jwt.Claims.Where(x => x.Type == "act").FirstOrDefault(); |
| | | AesClass aesClass = new AesClass(); |
| | | RuleCollection ruleCollection = aesClass.DecryptRules(act.Value); |
| | | //判断是否有永久对手分析权限 |
| | | FiOrderrecievemoneyDTOSearch searchs = new FiOrderrecievemoneyDTOSearch(); |
| | | searchs.page = 1; |
| | | searchs.rows = 10000; |
| | | searchs.Fkzt = "03"; |
| | | searchs.OrderType = "02"; |
| | | searchs.StartTime = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd HH:mm:ss"); |
| | | searchs.EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | searchs.HuiyuanId = userid; |
| | | searchs.OrderType1 = "竞争对手和评审专家参加政府采购数据信息查询"; |
| | | ResultDataEntity<FiOrderrecievemoneyDTO> resultDataEntitys = _fiOrderrecievemoneyService.SearchByPaging(searchs); |
| | | if (resultDataEntitys.DataList ==null || resultDataEntitys.DataList.Count == 0) |
| | | //if (resultDataEntitys.DataList.Count > 0) |
| | | { |
| | | string token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1; |
| | | if (ruleCollection.ZXDSFXLS > 0) |
| | | //if (ruleCollection.ZXDSFXLS == 0) |
| | | { |
| | | DateTime yuechu = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); |
| | | var zxdsfxlDTOs = _projectService.GetListZxdsfxl(userid, yuechu, yuechu.AddMonths(1),"1").OrderByDescending(x => x.Visittime).ToList(); |
| | | |
| | | if (zxdsfxlDTOs.Count > 30) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本月30次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | else if (zxdsfxlDTOs.Count == 30 && zxdsfxlDTOs[0].Visittime.Value.Day != DateTime.Now.Day) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本月30次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | var zxdsfxlDTOsnowdate = zxdsfxlDTOs.Where(x => x.Visittime >= DateTime.Now.Date && x.Visittime < DateTime.Now.AddDays(1).Date).OrderByDescending(x=>x.Visittime).ToList(); |
| | | if (zxdsfxlDTOsnowdate.Count > 2) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本日2次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | else if (zxdsfxlDTOsnowdate.Count == 2) |
| | | { |
| | | |
| | | TimeSpan ts2 = new TimeSpan(zxdsfxlDTOsnowdate[0].Visittime.Value.Ticks); |
| | | TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks); |
| | | TimeSpan timeLoop = ts1.Subtract(ts2).Duration(); |
| | | if (timeLoop.TotalMinutes > 15) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本日2次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | else if (token != zxdsfxlDTOsnowdate[0].Token/* && zxdsfxlDTOs.Count == 30*/) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本日2次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | } |
| | | else if(zxdsfxlDTOsnowdate.Count == 1) |
| | | { |
| | | |
| | | TimeSpan ts2 = new TimeSpan(zxdsfxlDTOsnowdate[0].Visittime.Value.Ticks); |
| | | TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks); |
| | | TimeSpan timeLoop = ts1.Subtract(ts2).Duration(); |
| | | if (token== zxdsfxlDTOsnowdate[0].Token && timeLoop.TotalMinutes > 15) |
| | | { |
| | | Response.StatusCode = 401;//重新登陆 |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本次访问时间已经超过15分钟,请重新登陆!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | else if(token != zxdsfxlDTOsnowdate[0].Token && zxdsfxlDTOs.Count == 30) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你本月30次测试机会已经用完!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | } |
| | | if ( token != zxdsfxlDTOsnowdate[0].Token) |
| | | { |
| | | //存储本次的访问信息 |
| | | ZxdsfxlDTO zxdsfxlDTO = new ZxdsfxlDTO(); |
| | | //zxdsfxlDTO.Id = Guid.NewGuid().ToString() ; |
| | | zxdsfxlDTO.Huiyuanid = userid; |
| | | zxdsfxlDTO.Huiyuanname = ruleCollection.User; |
| | | zxdsfxlDTO.Visittime = DateTime.Now; |
| | | zxdsfxlDTO.Token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1; |
| | | zxdsfxlDTO.Leixing = "1"; |
| | | zxdsfxlDTO.RecStatus = "A"; |
| | | zxdsfxlDTO.Creater = "1"; |
| | | zxdsfxlDTO.Createtime = zxdsfxlDTO.Visittime.Value; |
| | | zxdsfxlDTO.Modifier = "1"; |
| | | zxdsfxlDTO.Modifytime = zxdsfxlDTO.Visittime.Value; |
| | | ResultEntity resultEntity = _projectService.saveZxdsfxl(zxdsfxlDTO); |
| | | if (resultEntity.Result == false) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "访问失败"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你没有权限访问竞争对手分析"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "你没有登录!"; |
| | | returnMsg.count = 0; |
| | | return new JsonResult(returnMsg); |
| | | } |
| | | //search.page = 1; |
| | | //search.rows = 1; |
| | | ResultDataEntity<ProjectDTO> resultDataEntity = _projectService.SearchByPaging(search); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | returnMsg.code = 2; |
| | | returnMsg.error = "没有获取到token"; |
| | | returnMsg.error = "系统发生错误"; |
| | | returnMsg.count = 0; |
| | | |
| | | } |