增加同步物流模块

修改现有架构,改为分模块( 简易版)
This commit is contained in:
chfei committed 2026-09-22 17:52:42 +08:00
1 parent 15e11618c9
commit fa03add754
120 files changed
+9438 -299

No files matched your search

@@ -1,10 +1,12 @@
using KJD_Web.Entitys;
using KJD_Web.Model.WxModel;
using MySqlX.XDevAPI;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
@@ -267,8 +269,170 @@ namespace KJD_Web.Services.Users
summary.ConsumeTotal = (long)Math.Round(sum * 100m);
return summary;
}
}
/// <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))
// {
// item.OrderId = item.remark.Split(':')[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;
// list.Clear();
// Debug.WriteLine($"成功修改;{list.Count}");
// Debug.WriteLine($"共修改;{count}");
// }
// }
// }
// 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;
// }
// }
// return amount;
// }
//}
//[FreeSql.DataAnnotations.Table(Name = "wxxd.user_payment_record")]
//public class UserPaymentRecordSmall()
//{
// public long id { get; set; }
// public int type { get; set; }
// /// <summary>
// /// 金额(元)
// /// </summary>
// public decimal? amount { get; set; }
// /// <summary>
// /// 归属oem用户的金额
// /// </summary>
// public decimal? oem_amount { get; set; }
// public string remark { get; set; }
// public DateTime create_time { get; set; }
// [FreeSql.DataAnnotations.Column(IsIgnore = true)]
// public bool IsFill { get; set; }
// [FreeSql.DataAnnotations.Column(IsIgnore = true)]
// public string OrderId { get; set; }
//}
//[FreeSql.DataAnnotations.Table(Name = "erp.oms_wei_order")]
//public class weiOrder
//{
// public string order_id { get; set; }
// public string province_name { get; set; }
//}
public class UserAmountSummary
{
/// <summary>