增加 导入外部微信数据
This commit is contained in:
1 parent
5ed558e343
commit
a9f7b1f831
13 files changed
+2088
-1589
No files matched your search
+1568
-1540
File diff suppressed because it is too large.
Load diff
@@ -16,6 +16,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
@@ -1122,7 +1123,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
using (StreamReader sr = new StreamReader(path, Work.Api.UploadPinduoduoMain.GetFileEncoding(path)))
|
||||
{
|
||||
content = sourceContent = sr.ReadToEnd();
|
||||
content = sourceContent = sr.ReadToEnd();
|
||||
}
|
||||
|
||||
content = JsonHelper.SerializeObject(JsonHelper.JObjectParse(content));
|
||||
@@ -1152,7 +1153,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
else
|
||||
{
|
||||
rst = new PDDProdFormConverter().PddFrontToPddBackConvertFactory(sourceContent, true, null, true);
|
||||
rst = new PDDProdFormConverter().PddFrontToPddBackConvertFactory(path, true, null, true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1185,6 +1186,53 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
bool isCollectAuthorityUser = true;
|
||||
Get1688ProductForm.Out1688ProductImport(isCollectAuthorityUser, this.statusBar, this.pbLoading, OutProdSaveDbCallBack);
|
||||
}
|
||||
private void bt_import_wx_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Multiselect = true;
|
||||
// 设置过滤条件,只显示文本文件
|
||||
openFileDialog.Filter = "文本文件 (*.txt)|*.txt|All files (*.*)|*.*";
|
||||
// 显示对话框并获取结果
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var filePathLst = openFileDialog.FileNames.ToList();
|
||||
int successNum = 0;
|
||||
int failedNum = 0;
|
||||
foreach (var filePath in filePathLst)
|
||||
{
|
||||
string sourceContent = "";
|
||||
string content = "";
|
||||
string rst = "商品未识别";
|
||||
try
|
||||
{
|
||||
rst = new PDDProdFormConverter().PddFrontToPddBackConvertFactory(filePath, true, null, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rst = ex.Message;
|
||||
}
|
||||
if (string.IsNullOrEmpty(rst))
|
||||
successNum++;
|
||||
else
|
||||
failedNum++;
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
|
||||
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
||||
}));
|
||||
}
|
||||
|
||||
SearchDbProd(1, " 导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
pbLoading.Visible = false;
|
||||
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
|
||||
BaseMsgForm.ShowInfo("导入完成!");
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OutProdSaveDbCallBack(object msg)
|
||||
{
|
||||
@@ -1274,21 +1322,23 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
PDDDBProdListForm.GetPDDProductNotes(new List<ComboBox> { cmbBatchEditNotes }, addUserName);
|
||||
}
|
||||
|
||||
private void btnBatchEditCate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var rows = dgvDbProduct.Rows.Cast<DataGridViewRow>().Where(row
|
||||
=> row.Cells["colSelect"]?.Value.ParseToBool() == true);
|
||||
var prodIdList = rows.Select(r => r.Cells["col_spu_id"]?.Value.ToString()).ToList();
|
||||
var prodList = lstTemuDbProduct.Where(p => prodIdList.Contains(p.spu_id)).ToList();
|
||||
if (prodList.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("请选择要修改类目的商品");
|
||||
return;
|
||||
}
|
||||
private void btnBatchEditCate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var rows = dgvDbProduct.Rows.Cast<DataGridViewRow>().Where(row
|
||||
=> row.Cells["colSelect"]?.Value.ParseToBool() == true);
|
||||
var prodIdList = rows.Select(r => r.Cells["col_spu_id"]?.Value.ToString()).ToList();
|
||||
var prodList = lstTemuDbProduct.Where(p => prodIdList.Contains(p.spu_id)).ToList();
|
||||
if (prodList.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("请选择要修改类目的商品");
|
||||
return;
|
||||
}
|
||||
|
||||
WXUserCollectAuthProdEditCatesForm form = new WXUserCollectAuthProdEditCatesForm(prodList);
|
||||
WXUserCollectAuthProdEditCatesForm form = new WXUserCollectAuthProdEditCatesForm(prodList);
|
||||
form.ShowDialog();
|
||||
SearchDbProd(this.ucSplitPage1.CurrentPage);
|
||||
}
|
||||
}
|
||||
SearchDbProd(this.ucSplitPage1.CurrentPage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user