修改统计功能 使用新API接口
This commit is contained in:
1 parent
03f71a5d64
commit
8431a8f6b0
6 files changed
+1117
-708
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using WPFCommon.Models;
|
||||
@@ -6,152 +6,219 @@ using WPFCommon.Models;
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 查询参数
|
||||
/// 店铺营收统计 - 查询参数。
|
||||
/// 对应新接口 shop_revenue_statistics/get_shop_order_amount 与
|
||||
/// shop_revenue_statistics/get_shop_stats_details 的请求体(StartDate / EndDate / ShopIds)。
|
||||
/// </summary>
|
||||
public class ShopRevenueStatisticsQuery
|
||||
{
|
||||
/// <summary>开始时间</summary>
|
||||
/// <summary>开始日期</summary>
|
||||
public DateTime StartDate { get; set; }
|
||||
|
||||
/// <summary>结束时间</summary>
|
||||
/// <summary>结束日期</summary>
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
/// <summary>选中的店铺 app_key 列表;空/Null 表示全部店铺</summary>
|
||||
public List<string> ShopKeys { get; set; }
|
||||
/// <summary>
|
||||
/// 选中的店铺 ERP 店铺ID(ShopLoginInfo.ErpShopId)列表;
|
||||
/// 空/Null 表示全部店铺(服务层会取全部店铺的 ErpShopId)。
|
||||
/// </summary>
|
||||
public List<string> ShopIds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 接口返回的原始明细行。
|
||||
/// 与后端 WXOrderAmountInfo 保持一致(camelCase JSON):
|
||||
/// shopName, createTime, orderId, status, productPrice, orderPrice, purchasePrice, freight,
|
||||
/// predictCommissionFee, commissionAmount, discountedPrice, profit, purchaseStatus,
|
||||
/// outAmount, refundStatus, refundStatusString, refundAmount, externalProcurement
|
||||
/// 金额字段单位均为分(显示时需除以 100)。
|
||||
/// 店铺统计记录(接口返回)。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopStats -> Result<Dictionary<string, List<ShopStatsResponse>>>
|
||||
/// Key = 店铺ID,Value = 该店铺按 <see cref="ShopStatsGroupType"/> 聚合后的记录列表
|
||||
/// (汇总=1 条;天/周/月=每个自然日/自然周/自然月各 1 条)。
|
||||
/// 注意:接口只返回按 GroupType 聚合后的记录,不返回“整段汇总”,
|
||||
/// 页面上的汇总卡片由客户端对返回记录自行合计(GroupType=Summary 时每店铺一条,直接相加即可)。
|
||||
/// 金额字段单位均为“分”,显示时需除以 100 转为元。
|
||||
/// </summary>
|
||||
public class ShopRevenueStatisticsRow
|
||||
public class ShopStatsResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺名称
|
||||
/// 店铺ID
|
||||
/// </summary>
|
||||
[JsonProperty("shop_name")]
|
||||
public string ShopName { get; set; }
|
||||
public string ShopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下单时间(秒级时间戳)
|
||||
/// 销售订单创建日期
|
||||
/// </summary>
|
||||
[JsonProperty("create_time")]
|
||||
[JsonConverter(typeof(UnixDateTimeConverter))]
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime StatDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// 订单数(有效订单,不含退款订单)
|
||||
/// </summary>
|
||||
[JsonProperty("order_id")]
|
||||
public string OrderId { get; set; }
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// 销售总额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品总价(分)
|
||||
/// </summary>
|
||||
[JsonProperty("product_price")]
|
||||
public int ProductPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("order_price")]
|
||||
public int OrderPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购价(分)
|
||||
/// </summary>
|
||||
[JsonProperty("purchase_price")]
|
||||
public int PurchasePrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 运费(分)
|
||||
/// </summary>
|
||||
[JsonProperty("freight")]
|
||||
public int Freight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平台服务费(预计技术服务费,分)
|
||||
/// </summary>
|
||||
[JsonProperty("predict_commission_fee")]
|
||||
public int PredictCommissionFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 达人佣金(分)
|
||||
/// </summary>
|
||||
[JsonProperty("commission_amount")]
|
||||
public int CommissionAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 优惠金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("discounted_price")]
|
||||
public int DiscountedPrice { get; set; }
|
||||
public long SalesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 利润(分)
|
||||
/// </summary>
|
||||
[JsonProperty("profit")]
|
||||
public int Profit { get; set; }
|
||||
public long ProfitAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购状态
|
||||
/// 平台佣金(分)
|
||||
/// </summary>
|
||||
[JsonProperty("purchase_status")]
|
||||
public int PurchaseStatus { get; set; }
|
||||
public long PlatformFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外采金额(分),out_amount为空或0时从中转仓订单表补全
|
||||
/// 退款订单数
|
||||
/// </summary>
|
||||
public int RefundOrderCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已成功退款金额(分,店铺端已退款成功)
|
||||
/// </summary>
|
||||
public long RefundDone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退款处理中金额(分,店铺端退款中)
|
||||
/// </summary>
|
||||
public long RefundPending { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购单数
|
||||
/// </summary>
|
||||
public int PurchaseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总花费金额(分,买手号采购付款金额)
|
||||
/// </summary>
|
||||
public long TotalPurchase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 售后中买手总金额(分)
|
||||
/// </summary>
|
||||
public long TotalRefund => DoneRefund + PendingRefund + RejectedRefund;
|
||||
|
||||
/// <summary>
|
||||
/// 已成功退款金额(分,买手号采购退款成功)
|
||||
/// </summary>
|
||||
public long DoneRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 未退回金额(分)
|
||||
/// </summary>
|
||||
public long PendingRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被拒绝金额(分)
|
||||
/// </summary>
|
||||
public long RejectedRefund { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售趋势记录(接口返回):跨店铺合计后的按天趋势,供综合统计页的销售趋势折线图使用。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopStatsTrend
|
||||
/// -> Result<List<ShopStatsTrendResponse>>
|
||||
/// 请求参数:StartDate / EndDate / ShopIds(不需要 GroupType,固定按天返回)。
|
||||
/// 金额字段单位为“分”,显示时需除以 100 转为元。
|
||||
/// </summary>
|
||||
public class ShopStatsTrendResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 统计日期(天)
|
||||
/// </summary>
|
||||
public DateTime StatDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售额(分)
|
||||
/// </summary>
|
||||
public long SalesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单数
|
||||
/// </summary>
|
||||
public int OrderCount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细(接口返回):订单列表弹窗 ShowOrderDialogView 的数据行。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopOrderDetails
|
||||
/// -> Result<List<ShopOrderDetailResponse>>
|
||||
/// 请求参数:StartDate / EndDate / ShopIds / OrderType(见 <see cref="ShopOrderDetailType"/>)。
|
||||
/// 金额字段单位均为“分”,显示时需除以 100 转为元。
|
||||
/// </summary>
|
||||
public class ShopOrderDetailResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺ID
|
||||
/// </summary>
|
||||
public long ShopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 店铺名称
|
||||
/// </summary>
|
||||
public string ShopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商铺订单号
|
||||
/// </summary>
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单金额(分)
|
||||
/// </summary>
|
||||
public int OrderPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单退款金额(分),即商铺订单商品明细的退款金额之和;有效订单为 0
|
||||
/// </summary>
|
||||
public int OrderRefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外采金额(分),即该订单下所有买手订单的购买金额之和
|
||||
/// </summary>
|
||||
[JsonProperty("out_amount")]
|
||||
public int OutAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 售后状态(订单明细 refund_status)
|
||||
/// 买手未退回金额(分),即买手订单中退款未成功的退款金额之和;无售后时为 0
|
||||
/// </summary>
|
||||
[JsonProperty("refund_status")]
|
||||
public int RefundStatus { get; set; }
|
||||
public int UnrefundedAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 售后状态(退款单 status)
|
||||
/// 买手订单信息(一个订单号对应多个买手订单)
|
||||
/// </summary>
|
||||
[JsonProperty("refund_status_string")]
|
||||
public string RefundStatusString { get; set; }
|
||||
public List<BuyerOrderInfo> BuyerOrders { get; set; } = new List<BuyerOrderInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 买手订单信息(订单明细下的子项,一个商铺订单可对应多个买手订单)
|
||||
/// </summary>
|
||||
public class BuyerOrderInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 外部订单(买手订单)号
|
||||
/// </summary>
|
||||
public string OutOrderSn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 售后退款金额(分)
|
||||
/// 金额(分)
|
||||
/// </summary>
|
||||
public int OutAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退款金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("refund_amount")]
|
||||
public int RefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否外采:0=未从中转仓订单表查到,1=查到
|
||||
/// 退款状态
|
||||
/// </summary>
|
||||
[JsonProperty("external_procurement")]
|
||||
public int ExternalProcurement { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 买手退款金额
|
||||
/// </summary>
|
||||
[JsonProperty("buyer_refund_amount")]
|
||||
public int BuyerRefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 买手退款状态
|
||||
/// </summary>
|
||||
[JsonProperty("buyer_refund_status")]
|
||||
public string BuyerRefundStatus { get; set; }
|
||||
|
||||
public string RefundStatusText { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -167,7 +234,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>利润(实际利润)</summary>
|
||||
public decimal Profit { get; set; }
|
||||
|
||||
/// <summary>退款金额(统计期间退款)</summary>
|
||||
/// <summary>退款金额(统计期间店铺端退款:已成功 + 处理中)</summary>
|
||||
public decimal RefundAmount { get; set; }
|
||||
|
||||
/// <summary>退款订单数</summary>
|
||||
@@ -176,7 +243,10 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
/// <summary>
|
||||
/// 达人佣金(元)。
|
||||
/// 新接口未提供该字段,固定为 0,保留属性与页面展示,待后端补充字段后直接接上。
|
||||
/// </summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>客单价(平均每单金额)</summary>
|
||||
@@ -239,7 +309,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>店铺名称</summary>
|
||||
public string ShopName { get; set; }
|
||||
|
||||
/// <summary>订单数</summary>
|
||||
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>销售额(元)</summary>
|
||||
@@ -255,7 +325,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>客单价(元)</summary>
|
||||
@@ -280,6 +350,51 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
Month = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接口聚合方式(请求参数 GroupType,按数字传值)。
|
||||
/// 每种方式都返回 Dictionary<店铺ID, List<ShopStatsResponse>>:
|
||||
/// 汇总时每个店铺 1 条,天/周/月时每个店铺每个周期 1 条。
|
||||
/// </summary>
|
||||
public enum ShopStatsGroupType
|
||||
{
|
||||
/// <summary>
|
||||
/// 汇总:每个商铺只返回一条(整个查询范围合计)
|
||||
/// </summary>
|
||||
Summary = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 天:按自然日聚合,每个商铺每天一条
|
||||
/// </summary>
|
||||
Day = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 周:按自然周聚合(周一为一周开始),每个商铺每周一条
|
||||
/// </summary>
|
||||
Week = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 月:按自然月聚合,每个商铺每月一条
|
||||
/// </summary>
|
||||
Month = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细类型(订单列表弹窗的入口类型,对应接口参数 OrderType,按数字传值)。
|
||||
/// 数值与后端枚举保持一致:有效订单=1、退款订单=2、买手未退回金额的订单=3
|
||||
/// (后端枚举里的“全部订单 All=0”本页不使用,故不定义)。
|
||||
/// </summary>
|
||||
public enum ShopOrderDetailType
|
||||
{
|
||||
/// <summary>有效订单:没有发生售后的订单(对应统计里的订单数 / 销售额 / 利润口径)</summary>
|
||||
Valid = 1,
|
||||
|
||||
/// <summary>退款订单:发生过售后的订单(对应统计里的退款订单数口径)</summary>
|
||||
Refund = 2,
|
||||
|
||||
/// <summary>买手未退回金额的订单:退款订单中买手款项还没退回的(对应统计里的未退回金额口径)</summary>
|
||||
BuyerUnrefunded = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 天/周/月周期统计表格行(金额单位:元)。
|
||||
/// 按所选店铺(或全部店铺)统计:天统计每天一行;周统计每周一行;月统计每月一行。
|
||||
@@ -292,7 +407,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>周期显示文本(天:yyyy-MM-dd;周:yyyy-MM-dd ~ yyyy-MM-dd;月:yyyy-MM)</summary>
|
||||
public string Period { get; set; }
|
||||
|
||||
/// <summary>订单数</summary>
|
||||
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>销售额(元)</summary>
|
||||
@@ -309,7 +424,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>平均利润率(利润 / 采购金额,百分数,如 12.34 表示 12.34%)</summary>
|
||||
@@ -322,14 +437,51 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public decimal AvgOrderAmount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 一次查询的全部聚合结果(综合统计页使用)。
|
||||
/// 由两次请求组成:
|
||||
/// shop_revenue_statistics/GetShopStats(GroupType=Summary)-> 卡片/店铺统计表/销售占比(每店铺一条,与区间长度无关)
|
||||
/// shop_revenue_statistics/GetShopStatsTrend -> 销售趋势(跨店铺合计的按天序列)
|
||||
/// </summary>
|
||||
public class ShopRevenueStatisticsResult
|
||||
{
|
||||
/// <summary>汇总卡片数据</summary>
|
||||
public ShopRevenueSummary Summary { get; set; }
|
||||
|
||||
/// <summary>销售趋势(按天,缺失日期补 0)</summary>
|
||||
public List<RevenueTrendPoint> Trend { get; set; }
|
||||
|
||||
/// <summary>店铺销售占比(饼图)</summary>
|
||||
public List<ShopSalesProportionItem> ShopProportions { get; set; }
|
||||
|
||||
/// <summary>店铺统计表格</summary>
|
||||
public List<ShopStatisticsItem> ShopStatistics { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 天/周/月周期统计查询结果(周期统计页使用)。
|
||||
/// 接口不返回整段汇总,Summary 由返回的周期数据在客户端合计得出。
|
||||
/// </summary>
|
||||
public class ShopPeriodStatisticsResult
|
||||
{
|
||||
/// <summary>汇总卡片数据(整个查询时间段,客户端合计)</summary>
|
||||
public ShopRevenueSummary Summary { get; set; }
|
||||
|
||||
/// <summary>周期统计表格(天/周/月各一行)</summary>
|
||||
public List<ShopPeriodStatisticsItem> Items { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺下拉选项
|
||||
/// </summary>
|
||||
public class ShopOption
|
||||
{
|
||||
/// <summary>店铺 app_key(A.app_key)</summary>
|
||||
public string AppKey { get; set; }
|
||||
/// <summary>店铺ID(ShopLoginInfo.ShopId)</summary>
|
||||
public string ShopId { get; set; }
|
||||
|
||||
/// <summary>ERP 店铺ID(ShopLoginInfo.ErpShopId),统计接口的 ShopIds 使用该字段</summary>
|
||||
public string ErpShopId { get; set; }
|
||||
|
||||
/// <summary>店铺名称</summary>
|
||||
public string ShopName { get; set; }
|
||||
}
|
||||
@@ -346,55 +498,4 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
class UnixDateTimeConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return objectType == typeof(DateTime);
|
||||
}
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
// 读取数值(支持 long 和 int 类型)
|
||||
if (reader.TokenType == JsonToken.Integer)
|
||||
{
|
||||
long milliseconds = (long)reader.Value;
|
||||
// Unix 纪元:1970-01-01 UTC
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
}
|
||||
return epoch.AddSeconds(milliseconds);
|
||||
|
||||
|
||||
}
|
||||
// 如果传入的是字符串(如 "1700000000000"),也支持
|
||||
else if (reader.TokenType == JsonToken.String)
|
||||
{
|
||||
if (long.TryParse((string)reader.Value, out long milliseconds))
|
||||
{
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
}
|
||||
return epoch.AddSeconds(milliseconds);
|
||||
}
|
||||
}
|
||||
throw new JsonSerializationException($"无法将 {reader.Value} 转换为 DateTime");
|
||||
}
|
||||
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
// 序列化时转回时间戳
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
long milliseconds = (long)((DateTime)value - epoch).TotalMilliseconds;
|
||||
writer.WriteValue(milliseconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user