/// <summary> /// 进货单打印 /// </summary> /// <param name="ssql"></param> /// <returns></returns> public bool JHinto(int category_id, string title, string zhaiyao, string content, string add_time, string zhuzai) { string gsql = "insert into dt_article(channel_id,category_id,call_index,title,link_url,img_url,seo_title,seo_keywords,seo_description,zhaiyao,content,sort_id,click,status,groupids_view,vote_id,is_top,is_red,is_hot,is_slide,is_sys,is_msg,user_name,add_time,update_time)values(1," + category_id + ",'','" + title + "','','','" + title + "','','','" + zhaiyao + "','" + content + "',99,0,0,'',0,0,0,0,0,1,1,'admin','" + add_time + "',NULL)"; int PU = Ms.IntExeSQLNonQuery(gsql); string Sql = "insert into dt_article_attribute_value([article_id],[source],[author])values(" + PU + ",'" + zhuzai + "','" + zhuzai + "')"; return(Ms.ExeSQLNonQuery(Sql)); }
private void button4_Click(object sender, EventArgs e) { string IshopItemID = this.comboBox1.Text; string delSql1 = "delete from hqUVList where ItemID='" + IshopItemID + "'"; string delSql2 = "delete from hqUVListCUS where ItemID='" + IshopItemID + "'"; string delSql3 = "delete from hqKeywordList where ItemID='" + IshopItemID + "'"; string delSql4 = "delete from hqKeywordListCUS where ItemID='" + IshopItemID + "'"; Ms.ExeSQLNonQuery(delSql1); Ms.ExeSQLNonQuery(delSql2); Ms.ExeSQLNonQuery(delSql3); Ms.ExeSQLNonQuery(delSql4); string Sql = "SELECT DISTINCT ItemID FROM dbo.hqUVListCUS"; comboBox1.DisplayMember = "ItemID"; //控件显示的列名 comboBox1.ValueMember = "ItemID"; //控件值的列名 comboBox1.DataSource = Ms.runSQLDataSet(Sql, "ss").Tables[0]; }
public void GetshopCar(string URLA) { string KCDateTime = DateTime.Now.ToString("yyyy-MM-dd"); PostServer.Getcookie = FPPcokk.ToString(); //22m^2 // string strpayRateIndex = "https://sycm.taobao.com/mc/mq/mkt/rank/item/hotpurpose.json?dateRange=" + KCDateTime + "%7C" + KCDateTime + "&dateType=day&pageSize=50&page=1&order=desc&orderBy=cartHits&cateId=350404&device=0&sellerType=-1&indexCode=cateRankId%2CcltHits%2CcartHits%2CtradeIndex&_=1536297303197&token="; PostServer.GetHTTPTaobao(URLA); string txpayRateIndex = PostServer.GetHtml; JObject json = (JObject)JsonConvert.DeserializeObject(txpayRateIndex); string zone = json["data"]["data"].ToString(); // ShowInfo(zone); JArray results = JArray.Parse(zone); for (int i = 0; i < results.Count; i++) { string citemid, ctitle, cuvIndex, cpicUrl; citemid = results[i]["itemId"].ToString(); ctitle = results[i]["shopName"].ToString(); cuvIndex = results[i]["payItmCnt"].ToString(); cpicUrl = "https:" + results[i]["picUrl"].ToString(); string Sql = "INSERT INTO [Dp_shopindex]([ItemID],[shopname],[uvIndex],[indexdate],[picUrl])VALUES('" + citemid + "','" + ctitle + "'," + Math.Ceiling(decimal.Parse(cuvIndex)) + ",'" + CDateTime + "','" + cpicUrl + "')"; Ms.ExeSQLNonQuery(Sql); } }
public void Getshopindex() { DateTime BegDate = this.txtbegdate.Value; DateTime EndDate = this.txtenddate.Value; double ts2 = EndDate.Subtract(BegDate).TotalDays; string cItemid = txtItemID.Text; string ccateId = txtcateId.Text; for (int i = 0; i < ts2; i++) { Thread.Sleep(5000); string KeUrl = "https://sycm.taobao.com/mc/rivalItem/analysis/getFlowSource.json?device=2&cateId=" + ccateId + "&selfItemId=" + cItemid + "&dateType=day&dateRange=" + BegDate.AddDays(i).ToString("yyyy-MM-dd") + "%7C" + BegDate.AddDays(i).ToString("yyyy-MM-dd") + "&indexCode=payByrCntIndex&orderBy=payByrCntIndex&order=desc&_=1537104746274&token="; PostServer.Getcookie = FPPcokk.ToString(); PostServer.GetHTTPTaobao(KeUrl); string txpayRateIndex = PostServer.GetHtml; JObject json = (JObject)JsonConvert.DeserializeObject(txpayRateIndex); string zone = json["data"].ToString(); JArray results = JArray.Parse(zone); for (int j = 0; j < results.Count; j++) { decimal aa = decimal.Parse(results[j]["selfItemPayByrCntIndex"]["value"].ToString()); // ShowInfo("值:" + aa.ToString()); decimal bb = Math.Round(aa, 0); //; decimal cc = decimal.Parse(results[j]["selfItemPayByrCnt"]["value"].ToString()); string Sql = "INSERT INTO [DP_Num]([inNum],[outNum],[typeid])VALUES(" + bb + "," + cc + ",1)"; Ms.ExeSQLNonQuery(Sql); } } string Sqll = "Delete from DP_Num where outNum=0"; Ms.ExeSQLNonQuery(Sqll); }
/// <summary> /// 清空数据 /// </summary> /// <param name="IshopItemID"></param> public void DelUVTom(string IshopItemID) { string delSql1 = "delete from hqUVList where ItemID='" + IshopItemID + "'"; string delSql2 = "delete from hqUVListCUS where ItemID='" + IshopItemID + "'"; string delSql3 = "delete from hqKeywordList where ItemID='" + IshopItemID + "'"; string delSql4 = "delete from hqKeywordListCUS where ItemID='" + IshopItemID + "'"; Ms.ExeSQLNonQuery(delSql1); Ms.ExeSQLNonQuery(delSql2); Ms.ExeSQLNonQuery(delSql3); Ms.ExeSQLNonQuery(delSql4); }
private void button2_Click(object sender, EventArgs e) { string Sqldel = "delete from hqKeyword where ItemID='" + CItemid + "' and DItemdate='" + CDateTime + "'"; Ms.ExeSQLNonQuery(Sqldel); }
/// <summary> /// 大盘行情指数 /// </summary> public void getallList() { int HourNumber = DateTime.Now.Hour; DataTable shoptable = new DataTable(); string Sqlshop = "SELECT distinct top 70 [ItemID] ,[shopname],[uvIndex] ,[indexdate] FROM [Dp_shopindex] where indexdate='" + CDateTime + "' order by uvIndex desc"; shoptable = Ms.runSQLDataSet(Sqlshop, "ss").Tables[0]; string Sqldels = "delete from DPrivalItem where getdate='" + CDateTime + "'"; Ms.ExeSQLNonQuery(Sqldels); string SqlPE = "delete from DayDPAllListNumber where DItemdate='" + CDateTime + "' and daytypeid=" + 0 + ""; Ms.ExeSQLNonQuery(SqlPE); foreach (DataRow keydr in shoptable.Rows) { PostServer.Getcookie = FPPcokk.ToString(); string CcateId, CItemid, CshopName; CItemid = keydr["itemid"].ToString(); CshopName = keydr["shopname"].ToString(); CcateId = "50012100"; try { string strpayRateIndex = "https://sycm.taobao.com/mc/rivalItem/analysis/getLiveCoreIndexes.json?dateType=today&dateRange=" + CDateTime + "%7C" + CDateTime + "&device=2&cateId=" + CcateId + "&rivalItem1Id=" + CItemid + "&_=1535966409385&token="; PostServer.GetHTTPTaobaoTID(strpayRateIndex, TTid, "https://sycm.taobao.com/mc/ci/item/analysis?"); // PostServer.GetHTTPTaobao(strpayRateIndex); string txpayRateIndex = PostServer.GetHtml; JObject EJson = (JObject)JsonConvert.DeserializeObject(txpayRateIndex); string strJson = EJson["data"].ToString(); Etrace EtrJson = new Etrace(); string ToJson = EtrJson.stringJson(strJson); JObject json = (JObject)JsonConvert.DeserializeObject(ToJson); decimal cartHits = 0; decimal cltHits = 0; decimal payItemCnt = 0; decimal payRateIndex = 0; decimal seIpvUvHits = 0; decimal tradeIndex = 0; decimal uvIndex = 0; string itemid = "2342323423"; string shopName = "景宏"; cartHits = decimal.Parse(json["data"]["rivalItem1"]["cartHits"]["value"].ToString()); cltHits = decimal.Parse(json["data"]["rivalItem1"]["cltHits"]["value"].ToString()); payItemCnt = decimal.Parse(json["data"]["rivalItem1"]["payItemCnt"]["value"].ToString()); payRateIndex = decimal.Parse(json["data"]["rivalItem1"]["payRateIndex"]["value"].ToString()); seIpvUvHits = decimal.Parse(json["data"]["rivalItem1"]["seIpvUvHits"]["value"].ToString()); tradeIndex = decimal.Parse(json["data"]["rivalItem1"]["tradeIndex"]["value"].ToString()); uvIndex = decimal.Parse(json["data"]["rivalItem1"]["uvIndex"]["value"].ToString()); itemid = CItemid; shopName = CshopName; string SqlB = "INSERT INTO [DayDPAllListNumber]([shopName],[HouNumber],[typeID],[ItemID],[DItemdate],[daytypeid])VALUES('" + CItemid + shopName + "'," + payItemCnt + ",'今日','" + itemid + "','" + CDateTime + "'," + 0 + ")"; Ms.ExeSQLNonQuery(SqlB); string SqlC = "INSERT INTO [DayDPAllListNumber]([shopName],[HouNumber],[typeID],[ItemID],[DItemdate],[daytypeid])VALUES('" + CItemid + shopName + "'," + uvIndex + ",'流量指数','" + itemid + "','" + CDateTime + "'," + 0 + ")"; Ms.ExeSQLNonQuery(SqlC); string SqlD = "INSERT INTO [DayDPAllListNumber]([shopName],[HouNumber],[typeID],[ItemID],[DItemdate],[daytypeid])VALUES('" + CItemid + shopName + "'," + cartHits + ",'加购人气','" + itemid + "','" + CDateTime + "'," + 0 + ")"; Ms.ExeSQLNonQuery(SqlD); } catch (Exception) { label2.Text = CItemid + "-"; //MessageBox.Show(CItemid); } } }
/// <summary> /// 成交和指数 /// </summary> public void getai() { int HourNumber = DateTime.Now.Hour; DataTable shoptable = new DataTable(); string Sqlshop = "select itemid,shopname,IDshopName from dp_shop"; shoptable = Ms.runSQLDataSet(Sqlshop, "ss").Tables[0]; foreach (DataRow keydr in shoptable.Rows) { try { PostServer.Getcookie = FPPcokk.ToString(); string CcateId, CItemid, CshopName; CItemid = keydr["itemid"].ToString(); CshopName = keydr["itemid"].ToString() + keydr["shopname"].ToString(); CcateId = "50012100"; string strpayRateIndex = "https://sycm.taobao.com/mc/rivalItem/analysis/getLiveCoreTrend.json?dateType=today&dateRange=" + CDateTime + "%7C" + CDateTime + "&indexCode=&device=2&cateId=" + CcateId + "&rivalItem1Id=" + CItemid + "&_=1535966409385&token="; // string strpayRateIndex = "https://sycm.taobao.com/mc/rivalItem/analysis/getLiveCoreTrend.json?dateRange=" + CDateTime + "%7C" + CDateTime + "&dateType=today&device=2&sellerType=0&cateId=" + CcateId + "&itemId=" + CItemid + "&topType=flow&indexCode=uv&_=1535778429590&token="; Thread.Sleep(5000); PostServer.GetHTTPTaobaoTID(strpayRateIndex, TTid); string txpayRateIndex = PostServer.GetHtml; JObject EJson = (JObject)JsonConvert.DeserializeObject(txpayRateIndex); string strJson = EJson["data"].ToString(); Etrace EtrJson = new Etrace(); string ToJson = EtrJson.stringJson(strJson); // PostServer.GetHTTPTaobao(strpayRateIndex); // string txpayRateIndex = PostServer.GetHtml; JObject json = (JObject)JsonConvert.DeserializeObject(ToJson); for (int j = 0; j <= 6; j++) { //支付转化指数 string typeIDstr = ""; string jsonpayRateIndex = ""; if (j == 0) { jsonpayRateIndex = json["data"]["rivalItem1"]["cartHits"].ToString(); typeIDstr = "cartHits"; } if (j == 1) { jsonpayRateIndex = json["data"]["rivalItem1"]["cltHits"].ToString(); typeIDstr = "cltHits"; } if (j == 2) { jsonpayRateIndex = json["data"]["rivalItem1"]["payItemCnt"].ToString(); typeIDstr = "payItemCnt"; } if (j == 3) { jsonpayRateIndex = json["data"]["rivalItem1"]["payRateIndex"].ToString(); typeIDstr = "payRateIndex"; } if (j == 4) { jsonpayRateIndex = json["data"]["rivalItem1"]["seIpvUvHits"].ToString(); typeIDstr = "seIpvUvHits"; } if (j == 5) { jsonpayRateIndex = json["data"]["rivalItem1"]["tradeIndex"].ToString(); typeIDstr = "tradeIndex"; } if (j == 6) { jsonpayRateIndex = json["data"]["rivalItem1"]["uvIndex"].ToString(); typeIDstr = "uvIndex"; } //删除 string Sqldel = " delete from Dpnumber where ItemID='" + CItemid + "' and typeid='" + typeIDstr + "'"; Ms.ExeSQLNonQuery(Sqldel); //ShowInfo(jsonpayRateIndex); JArray payRateIndexJArray = JArray.Parse(jsonpayRateIndex); for (int i = 0; i < payRateIndexJArray.Count; i++) { decimal NumberPayRate = 0; if (payRateIndexJArray[i].ToString() != "") { NumberPayRate = Math.Ceiling(decimal.Parse(payRateIndexJArray[i].ToString())); } else { NumberPayRate = 0; } string Sql = "INSERT INTO [DPNumber]([shopName],[DateHour],[HouNumber],[typeID],[ItemID],[DItemdate])VALUES('" + CshopName + "'," + i + "," + NumberPayRate + ",'" + typeIDstr + "','" + CItemid + "','" + CDateTime + "')"; Ms.ExeSQLNonQuery(Sql); } } } catch (Exception) { throw; } } this.ultraGridcnt.DataSource = Ms.runSQLDataSet(txtSql(CDateTime, "payItemCnt").ToString(), "ss").Tables[0]; //this.ultraGrid2.DataSource = Ms.runSQLDataSet(txtSql(CDateTime, "uvIndex").ToString(), "ss").Tables[0]; //this.ultraGrid5.DataSource = Ms.runSQLDataSet(txtSql(CDateTime, "cartHits").ToString(), "ss").Tables[0]; this.ultraGrid3.DataSource = Ms.runSQLDataSet(txtSql(CDateTime, "payRateIndex").ToString(), "ss").Tables[0]; ultraGridcnt.DisplayLayout.Bands[0].Columns["shopname"].Header.Fixed = true; //ultraGrid2.DisplayLayout.Bands[0].Columns["shopname"].Header.Fixed = true; //ultraGrid5.DisplayLayout.Bands[0].Columns["shopname"].Header.Fixed = true; ultraGrid3.DisplayLayout.Bands[0].Columns["shopname"].Header.Fixed = true; ultraGridcnt.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; ultraGridcnt.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].Header.Appearance.ForeColor = Color.Red; //ultraGrid2.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; //ultraGrid2.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].Header.Appearance.ForeColor = Color.Red; //ultraGrid5.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; //ultraGrid5.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].Header.Appearance.ForeColor = Color.Red; //ultraGrid3.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; //ultraGrid3.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].Header.Appearance.ForeColor = Color.Red; }
public void getai() { // GetCook(); int HourNumber = DateTime.Now.Hour; PostServer.Getcookie = FPPcokk.ToString(); //空调扇 string KKurl = "https://sycm.taobao.com/ipoll/live/industry/showTopItems.json?cateId=50017589&cateLevel=2&device=0&limit=100&page=1&seller=-1&size=50&token=9592cec50&_=1532944703615"; //蒸气刷 string KKurl = "https://sycm.taobao.com/ipoll/live/industry/showTopItems.json?cateId=50008553&cateLevel=2&device=0&limit=100&page=1&seller=-1&size=50&token=9592cec50&_=1532944703615"; //女童装 string KKurl = "https://sycm.taobao.com/ipoll/live/industry/showTopItems.json?cateId=50010518&cateLevel=2&device=0&limit=100&page=1&seller=-1&size=50&token=9592cec50&_=1532944703615"; string KKurl = "https://sycm.taobao.com/ipoll/live/industry/showTopItems.json?cateId=350404&cateLevel=2&device=0&limit=100&page=1&seller=-1&size=50&token=9592cec50&_=1532944703615"; PostServer.GetHTTPTaobao(KKurl); string gHtml = PostServer.GetHtml; // ShowInfo(gHtml); // Thread.Sleep(10000); JObject json = (JObject)JsonConvert.DeserializeObject(gHtml); string zone = json["data"]["data"]["topDatas"]["list"].ToString(); string zone1 = json["data"]["data"]["watchDatas"].ToString(); DataTable dts = JsonConvert.DeserializeObject <DataTable>(zone); DataTable dts1 = JsonConvert.DeserializeObject <DataTable>(zone1); this.ultraGrid1.DataSource = dts; string Sqldel = "delete from hqNumber where DateHour=" + HourNumber; Ms.ExeSQLNonQuery(Sqldel); // ultraGrid1.DisplayLayout.Bands[0].Columns["ADDate"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; // DataTable WXdts = JsonConvert.DeserializeObject<DataTable>(zone); // loadDataSet(); DataTable dt = new DataTable(); DataRow dr = null; // dt = KeywordProdurcer.Tables[0]; foreach (DataRow keydr in dts.Rows) { // dr = dt.NewRow(); // dr["ID"] = 0; // // // dr["ItemID"] = ItemID.Text; // // // dr["keyword"] = keydr["keyword"].ToString(); // // // dr["keypv"] = float.Parse(keydr["uv"].ToString()); // // // dr["keydate"] = DateTime.Now.AddDays(i).ToString("yyyy-MM-dd"); ; // // // dr["keytype"] = 0; // dt.Rows.Add(dr); string bb = "店铺:" + keydr["shopName"].ToString(); string aa = "件数:" + keydr["paySubOrderCnt"].ToString(); string shopNameID = keydr["itemid"].ToString() + keydr["shopName"].ToString(); // ShowInfo(bb + "----" + aa); string Sql = "INSERT INTO [hqNumber]([shopName],[DateHour],[HouNumber])VALUES('" + shopNameID + "'," + HourNumber + "," + int.Parse(keydr["paySubOrderCnt"].ToString()) + "-(SELECT isnull(SUM(houNumber),0) FROM dbo.hqNumber where shopname='" + shopNameID + "' and DateHour<" + HourNumber + "))"; // ShowInfo(Sql); Ms.ExeSQLNonQuery(Sql); } string GSql = "select * from [Pnumber_View]"; this.ultraGrid2.DataSource = Ms.runSQLDataSet(GSql, "ss").Tables[0];; // ultraGrid3.DisplayLayout.Bands[0].Columns[HourNumber.ToString()].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Descending; }