master
wufan 2 months ago
parent f782c1bb0c
commit d92e954cb6

@ -11,6 +11,41 @@ namespace TradeManageNew.Models.Shage
/// </summary>
public string OrderCode { get; set; }
/// <summary>
/// 平台单号
/// </summary>
public string PlatOrderCode { get; set; }
/// <summary>
/// 收件人
/// </summary>
public string RevName { get; set; }
/// <summary>
/// 收件国家
/// </summary>
public string RevCountry { get; set; }
/// <summary>
/// 收件地址
/// </summary>
public string RevAddr { get; set; }
/// <summary>
/// 收件人电话
/// </summary>
public string RevPhone { get; set; }
/// <summary>
/// 邮编
/// </summary>
public string RevPostCode { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// sku明细
/// </summary>
@ -38,5 +73,10 @@ namespace TradeManageNew.Models.Shage
/// sku编码
/// </summary>
public string SkuCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Quantity { get; set; }
}
}

@ -1516,25 +1516,49 @@ namespace TradeManageNew.OuterService
var spuIds = skus.Select(x => x.GoodsId).Distinct().ToList();
var spus = db.HW_GoodsInfo.Where(x => spuIds.Contains(x.GoodsId));
var order = db.DT_OrderInfo.FirstOrDefault(x =>
x.OrderId == orderUsedSaleEntryList.First().OrderId);
var orderInfo = (from order in db.DT_OrderInfo
join orderXxInfo in db.DT_OrderXXInfo on order.OrderId equals orderXxInfo.OrderId
join shop in db.JC_Shop on order.ShopId equals shop.ShopId
where order.OrderId == orderUsedSaleEntryList.First().OrderId
select new
{
order.OrderId,
order.OrderCode,
order.PlatOrderCode,
orderXxInfo.RevName,
orderXxInfo.RevCountry,
orderXxInfo.RevAddr,
orderXxInfo.RevPhone,
orderXxInfo.RevPostCode,
shop.ShopName
}).FirstOrDefault();
var result = new GetOrderUsedSaleDto
{
OrderId = order.OrderId,
OrderCode = order.OrderCode,
Items = skus.Select(o =>
{
var spu = spus.FirstOrDefault(x => x.GoodsId == o.GoodsId);
return new GetOrderUsedSaleItemDto
OrderId = orderInfo.OrderId,
OrderCode = orderInfo.OrderCode,
PlatOrderCode = orderInfo.PlatOrderCode,
RevName = orderInfo.RevName,
RevCountry = orderInfo.RevCountry,
RevAddr = orderInfo.RevAddr,
RevPhone = orderInfo.RevPhone,
RevPostCode = orderInfo.RevPostCode,
ShopName = orderInfo.ShopName,
Items = groupOrderUsedSaleEntry.Select(o =>
{
ProductCode = spu?.GoodsCode,
ProductDescription = spu?.GoodsEnglisgName,
GoodsDetailId = o.DetailId,
SkuCode = o.SKU1
};
}).ToList()
var sku = skus.First(x => x.DetailId == o.Key);
var spu = spus.FirstOrDefault(x => x.GoodsId == o.Key);
return new GetOrderUsedSaleItemDto
{
ProductCode = spu?.GoodsCode,
ProductDescription = spu?.GoodsEnglisgName,
GoodsDetailId = sku.DetailId,
SkuCode = sku.SKU1,
Quantity = o.Quantity
};
})
.ToList()
};
md.Code = "100";

@ -18,6 +18,7 @@ namespace TradeUsedSale.Repositories
WriteTraceLine = TraceCallback;
}
public ITable<DT_OrderInfo> DT_OrderInfo => this.GetTable<DT_OrderInfo>();
public ITable<DT_OrderXXInfo> DT_OrderXXInfo => this.GetTable<DT_OrderXXInfo>();
public ITable<DT_OrderGoods> DT_OrderGoods => this.GetTable<DT_OrderGoods>();
public ITable<HW_GoodsInfo> HW_GoodsInfo => this.GetTable<HW_GoodsInfo>();
public ITable<HW_GoodsDetail> HW_GoodsDetail => this.GetTable<HW_GoodsDetail>();
@ -25,5 +26,6 @@ namespace TradeUsedSale.Repositories
public ITable<DT_OrderUsedSale> DT_OrderUsedSale => this.GetTable<DT_OrderUsedSale>();
public ITable<DT_OrderUsedSaleEntry> DT_OrderUsedSaleEntry => this.GetTable<DT_OrderUsedSaleEntry>();
public ITable<DT_OrderUsedSalePlatform> DT_OrderUsedSalePlatform => this.GetTable<DT_OrderUsedSalePlatform>();
public ITable<JC_Shop> JC_Shop => this.GetTable<JC_Shop>();
}
}

@ -3,10 +3,9 @@ using System;
namespace TradeUsedSale.Repositories.Models
{
public partial class DT_OrderReturn
public class DT_OrderReturn
{
[PrimaryKey, Identity]
public int id { get; set; }
[PrimaryKey, Identity] public int id { get; set; }
public int? orderid { get; set; }
public string ordercode { get; set; }
public string asin { get; set; }
@ -39,46 +38,57 @@ namespace TradeUsedSale.Repositories.Models
public string ImgUrl3 { get; set; }
public string ImgUrl4 { get; set; }
public string ImgUrl5 { get; set; }
/// <summary>
/// 在美国OfferUp二手平台是否上架
/// </summary>
public int? IsOfferUp { get; set; }
/// <summary>
/// 在美国MaketPlace二手平台是否上架
/// </summary>
public int? IsMaketPlace { get; set; }
/// <summary>
/// 本条退货是否二手商品
/// </summary>
public bool? isSecondHand { get; set; }
/// <summary>
/// 二手订单条形码
/// </summary>
public string SecondHandCode { get; set; }
/// <summary>
/// 二手订单状态
/// </summary>
public int? SecondHandType { get; set; }
/// <summary>
/// 二手订单客户提货码
/// </summary>
public string SecondHandImgUrl { get; set; }
/// <summary>
/// 是否存在二手订单客户预约单
/// </summary>
public bool? isSecondHandBuyer { get; set; }
/// <summary>
/// 二手订单客户姓名
/// </summary>
public string SecondHandBuyerName { get; set; }
/// <summary>
/// 二手订单客户电话
/// </summary>
public string SecondHandBuyerPhone { get; set; }
/// <summary>
/// 二手订单客户到达时间
/// </summary>
public string SecondHandBuyerTime { get; set; }
/// <summary>
/// 二手售卖价
/// </summary>

@ -0,0 +1,218 @@
using System;
using LinqToDB.Mapping;
namespace TradeUsedSale.Repositories.Models
{
public class DT_OrderXXInfo
{
[PrimaryKey, Identity] public int Id { get; set; }
public int? OrderId { get; set; }
public decimal? TotalWeight { get; set; }
public decimal? TotalSoild { get; set; }
/// <summary>
/// 货币
/// </summary>
public string MoneyType { get; set; }
/// <summary>
/// Sku
/// </summary>
public string CustomID { get; set; }
/// <summary>
/// 客户id
/// </summary>
public string SKU { get; set; }
/// <summary>
/// 收件人
/// </summary>
public string RevName { get; set; }
/// <summary>
/// 买家国家
/// </summary>
public string RevCountry { get; set; }
/// <summary>
/// 收件地址
/// </summary>
public string RevAddr { get; set; }
/// <summary>
/// 电话
/// </summary>
public string RevPhone { get; set; }
/// <summary>
/// 手机
/// </summary>
public string RevMoblie { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string RevMail { get; set; }
/// <summary>
/// 传真
/// </summary>
public string RevFax { get; set; }
/// <summary>
/// 收件人邮编
/// </summary>
public string RevPostCode { get; set; }
/// <summary>
/// 提交信息
/// </summary>
public string SendInfo { get; set; }
/// <summary>
/// 异常信息
/// </summary>
public string ErrorInfo { get; set; }
/// <summary>
/// 购买备注
/// </summary>
public string BuyRemark { get; set; }
/// <summary>
/// 留言
/// </summary>
public string LeaveWord { get; set; }
/// <summary>
/// 计费方式
/// </summary>
public int? FeeType { get; set; }
/// <summary>
/// 是否挂号
/// </summary>
public int? IsRegister { get; set; }
/// <summary>
/// 运输方式
/// </summary>
public int? Post { get; set; }
/// <summary>
/// 运输费用
/// </summary>
public decimal? PostFee { get; set; }
/// <summary>
/// 包装费用
/// </summary>
public decimal? BoxFee { get; set; }
/// <summary>
/// 货物货值
/// </summary>
public decimal? GoodsFee { get; set; }
/// <summary>
/// 我方银行账户
/// </summary>
public string BankCode { get; set; }
/// <summary>
/// 银行流水号
/// </summary>
public string BankNo { get; set; }
/// <summary>
/// 客户银行账户
/// </summary>
public string CustomBankCode { get; set; }
/// <summary>
/// 客户类型1平台2直销
/// </summary>
public int? CustomType { get; set; }
/// <summary>
/// 错发图片id
/// </summary>
public string ErrorImage { get; set; }
/// <summary>
/// 渠道
/// </summary>
public int? Channel { get; set; }
/// <summary>
/// 物品地址
/// </summary>
public string GoodsAddr { get; set; }
/// <summary>
/// 跟踪码
/// </summary>
public string TrackCode { get; set; }
/// <summary>
/// 发货仓库
/// </summary>
public int? StoreId { get; set; }
/// <summary>
/// 快递信息
/// </summary>
public string PostInfo { get; set; }
/// <summary>
/// 订单状态1正常2有留言3异常
/// </summary>
public int? OrderState { get; set; }
/// <summary>
/// 收件省,州
/// </summary>
public string RevProvince { get; set; }
/// <summary>
/// 收件城市
/// </summary>
public string RevCity { get; set; }
/// <summary>
/// 收件人区县
/// </summary>
public string RevArea { get; set; }
public string PostError { get; set; }
public string CountryCode { get; set; }
public string CountryName { get; set; }
public int? SendAddr { get; set; }
public int? TrackState { get; set; }
public DateTime? TrackDate { get; set; }
public int? IsLeaveWord { get; set; }
public int? InnerPost { get; set; }
public decimal? InnerPostFee { get; set; }
/// <summary>
/// 前置跟踪码
/// </summary>
public string FontTrackCode { get; set; }
public string OnlinePostId { get; set; }
public string PostOneCode { get; set; }
public string TrackCode2 { get; set; }
public int? LogisticsId { get; set; }
public decimal? Fee1 { get; set; }
public decimal? Fee2 { get; set; }
public decimal? Fee3 { get; set; }
public decimal? Fee4 { get; set; }
public string RevProvinceCode { get; set; }
public decimal? Fee11 { get; set; }
public decimal? Fee12 { get; set; }
public decimal? Fee13 { get; set; }
public int? IsAutoTrack { get; set; }
public string Zone { get; set; }
}
}

@ -1,9 +1,11 @@
using System;
using LinqToDB.Mapping;
namespace TradeUsedSale.Repositories.Models
{
public class HW_GoodsInfo
{
[PrimaryKey, Identity]
public int GoodsId { get; set; }
/// <summary>

@ -0,0 +1,114 @@
using System;
using LinqToDB.Mapping;
namespace TradeUsedSale.Repositories.Models
{
public class JC_Shop
{
[PrimaryKey, Identity] public int ShopId { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 1速卖通2亚马逊3Ebay4Wish
/// </summary>
public int? PlatType { get; set; }
/// <summary>
/// 所属部门
/// </summary>
public int? DeptId { get; set; }
/// <summary>
/// 添加日期
/// </summary>
public DateTime? InDate { get; set; }
public int? CompanyId { get; set; }
/// <summary>
/// 最大请求次数
/// </summary>
public int? RequestMaxNumber { get; set; }
/// <summary>
/// 当前请求次数
/// </summary>
public int? RequestNumber { get; set; }
/// <summary>
/// 开发者帐号,速卖通AppKey,亚马逊accessKeyId
/// </summary>
public string Appkey { get; set; }
/// <summary>
/// 开发者密钥,速卖通DeveKey,亚马逊secretAccessKey
/// </summary>
public string DeveKey { get; set; }
/// <summary>
/// 速卖通长时令牌亚马逊卖家ID
/// </summary>
public string RefreshToken { get; set; }
/// <summary>
/// 速卖通短时令牌亚马逊店铺IDEbay与Wish的Token
/// </summary>
public string AccessToken { get; set; }
/// <summary>
/// 亚马逊API请求服务器国家地址
/// </summary>
public string Country { get; set; }
/// <summary>
/// 长时令牌保存时间
/// </summary>
public DateTime? RefreshTokenSaveTime { get; set; }
/// <summary>
/// 短时令牌更新时间
/// </summary>
public DateTime? AccessTokenUpdateTime { get; set; }
/// <summary>
/// 是否每天自动读取API订单
/// </summary>
public bool? IsAutoReadData { get; set; }
/// <summary>
/// 店铺匹配优先级
/// </summary>
public int? LevelGrade { get; set; }
/// <summary>
/// 是否有FBA店铺
/// </summary>
public bool? IsFba { get; set; }
public int? OutDay { get; set; }
public string Master { get; set; }
public string Buyer { get; set; }
public string ShopUser { get; set; }
public string ShopNo { get; set; }
public string LoginName { get; set; }
public string Password { get; set; }
public decimal? PersonFee { get; set; }
public string Code { get; set; }
public string ReUrl { get; set; }
public DateTime? FeeDate { get; set; }
public decimal? TXFee { get; set; }
public int? state { get; set; }
public string sendname { get; set; }
public string store_id { get; set; }
public decimal? dayfee { get; set; }
/// <summary>
/// 是否自己上传面单 1 是2不同步
/// </summary>
public int? Upload_label { get; set; }
}
}

@ -55,8 +55,10 @@
<Compile Include="Repositories\Models\DT_OrderUsedSale.cs" />
<Compile Include="Repositories\Models\DT_OrderUsedSaleEntry.cs" />
<Compile Include="Repositories\Models\DT_OrderUsedSalePlatform.cs" />
<Compile Include="Repositories\Models\DT_OrderXXInfo.cs" />
<Compile Include="Repositories\Models\HW_GoodsDetail.cs" />
<Compile Include="Repositories\Models\HW_GoodsInfo.cs" />
<Compile Include="Repositories\Models\JC_Shop.cs" />
<Compile Include="Repositories\Utils\ExpressionExtensions.cs" />
<Compile Include="Repositories\Utils\LinqToDbExtensions.cs" />
<Compile Include="Repositories\Utils\ParameterRebinder.cs" />

Loading…
Cancel
Save