7 changed files with 721 additions and 12 deletions
@ -0,0 +1,83 @@ |
|||||
|
using System.IO; |
||||
|
using System.Security.Cryptography; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWYB.Common.Extensions |
||||
|
{ |
||||
|
public static class EncryptionExtension |
||||
|
{ |
||||
|
|
||||
|
public static string Md5Encrypt(this string originStr) |
||||
|
{ |
||||
|
using (var md5 = MD5.Create()) |
||||
|
{ |
||||
|
return string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(originStr)).Select(x => x.ToString("x2"))); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//AES加密 传入,要加密的串和, 解密key
|
||||
|
public static string AESEncrypt(this string input) |
||||
|
{ |
||||
|
var key = "dataplatform2019"; |
||||
|
var ivStr = "1012132405963708"; |
||||
|
|
||||
|
var encryptKey = Encoding.UTF8.GetBytes(key); |
||||
|
var iv = Encoding.UTF8.GetBytes(ivStr); //偏移量,最小为16
|
||||
|
using (var aesAlg = Aes.Create()) |
||||
|
{ |
||||
|
using (var encryptor = aesAlg.CreateEncryptor(encryptKey, iv)) |
||||
|
{ |
||||
|
using (var msEncrypt = new MemoryStream()) |
||||
|
{ |
||||
|
using (var csEncrypt = new CryptoStream(msEncrypt, encryptor, |
||||
|
CryptoStreamMode.Write)) |
||||
|
|
||||
|
using (var swEncrypt = new StreamWriter(csEncrypt)) |
||||
|
{ |
||||
|
swEncrypt.Write(input); |
||||
|
} |
||||
|
var decryptedContent = msEncrypt.ToArray(); |
||||
|
|
||||
|
return Convert.ToBase64String(decryptedContent); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static string AESDecrypt(this string cipherText) |
||||
|
{ |
||||
|
var fullCipher = Convert.FromBase64String(cipherText); |
||||
|
|
||||
|
var ivStr = "1012132405963708"; |
||||
|
var key = "dataplatform2019"; |
||||
|
|
||||
|
var iv = Encoding.UTF8.GetBytes(ivStr); |
||||
|
var decryptKey = Encoding.UTF8.GetBytes(key); |
||||
|
|
||||
|
using (var aesAlg = Aes.Create()) |
||||
|
{ |
||||
|
using (var decryptor = aesAlg.CreateDecryptor(decryptKey, iv)) |
||||
|
{ |
||||
|
string result; |
||||
|
using (var msDecrypt = new MemoryStream(fullCipher)) |
||||
|
{ |
||||
|
using (var csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) |
||||
|
{ |
||||
|
using (var srDecrypt = new StreamReader(csDecrypt)) |
||||
|
{ |
||||
|
result = srDecrypt.ReadToEnd(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static string Base64Encrypt(this string originStr) |
||||
|
{ |
||||
|
return Convert.ToBase64String(Encoding.UTF8.GetBytes(originStr)); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,113 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Db |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商表
|
||||
|
/// </summary>
|
||||
|
[Table(Name = "purchaser", DisableSyncStructure = true)] |
||||
|
public partial class Purchaser |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商Id (1688 SellerUserId)
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 20, IsPrimary = true, IsNullable = false)] |
||||
|
public string Id { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商Id2 (1688 SellerLoginId)
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string Id2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发货地(产地)
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string Location { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 经营模式
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string ManagmentMode { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string MemberId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商名称
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购平台
|
||||
|
/// </summary>
|
||||
|
[Column(MapType = typeof(int?))] |
||||
|
public Enums.Platform? Platform { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 商家标签 (超级工厂/实力工厂/实力供应商),可空
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 20)] |
||||
|
public string Tag { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定SPU数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? BindingSpuCount { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购SPU数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? PurchasedSpuCount { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定SKU数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? BindingSkuCount { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购SKU数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? PurchasedSkuCount { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购次数/采购订单数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? PurchasedCount { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购金额
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "decimal(18,2)")] |
||||
|
public decimal? PurchasedAmount { get; set; } = 0.00M; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上次采购时间
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "datetime")] |
||||
|
public DateTime? LastPurchasedTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 最近90天采购金额
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "decimal(18,2)")] |
||||
|
public decimal? Recent90dPurchasedAmount { get; set; } = 0.00M; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 最近90天采购次数
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "decimal(18,2)")] |
||||
|
public decimal? Recent90dPurchasedCount { get; set; } = 0.00M; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Db |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购方案商品表
|
||||
|
/// </summary>
|
||||
|
[Table(Name = "purchaseschemeproduct", DisableSyncStructure = true)] |
||||
|
public partial class PurchaseSchemeProduct |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商品和采购方案的关系Id
|
||||
|
/// </summary>
|
||||
|
[Column(IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
[Column(DbType = "datetime")] |
||||
|
public DateTime? CreateTime { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50, IsNullable = false)] |
||||
|
public string ProductId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商品Id
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50, IsNullable = false)] |
||||
|
public string PurchaseProductId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商品链接
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 100)] |
||||
|
public string PurchaseUrl { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50, IsNullable = false)] |
||||
|
public string SkuId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sku采购方案Id
|
||||
|
/// </summary>
|
||||
|
public long SkuPurchaseSchemeId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商Id
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 20)] |
||||
|
public string PurchaserId { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,359 @@ |
|||||
|
namespace BBWYB.Server.Model |
||||
|
{ |
||||
|
public class Enums |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 电商平台 淘宝 = 0,京东 = 1,阿里巴巴 = 2,拼多多 = 3,微信 = 4,拳探 = 10,抖音 = 11
|
||||
|
/// </summary>
|
||||
|
public enum Platform |
||||
|
{ |
||||
|
淘宝 = 0, |
||||
|
京东 = 1, |
||||
|
阿里巴巴 = 2, |
||||
|
拼多多 = 3, |
||||
|
微信 = 4, |
||||
|
拳探 = 10, |
||||
|
抖音 = 11 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购方式 线上采购 = 0,关联外部单 = 1,手动下单 = 2
|
||||
|
/// </summary>
|
||||
|
public enum PurchaseMethod |
||||
|
{ |
||||
|
线上采购 = 0, |
||||
|
关联外部单 = 1, |
||||
|
手动下单 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购单模式 批发 = 0,代发 = 1
|
||||
|
/// </summary>
|
||||
|
public enum PurchaseOrderMode |
||||
|
{ |
||||
|
批发 = 0, |
||||
|
代发 = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 仓储类型
|
||||
|
/// </summary>
|
||||
|
public enum StorageType |
||||
|
{ |
||||
|
京仓 = 0, |
||||
|
云仓 = 1, |
||||
|
本地自发 = 2, |
||||
|
代发 = 3, |
||||
|
SD = 4 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单类型
|
||||
|
/// </summary>
|
||||
|
public enum OrderType |
||||
|
{ |
||||
|
#region JD订单类型
|
||||
|
SOP = 22, |
||||
|
LOC = 75, |
||||
|
FBP = 21 |
||||
|
#endregion
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 支付方式
|
||||
|
/// </summary>
|
||||
|
public enum PayType |
||||
|
{ |
||||
|
货到付款 = 1, |
||||
|
邮局汇款 = 2, |
||||
|
自提 = 3, |
||||
|
在线支付 = 4, |
||||
|
公司转账 = 5, |
||||
|
银行卡转账 = 6 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单状态
|
||||
|
/// <para>待付款 = 0</para>
|
||||
|
/// <para>等待采购 = 1, 部分采购 = 110</para>
|
||||
|
/// <para>待发货 = 2, 部分发货 = 120</para>
|
||||
|
/// <para>待收货 = 3, 部分收货 = 130</para>
|
||||
|
/// <para>已完成 = 4</para>
|
||||
|
/// <para>已取消 = 6</para>
|
||||
|
/// <para>待验收 = 140</para>
|
||||
|
/// <para>待核算 = 150</para>
|
||||
|
/// </summary>
|
||||
|
public enum OrderState |
||||
|
{ |
||||
|
待付款 = 0, |
||||
|
等待采购 = 1, |
||||
|
部分采购 = 110, |
||||
|
待发货 = 2, |
||||
|
部分发货 = 120, |
||||
|
待收货 = 3, |
||||
|
部分收货 = 130, |
||||
|
已完成 = 4, |
||||
|
已取消 = 6, |
||||
|
待验收 = 140, |
||||
|
待核算 = 150 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购单状态 待发货 = 0, 部分发货=1, 待收货 = 10, 部分收货=11, 已签收 = 20, 已取消 = 100
|
||||
|
/// </summary>
|
||||
|
public enum PurchaseOrderState |
||||
|
{ |
||||
|
待发货 = 0, |
||||
|
部分发货 = 1, |
||||
|
待收货 = 10, |
||||
|
部分收货 = 11, |
||||
|
已签收 = 20, |
||||
|
已取消 = 100 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 刷单类型
|
||||
|
/// </summary>
|
||||
|
public enum SDType |
||||
|
{ |
||||
|
自刷 = 0, |
||||
|
其他 = 1, |
||||
|
京礼金 = 2, |
||||
|
刷单组 = 3 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单同步任务状态
|
||||
|
/// </summary>
|
||||
|
public enum OrderSyncState |
||||
|
{ |
||||
|
Running = 0, |
||||
|
End = 1 |
||||
|
} |
||||
|
|
||||
|
public enum PayChannelType |
||||
|
{ |
||||
|
支付宝 = 0, |
||||
|
微信 = 1, |
||||
|
银行卡 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 服务单处理结果
|
||||
|
/// </summary>
|
||||
|
public enum ServiceResult |
||||
|
{ |
||||
|
退货 = 0, |
||||
|
换新 = 1, |
||||
|
原返 = 2, |
||||
|
线下换新 = 3, |
||||
|
维修 = 4, |
||||
|
商品补发 = 5, |
||||
|
仅退款 = 6, |
||||
|
SD退货 = 7 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 商品处理方式
|
||||
|
/// </summary>
|
||||
|
public enum ProductResult |
||||
|
{ |
||||
|
一件代发_退回厂家 = 0, |
||||
|
退回齐越仓 = 1, |
||||
|
退回京仓 = 2, |
||||
|
退回云仓 = 3, |
||||
|
客户无退货 = 4 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 商品情况
|
||||
|
/// </summary>
|
||||
|
public enum ProductHealth |
||||
|
{ |
||||
|
可二次销售 = 0, |
||||
|
残次品_无法二次销售 = 1, |
||||
|
厂家退货退款 = 2, |
||||
|
客户无退货 = 3, |
||||
|
破损 = 4 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 排序时间类型 ModifyTime = 0, StartTime = 1
|
||||
|
/// </summary>
|
||||
|
public enum SortTimeType |
||||
|
{ |
||||
|
ModifyTime = 0, StartTime = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 支付账单类型
|
||||
|
/// </summary>
|
||||
|
public enum PayBillType |
||||
|
{ |
||||
|
支付宝 = 0, |
||||
|
微信 = 1, |
||||
|
银行卡 = 2 |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 资金类型
|
||||
|
/// </summary>
|
||||
|
public enum AuditCapitalType |
||||
|
{ |
||||
|
当月商品采购 = 0, |
||||
|
当月商品退款 = 1, |
||||
|
上月商品采购 = 2, |
||||
|
上月商品退款 = 3, |
||||
|
批量采购商品 = 4, |
||||
|
采购运费 = 5, |
||||
|
入仓运费 = 6, |
||||
|
售后成本 = 7, |
||||
|
发票点数 = 8, |
||||
|
快递单号 = 9, |
||||
|
诚e赊还款 = 10, |
||||
|
空单号 = 11, |
||||
|
购买刷单号 = 12, |
||||
|
手机费 = 13, |
||||
|
质检报告 = 14, |
||||
|
备用金转入 = 15, |
||||
|
平台补贴 = 16, |
||||
|
快递赔付 = 17, |
||||
|
自定义 = 18, |
||||
|
备用金充值 = 19 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 京东仓库类型 1商家仓 2京东仓
|
||||
|
/// </summary>
|
||||
|
public enum StockType |
||||
|
{ |
||||
|
商家仓 = 1, 京仓 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 仓库状态 0暂停,1使用
|
||||
|
/// </summary>
|
||||
|
public enum StockStatus |
||||
|
{ |
||||
|
暂停 = 0, 使用 = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// SKU库存周期 暂无周期=0,增长期=1,稳定期=2,衰退期=3
|
||||
|
/// </summary>
|
||||
|
public enum SkuStockNumCycleType |
||||
|
{ |
||||
|
暂无周期 = 0, |
||||
|
增长期 = 1, |
||||
|
稳定期 = 2, |
||||
|
衰退期 = 3 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 司南周期 暂无周期 = -1,成长加速期 = 0,成熟利润期 = 1,稳定日销期 = 2,策马奔腾期 = 3
|
||||
|
/// </summary>
|
||||
|
public enum SiNanCycleType |
||||
|
{ |
||||
|
暂无周期 = -1, |
||||
|
成长加速期 = 0, |
||||
|
成熟利润期 = 1, |
||||
|
稳定日销期 = 2, |
||||
|
策马奔腾期 = 3 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 促销任务状态 等待 = 0,进行中 = 1,已完成 = 2, 已停止 = 3
|
||||
|
/// </summary>
|
||||
|
public enum PromitionTaskStatus |
||||
|
{ |
||||
|
等待 = 0, |
||||
|
进行中 = 1, |
||||
|
已完成 = 2, |
||||
|
已停止 = 3 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// AppKey类型 全类型 = 0, 订单管理 = 1, 商品管理 = 2
|
||||
|
/// </summary>
|
||||
|
public enum AppKeyType |
||||
|
{ |
||||
|
全类型 = 0, 订单管理 = 1, 商品管理 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商品API模式 Spider = 0,OneBound = 1
|
||||
|
/// </summary>
|
||||
|
public enum PurchaseProductAPIMode |
||||
|
{ |
||||
|
Spider = 0, |
||||
|
OneBound = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打包配置状态 待配置 = 0,已配置 = 1,需修改 = 2
|
||||
|
/// </summary>
|
||||
|
public enum PackConfigState |
||||
|
{ |
||||
|
待配置 = 0, |
||||
|
已配置 = 1, |
||||
|
需修改 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 入仓类型 (发回齐越 = 0, 厂商代发入仓 = 1,其他仓不包装 = 2)
|
||||
|
/// </summary>
|
||||
|
public enum IntoStoreType |
||||
|
{ |
||||
|
发回齐越 = 0, 厂商代发入仓 = 1, 其他仓不包装 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 限时任务类型 采购任务 = 0, 合格证拟定任务 = 10, 合格证补充任务 = 11, 待核算任务 = 20, 待议价任务 = 30
|
||||
|
/// </summary>
|
||||
|
public enum TimeLimitTaskType |
||||
|
{ |
||||
|
采购任务 = 0, 合格证拟定任务 = 10, 合格证补充任务 = 11, 待核算任务 = 20, 待议价任务 = 30 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平价状态 未平价=0 已平价=1 部分平价=2
|
||||
|
/// </summary>
|
||||
|
public enum AutoEditOrderPriceType |
||||
|
{ |
||||
|
未平价 = 0, 已平价 = 1, 部分平价 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 触发优化原因 首次采购 = 0, 首次优化 = 1, 再次优化 = 2
|
||||
|
/// </summary>
|
||||
|
public enum TriggerOptimizationReason |
||||
|
{ |
||||
|
首次采购 = 0, 首次优化 = 1, 再次优化 = 2 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 厂家经营模式 贸易 = 0, 厂家 = 1
|
||||
|
/// </summary>
|
||||
|
public enum ManagmentMode |
||||
|
{ |
||||
|
贸易 = 0, 厂家 = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 厂家扩展信息类型 主营类目 = 0, 标签 = 1
|
||||
|
/// </summary>
|
||||
|
public enum PurchaserBasicInfoType |
||||
|
{ |
||||
|
主营类目 = 0, 标签 = 1 |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 比较运算符 大于 = 0, 小于 = 1, 等于 = 2, 介于 = 3
|
||||
|
/// </summary>
|
||||
|
public enum ComparisonOperator |
||||
|
{ |
||||
|
大于 = 0, 小于 = 1, 等于 = 2, 介于 = 3 |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue