商品进货价相关功能 完成度40%

This commit is contained in:
wule committed 2025-08-29 18:57:24 +08:00
1 parent 6b6d63dd41
commit eca6a8a9e7
23 files changed
+1912 -98

No files matched your search

+3 -1
View File
@@ -197,10 +197,12 @@
<Compile Include="Model\Result\TemuCategoryTemplateInfo.cs" />
<Compile Include="Model\Result\TemuCheckPriceInfo.cs" />
<Compile Include="Model\Result\TemuDBExtCodePriceInfo.cs" />
<Compile Include="Model\Result\TemuDBProductPurchasePriceInfo.cs" />
<Compile Include="Model\Result\TemuDBProductSelect.cs" />
<Compile Include="Model\Result\TemuGoodsQualityInfo.cs" />
<Compile Include="Model\Result\TemuListProductInfo.cs" />
<Compile Include="Model\Result\TemuPriceAdjustInfo.cs" />
<Compile Include="Model\Result\TemuProductInfo.cs" />
<Compile Include="Model\Result\TemuDetailProductInfo.cs" />
<Compile Include="Model\Param\TemuProductManage\TemuProductParam.cs" />
<Compile Include="Model\Result\TemuDBProduct.cs" />
<Compile Include="Model\Result\TemuReturnPackageDetailInfo.cs" />
+2 -2
View File
@@ -27,8 +27,8 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 562;
//public static int VersionCount = 562;
public static int VersionCount = 565;
//public static int VersionCount = 565;
/// <summary>
/// 版本号
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Result
{
public class TemuDBProductPurchasePriceInfo
{
public int id { get; set; }
public string spu_id { get; set; }
public string skc_id { get; set; }
public string cat_id { get; set; }
public string cat_name { get; set; }
public string ext_code { get; set; }
public string product_name { get; set; }
public string main_img { get; set; }
public string price_text { get; set; }
public string sku_purchase_price_json { get; set; }
public List<TemuDBSkuPurchasePriceInfo> dbSkuPurchasePriceList { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string notes { get; set; }
}
public class TemuDBSkuPurchasePriceInfo
{
public int? productSkuId { get; set; }
public List<TemuProductSkuSpec> productSkuSpecList { get; set; }
public int? PriceValue { get; set; }
public int? PurchasePriceValue { get; set; }
}
}
@@ -9,7 +9,7 @@ namespace AllBase.Model.Result
/// <summary>
/// temu商品获取
/// </summary>
public class TemuProductInfo
public class TemuDetailProductInfo
{
public TemuCategories categories { get; set; }
public long? supplierId { get; set; }
+163
View File
@@ -0,0 +1,163 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Result
{
public class TemuListProductInfo
{
public long? productId { get; set; }
public long? productSkcId { get; set; }
public string productName { get; set; }
public int? productType { get; set; }
public int? sourceType { get; set; }
public long? goodsId { get; set; }
public TemuCat leafCat { get; set; }
public TemuListCategoriesItem categories { get; set; }
public List<TemuProductProperty> TemuProductProperty { get; set; }
public List<long> sizeTemplateIds { get; set; }
public int? productTotalSalesVolume { get; set; }
public string extCode { get; set; }
public int? skcStatus { get; set; }
public int? skcSiteStatus { get; set; }
public string mainImageUrl { get; set; }
public int? last7DaysSalesVolume { get; set; }
public List<TemuProductSkusummaryItem> productSkuSummaries { get; set; }
public long? createdAt { get; set; }
public TemuproductJitModeItem productJitMode { get; set; }
public object productCertAuditStatus { get; set; }
public object offSaleByNoCert { get; set; }
public object noCertPunishRecord { get; set; }
public object productCertConfig { get; set; }
public object productCertPunish { get; set; }
public TemuProductPersonalizationItem productPersonalization { get; set; }
public object goodsAdvantageLabelVOList { get; set; }
public object productTags { get; set; }
public TemuProductFragileLabelAttrItem ProductFragileLabelAttr { get; set; }
public List<object> productGuideFileI18nList { get; set; }
public List<object> productGuideFileNewVOList { get; set; }
public object printedGuideFileInfoVO { get; set; }
public List<TemuProductPropAdjustTaskItem> productPropAdjustTasks { get; set; }
public bool? needGuideFile { get; set; }
public object productGuideFileIfNeed { get; set; }
public object guideFileStatus { get; set; }
public object guideFileFailReason { get; set; }
public int? electronicGuideFileComplianceLabel { get; set; }
public int? printedGuideFileComplianceLabel { get; set; }
public bool? productSelected { get; set; }
public bool? canEditSizeTemplate { get; set; }
public object inProcessEditTasks { get; set; }
public object productAuditDraft { get; set; }
public object hasDecoration { get; set; }
public object hasCarouseVideo { get; set; }
public object hasDetailVideo { get; set; }
public bool? matchSkcJitMode { get; set; }
public bool? isJitUnSignForMms { get; set; }
public object guideFileAttribute { get; set; }
public object similarClusterProduct { get; set; }
public object guideFilePageImages { get; set; }
public bool? isSupportPersonalization { get; set; }
public int? supplierSourceType { get; set; }
public object productSemiManaged { get; set; }
public object productPublishLabel { get; set; }
public TemuProductPatternItem ProductPattern { get; set; }
public object productCustomizationTechnology { get; set; }
public int? hotSaleGoodsLabelStyle { get; set; }
public bool? sensitiveAttrProblemTag { get; set; }
public object classId { get; set; }
public bool? industrySelectionTag { get; set; }
public object allowanceCertList { get; set; }
public object flowAllowanceSiteList { get; set; }
public int? flowAllowanceStatus { get; set; }
public object newProductCatMisplace { get; set; }
public object productPotentialInfo { get; set; }
public bool? hotSaleCarouselVideoNeedUpload { get; set; }
public bool? highPrice { get; set; }
}
public class TemuListCategoriesItem
{
public TemuCat cat1 { get; set; }
public TemuCat cat2 { get; set; }
public TemuCat cat3 { get; set; }
public TemuCat cat4 { get; set; }
public TemuCat cat5 { get; set; }
public TemuCat cat6 { get; set; }
public TemuCat cat7 { get; set; }
public TemuCat cat8 { get; set; }
public TemuCat cat9 { get; set; }
public TemuCat cat10 { get; set; }
public int? catType { get; set; }
}
public class TemuProductSkusummaryItem
{
public long? productSkuId { get; set; }
public string thumbUrl { get; set; }
public List<TemuProductSkuSpec> productSkuSpecList { get; set; }
public string currencyType { get; set; }
public object financeExchangeRate { get; set; }
public int? supplierPrice { get; set; }
public object supplierPriceUS { get; set; }
public object siteSupplierPrices { get; set; }
public string extCode { get; set; }
public TemuProductSkuWhExtAttr productSkuWhExtAttr { get; set; }
public TemuProductSkuSaleExtAttr productSkuSaleExtAttr { get; set; }
public int? todaySalesVolume { get; set; }
public int? realStock { get; set; }
public object virtualStock { get; set; }
public object virtualStockLimitType { get; set; }
public object salesStockLockType { get; set; }
public object stockLockDetailList { get; set; }
public object tempLockNum { get; set; }
public object productSkuSemiManagedStock { get; set; }
public object sampleNetWeight { get; set; }
public object productSkuCwVOList { get; set; }
public TemuProductSkuMultiPack productSkuMultiPack { get; set; }
public int? priceReviewStatus { get; set; }
public object flowLimit { get; set; }
public object preLimitTime { get; set; }
}
public class TemuproductJitModeItem
{
public bool? matchJitMode { get; set; }
public int? quickSellAgtSignStatus { get; set; }
public bool? signLatestAgt { get; set; }
}
public class TemuProductPersonalizationItem
{
public object personalizationSwitch { get; set; }
public object personalizationTmp { get; set; }
public bool? signLatestAgt { get; set; }
public int? personalizationAgtSignStatus { get; set; }
}
public class TemuProductFragileLabelAttrItem
{
public bool? isFragile { get; set; }
}
public class TemuProductPropAdjustTaskItem {
public int? adjustType { get; set; }
public int? status { get; set; }
}
public class TemuProductPatternItem
{
public bool? canRelatePattern { get; set; }
public object patternId { get; set; }
public object isModified { get; set; }
public object garmentPreviewPics { get; set; }
public object paperPreviewPics { get; set; }
public object patternFile { get; set; }
public object modifiedPaperPreviewPics { get; set; }
public object modifiedPatternFile { get; set; }
}
}
@@ -292,5 +292,287 @@ namespace KJD_Web.BLL
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString();
string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString();
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sqlExist = "select count(spu_id) from kjd.product_purchase_price where spu_id=@spu_id";
string sql = "insert into kjd.product_purchase_price " +
"(spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,price_text,sku_purchase_price_json,notes) " +
"values (@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@price_text,@sku_purchase_price_json,@notes);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray());
if (has != "0")
{
mySql.Close();
return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}";
}
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyPurchasePrice(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString();
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString();
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString();
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString();
string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString();
string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString();
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString();
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update kjd.product_purchase_price set";
if (cat_id != null)
sql += " cat_id=@cat_id,";
if (cat_name != null)
sql += " cat_name=@cat_name,";
if (ext_code != null)
sql += " ext_code=@ext_code,";
if (product_name != null)
sql += " product_name=@product_name,";
if (main_img != null)
sql += " main_img=@main_img,";
if (price_text != null)
sql += " price_text=@price_text,";
if (sku_purchase_price_json != null)
sql += " sku_purchase_price_json=@sku_purchase_price_json,";
if (notes != null)
sql += " notes=@notes,";
sql = sql.TrimEnd(',');
sql += " where id=@db_id;";
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetPurchasePriceList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
var search_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_spu_id"));
var search_skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_skc_id"));
var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code"));
var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes"));
var in_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_spu_id"));
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_spu_id", Value = "%" + search_spu_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_skc_id", Value = "%" + search_skc_id + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_spu_id", Value = in_spu_id.ParseToString() });
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd.product_purchase_price p where 1=1";
string where = "";
if (!string.IsNullOrWhiteSpace(search_spu_id))
where += " and p.spu_id like @search_spu_id";
if (!string.IsNullOrWhiteSpace(search_skc_id))
where += " and p.skc_id like @search_skc_id";
if (!string.IsNullOrWhiteSpace(search_ext_code))
where += " and p.ext_code like @search_ext_code";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like @search_notes";
if (!string.IsNullOrEmpty(in_spu_id))
where += " and p.ext_code in ('" + in_spu_id?.Replace(",", "','") + "')";
sql += where;
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "select * from kjd.product_purchase_price p where 1=1";
//where子句
sql += where;
sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
}
mySql.Close();
if (dt != null)
{
try
{
List<ProductPurchasePriceResultParam> purchasePriceList = new List<ProductPurchasePriceResultParam>();
foreach (DataRow row in dt.Rows)
{
ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam
{
id = row["id"].ParseToInt(),
cat_id = row["cat_id"].ParseToString(),
cat_name = row["cat_name"].ParseToString(),
main_img = row["main_img"].ParseToString(),
price_text = row["price_text"].ParseToString(),
product_name = row["product_name"].ParseToString(),
skc_id = row["skc_id"].ParseToString(),
sku_purchase_price_json = row["sku_purchase_price_json"].ParseToString(),
spu_id = row["spu_id"].ParseToString(),
notes = row["notes"].ParseToString(),
ext_code = row["ext_code"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
};
purchasePriceList.Add(price);
}
var data = JsonUtils.SerializerObjectToString(purchasePriceList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string DelPurchasePrice(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from kjd.product_purchase_price where id='" + id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -99,6 +99,7 @@
<Compile Include="Model\DBPriceResultParam.cs" />
<Compile Include="Model\OrderParam.cs" />
<Compile Include="Model\DBProductResultParam.cs" />
<Compile Include="Model\ProductPurchasePriceResultParam.cs" />
<Compile Include="Model\ProductSelectResultParam.cs" />
<Compile Include="Model\ShopModel\ShopParam.cs" />
<Compile Include="Model\UserLoginResultParam.cs" />
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model
{
public class ProductPurchasePriceResultParam
{
public int id { get; set; }
public string spu_id { get; set; }
public string skc_id { get; set; }
public string cat_id { get; set; }
public string cat_name { get; set; }
public string ext_code { get; set; }
public string product_name { get; set; }
public string main_img { get; set; }
public string price_text { get; set; }
public string sku_purchase_price_json { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string notes { get; set; }
}
}
+9
View File
@@ -146,6 +146,12 @@
<Compile Include="KJDForms\AdminForms\AdminProductPriceCheckForm.Designer.cs">
<DependentUpon>AdminProductPriceCheckForm.cs</DependentUpon>
</Compile>
<Compile Include="KJDForms\ProductForms\PurchasePriceForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="KJDForms\ProductForms\PurchasePriceForm.Designer.cs">
<DependentUpon>PurchasePriceForm.cs</DependentUpon>
</Compile>
<Compile Include="KJDForms\ProductSelectForms\DbProductCategorySearch.cs">
<SubType>Form</SubType>
</Compile>
@@ -602,6 +608,9 @@
<EmbeddedResource Include="KJDForms\AdminForms\AdminProductPriceCheckForm.resx">
<DependentUpon>AdminProductPriceCheckForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="KJDForms\ProductForms\PurchasePriceForm.resx">
<DependentUpon>PurchasePriceForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="KJDForms\ProductSelectForms\DbProductCategorySearch.resx">
<DependentUpon>DbProductCategorySearch.cs</DependentUpon>
</EmbeddedResource>
@@ -732,7 +732,7 @@ namespace TemuKJD.KJDForms.AdminForms
}
if (!string.IsNullOrEmpty(text))
{
TemuProductInfo prodInfo = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(text);
TemuDetailProductInfo prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(text);
TemuProductParam prodParam = new TemuProductParam();
prodParam.carouselImageI18nReqs = prodInfo.carouselImageI18nVOList;
prodParam.carouselImageUrls = prodInfo.carouselImageUrls;
@@ -58,7 +58,7 @@ namespace TemuKJD.KJDForms.AdminForms
JObject obj = JObject.Parse(html);
var result = JsonHelper.SerializeObject(obj["result"]);
var sizeRst = "";
TemuProductInfo product = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(result);
TemuDetailProductInfo product = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(result);
if (product.sizeTemplateId > 0)
{
@@ -176,7 +176,7 @@ namespace TemuKJD.KJDForms.AdminForms
JObject obj = JObject.Parse(html);
var result = JsonHelper.SerializeObject(obj["result"]);
var sizeRst = "";
TemuProductInfo product = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(result);
TemuDetailProductInfo product = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(result);
if (product.sizeTemplateId > 0)
{
@@ -269,7 +269,7 @@ namespace TemuKJD.KJDForms.AdminForms
return "success";
}
TemuCat GetCat(TemuProductInfo product)
TemuCat GetCat(TemuDetailProductInfo product)
{
if (product == null)
return new TemuCat();
+14 -55
View File
@@ -31,36 +31,16 @@
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("备货管理");
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("调价管理");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("活动报名");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("商品认领");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("库存上传");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("商品发布");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("佣金设置");
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("净化数据");
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("产品数据库");
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("商品上下架");
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("清理无流量");
System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("库存管理");
System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("特殊延迟发货");
System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("云违规排查");
System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("跳转上家");
System.Windows.Forms.TreeNode treeNode16 = new System.Windows.Forms.TreeNode("上传错误列表");
System.Windows.Forms.TreeNode treeNode17 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] {
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("设置进货价");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("商品认领");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("库存上传");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3,
treeNode4,
treeNode5,
treeNode6,
treeNode7,
treeNode8,
treeNode9,
treeNode10,
treeNode11,
treeNode12,
treeNode13,
treeNode14,
treeNode15,
treeNode16});
treeNode6});
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
@@ -157,37 +137,16 @@
treeNode2.Text = "调价管理";
treeNode3.Name = "活动报名";
treeNode3.Text = "活动报名";
treeNode4.Name = "商品认领";
treeNode4.Text = "商品认领";
treeNode5.Name = "库存上传";
treeNode5.Text = "库存上传";
treeNode6.Name = "商品发布";
treeNode6.Text = "商品发布";
treeNode7.Name = "佣金设置";
treeNode7.Text = "佣金设置";
treeNode8.Name = "净化数据";
treeNode8.Text = "净化数据";
treeNode9.Name = "产品数据库";
treeNode9.Text = "产品数据库";
treeNode10.Name = "商品上下架";
treeNode10.Text = "商品上下架";
treeNode11.Name = "清理无流量";
treeNode11.Text = "清理无流量";
treeNode12.Name = "库存管理";
treeNode12.Text = "库存管理";
treeNode13.Name = "特殊延迟发货";
treeNode13.Text = "特殊延迟发货";
treeNode14.Name = "云违规排查";
treeNode14.Text = "云违规排查";
treeNode15.Name = "跳转上家";
treeNode15.Tag = "bottom";
treeNode15.Text = "跳转上家";
treeNode16.Name = "上传错误列表";
treeNode16.Text = "上传错误列表";
treeNode17.Name = "商品管理";
treeNode17.Text = "商品管理";
treeNode4.Name = "设置进货价";
treeNode4.Text = "设置进货价";
treeNode5.Name = "商品认领";
treeNode5.Text = "商品认领";
treeNode6.Name = "库存上传";
treeNode6.Text = "库存上传";
treeNode7.Name = "商品管理";
treeNode7.Text = "商品管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode17});
treeNode7});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 521);
this.tv.TabIndex = 1;
+7 -3
View File
@@ -24,6 +24,7 @@ namespace TemuKJD.KJDForms.ProductForms
public Lazy<DbProductUserSelectForm> userSelectDbProductForm = new Lazy<DbProductUserSelectForm>();
public Lazy<ProductThirdUserSelectForm> userSelectThirdProductForm = new Lazy<ProductThirdUserSelectForm>();
public Lazy<MarketingActivityForm> marketingActivityForm = new Lazy<MarketingActivityForm>();
public Lazy<PurchasePriceForm> purchasePriceForm = new Lazy<PurchasePriceForm>();
public ProductForm()
{
@@ -52,15 +53,18 @@ namespace TemuKJD.KJDForms.ProductForms
case "调价管理":
SetForm(priceManageForm.Value);
break;
case "活动报名":
SetForm(marketingActivityForm.Value);
break;
case "设置进货价":
SetForm(purchasePriceForm.Value);
break;
case "商品认领":
SetForm(userSelectDbProductForm.Value);
break;
case "库存上传":
SetForm(userSelectThirdProductForm.Value);
break;
case "活动报名":
SetForm(marketingActivityForm.Value);
break;
}
}));
}).Start();
@@ -0,0 +1,617 @@
namespace TemuKJD.KJDForms.ProductForms
{
partial class PurchasePriceForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnSearchPrice = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dgvProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
this.colProductId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdSkc = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colExtCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSku = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPrcie = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.ucGroupBoxEx2.SuspendLayout();
this.ucGroupBoxEx1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx2);
this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer1.Size = new System.Drawing.Size(1121, 573);
this.splitContainer1.SplitterDistance = 120;
this.splitContainer1.TabIndex = 11;
//
// ucGroupBoxEx2
//
this.ucGroupBoxEx2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.Controls.Add(this.panelEx1);
this.ucGroupBoxEx2.Controls.Add(this.btnSearchPrice);
this.ucGroupBoxEx2.Location = new System.Drawing.Point(147, 2);
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
this.ucGroupBoxEx2.Size = new System.Drawing.Size(972, 120);
this.ucGroupBoxEx2.TabIndex = 469;
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "读取商品";
//
// panelEx1
//
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Location = new System.Drawing.Point(134, 32);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(84, 23);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.panelEx1.Style.GradientAngle = 90;
this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.panelEx1.TabIndex = 668;
this.panelEx1.Text = "停止读取";
//
// btnSearchPrice
//
this.btnSearchPrice.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSearchPrice.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSearchPrice.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSearchPrice.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSearchPrice.Location = new System.Drawing.Point(32, 32);
this.btnSearchPrice.Name = "btnSearchPrice";
this.btnSearchPrice.Size = new System.Drawing.Size(96, 23);
this.btnSearchPrice.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSearchPrice.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSearchPrice.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSearchPrice.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSearchPrice.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSearchPrice.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSearchPrice.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSearchPrice.Style.GradientAngle = 90;
this.btnSearchPrice.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSearchPrice.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSearchPrice.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSearchPrice.TabIndex = 427;
this.btnSearchPrice.Text = "读取在售商品";
this.btnSearchPrice.Click += new System.EventHandler(this.btnSearchPrice_Click);
//
// ucGroupBoxEx1
//
this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2);
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
this.ucGroupBoxEx1.Size = new System.Drawing.Size(144, 120);
this.ucGroupBoxEx1.TabIndex = 399;
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "基础";
//
// btnRefreshShop
//
this.btnRefreshShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefreshShop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnRefreshShop.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefreshShop.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefreshShop.Location = new System.Drawing.Point(17, 31);
this.btnRefreshShop.Name = "btnRefreshShop";
this.btnRefreshShop.Size = new System.Drawing.Size(110, 24);
this.btnRefreshShop.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnRefreshShop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRefreshShop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRefreshShop.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnRefreshShop.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnRefreshShop.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnRefreshShop.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnRefreshShop.Style.GradientAngle = 90;
this.btnRefreshShop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnRefreshShop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnRefreshShop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnRefreshShop.TabIndex = 431;
this.btnRefreshShop.Text = "刷新店铺";
this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshShop_Click);
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.splitContainer2);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
this.splitContainer3.Size = new System.Drawing.Size(1121, 449);
this.splitContainer3.SplitterDistance = 420;
this.splitContainer3.TabIndex = 1;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.dgvShop);
this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.dgvProduct);
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
this.splitContainer2.Size = new System.Drawing.Size(1121, 420);
this.splitContainer2.SplitterDistance = 280;
this.splitContainer2.TabIndex = 0;
//
// dgvShop
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
this.colShopLoginName,
this.colShopId,
this.colShopName,
this.colShopNotes,
this.colLoginStatus,
this.colCanUse,
this.colMessage});
this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvShop.Location = new System.Drawing.Point(4, 0);
this.dgvShop.Name = "dgvShop";
this.dgvShop.ReadOnly = true;
this.dgvShop.RowHeadersWidth = 25;
this.dgvShop.RowTemplate.Height = 23;
this.dgvShop.Size = new System.Drawing.Size(276, 420);
this.dgvShop.TabIndex = 6;
this.dgvShop.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellClick);
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// colSelect
//
this.colSelect.HeaderText = "全选";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 28;
//
// colShopLoginName
//
this.colShopLoginName.HeaderText = "店铺登录名";
this.colShopLoginName.Name = "colShopLoginName";
this.colShopLoginName.ReadOnly = true;
this.colShopLoginName.Visible = false;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
this.colShopId.Visible = false;
this.colShopId.Width = 55;
//
// colShopName
//
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopName.Width = 70;
//
// colShopNotes
//
this.colShopNotes.HeaderText = "分组";
this.colShopNotes.Name = "colShopNotes";
this.colShopNotes.ReadOnly = true;
this.colShopNotes.Width = 70;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "状态";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Width = 38;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
this.colCanUse.Name = "colCanUse";
this.colCanUse.ReadOnly = true;
this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCanUse.Visible = false;
this.colCanUse.Width = 28;
//
// colMessage
//
this.colMessage.HeaderText = "消息";
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
//
// dgvProduct
//
this.dgvProduct.AllowUserToAddRows = false;
this.dgvProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dgvProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
this.colSupplierId,
this.colSupplierName,
this.colImgUrl,
this.colProductSkcPic,
this.colProductId,
this.colProdSkc,
this.colProdName,
this.colExtCode,
this.colSku,
this.colPrcie,
this.colEdit,
this.colMsg});
this.dgvProduct.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvProduct.Location = new System.Drawing.Point(0, 0);
this.dgvProduct.Name = "dgvProduct";
this.dgvProduct.ReadOnly = true;
this.dgvProduct.RowTemplate.Height = 23;
this.dgvProduct.Size = new System.Drawing.Size(833, 420);
this.dgvProduct.TabIndex = 187;
this.dgvProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvProduct_Scroll);
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.statusBar);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Size = new System.Drawing.Size(1121, 25);
this.splitContainer4.SplitterDistance = 587;
this.splitContainer4.TabIndex = 3;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(587, 25);
this.statusBar.TabIndex = 2;
//
// btnClear
//
this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClear.Location = new System.Drawing.Point(303, -1);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.Style.GradientAngle = 90;
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// colCheck
//
this.colCheck.HeaderText = "选择";
this.colCheck.Name = "colCheck";
this.colCheck.ReadOnly = true;
this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCheck.Width = 30;
//
// colSupplierId
//
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
//
// colSupplierName
//
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colImgUrl
//
this.colImgUrl.HeaderText = "图片路径";
this.colImgUrl.Name = "colImgUrl";
this.colImgUrl.ReadOnly = true;
this.colImgUrl.Visible = false;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Width = 60;
//
// colProductId
//
this.colProductId.HeaderText = "商品Id";
this.colProductId.Name = "colProductId";
this.colProductId.ReadOnly = true;
this.colProductId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProductId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colProdSkc
//
this.colProdSkc.FillWeight = 150F;
this.colProdSkc.HeaderText = "商品SKC";
this.colProdSkc.Name = "colProdSkc";
this.colProdSkc.ReadOnly = true;
this.colProdSkc.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProdSkc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colProdSkc.Width = 95;
//
// colProdName
//
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
this.colProdName.Width = 180;
//
// colExtCode
//
this.colExtCode.HeaderText = "货号";
this.colExtCode.Name = "colExtCode";
this.colExtCode.ReadOnly = true;
//
// colSku
//
this.colSku.HeaderText = "商品规格";
this.colSku.Name = "colSku";
this.colSku.ReadOnly = true;
this.colSku.Width = 120;
//
// colPrcie
//
this.colPrcie.HeaderText = "商品进货价";
this.colPrcie.Name = "colPrcie";
this.colPrcie.ReadOnly = true;
this.colPrcie.Width = 90;
//
// colEdit
//
this.colEdit.HeaderText = "设置进货价";
this.colEdit.Name = "colEdit";
this.colEdit.ReadOnly = true;
this.colEdit.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colEdit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colEdit.Width = 90;
//
// colMsg
//
this.colMsg.HeaderText = "状态";
this.colMsg.Name = "colMsg";
this.colMsg.ReadOnly = true;
this.colMsg.Width = 400;
//
// PurchasePriceForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1121, 573);
this.Controls.Add(this.splitContainer1);
this.Name = "PurchasePriceForm";
this.Text = "PurchasePriceForm";
this.Load += new System.EventHandler(this.PurchasePriceForm_Load);
this.VisibleChanged += new System.EventHandler(this.PurchasePriceForm_VisibleChanged);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ucGroupBoxEx2.ResumeLayout(false);
this.ucGroupBoxEx1.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).EndInit();
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
this.splitContainer4.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private UserComponent.UcGroupBoxEx ucGroupBoxEx2;
private DevComponents.DotNetBar.PanelEx btnSearchPrice;
private UserComponent.UcGroupBoxEx ucGroupBoxEx1;
private DevComponents.DotNetBar.PanelEx btnRefreshShop;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.SplitContainer splitContainer2;
private UserComponent.DataGridViewEx dgvShop;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private UserComponent.DataGridViewEx dgvProduct;
private System.Windows.Forms.SplitContainer splitContainer4;
private UserControls.StatusBarUserControl statusBar;
private DevComponents.DotNetBar.PanelEx panelEx1;
private DevComponents.DotNetBar.PanelEx btnClear;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProdSkc;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdName;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colSku;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
}
}
@@ -0,0 +1,457 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using TemuKJD.KJDForms.ShopForms;
namespace TemuKJD.KJDForms.ProductForms
{
public partial class PurchasePriceForm : Form
{
private CheckBox chkSelectAll = null;
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
List<TemuListProductInfo> lstProductInfo = new List<TemuListProductInfo>();
public PurchasePriceForm()
{
InitializeComponent();
}
private void PurchasePriceForm_Load(object sender, EventArgs e)
{
chkSelectAll = dgvShop.Columns["colSelect"].AddHeaderCheckBox(HorizontalAlignment.Center, 0, 0, null, null, false);
dgvShop.Columns["colSelect"].HeaderText = "";
chkSelectAll.Width = chkSelectAll.Height = 13;
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
this.dgvProduct.AddSelectorColumn("colCheck");
}
private void chkSelectAll_CheckedChanged(object sender, EventArgs e)
{
if (!chkSelectAll.Checked)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
row.Cells["colSelect"].Value = false;
}
}
else
{
var list = GlobalConfig.ShopLoginList.Where(s => s.LoginStatus2 == "国际版在线").Select(ss => ss.ShopId);
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
row.Cells["colSelect"].Value = true;
}
}
}
private void PurchasePriceForm_VisibleChanged(object sender, EventArgs e)
{
if (Visible == true)
RefreshShop();
}
private void btnRefreshShop_Click(object sender, EventArgs e)
{
RefreshShop();
}
private void RefreshShop()
{
// 店铺Id
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
// 获取被删除的店铺
List<DataGridViewRow> dgvRowList = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> !GlobalConfig.ShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
// 更新被删除的店铺列表
foreach (var row in dgvRowList)
{
dgvShop.Rows.Remove(row);
}
// 绑定其他店铺(含新导入的店铺)
foreach (ShopLoginInfo shopEntity in GlobalConfig.ShopLoginList)
{
if (!string.IsNullOrEmpty(shopEntity.ShopId))
BindShop(shopEntity, selectIds);
}
}
private void BindShop(ShopLoginInfo shopEntity, List<string> selectShopId = null)
{
if (shopEntity == null)
return;
if (selectShopId == null)
selectShopId = new List<string>();
bool canUse = shopEntity.LoginStatus2 == "国际版在线";
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
if (row == null)
{
int id = this.dgvShop.Rows.Add(
selectShopId.Contains(shopEntity.ShopId) && canUse,
shopEntity.LoginName,
shopEntity.ShopId,
shopEntity.ShopAccount,
shopEntity.Notes,
canUse ? "在线" : "掉线",
canUse,
string.Empty
);
row = dgvShop.Rows[id];
row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
}
else
{
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colShopNotes"].Value = shopEntity.Notes;
row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
row.Cells["colCanUse"].Value = canUse;
}
}
private void dgvShop_CellClick(object sender, DataGridViewCellEventArgs e)
{
string columnName = dgvShop.Columns[e.ColumnIndex].Name;
switch (columnName)
{
case "colSelect":
dgvShop.CellContentClick -= dgvShop_CellContentClick;
dgvShop_CellContentClick(sender, e);
break;
default:
dgvShop.CellContentClick -= dgvShop_CellContentClick;
dgvShop.CellContentClick += dgvShop_CellContentClick;
break;
}
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
string columnName = dgvShop.Columns[e.ColumnIndex].Name;
long shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToLong();
string shopAccount = dgvShop.Rows[e.RowIndex].Cells["colShopName"].Value.ToString();
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString());
var row = dgvShop.Rows[e.RowIndex];
switch (columnName)
{
case "colSelect":
if (row.Cells["colCanUse"].Value.ParseToBool() || row.Cells["colSelect"].Value.ParseToBool())
{
row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool();
chkSelectAll.CheckedChanged -= chkSelectAll_CheckedChanged;
if (dgvShop.Rows.Cast<DataGridViewRow>().All(r => r.Cells["colSelect"].Value.ParseToBool()))
chkSelectAll.Checked = true;
else
chkSelectAll.Checked = false;
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
}
else
{
BaseMsgForm.ShowInfo("店铺国际版未登录!");
}
break;
}
}
private string GetProductList(ShopLoginInfo shop, int page = 1, string skcIds="")
{
page = Math.Max(page, 1);
string url = "https://agentseller.temu.com/visage-agent-seller/product/skc/pageQuery";
string body;
body = @"{""page"":" + page + @",""pageSize"":200,""skcTopStatus"":100}";
if (!string.IsNullOrEmpty(skcIds))
body = @"{""productSkuIds"":[" + skcIds + @"],""page"":" + page + @",""pageSize"":200,""skcTopStatus"":100}";
string refere = "https://agentseller.temu.com/goods/list";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
private void btnSearchPrice_Click(object sender, EventArgs e)
{
var lstShopId = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
if (lstShopId.Count == 0)
{
BaseMsgForm.ShowInfo("请选择店铺!");
return;
}
lstProductInfo.Clear();
dgvProduct.Rows.Clear();
var dgvRows = this.dgvShop.Rows.Cast<DataGridViewRow>();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString()));
foreach (var row in dgvRows)
{
row.Cells["colMessage"].Value = "";
}
ucGroupBoxEx2.Enabled = false;
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
var lstShopIdTemp = new List<string>();
lstShopIdTemp.AddRange(lstShopId);
int i = 0;
foreach (var shopId in lstShopIdTemp)
{
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在查询...";
this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count;
this.statusBar.UpdateProgressBar(i + 1);
i++;
}));
if (cancellationTokenSource.IsCancellationRequested)
break;
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null)
continue;
#region 检测登录
if (shop.LoginStatus2 != "国际版在线")
{
continue;
}
if (ShopListForm.Instance == null)
ShopListForm.Instance = new ShopListForm();
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
if (shop.LoginStatus2 != "国际版在线")
{
Invoke(new Action(() =>
{
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "店铺掉线";
row.Cells["colLoginStatus"].Value = "国际版未登录";
row.Cells["colCanUse"].Value = false;
}
}));
continue;
}
#endregion
Invoke(new Action(() =>
{
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "正在查询";
}
}));
int page = 1;
int totalPage = 1;
bool isError = false;
string errMsg = "";
while (page <= totalPage)
{
if (cancellationTokenSource.IsCancellationRequested)
break;
int tryCount = 0;
tryAgain:
Thread.Sleep(100 + Randomx.GetId(200));
string jsonStr = GetProductList(shop, page);
if (jsonStr.Contains("指定的值含有无效的控制字符"))
{
BaseMsgForm.ShowError("店铺" + shop.LoginName + " " + shop.ShopId + "已掉线");
isError = true;
break;
}
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
{
tryCount++;
Thread.Sleep(Randomx.GetId(500, 1000));
goto tryAgain;
}
if (jsonStr.Contains("当前操作人数太多,请稍后重试"))
{
}
if (!jsonStr.Contains("\"success\":true"))
{
isError = true;
string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr))
errMsg += sErr + " ";
page++;
continue;
}
string tag = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now).ToString();
if (jsonStr.Contains("\"success\":true"))
{
var jArr = new JArray();
try
{
var jObj = JObject.Parse(jsonStr);
jArr = jObj["result"]?["pageItems"] as JArray;
if (jArr == null)
jArr = new JArray();
foreach (var item in jArr)
{
string sItem = JsonHelper.SerializeObject(item);
TemuListProductInfo pInfo = JsonHelper.DeserializeJsonToObject<TemuListProductInfo>(sItem); // 反序列化得到类
List<string> productInfoSpuIdLst= new List<string>();
if (pInfo != null && !lstProductInfo.Any(a => a.productId == pInfo.productId))
{
lstProductInfo.Add(pInfo);
productInfoSpuIdLst.Add(pInfo.productId.ParseToString());
Invoke(new Action(() =>
{
int rowId = this.dgvProduct.Rows.Add(
true,
shop.ShopId,
shop.ShopAccount, // pInfo.supplierName, // 列表里取不到,这里取shop里的
pInfo.mainImageUrl.Replace("https", "http").Replace("img.kwcdn.com", "img.cdnfe.com") + "?imageMogr2/thumbnail/60x",
defaultBitmap,//image, // skc图片
pInfo.productId,
pInfo.productSkcId,
pInfo.productName, // 商品标题
pInfo.extCode,
"",
"",
"设置",
"" // 操作结果,状态
);
dgvProduct.Rows[rowId].Height = 60;
}));
}
}
}
catch (Exception ex)
{
BaseMsgForm.ShowError(ex.Message);
}
Invoke(new Action(() =>
{
ShowDgvImg(dgvProduct);
}));
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
totalPage = Math.Ceiling(total / 200.0).ParseToInt();
}
page++;
}
Invoke(new Action(() =>
{
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
if (!isError)
{
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "已查询";
}
}
else
{
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "查询失败 " + errMsg;
}
}
}));
}
Invoke(new Action(() =>
{
ucGroupBoxEx2.Enabled = true;
string sRst = "查询结束!";
if (cancellationTokenSource.IsCancellationRequested)
sRst = "已取消查询!";
BaseMsgForm.ShowInfo(sRst);
this.statusBar.lblTaskStatus.Text = sRst;
}));
}, cancellationTokenSource.Token);
}
Bitmap defaultBitmap = new Bitmap(80, 80);
void ShowDgvImg(DataGridView dgv)
{
Task.Run(() =>
{
foreach (DataGridViewRow row in dgv.Rows)
{
if (row.Index > 0 && row.Cells["colProductSkcPic"].Displayed == false)
{
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = defaultBitmap;
}));
}
catch
{
}
continue;
}
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
//BaseMsgForm.ShowError("图片加载失败 " + getImgError);
image = TemuKJD.Properties.Resources.errpic;
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvProduct_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg(this.dgvProduct);
}
void GetPurchasePrice()
{
}
}
}
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colSelect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopLoginName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCanUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMessage.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCheck.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSupplierId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSupplierName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProdName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colExtCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSku.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPrcie.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colEdit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMsg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -837,8 +837,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
//var prodDetailStr = GetHtml.UrlDecode(dbProd.product_json);
//var prodInfo = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(prodDetailStr);
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(dbProd.product_json);
//var prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(prodDetailStr);
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(dbProd.product_json);
var sTemuSizeSpec = dbProd.size_json;
TemuProductParam prodParam = new TemuProductParam();
@@ -796,7 +796,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
}));
}
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(dbProd.product_json);
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(dbProd.product_json);
var sTemuSizeSpec = dbProd.size_json;
TemuProductParam prodParam = new TemuProductParam();
@@ -81,7 +81,7 @@ namespace TemuKJD.KJDForms.ShopForms
if (isBack)
{
endTime = this.dtpEndDate.Value.Date.AddDays(1);
startTime = endTime.AddMonths(-1);
startTime = endTime.AddMonths(-6);
}
cancellationTokenSource = new CancellationTokenSource();
var t = Task.Run(() =>
+2 -2
View File
@@ -83,7 +83,7 @@
this.splitContainer1.Panel2.Controls.Add(this.btnReload);
this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin);
this.splitContainer1.Size = new System.Drawing.Size(1438, 736);
this.splitContainer1.SplitterDistance = 676;
this.splitContainer1.SplitterDistance = 674;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -95,7 +95,7 @@
this.btnReturnPackage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReturnPackage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReturnPackage.ForeColor = System.Drawing.Color.White;
this.btnReturnPackage.Location = new System.Drawing.Point(651, 28);
this.btnReturnPackage.Location = new System.Drawing.Point(651, 31);
this.btnReturnPackage.Margin = new System.Windows.Forms.Padding(2);
this.btnReturnPackage.Name = "btnReturnPackage";
this.btnReturnPackage.Size = new System.Drawing.Size(136, 25);
@@ -30,8 +30,8 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnGetNotGet = new DevComponents.DotNetBar.PanelEx();
@@ -55,7 +55,6 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -69,6 +68,7 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.colSaleOutSkcNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSoonSaleOutSkcNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAdviceStockSkcNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -144,6 +144,7 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.btnGetNotGet.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetNotGet.TabIndex = 431;
this.btnGetNotGet.Text = "查询未获取";
this.btnGetNotGet.Click += new System.EventHandler(this.btnGetNotGet_Click);
//
// btnGetSelect
//
@@ -168,6 +169,7 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.btnGetSelect.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetSelect.TabIndex = 427;
this.btnGetSelect.Text = "查询选中";
this.btnGetSelect.Click += new System.EventHandler(this.btnGetSelect_Click);
//
// ucGroupBoxEx1
//
@@ -413,19 +415,19 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5;
this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -449,17 +451,7 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.dgvShop.RowTemplate.Height = 23;
this.dgvShop.Size = new System.Drawing.Size(1245, 383);
this.dgvShop.TabIndex = 5;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1253, 26);
this.statusBar.TabIndex = 1;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// colSelect
//
@@ -545,6 +537,17 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
this.colAdviceStockSkcNum.Name = "colAdviceStockSkcNum";
this.colAdviceStockSkcNum.ReadOnly = true;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1253, 26);
this.statusBar.TabIndex = 1;
//
// ShopWorkStatisticsForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -301,5 +301,84 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
string loginName = dgvShop.Rows[e.RowIndex].Cells["colShopLoginName"].Value.ParseToString();
string accountId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
switch (headerText)
{
case "检测":
break;
case "进入店铺":
IsOperate = true;
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
//shopLoginForm.Parent = this;
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.InitUrl = "https://agentseller.temu.com";
shopLoginForm.Show();
IsOperate = false;
}
break;
case "状态":
IsOperate = true;
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
//shopLoginForm.chkCloseAfterLogin.Checked = false;
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == loginName);
bool canUse = shop.LoginStatus == "登录成功" && shop.LoginStatus2 == "国际版在线";
foreach (var row in rows)
{
row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
}
ReGetStatistics(rows.Select(s => s.Cells["colShopId"].Value.ParseToString()).ToList());
}
IsOperate = false;
break;
default:
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value;
break;
}
}
private void btnGetNotGet_Click(object sender, EventArgs e)
{
RefreshShop();
}
private void btnGetSelect_Click(object sender, EventArgs e)
{
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
ReGetStatistics(selectIds);
}
void ReGetStatistics(List<string> reGetShopIds)
{
var shopList = GlobalConfig.ShopLoginList.Where(s => reGetShopIds.Contains(s.ShopId)).ToList();
foreach (var shop in shopList)
{
ShopWorkStatisticsInfo statistics = lstShopStatisticsInfo.FirstOrDefault(s => s.shop_id.ToString() == shop.ShopId);
if (statistics != null)
statistics.is_search_1 = statistics.is_search_2 = false;
}
this.pbLoading.Visible = true;
GetShopStatistics(shopList, reGetShopIds);
}
}
}
+5 -2
View File
@@ -241,13 +241,16 @@ namespace TemuKJD
if (dicUpReturn.Keys.Contains(shop) && dicUpReturn[shop] == DateTime.Now.ToString("yyyyMMdd")) //今日已获取过
continue;
var rst = retrunPackageForm.GetReturnPackage(shop, true);
var rst = retrunPackageForm.GetReturnPackage(shop, true); // 后台读取退货信息
if (rst == false && shop.LoginStatus == "登录成功" && shop.LoginStatus2 == "国际版在线")
{
dicUpReturn[shop] = DateTime.Now.ToString("yyyyMMdd");
}
}
Thread.Sleep(1000 * 60 * 60);
for (int i = 0; i< 3600; i++)
{
Thread.Sleep(1000);
}
}
});
#endregion