子账号管理相关内容
This commit is contained in:
1 parent
9fe9fa2610
commit
b48f320099
101 files changed
+3171
-572
No files matched your search
@@ -0,0 +1,559 @@
|
||||
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.Net;
|
||||
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 PriceManageForm : Form
|
||||
{
|
||||
private CheckBox chkSelectAll = null;
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
List<TemuPriceAdjustInfo> lstPriceAdjustInfo = new List<TemuPriceAdjustInfo>();
|
||||
|
||||
public PriceManageForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void PriceManageForm_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.dgvAdjust.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.LoginStatus == "登录成功").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 PriceManageForm_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 (DouShopLoginInfo shopEntity in GlobalConfig.ShopLoginList)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(shopEntity.ShopId))
|
||||
BindShop(shopEntity, selectIds);
|
||||
}
|
||||
}
|
||||
|
||||
private void BindShop(DouShopLoginInfo shopEntity, List<string> selectShopId = null)
|
||||
{
|
||||
if (shopEntity == null)
|
||||
return;
|
||||
if (selectShopId == null)
|
||||
selectShopId = new List<string>();
|
||||
|
||||
bool canUse = shopEntity.LoginStatus == "登录成功";
|
||||
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
|
||||
if (row == null)
|
||||
{
|
||||
this.dgvShop.Rows.Add(
|
||||
selectShopId.Contains(shopEntity.ShopId) && canUse,
|
||||
shopEntity.LoginName,
|
||||
shopEntity.ShopId,
|
||||
shopEntity.ShopAccount,
|
||||
shopEntity.LoginStatus,
|
||||
canUse,
|
||||
string.Empty
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
|
||||
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
|
||||
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
|
||||
row.Cells["colLoginStatus"].Value = shopEntity.LoginStatus;
|
||||
row.Cells["colCanUse"].Value = canUse;
|
||||
}
|
||||
}
|
||||
|
||||
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 = !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 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;
|
||||
}
|
||||
|
||||
var columns = this.dgvAdjust.Columns.Cast<DataGridViewColumn>();
|
||||
foreach (var col in columns)
|
||||
{
|
||||
//if (col.Name == "colParentStockId" || col.Name == "colStockId")
|
||||
//{
|
||||
// col.Visible = true;
|
||||
//}
|
||||
//if (col.Name == "colTodaySaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum"
|
||||
// || col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp")
|
||||
//{
|
||||
// col.Visible = false;
|
||||
//}
|
||||
}
|
||||
|
||||
lstPriceAdjustInfo.Clear();
|
||||
dgvAdjust.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;
|
||||
ucGroupBoxEx4.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.Value = (i + 1);
|
||||
this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + lstShopIdTemp.Count;
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count;
|
||||
i++;
|
||||
}));
|
||||
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
continue;
|
||||
|
||||
#region 检测登录
|
||||
if (shop.LoginStatus != "登录成功")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ShopListForm.Instance == null)
|
||||
ShopListForm.Instance = new ShopListForm();
|
||||
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
|
||||
if (shop.LoginStatus != "登录成功")
|
||||
{
|
||||
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 = GetPriceAdjustList(shop, page, chkHasSuccess.Checked ? "已调价" : "待调价");
|
||||
if (jsonStr.Contains("指定的值含有无效的控制字符"))
|
||||
{
|
||||
BaseMsgForm.ShowError("店铺" + shop.LoginName + " " + shop.ShopId + "已掉线");
|
||||
isError = true;
|
||||
break;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
|
||||
{
|
||||
tryCount++;
|
||||
goto tryAgain;
|
||||
}
|
||||
if (!jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
isError = true;
|
||||
string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
|
||||
if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr))
|
||||
errMsg += sErr + " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
var jArr = new JArray();
|
||||
try
|
||||
{
|
||||
var jObj = JObject.Parse(jsonStr);
|
||||
jArr = jObj["result"]?["list"] as JArray;
|
||||
if (jArr == null)
|
||||
jArr = new JArray();
|
||||
}
|
||||
catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
|
||||
foreach (var item in jArr)
|
||||
{
|
||||
string sItem = item.ToString();
|
||||
TemuPriceAdjustInfo pInfo = JsonHelper.DeserializeJsonToObject<TemuPriceAdjustInfo>(sItem); // 反序列化得到类
|
||||
if (pInfo != null && !lstPriceAdjustInfo.Any(a=>a.priceOrderSn == pInfo.priceOrderSn))
|
||||
{
|
||||
lstPriceAdjustInfo.Add(pInfo);
|
||||
|
||||
string url = pInfo.image.Replace("https", "http");
|
||||
var image = Image.FromStream(WebRequest.Create(url).GetResponse().GetResponseStream());
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
int rowId = this.dgvAdjust.Rows.Add(
|
||||
true,
|
||||
pInfo.supplierId,
|
||||
shop.ShopAccount, // pInfo.supplierName, // 列表里取不到,这里取shop里的
|
||||
pInfo.priceOrderSn,
|
||||
image, // skc图片
|
||||
pInfo.productId,
|
||||
pInfo.skcId,
|
||||
pInfo.productName + "\r\n" + pInfo.skuSpecs, // 商品标题+sku名称
|
||||
string.IsNullOrEmpty(pInfo.activityInvitationName)? "日常价格" : pInfo.activityInvitationName, // 申报价格类型
|
||||
pInfo.skuInfoItemList.FirstOrDefault()?.price.ParseToDecimal() / 100, // 当前申报价格
|
||||
pInfo.newSupplyPrice?.ParseToDecimal() / 100, // 调整后的申报价格
|
||||
pInfo.skuInfoItemList.FirstOrDefault()?.currencyName, // 币种
|
||||
pInfo.source, // 申请来源
|
||||
"", // 调价类型
|
||||
pInfo.adjustReason, // 调价原因
|
||||
"" // 操作结果,状态
|
||||
);
|
||||
|
||||
dgvAdjust.Rows[rowId].Height = 60;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
|
||||
totalPage = Math.Ceiling(total / 10.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(() =>
|
||||
{
|
||||
chkHasSuccess.Enabled = true;
|
||||
ucGroupBoxEx2.Enabled = true;
|
||||
ucGroupBoxEx4.Enabled = true;
|
||||
string sRst = "查询结束!";
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
sRst = "已取消查询!";
|
||||
|
||||
BaseMsgForm.ShowInfo(sRst);
|
||||
this.statusBar.lblTaskStatus.Text = sRst;
|
||||
}));
|
||||
}, cancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据店铺获取调价单列表
|
||||
/// </summary>
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
private string GetPriceAdjustList(DouShopLoginInfo shop, int page = 1, string type = "待调价")
|
||||
{
|
||||
page = Math.Max(page, 1);
|
||||
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/magneto/price-adjust/page-query";
|
||||
string body;
|
||||
if (type == "待调价")
|
||||
body = @"{""pageInfo"":{""pageSize"":10,""pageNo"":" + page + @"},""status"":1,""quickSearch"":[]}";
|
||||
else
|
||||
body = @"{""pageInfo"":{""pageSize"":10,""pageNo"":" + page + @"},""status"":2,""quickSearch"":[]}";
|
||||
|
||||
string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
|
||||
return ProductResponse.GetPostResponse(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private void panelEx1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (cancellationTokenSource != null)
|
||||
cancellationTokenSource.Cancel();
|
||||
}
|
||||
|
||||
private void btnStartStockUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
var lstSn = dgvAdjust.Rows.Cast<DataGridViewRow>().Where(row
|
||||
=> row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colPriceOrderSn"]?.Value.ToString()).ToList();
|
||||
var lstPriceAdjust = lstPriceAdjustInfo.Where(s => lstSn.Contains(s.priceOrderSn.ParseToString())).ToList();
|
||||
if (lstPriceAdjust.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowInfo("请选择要拒绝跟价的商品!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(txtScale1.Text.Trim()))
|
||||
{
|
||||
BaseMsgForm.ShowInfo("请输入拒绝跟价理由!");
|
||||
return;
|
||||
}
|
||||
|
||||
ucGroupBoxEx2.Enabled = false;
|
||||
ucGroupBoxEx4.Enabled = false;
|
||||
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
Task.Run(() =>
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var priceAdjust in lstPriceAdjust)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
this.statusBar.lblTaskStatus.Text = "正在创建备货单...";
|
||||
this.statusBar.pgbTaskProgress.Value = (i + 1);
|
||||
this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + lstPriceAdjust.Count;
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstPriceAdjust.Count;
|
||||
i++;
|
||||
}));
|
||||
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
var rows = this.dgvAdjust.Rows.Cast<DataGridViewRow>().Where(r =>
|
||||
r.Cells["colPriceOrderSn"].Value.ToString() == priceAdjust.priceOrderSn.ParseToString());
|
||||
|
||||
|
||||
if (priceAdjust.isRefuseAdjust == true)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMsg"].Value = "已拒绝跟价";
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == priceAdjust.supplierId.ToString());
|
||||
if (shop == null || shop.LoginStatus != "登录成功")
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMsg"].Value = "店铺掉线或不存在";
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMsg"].Value = "正在操作";
|
||||
}
|
||||
}));
|
||||
|
||||
Thread.Sleep(200 + Randomx.GetId(100));
|
||||
|
||||
//var adjustLst = lstPriceAdjustInfo.Where(a => a.skuIds == priceAdjust.skuIds && a.isRefuseAdjust == false).ToList();
|
||||
var adjustLst = lstPriceAdjustInfo.Where(a =>
|
||||
priceAdjust.skuInfoItemList.Any(sku => a.skuIds.Contains(sku.productSkuId.ToString())) && a.isRefuseAdjust == false).ToList();
|
||||
var adjustStrLst = adjustLst.Select(s => s.id.ParseToString()).ToList();
|
||||
|
||||
|
||||
string jsonStr = this.refuseAdjust(shop, adjustStrLst, this.txtScale1.Text.Trim());
|
||||
bool isError = !jsonStr.Contains("\"success\":true");
|
||||
string sErrMsg1 = BaseRegex.GetStringJson(ref jsonStr, "errorMsg").ParseToString();
|
||||
if (!isError)
|
||||
{
|
||||
foreach(var adj in adjustLst)
|
||||
{
|
||||
adj.isRefuseAdjust = true;
|
||||
}
|
||||
}
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
if (!isError)
|
||||
{
|
||||
priceAdjust.isRefuseAdjust = true;
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMsg"].Value = "已拒绝跟价";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMsg"].Value = "拒绝跟价失败:" + sErrMsg1;
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ucGroupBoxEx2.Enabled = true;
|
||||
ucGroupBoxEx4.Enabled = true;
|
||||
string sRst = "操作结束(拒绝跟价)!";
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
sRst = "已取消操作(拒绝跟价)!";
|
||||
|
||||
BaseMsgForm.ShowInfo(sRst);
|
||||
this.statusBar.lblTaskStatus.Text = sRst;
|
||||
}));
|
||||
}, cancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拒绝跟价
|
||||
/// </summary>
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="subOrderInfo"></param>
|
||||
/// <returns></returns>
|
||||
private string refuseAdjust(DouShopLoginInfo shop, List<string> adjustIdList, string refuseReason)
|
||||
{
|
||||
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/gmp/bg/magneto/api/price-adjust/batch/adjust";
|
||||
string body = "{\"adjustList\":[";
|
||||
foreach (var adjustId in adjustIdList)
|
||||
{
|
||||
body += "{\"adjustId\":" + adjustId + ",\"result\":2,\"reason\":\"" + refuseReason + "\"},";
|
||||
}
|
||||
body = body.TrimEnd(',');
|
||||
body += "]}";
|
||||
string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
|
||||
return ProductResponse.GetPostResponse(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private void dgvStock_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
string columnName = dgvAdjust.Columns[e.ColumnIndex].Name;
|
||||
var row = dgvAdjust.Rows[e.RowIndex];
|
||||
switch (columnName)
|
||||
{
|
||||
case "colCheck":
|
||||
row.Cells["colCheck"].Value = !row.Cells["colCheck"].Value.ParseToBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user