调整客户端所有页面支持 店铺id 名称 分组 筛选功能
This commit is contained in:
1 parent
a23020725a
commit
ec170f4285
33 files changed
+1571
-799
No files matched your search
@@ -59,7 +59,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
/// <summary>
|
||||
/// jit开通参数配置
|
||||
/// </summary>
|
||||
List<OpenJitParams> lstOpenJitParams = null;
|
||||
List<OpenJitFullParams> lstOpenJitParams = null;
|
||||
|
||||
public TemuJitForm()
|
||||
{
|
||||
@@ -108,9 +108,9 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
this.chkSearchTime.CheckedChanged += Txt_TextChanged;
|
||||
|
||||
// 读取货号开通jit参数
|
||||
lstOpenJitParams = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<OpenJitParams>>("open_jit_params");
|
||||
lstOpenJitParams = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<OpenJitFullParams>>("open_jit_params");
|
||||
if (lstOpenJitParams == null)
|
||||
lstOpenJitParams = new List<OpenJitParams>();
|
||||
lstOpenJitParams = new List<OpenJitFullParams>();
|
||||
}
|
||||
|
||||
private void Txt_TextChanged(object sender, EventArgs e)
|
||||
@@ -168,17 +168,17 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
|
||||
|
||||
var shopLst = GlobalConfig.ShopLoginList.ToList();
|
||||
if (!string.IsNullOrWhiteSpace(txtShopId.Text))
|
||||
if (!string.IsNullOrWhiteSpace(txtShopId.Text.Trim()))
|
||||
{
|
||||
shopLst = shopLst.Where(s => txtShopId.Text.Contains(s.ShopId)).ToList();
|
||||
shopLst = shopLst.Where(s => ("," + txtShopId.Text.Trim() + ",").Contains("," + s.ShopId + ",") || s.ShopId.Contains(txtShopId.Text.Trim())).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(txtShopName.Text))
|
||||
if (!string.IsNullOrWhiteSpace(txtShopName.Text.Trim()))
|
||||
{
|
||||
shopLst = shopLst.Where(s => txtShopName.Text.Contains(s.ShopAccount)).ToList();
|
||||
shopLst = shopLst.Where(s => ("," + txtShopName.Text.Trim() + ",").Contains("," + s.ShopAccount + ",") || s.ShopAccount.ToLower().Contains(txtShopName.Text.Trim().ToLower())).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(txtNotes.Text))
|
||||
if (!string.IsNullOrWhiteSpace(txtNotes.Text.Trim()))
|
||||
{
|
||||
shopLst = shopLst.Where(s => txtNotes.Text.Contains(s.Notes)).ToList();
|
||||
shopLst = shopLst.Where(s => ("," + txtNotes.Text.Trim() + ",").Contains("," + s.Notes + ",") || s.Notes.ToLower().Contains(txtNotes.Text.Trim().ToLower())).ToList();
|
||||
}
|
||||
|
||||
// 获取被删除的店铺
|
||||
@@ -793,10 +793,11 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
this.dgvExtCode.Rows.Clear();
|
||||
foreach (var ext in extCodeLst)
|
||||
{
|
||||
var paramsExist = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == ext);
|
||||
this.dgvExtCode.Rows.Add(
|
||||
false,
|
||||
false,
|
||||
ext,
|
||||
lstOpenJitParams.Any(p => p.ExtCode == ext) ? "查看" : "未设置"
|
||||
paramsExist != null ? ("价:" + paramsExist.PriceMin + "-" + paramsExist.PriceMax + ";库:" + paramsExist.Stock) : "未设置"
|
||||
);
|
||||
}
|
||||
}));
|
||||
@@ -1344,6 +1345,12 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
BaseMsgForm.ShowError(checkJitParamRst);
|
||||
return;
|
||||
}
|
||||
checkJitParamRst = CheckExtCodeJitParam();
|
||||
if (!string.IsNullOrEmpty(checkJitParamRst))
|
||||
{
|
||||
BaseMsgForm.ShowError(checkJitParamRst);
|
||||
return;
|
||||
}
|
||||
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
pbLoading.Visible = true;
|
||||
@@ -1396,6 +1403,46 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
return "";
|
||||
}
|
||||
|
||||
string CheckExtCodeJitParam()
|
||||
{
|
||||
var dgvRows = this.dgvExtCode.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelectExtCode"].Value.ParseToBool() == true).ToList();
|
||||
foreach (var dgvRow in dgvRows)
|
||||
{
|
||||
// 如果货号存在Jit开通配置,按货号指定配置开通
|
||||
var extCode = dgvRow.Cells["colFilterExtCode"].Value.ParseToString();
|
||||
var extCodeOpenJitParams = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == extCode);
|
||||
if (extCodeOpenJitParams != null)
|
||||
{
|
||||
var minPriceFen = (extCodeOpenJitParams.PriceMin * 100).ParseToInt();
|
||||
var maxPriceFen = (extCodeOpenJitParams.PriceMax * 100).ParseToInt();
|
||||
var identifyCode = extCodeOpenJitParams.IdentifyCode;
|
||||
var realPicture = extCodeOpenJitParams.RealPicture;
|
||||
var stock = extCodeOpenJitParams.Stock;
|
||||
|
||||
if (chkBatchPrice.Checked && (minPriceFen < 500 || maxPriceFen < 500 || maxPriceFen < minPriceFen))
|
||||
{
|
||||
return "请为选中的货号:" + extCode + " 合理设置价格!至少为 5 且最大值不能小于最小值!";
|
||||
}
|
||||
|
||||
if (chkBatchIdentifyCode.Checked && identifyCode.IsNullOrEmpty())
|
||||
{
|
||||
return "请为选中的货号:" + extCode + " 填写识别码!";
|
||||
}
|
||||
|
||||
if (chkBatchRealPicture.Checked && realPicture.IsNullOrEmpty())
|
||||
{
|
||||
return "请为选中的货号:" + extCode + " 选择实拍图!";
|
||||
}
|
||||
|
||||
if (chkBatchStock.Checked && stock < 1)
|
||||
{
|
||||
return "请为选中的货号:" + extCode + " 设置合理库存!大于 0 !";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void AutoJit(int type = 1)
|
||||
{
|
||||
//var batchExtCodeLst = txtBatchExtCode.Text.Trim().Split(new string[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -1907,7 +1954,8 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
FilterRows();
|
||||
break;
|
||||
case "JIT配置":
|
||||
if (row.Cells[e.ColumnIndex].Value.ParseToString() == "查看")
|
||||
case "JIT配置(点击显示详情)":
|
||||
if (row.Cells[e.ColumnIndex].Value.ParseToString() != "未设置")
|
||||
{
|
||||
var extCode = row.Cells["colFilterExtCode"].Value.ParseToString();
|
||||
var jitParam = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == extCode);
|
||||
@@ -1926,7 +1974,7 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
}
|
||||
}
|
||||
|
||||
string DisplayOpenJitParams(OpenJitParams jitParam)
|
||||
string DisplayOpenJitParams(OpenJitFullParams jitParam)
|
||||
{
|
||||
this.txtBatchPriceMin.Text = jitParam.PriceMin.ToString();
|
||||
this.txtBatchPriceMax.Text = jitParam.PriceMax.ToString();
|
||||
@@ -1934,14 +1982,21 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
this.txtBatchStock.Text = jitParam.Stock.ToString();
|
||||
try
|
||||
{
|
||||
Image image = Image.FromFile(jitParam.RealPicture);
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
if (!string.IsNullOrEmpty(jitParam.RealPicture))
|
||||
{
|
||||
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
byte[] imageBytes = memoryStream.ToArray();
|
||||
Image image = Image.FromFile(jitParam.RealPicture);
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
byte[] imageBytes = memoryStream.ToArray();
|
||||
}
|
||||
this.pbBatchRealPicture.Image = image;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pbBatchRealPicture.Image = new Bitmap(1,1);
|
||||
}
|
||||
this.pbBatchRealPicture.Tag = jitParam.RealPicture;
|
||||
this.pbBatchRealPicture.Image = image;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -2272,7 +2327,7 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
foreach (var extCode in extCodeLst)
|
||||
{
|
||||
lstOpenJitParams.RemoveAll(p => p.ExtCode == extCode);
|
||||
var jitParam = new OpenJitParams()
|
||||
var jitParam = new OpenJitFullParams()
|
||||
{
|
||||
ExtCode = extCode,
|
||||
IdentifyCode = txtBatchIdentifyCode.Text.Trim(),
|
||||
@@ -2283,11 +2338,13 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
};
|
||||
lstOpenJitParams.Add(jitParam);
|
||||
}
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("open_jit_params", lstOpenJitParams);
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("open_jit_params", JsonHelper.DeserializeJsonToList<OpenJitParamsNoImg>(JsonHelper.SerializeObject(lstOpenJitParams)));
|
||||
BaseMsgForm.ShowInfo("选中货号的JIT配置已保存!");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colJitConfig"].Value = "查看";
|
||||
var ext = row.Cells["colFilterExtCode"].Value.ParseToString();
|
||||
var paramsExist = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == ext);
|
||||
row.Cells["colJitConfig"].Value = ("价:" + paramsExist.PriceMin + "-" + paramsExist.PriceMax + ";库:" + paramsExist.Stock); // "查看";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2317,6 +2374,12 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pbBatchRealPicture_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowImgForm imgForm = new ShowImgForm(pbBatchRealPicture.Image);
|
||||
imgForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
// jit操作查询相关设置
|
||||
@@ -2332,9 +2395,9 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开开通jit配置参数
|
||||
/// 开通jit配置参数
|
||||
/// </summary>
|
||||
public class OpenJitParams
|
||||
public class OpenJitFullParams
|
||||
{
|
||||
public string ExtCode { get; set; }
|
||||
public decimal PriceMin { get; set; }
|
||||
@@ -2343,6 +2406,17 @@ Content-Disposition: form-data; name=""upload_sign""
|
||||
public string RealPicture { get; set; }
|
||||
public int Stock { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 因为每家店铺图片不一致,所以保存价格和数量,但是图片和识别码不保存
|
||||
/// </summary>
|
||||
public class OpenJitParamsNoImg
|
||||
{
|
||||
public string ExtCode { get; set; }
|
||||
public decimal PriceMin { get; set; }
|
||||
public decimal PriceMax { get; set; }
|
||||
public int Stock { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合规信息
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user