jit 合规信息修改
This commit is contained in:
1 parent
31d11c0341
commit
e37ee16782
6 files changed
+1026
-36
No files matched your search
@@ -16,6 +16,7 @@ using TemuKJD.BaseForms;
|
||||
using TemuKJD.BLL;
|
||||
using TemuKJD.Extension;
|
||||
using TemuKJD.KJDForms.AdminForms;
|
||||
using TemuKJD.KJDForms.ProductForms.TemuJitSubForms;
|
||||
using TemuKJD.KJDForms.ShopForms;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
@@ -58,10 +59,18 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
this.txtShopName.Text = setJitConfig.SearchShopName;
|
||||
this.chkSearchAllShop.Checked = setJitConfig.SearchAllShop;
|
||||
|
||||
this.txtSpuId.Text = setJitConfig.SearchSpuId;
|
||||
this.txtExtCode.Text = setJitConfig.SearchExtCode;
|
||||
this.chkSearchTime.Checked = setJitConfig.SearchDuration;
|
||||
|
||||
this.txtNotes.TextChanged += Txt_TextChanged;
|
||||
this.txtShopId.TextChanged += Txt_TextChanged;
|
||||
this.txtShopName.TextChanged += Txt_TextChanged;
|
||||
this.chkSearchAllShop.CheckedChanged += Txt_TextChanged;
|
||||
|
||||
this.txtSpuId.TextChanged += Txt_TextChanged;
|
||||
this.txtExtCode.TextChanged += Txt_TextChanged;
|
||||
this.chkSearchTime.CheckedChanged += Txt_TextChanged;
|
||||
}
|
||||
|
||||
private void Txt_TextChanged(object sender, EventArgs e)
|
||||
@@ -71,6 +80,10 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
setJitConfig.SearchShopName = this.txtShopName.Text.Trim();
|
||||
setJitConfig.SearchAllShop = this.chkSearchAllShop.Checked;
|
||||
|
||||
setJitConfig.SearchSpuId = this.txtSpuId.Text.Trim();
|
||||
setJitConfig.SearchExtCode = this.txtExtCode.Text.Trim();
|
||||
setJitConfig.SearchDuration = this.chkSearchTime.Checked;
|
||||
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("set_jit_config", setJitConfig);
|
||||
}
|
||||
|
||||
@@ -218,10 +231,22 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
case "登录":
|
||||
case "状态":
|
||||
{
|
||||
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
|
||||
if (shop.LoginStatus2 == "国际版在线")
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com";
|
||||
adminLoginForm.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -300,9 +325,9 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
startTime = BaseClass.DateTimeToTimestampMilliseconds(dtpStartTime.Value.Date);
|
||||
endTime = BaseClass.DateTimeToTimestampMilliseconds(dtpEndTime.Value.Date.AddDays(1).AddMilliseconds(-1));
|
||||
}
|
||||
string searchSkcIds = txtSkcId.Text.Trim().Trim(',');
|
||||
string searchSpuIds = txtSpuId.Text.Trim().Trim(',');
|
||||
string searchExtCodes = txtExtCode.Text.Trim().Trim(',');
|
||||
var searchRst = this.SearchForChainSupplier(shop, page, 50, searchSkcIds, searchExtCodes, type, startTime, endTime);
|
||||
var searchRst = this.SearchForChainSupplier(shop, page, 50, "", searchSpuIds, searchExtCodes, type, startTime, endTime);
|
||||
if (searchRst.Contains("登录过期") || searchRst.Contains("Invalid Login State"))
|
||||
{
|
||||
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
|
||||
@@ -334,6 +359,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
extCodeLst.Add(priceInfo.skcList.FirstOrDefault()?.extCode);
|
||||
}
|
||||
|
||||
// 查询合规信息
|
||||
var spuIds = "";
|
||||
foreach (var priceInfo in checkPriceInfoTmpLst)
|
||||
{
|
||||
@@ -341,10 +367,11 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
spuIds = "\"" + spuIds.Trim(',').Replace(",", "\",\"") + "\"";
|
||||
List<complianceInfo> complianceInfoTmpLst = null;
|
||||
string sErrMsg = "";
|
||||
if (spuIds.Length > 2)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(50, 100));
|
||||
var queryComplianceRst = this.QueryComplianceInfo(shop, 50, spuIds);
|
||||
var queryComplianceRst = this.QueryComplianceInfoList(shop, 50, spuIds);
|
||||
queryComplianceRst = GetHtml.Unicode2String(queryComplianceRst);
|
||||
if (queryComplianceRst.Contains("\"success\":true"))
|
||||
{
|
||||
@@ -354,6 +381,14 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
complianceInfoTmpLst = JsonHelper.DeserializeJsonToList<complianceInfo>(sData);
|
||||
lstComplianceInfo.AddRange(complianceInfoTmpLst);
|
||||
}
|
||||
else
|
||||
{
|
||||
sErrMsg = BaseRegex.GetStringJson(ref queryComplianceRst, "errorMsg").ParseToString();
|
||||
if (string.IsNullOrEmpty(sErrMsg))
|
||||
sErrMsg = BaseRegex.GetStringJson(ref queryComplianceRst, "error_msg").ParseToString();
|
||||
if (string.IsNullOrEmpty(sErrMsg))
|
||||
sErrMsg = queryComplianceRst;
|
||||
}
|
||||
}
|
||||
|
||||
int num = 0;
|
||||
@@ -400,13 +435,18 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
var reviewExtCode = priceInfo.skcList.FirstOrDefault()?.extCode;
|
||||
Thread.Sleep(Randomx.GetId(20, 50));
|
||||
|
||||
var complianceInfo = complianceInfoTmpLst.FirstOrDefault(c => c.spu_id == priceInfo.productId);
|
||||
if (complianceInfo == null)
|
||||
complianceInfo = new complianceInfo();
|
||||
var complianceTaskNames = complianceInfo.wait_task_dtolist
|
||||
.Where(t => t.task_name == "欧盟负责人" || t.task_name == "制造商信息" || t.is_not_required == false)
|
||||
.Select(t => t.task_name).ToList();
|
||||
var complianceStr = string.Join("\r\n", complianceTaskNames);
|
||||
var complianceStr = sErrMsg;
|
||||
if (sErrMsg.IsNullOrEmpty())
|
||||
{
|
||||
var complianceInfo = complianceInfoTmpLst.FirstOrDefault(c => c.spu_id == priceInfo.productId);
|
||||
if (complianceInfo == null)
|
||||
complianceInfo = new complianceInfo();
|
||||
var complianceTaskNames = complianceInfo.wait_task_show_dtolist.Where(ta => ta.status == 2)
|
||||
.Where(t => t.wait_task_dtolist.Any(ta => ta.task_name == "欧盟负责人" ||
|
||||
ta.task_name == "制造商信息" || ta.is_not_required == false))
|
||||
.Select(t => t.show_name).ToList();
|
||||
complianceStr = string.Join("\r\n", complianceTaskNames);
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
int rowId = this.dgvPriceCheck.Rows.Add(
|
||||
@@ -426,7 +466,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
// sku不同价的会被分成多个review,priceInfo此时为价格范围
|
||||
reviewInfo.productSkuList.FirstOrDefault()?.supplierPrice, //priceInfo.supplierPrice
|
||||
BaseClass.StampToDateTime((priceInfo.skcList.FirstOrDefault()?.statusTime.createdTime.ParseToLong() / 1000).ParseToInt()).ToString("yy/MM/dd HH:mm:ss"),
|
||||
complianceStr,
|
||||
complianceStr.IsNullOrEmpty() ? "已填写" : complianceStr,
|
||||
""
|
||||
);
|
||||
dgvPriceCheck.Rows[rowId].Height = 60;
|
||||
@@ -459,7 +499,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
|
||||
|
||||
private string SearchForChainSupplier(ShopLoginInfo shop, int page, int pageSize = 50, string prodSkcIds = null, string skcExtCode = null,
|
||||
private string SearchForChainSupplier(ShopLoginInfo shop, int page, int pageSize = 50, string prodSkcIds = null, string prodSpuIds = null, string skcExtCode = null,
|
||||
string type = "待创建首单", long startTime = 0, long endTime = 0)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/api/kiana/mms/robin/searchForChainSupplier";
|
||||
@@ -475,14 +515,18 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
body += "\"secondarySelectStatusList\":[10],";
|
||||
body += "\"supplierTodoTypeList\":[],";
|
||||
if (!string.IsNullOrEmpty(prodSkcIds))
|
||||
body += "\"productSkcIdList\":[" + prodSkcIds + "],";
|
||||
body += "\"productSkcIdList\":[" + prodSpuIds + "],";
|
||||
if (!string.IsNullOrEmpty(prodSpuIds))
|
||||
body += "\"productSpuIdList\":[" + prodSpuIds + "],";
|
||||
|
||||
//":[],"productSpuIdList":[5296122040]}
|
||||
body = body.TrimEnd(',');
|
||||
body += "}";
|
||||
string referer = "https://agentseller.temu.com/newon/product-select";
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, referer);
|
||||
}
|
||||
|
||||
private string QueryComplianceInfo(ShopLoginInfo shop, int pageSize = 50, string prodSpuIds = null)
|
||||
private string QueryComplianceInfoList(ShopLoginInfo shop, int pageSize = 50, string prodSpuIds = null)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/ms/bg-flux-ms/compliance_property/page_query";
|
||||
string body = "";
|
||||
@@ -500,6 +544,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
string prodId = dgvPriceCheck.Rows[e.RowIndex].Cells["colProductId"].Value.ParseToString();
|
||||
string accountId = dgvPriceCheck.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
|
||||
var shop = lstAdminShopInfo.FirstOrDefault(v => v.ShopId == accountId);
|
||||
var compInfo = this.lstComplianceInfo.FirstOrDefault(c => c.spu_id.ParseToString() == prodId);
|
||||
|
||||
switch (headerText)
|
||||
{
|
||||
@@ -549,11 +594,19 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
// }
|
||||
// break;
|
||||
case "合规":
|
||||
case "合规信息":
|
||||
{
|
||||
//加州65号提案
|
||||
//欧盟负责人
|
||||
//制造商信息
|
||||
//其他合规信息 商品识别码
|
||||
//填写以下信息: //加州65号提案 //欧盟负责人 //制造商信息 //其他合规信息-商品识别码
|
||||
ComplianceForm compForm = new ComplianceForm(shop, compInfo);
|
||||
compForm.ShowDialog();
|
||||
if (compForm.EditSuccess == true)
|
||||
{
|
||||
var rows = dgvPriceCheck.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colProductId"].Value.ParseToString() == prodId);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colCompliance"].Value = "已填写";
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "Skc图片":
|
||||
@@ -574,6 +627,12 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
{
|
||||
this.pnlSpecDetail.Visible = false;
|
||||
}
|
||||
|
||||
private void btnResetExtCode_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.txtSpuId.Text = "";
|
||||
this.txtExtCode.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
public class SetJitConfig
|
||||
@@ -582,6 +641,9 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
public string SearchShopName { get; set; } = "";
|
||||
public string SearchNotes { get; set; } = "";
|
||||
public bool SearchAllShop { get; set; } = true;
|
||||
public string SearchSpuId { get; set; } = "";
|
||||
public string SearchExtCode { get; set; } = "";
|
||||
public bool SearchDuration { get; set; } = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 合规信息
|
||||
@@ -595,9 +657,15 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
public long? goods_id { get; set; } // 601103852497488,
|
||||
public string goods_url { get; set; } // "https://img.kwcdn.com/product/fancy/0f52acc1-edfe-4f70-8032-012505ad0da5.jpg",
|
||||
public List<task_dto> wait_task_dtolist { get; set; }
|
||||
public List<task_dto> wait_task_show_dtolist { get; set; }
|
||||
public List<wait_task_show_dto> wait_task_show_dtolist { get; set; }
|
||||
public bool? on_sale { get; set; } // false
|
||||
}
|
||||
public class wait_task_show_dto
|
||||
{
|
||||
public string show_name { get; set; } // "加州 65 号提案"
|
||||
public int? status { get; set; } // 2
|
||||
public List<task_dto> wait_task_dtolist { get; set; }
|
||||
}
|
||||
public class task_dto
|
||||
{
|
||||
public long? task_id { get; set; } // 101042759897649,
|
||||
@@ -614,6 +682,5 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
public bool? on_site { get; set; } // false,
|
||||
public List<int> region_list { get; set; } // [105, 106, 107, 108, 109, ...],
|
||||
public string content { get; set; } // "德国站、法国站、意大利站、荷兰站、西班牙站、葡萄牙站、波兰站、瑞典站、希腊站、爱尔兰站、塞浦路斯站、捷克站、匈牙利站、丹麦站、罗马尼亚站、保加利亚站、比利时站、奥地利站、芬兰站、斯洛伐克站、克罗地亚站、斯洛文尼亚站、立陶宛站、爱沙尼亚站、拉脱维亚站、马耳他站、卢森堡站"
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user