增加同步物流类型 结算 查询

This commit is contained in:
chfei committed 2026-09-24 17:05:45 +08:00
1 parent 6ce55f7b58
commit efa9955bd2
4 files changed
+134 -129

No files matched your search

@@ -131,7 +131,7 @@ namespace KJD_Web.Services.Users
decimal rebate_amount = 0m; // 正数部分(累计返利) decimal rebate_amount = 0m; // 正数部分(累计返利)
DateTime now = DateTime.Now; DateTime now = DateTime.Now;
List<int> UserPaymentTypeFiltert = [16, 20, 23, 26, 31, 34]; List<int> UserPaymentTypeFiltert = [16, 20, 23, 26, 31, 34, 55];
var paymentQuery = tr_freeSql.Select<UserPaymentRecordEntity>() var paymentQuery = tr_freeSql.Select<UserPaymentRecordEntity>()
.Where(a => userNames.Contains(a.UserName)) .Where(a => userNames.Contains(a.UserName))
.Where(a => UserPaymentTypeFiltert.Contains(a.Type)) .Where(a => UserPaymentTypeFiltert.Contains(a.Type))
@@ -258,7 +258,7 @@ namespace KJD_Web.Services.Users
if (user == null) throw new Exception("错误的用户"); if (user == null) throw new Exception("错误的用户");
summary.RechargeTotal = (long)Math.Round((user.RechargeAmountTotal ?? 0) * 100m); summary.RechargeTotal = (long)Math.Round((user.RechargeAmountTotal ?? 0) * 100m);
summary.Balance = (long)Math.Round((user.Balance ?? 0) * 100m); summary.Balance = (long)Math.Round((user.Balance ?? 0) * 100m);
List<int> types = new List<int> { 16, 20, 23, 24, 26, 31 }; List<int> types = new List<int> { 16, 20, 23, 24, 26, 31, 55 };
var data = _freeSql.Select<UserPaymentRecordEntity>() var data = _freeSql.Select<UserPaymentRecordEntity>()
@@ -274,133 +274,133 @@ namespace KJD_Web.Services.Users
// /// <summary> // /// <summary>
// /// 填充历史数据 // /// 填充历史数据
// /// </summary> // /// </summary>
// public void FillHistoryOemAmount() // public void FillHistoryOemAmount()
// { // {
// List<UserPaymentRecordSmall> data = new List<UserPaymentRecordSmall>(); // List<UserPaymentRecordSmall> data = new List<UserPaymentRecordSmall>();
// string path = @"d:\ddddd.json"; // string path = @"d:\ddddd.json";
// if (File.Exists(path)) // if (File.Exists(path))
// { // {
// data = JsonConvert.DeserializeObject<List<UserPaymentRecordSmall>>(File.ReadAllText(path)); // data = JsonConvert.DeserializeObject<List<UserPaymentRecordSmall>>(File.ReadAllText(path));
// } // }
// else // else
// { // {
// data = _freeSql.Select<UserPaymentRecordSmall>() // data = _freeSql.Select<UserPaymentRecordSmall>()
// .Where(a => a.type == 20 || a.type == 26) // .Where(a => a.type == 20 || a.type == 26)
// .Where(a => a.create_time < DateTime.Parse("2026-09-01 00:00:00")) // .Where(a => a.create_time < DateTime.Parse("2026-09-01 00:00:00"))
// .OrderBy(a => a.id) // .OrderBy(a => a.id)
// .ToList(); // .ToList();
// } // }
// Debug.WriteLine($"共;{data.Count}"); // Debug.WriteLine($"共;{data.Count}");
// int max = 500; // int max = 500;
// int count = 0; // int count = 0;
// List<UserPaymentRecordSmall> list = new List<UserPaymentRecordSmall>(); // List<UserPaymentRecordSmall> list = new List<UserPaymentRecordSmall>();
// foreach (var item in data) // foreach (var item in data)
// { // {
// //if (item.IsFill) continue; // //if (item.IsFill) continue;
// try // try
// { // {
// if (!string.IsNullOrEmpty(item.remark)) // if (!string.IsNullOrEmpty(item.remark))
// { // {
// var ls = item.remark.Split(':'); // var ls = item.remark.Split(':');
// if (ls.Length != 2) continue; // if (ls.Length != 2) continue;
// item.OrderId = ls[1]; // item.OrderId = ls[1];
// list.Add(item); // list.Add(item);
// if (list.Count == max) // if (list.Count == max)
// { // {
// var orderNames = list.Select(a => a.OrderId); // var orderNames = list.Select(a => a.OrderId);
// List<weiOrder> orders = _freeSql.Select<weiOrder>() // List<weiOrder> orders = _freeSql.Select<weiOrder>()
// .Where(a => orderNames.Contains(a.order_id)) // .Where(a => orderNames.Contains(a.order_id))
// .ToList(); // .ToList();
// fillOemAmount(list, orders); // fillOemAmount(list, orders);
// var uCount = _freeSql.Update<UserPaymentRecordSmall>() // var uCount = _freeSql.Update<UserPaymentRecordSmall>()
// .SetSource(list) // .SetSource(list)
// .UpdateColumns(a => new { a.oem_amount }) // .UpdateColumns(a => new { a.oem_amount })
// .ExecuteAffrows(); // .ExecuteAffrows();
// if (uCount != list.Count) // if (uCount != list.Count)
// { // {
// Debug.WriteLine("数量不对"); // Debug.WriteLine("数量不对");
// } // }
// list.ForEach(a => a.IsFill = true); // list.ForEach(a => a.IsFill = true);
// File.WriteAllText(path, JsonConvert.SerializeObject(data)); // File.WriteAllText(path, JsonConvert.SerializeObject(data));
// count += list.Count; // count += list.Count;
// Debug.WriteLine($"成功修改;{list.Count}"); // Debug.WriteLine($"成功修改;{list.Count}");
// list.Clear(); // list.Clear();
// Debug.WriteLine($"共修改;{count}"); // Debug.WriteLine($"共修改;{count}");
// } // }
// } // }
// } // }
// finally // finally
// { // {
// } // }
// } // }
// } // }
// private void fillOemAmount(List<UserPaymentRecordSmall> list, List<weiOrder> orders) // private void fillOemAmount(List<UserPaymentRecordSmall> list, List<weiOrder> orders)
// { // {
// foreach (var item in list) // foreach (var item in list)
// { // {
// var order = orders.FirstOrDefault(a => a.order_id == item.OrderId); // var order = orders.FirstOrDefault(a => a.order_id == item.OrderId);
// if (order != null) // if (order != null)
// { // {
// item.oem_amount = getoemamount(order.province_name, item.amount.Value, item.type); // item.oem_amount = getoemamount(order.province_name, item.amount.Value, item.type);
// } // }
// } // }
// } // }
// private Dictionary<string, decimal> DicWarehousePostage = new Dictionary<string, decimal> // private Dictionary<string, decimal> DicWarehousePostage = new Dictionary<string, decimal>
// { // {
// { "湖北", 2.2m }, // { "湖北", 2.2m },
//{ "湖南", 2.2m }, //{ "湖南", 2.2m },
//{ "江西", 2.2m }, //{ "江西", 2.2m },
//{ "河南", 2.2m }, //{ "河南", 2.2m },
//{ "上海", 3m }, //{ "上海", 3m },
//{ "浙江", 2.2m }, //{ "浙江", 2.2m },
//{ "安徽", 2.2m }, //{ "安徽", 2.2m },
//{ "江苏", 2.2m }, //{ "江苏", 2.2m },
//{ "河北", 2.2m }, //{ "河北", 2.2m },
//{ "山东", 2.2m }, //{ "山东", 2.2m },
//{ "福建", 2.2m }, //{ "福建", 2.2m },
//{ "广东", 2.2m }, //{ "广东", 2.2m },
//{ "深圳", 2.8m }, //{ "深圳", 2.8m },
//{ "天津", 2.2m }, //{ "天津", 2.2m },
//{ "北京", 3.2m }, //{ "北京", 3.2m },
//{ "山西", 2.2m }, //{ "山西", 2.2m },
//{ "陕西", 2.2m }, //{ "陕西", 2.2m },
//{ "广西", 2.2m }, //{ "广西", 2.2m },
//{ "云南", 2.2m }, //{ "云南", 2.2m },
//{ "贵州", 2.2m }, //{ "贵州", 2.2m },
//{ "四川", 2.2m }, //{ "四川", 2.2m },
//{ "重庆", 2.2m }, //{ "重庆", 2.2m },
//{ "黑龙江", 2.7m }, //{ "黑龙江", 2.7m },
//{ "吉林", 2.7m }, //{ "吉林", 2.7m },
//{ "辽宁", 2.7m }, //{ "辽宁", 2.7m },
//{ "青海", 2.7m }, //{ "青海", 2.7m },
//{ "宁夏", 2.7m }, //{ "宁夏", 2.7m },
//{ "甘肃", 2.7m }, //{ "甘肃", 2.7m },
//{ "内蒙", 4.5m }, //{ "内蒙", 4.5m },
//{ "海南", 4.5m }, //{ "海南", 4.5m },
//{ "新疆", 12.5m }, //{ "新疆", 12.5m },
//{ "西藏", 12.5m }, //{ "西藏", 12.5m },
// }; // };
// private decimal getoemamount(string province, decimal amount, int type) // private decimal getoemamount(string province, decimal amount, int type)
// { // {
// foreach (var item in DicWarehousePostage) // foreach (var item in DicWarehousePostage)
// { // {
// if (province.StartsWith(item.Key)) // if (province.StartsWith(item.Key))
// { // {
// if (type == 20) // if (type == 20)
// return amount - item.Value; // return amount - item.Value;
// if (type == 26) // if (type == 26)
// return amount - item.Value - 0.3m; // return amount - item.Value - 0.3m;
// } // }
// } // }
// return amount; // return amount;
// } // }
} }
@@ -94,7 +94,7 @@ public partial class UserService
{ {
var users = GetOEMUsers(oem.OemId); var users = GetOEMUsers(oem.OemId);
var userNames = users.Select(u => u.UserName).ToList(); var userNames = users.Select(u => u.UserName).ToList();
List<int> types = [20, 23, 26, 16, 31, 34]; List<int> types = [20, 23, 26, 16, 31, 34, 55];
var query = _freeSql.Select<UserPaymentRecordEntity>() var query = _freeSql.Select<UserPaymentRecordEntity>()
.Where(a => types.Contains(a.Type)) .Where(a => types.Contains(a.Type))
@@ -238,7 +238,12 @@ public class VirtualLogisticsService : ITransientDependency
public List<OrderStatusResultItem> GetOrderStatus(string[] orders) public List<OrderStatusResultItem> GetOrderStatus(string[] orders)
{ {
return _api.GetOrderStatus(orders).Data; var ret = _api.GetOrderStatus(orders);
if (ret.Success)
{
return ret.Data;
}
throw new Exception(ret.Msg);
} }
} }
+2 -2
View File
@@ -129,7 +129,7 @@ internal class GiftLogisticsTest
public void GetOrderStatus() public void GetOrderStatus()
{ {
var logisticsService = _container.Resolve<VirtualLogisticsService>(); var logisticsService = _container.Resolve<VirtualLogisticsService>();
var data = logisticsService.GetOrderStatus(["260923-573109716621688"]); var data = logisticsService.GetOrderStatus(["260923-407759756800192"]);
Console.WriteLine(string.Join(" ", data.Select(a => $"{a.OrderSn}:{a.ShopOrder}:{a.DeliveryStatus}"))); Console.WriteLine(string.Join(" ", data.Select(a => $"{a.OrderSn}:{a.KuaidiSn}:{a.ShopOrder}:{a.DeliveryStatus}")));
} }
} }