增加同步物流类型 结算 查询
This commit is contained in:
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; // 正数部分(累计返利)
|
||||
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>()
|
||||
.Where(a => userNames.Contains(a.UserName))
|
||||
.Where(a => UserPaymentTypeFiltert.Contains(a.Type))
|
||||
@@ -258,7 +258,7 @@ namespace KJD_Web.Services.Users
|
||||
if (user == null) throw new Exception("错误的用户");
|
||||
summary.RechargeTotal = (long)Math.Round((user.RechargeAmountTotal ?? 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>()
|
||||
@@ -274,133 +274,133 @@ namespace KJD_Web.Services.Users
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// 填充历史数据
|
||||
// /// </summary>
|
||||
// public void FillHistoryOemAmount()
|
||||
// {
|
||||
// List<UserPaymentRecordSmall> data = new List<UserPaymentRecordSmall>();
|
||||
// string path = @"d:\ddddd.json";
|
||||
// if (File.Exists(path))
|
||||
// {
|
||||
// data = JsonConvert.DeserializeObject<List<UserPaymentRecordSmall>>(File.ReadAllText(path));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// data = _freeSql.Select<UserPaymentRecordSmall>()
|
||||
// .Where(a => a.type == 20 || a.type == 26)
|
||||
// .Where(a => a.create_time < DateTime.Parse("2026-09-01 00:00:00"))
|
||||
// .OrderBy(a => a.id)
|
||||
// .ToList();
|
||||
// }
|
||||
// Debug.WriteLine($"共;{data.Count}");
|
||||
// int max = 500;
|
||||
// int count = 0;
|
||||
// List<UserPaymentRecordSmall> list = new List<UserPaymentRecordSmall>();
|
||||
// foreach (var item in data)
|
||||
// {
|
||||
// //if (item.IsFill) continue;
|
||||
// try
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(item.remark))
|
||||
// {
|
||||
// var ls = item.remark.Split(':');
|
||||
// if (ls.Length != 2) continue;
|
||||
// item.OrderId = ls[1];
|
||||
// list.Add(item);
|
||||
// if (list.Count == max)
|
||||
// {
|
||||
// var orderNames = list.Select(a => a.OrderId);
|
||||
// List<weiOrder> orders = _freeSql.Select<weiOrder>()
|
||||
// .Where(a => orderNames.Contains(a.order_id))
|
||||
// .ToList();
|
||||
// fillOemAmount(list, orders);
|
||||
// var uCount = _freeSql.Update<UserPaymentRecordSmall>()
|
||||
// .SetSource(list)
|
||||
// .UpdateColumns(a => new { a.oem_amount })
|
||||
// .ExecuteAffrows();
|
||||
// if (uCount != list.Count)
|
||||
// {
|
||||
// Debug.WriteLine("数量不对");
|
||||
// }
|
||||
// list.ForEach(a => a.IsFill = true);
|
||||
// File.WriteAllText(path, JsonConvert.SerializeObject(data));
|
||||
// count += list.Count;
|
||||
// Debug.WriteLine($"成功修改;{list.Count}");
|
||||
// list.Clear();
|
||||
// Debug.WriteLine($"共修改;{count}");
|
||||
// /// <summary>
|
||||
// /// 填充历史数据
|
||||
// /// </summary>
|
||||
// public void FillHistoryOemAmount()
|
||||
// {
|
||||
// List<UserPaymentRecordSmall> data = new List<UserPaymentRecordSmall>();
|
||||
// string path = @"d:\ddddd.json";
|
||||
// if (File.Exists(path))
|
||||
// {
|
||||
// data = JsonConvert.DeserializeObject<List<UserPaymentRecordSmall>>(File.ReadAllText(path));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// data = _freeSql.Select<UserPaymentRecordSmall>()
|
||||
// .Where(a => a.type == 20 || a.type == 26)
|
||||
// .Where(a => a.create_time < DateTime.Parse("2026-09-01 00:00:00"))
|
||||
// .OrderBy(a => a.id)
|
||||
// .ToList();
|
||||
// }
|
||||
// Debug.WriteLine($"共;{data.Count}");
|
||||
// int max = 500;
|
||||
// int count = 0;
|
||||
// List<UserPaymentRecordSmall> list = new List<UserPaymentRecordSmall>();
|
||||
// foreach (var item in data)
|
||||
// {
|
||||
// //if (item.IsFill) continue;
|
||||
// try
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(item.remark))
|
||||
// {
|
||||
// var ls = item.remark.Split(':');
|
||||
// if (ls.Length != 2) continue;
|
||||
// item.OrderId = ls[1];
|
||||
// list.Add(item);
|
||||
// if (list.Count == max)
|
||||
// {
|
||||
// var orderNames = list.Select(a => a.OrderId);
|
||||
// List<weiOrder> orders = _freeSql.Select<weiOrder>()
|
||||
// .Where(a => orderNames.Contains(a.order_id))
|
||||
// .ToList();
|
||||
// fillOemAmount(list, orders);
|
||||
// var uCount = _freeSql.Update<UserPaymentRecordSmall>()
|
||||
// .SetSource(list)
|
||||
// .UpdateColumns(a => new { a.oem_amount })
|
||||
// .ExecuteAffrows();
|
||||
// if (uCount != list.Count)
|
||||
// {
|
||||
// Debug.WriteLine("数量不对");
|
||||
// }
|
||||
// list.ForEach(a => a.IsFill = true);
|
||||
// File.WriteAllText(path, JsonConvert.SerializeObject(data));
|
||||
// count += list.Count;
|
||||
// Debug.WriteLine($"成功修改;{list.Count}");
|
||||
// list.Clear();
|
||||
// Debug.WriteLine($"共修改;{count}");
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// private void fillOemAmount(List<UserPaymentRecordSmall> list, List<weiOrder> orders)
|
||||
// {
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// var order = orders.FirstOrDefault(a => a.order_id == item.OrderId);
|
||||
// if (order != null)
|
||||
// {
|
||||
// item.oem_amount = getoemamount(order.province_name, item.amount.Value, item.type);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// private Dictionary<string, decimal> DicWarehousePostage = new Dictionary<string, decimal>
|
||||
// {
|
||||
// { "湖北", 2.2m },
|
||||
//{ "湖南", 2.2m },
|
||||
//{ "江西", 2.2m },
|
||||
//{ "河南", 2.2m },
|
||||
//{ "上海", 3m },
|
||||
//{ "浙江", 2.2m },
|
||||
//{ "安徽", 2.2m },
|
||||
//{ "江苏", 2.2m },
|
||||
//{ "河北", 2.2m },
|
||||
//{ "山东", 2.2m },
|
||||
//{ "福建", 2.2m },
|
||||
//{ "广东", 2.2m },
|
||||
//{ "深圳", 2.8m },
|
||||
//{ "天津", 2.2m },
|
||||
//{ "北京", 3.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 },
|
||||
//{ "内蒙", 4.5m },
|
||||
//{ "海南", 4.5m },
|
||||
//{ "新疆", 12.5m },
|
||||
//{ "西藏", 12.5m },
|
||||
// };
|
||||
// private decimal getoemamount(string province, decimal amount, int type)
|
||||
// {
|
||||
// foreach (var item in DicWarehousePostage)
|
||||
// {
|
||||
// if (province.StartsWith(item.Key))
|
||||
// {
|
||||
// if (type == 20)
|
||||
// return amount - item.Value;
|
||||
// if (type == 26)
|
||||
// return amount - item.Value - 0.3m;
|
||||
// private void fillOemAmount(List<UserPaymentRecordSmall> list, List<weiOrder> orders)
|
||||
// {
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// var order = orders.FirstOrDefault(a => a.order_id == item.OrderId);
|
||||
// if (order != null)
|
||||
// {
|
||||
// item.oem_amount = getoemamount(order.province_name, item.amount.Value, item.type);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// private Dictionary<string, decimal> DicWarehousePostage = new Dictionary<string, decimal>
|
||||
// {
|
||||
// { "湖北", 2.2m },
|
||||
//{ "湖南", 2.2m },
|
||||
//{ "江西", 2.2m },
|
||||
//{ "河南", 2.2m },
|
||||
//{ "上海", 3m },
|
||||
//{ "浙江", 2.2m },
|
||||
//{ "安徽", 2.2m },
|
||||
//{ "江苏", 2.2m },
|
||||
//{ "河北", 2.2m },
|
||||
//{ "山东", 2.2m },
|
||||
//{ "福建", 2.2m },
|
||||
//{ "广东", 2.2m },
|
||||
//{ "深圳", 2.8m },
|
||||
//{ "天津", 2.2m },
|
||||
//{ "北京", 3.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 },
|
||||
//{ "内蒙", 4.5m },
|
||||
//{ "海南", 4.5m },
|
||||
//{ "新疆", 12.5m },
|
||||
//{ "西藏", 12.5m },
|
||||
// };
|
||||
// private decimal getoemamount(string province, decimal amount, int type)
|
||||
// {
|
||||
// foreach (var item in DicWarehousePostage)
|
||||
// {
|
||||
// if (province.StartsWith(item.Key))
|
||||
// {
|
||||
// if (type == 20)
|
||||
// return amount - item.Value;
|
||||
// if (type == 26)
|
||||
// return amount - item.Value - 0.3m;
|
||||
|
||||
// }
|
||||
// }
|
||||
// return amount;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return amount;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public partial class UserService
|
||||
{
|
||||
var users = GetOEMUsers(oem.OemId);
|
||||
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>()
|
||||
.Where(a => types.Contains(a.Type))
|
||||
|
||||
@@ -238,7 +238,12 @@ public class VirtualLogisticsService : ITransientDependency
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,7 +129,7 @@ internal class GiftLogisticsTest
|
||||
public void GetOrderStatus()
|
||||
{
|
||||
var logisticsService = _container.Resolve<VirtualLogisticsService>();
|
||||
var data = logisticsService.GetOrderStatus(["260923-573109716621688"]);
|
||||
Console.WriteLine(string.Join(" ", data.Select(a => $"{a.OrderSn}:{a.ShopOrder}:{a.DeliveryStatus}")));
|
||||
var data = logisticsService.GetOrderStatus(["260923-407759756800192"]);
|
||||
Console.WriteLine(string.Join(" ", data.Select(a => $"{a.OrderSn}:{a.KuaidiSn}:{a.ShopOrder}:{a.DeliveryStatus}")));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user