云库数据上传
This commit is contained in:
1 parent
cd82a1ec15
commit
dc977c45d8
12 files changed
+275
-96
No files matched your search
@@ -8,6 +8,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TemuKJD.BLL.ImportConverts;
|
||||
@@ -16,7 +17,7 @@ using Work;
|
||||
namespace TemuKJD.BLL
|
||||
{
|
||||
public class PDDProdFormConverter
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// 拼多多前端采集转拼多多后台采集数据
|
||||
/// </summary>
|
||||
@@ -24,7 +25,7 @@ namespace TemuKJD.BLL
|
||||
/// <param name="UpdateOldData"></param>
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvert(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false)
|
||||
public string PddFrontToPddBackConvert(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false, bool isSaveDb = true)
|
||||
{
|
||||
PDDFrontProductInfo frontProdInfo = null;
|
||||
try
|
||||
@@ -328,8 +329,12 @@ namespace TemuKJD.BLL
|
||||
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
|
||||
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (!isSaveDb)
|
||||
return "success" + dbProd.product_json;
|
||||
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (IsCollectAuthorityUser)
|
||||
collectAuthorityTag = "-" + BaseClass.UserName;
|
||||
|
||||
@@ -406,7 +411,7 @@ namespace TemuKJD.BLL
|
||||
/// <param name="UpdateOldData"></param>
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvert2(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false)
|
||||
public string PddFrontToPddBackConvert2(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false, bool isSaveDb = true)
|
||||
{
|
||||
PDDFrontProductInfo2 frontProdInfo = null;
|
||||
try
|
||||
@@ -800,8 +805,11 @@ namespace TemuKJD.BLL
|
||||
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
|
||||
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (!isSaveDb)
|
||||
return "success" + dbProd.product_json;
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (IsCollectAuthorityUser)
|
||||
collectAuthorityTag = "-" + BaseClass.UserName;
|
||||
|
||||
@@ -880,7 +888,7 @@ namespace TemuKJD.BLL
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <param name="IsCollectAuthorityUser"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvert3(string outProdJson3, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false)
|
||||
public string PddFrontToPddBackConvert3(string outProdJson3, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false, bool isSaveDb = true)
|
||||
{
|
||||
initDataObjInfo frontProdInfo = null;
|
||||
try
|
||||
@@ -1201,8 +1209,11 @@ namespace TemuKJD.BLL
|
||||
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
|
||||
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (!isSaveDb)
|
||||
return "success" + dbProd.product_json;
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (IsCollectAuthorityUser)
|
||||
collectAuthorityTag = "-" + BaseClass.UserName;
|
||||
|
||||
@@ -1282,7 +1293,7 @@ namespace TemuKJD.BLL
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <param name="IsCollectAuthorityUser"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvertV4(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false)
|
||||
public string PddFrontToPddBackConvertV4(string outProdJson, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false, bool isSaveDb = true)
|
||||
{
|
||||
|
||||
|
||||
@@ -1603,8 +1614,11 @@ namespace TemuKJD.BLL
|
||||
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
|
||||
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (!isSaveDb)
|
||||
return "success" + dbProd.product_json;
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (IsCollectAuthorityUser)
|
||||
collectAuthorityTag = "-" + BaseClass.UserName;
|
||||
|
||||
@@ -1675,20 +1689,23 @@ namespace TemuKJD.BLL
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外来格式V5
|
||||
/// </summary>
|
||||
/// <param name="outProdJson"></param>
|
||||
/// <param name="UpdateOldData"></param>
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <param name="IsCollectAuthorityUser"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvertFactory(string filePath, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false)
|
||||
/// <summary>
|
||||
/// 外来格式V5
|
||||
/// </summary>
|
||||
/// <param name="outProdJson"></param>
|
||||
/// <param name="UpdateOldData"></param>
|
||||
/// <param name="specialProdType"></param>
|
||||
/// <param name="IsCollectAuthorityUser"></param>
|
||||
/// <returns></returns>
|
||||
public string PddFrontToPddBackConvertFactory(string filePath, bool UpdateOldData = true, string specialProdType = null, bool IsCollectAuthorityUser = false, bool isSaveDb = true, string content = null)
|
||||
{
|
||||
PDDFrontProductInfo5 frontProdInfo = null;
|
||||
try
|
||||
{
|
||||
frontProdInfo = ConverterToPddFactory.Convert(filePath);
|
||||
if (!content.IsNullOrEmpty())
|
||||
frontProdInfo = ConverterToPddFactory.SetContentConvert(content);
|
||||
else
|
||||
frontProdInfo = ConverterToPddFactory.Convert(filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1992,8 +2009,11 @@ namespace TemuKJD.BLL
|
||||
dbProd.main_img = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url;
|
||||
dbProd.product_json = JsonHelper.SerializeObject(prodInfo);
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (!isSaveDb)
|
||||
return "success" + dbProd.product_json;
|
||||
|
||||
// 商品采集权限用户采集的数据加上用户前缀(商品前缀显示给用户的时候隐藏)
|
||||
string collectAuthorityTag = "";
|
||||
if (IsCollectAuthorityUser)
|
||||
collectAuthorityTag = "-" + BaseClass.UserName;
|
||||
|
||||
|
||||
Reference in new issue
Block a user