自动上报违规商品
上货自动检测违规商品
自动下架违规商品
This commit is contained in:
chfei committed 2026-10-30 14:14:14 +08:00
1 parent a319af0e91
commit d5e38dd518
9 files changed
+308 -19

No files matched your search

@@ -675,7 +675,7 @@ namespace TemuKJD.WXForms.ProductForms
item.Cells["colSelect"].Value = wxUploadRule.SelectedShopIds.Contains(shopId);
}
}
isInit = true;
}
@@ -1715,6 +1715,36 @@ namespace TemuKJD.WXForms.ProductForms
}));
}
// 开启上货自动剔除时,上传前检测违规状态;违规或检测失败均禁止上传。
if (GlobalConfig.GlobalSettings.AutoExcludeViolationProductsOnUpload)
{
try
{
if (!long.TryParse(dbProd.spu_id, out var goodsId) || goodsId <= 0)
throw new Exception("商品ID无效");
var statuses = CloudGoodsService.GetViolationStatus(new List<long> { goodsId }).GetAwaiter().GetResult();
var status = statuses.FirstOrDefault(item => item.GoodsId == goodsId);
if (status == null)
throw new Exception("未返回当前商品的违规状态");
if (status.IsViolation)
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"当前商品违规,禁止上传\"}";
}
catch (Exception ex)
{
if (cell != null)
Invoke(new Action(() => cell.Value = "商品违规检测失败,禁止上传"));
return JsonConvert.SerializeObject(new
{
success = false,
draftId = 0,
status = "未上传",
errMsg = "商品违规检测失败,禁止上传:" + ex.Message
});
}
}
#region 裂变标题
if (BaseClass.UserAuthority.Contains("裂变调试") && chkFissionGoodsName.Checked)
{