|
|
@@ -53,6 +53,7 @@ using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
|
|
using static SiteCore.taoObj.Api_tmc_refund_info_Obj;
|
|
|
using System.Threading.Tasks;
|
|
|
using SiteCore.taoObj.WebApi;
|
|
|
+using System.Web.UI.WebControls.WebParts;
|
|
|
|
|
|
namespace SiteCore.Handler
|
|
|
{
|
|
|
@@ -12771,41 +12772,8 @@ namespace SiteCore.Handler
|
|
|
returnSuccess(JsonConvert.SerializeObject(new { list }));
|
|
|
}
|
|
|
|
|
|
- Dictionary<int, Dictionary<string, string>> supplierMap = new Dictionary<int, Dictionary<string, string>>()
|
|
|
- {
|
|
|
- //chy----19
|
|
|
- {19, new Dictionary<string, string> {{"不干胶", "不干胶"}, {"卡片", "卡片"}, { "宣传单", "宣传单" }, { "手提袋", "手提袋" } }},
|
|
|
- //GD-CYT-----64
|
|
|
- {64, new Dictionary<string, string> {{"不干胶", "不干胶"}, {"卡片", "卡片"}, {"杯套", "杯套"}}},
|
|
|
- //ZHX----3
|
|
|
- {3, new Dictionary<string, string> {{"不干胶", "不干胶"}, {"卡片", "卡片"}, {"插卡", "插卡"}, {"uv", "uv"}, { "班旗", "班旗" }}},
|
|
|
- //JK----97
|
|
|
- {97, new Dictionary<string, string> {{"uv", "uv"}}},
|
|
|
- //ZT----70
|
|
|
- {70, new Dictionary<string, string> {{"uv", "uv"}}},
|
|
|
- //GD-CYTUV---126
|
|
|
- {126, new Dictionary<string, string> {{"uv", "uv"}}},
|
|
|
- //LHCY-----98
|
|
|
- {98, new Dictionary<string, string> {{"条幅", "条幅"}, {"帆布", "帆布"}, { "贡缎布", "贡缎布" }, { "纱幔", "纱幔" }, { "班旗", "班旗" } }},
|
|
|
- //XD-----90
|
|
|
- {90, new Dictionary<string, string> {{"条幅", "条幅"}, {"桌布", "桌布"}, { "班旗", "班旗" } }},
|
|
|
- //CYCY-----14
|
|
|
- {14, new Dictionary<string, string> {{"卡片", "卡片"}, {"宣传单", "宣传单"}, {"杯套", "杯套"}}},
|
|
|
- //THLZY----122
|
|
|
- {122, new Dictionary<string, string> {{ "烫画", "烫画" }, { "冷转印", "冷转印" }}}
|
|
|
- };
|
|
|
- //其他改名
|
|
|
- Dictionary<int, string> suppliers = new Dictionary<int, string>()
|
|
|
- {
|
|
|
- {15,"滴塑" }, {119,"数码" }, {121,"数码" }, {110,"刮刮卡" }, {10,"数码" },
|
|
|
- {5,"海报" }, {80,"数码" }, {96,"数码" }, {9,"金属标" },
|
|
|
- {7,"综合" }, {116,"棉卡" }, {59,"海报" }, {37,"不干胶" },
|
|
|
- {81,"金属标" }, {30,"卡片" }, {111,"种子纸" }, {72,"金属标" },
|
|
|
- {13,"数码" }, {45,"卷标" }, {31,"联单" }, {118,"海报" },
|
|
|
- {71,"数码" }, {70,"uv" },{93,"金属标" },{105,"uv" },{97,"数码" },
|
|
|
- {49,"暖心贴" }, {117,"手提袋" },{108,"写真布" },{44,"PVC" },{32,"扇子" },
|
|
|
- {4,"不干胶" },{106,"不干胶" },{94,"纸杯" },{100,"暖心贴" },{114,"定制衫" },{ 129,"种子纸"},{ 125,"胶带"},{ 127,"PET透卡"}
|
|
|
- };
|
|
|
+
|
|
|
+
|
|
|
//不统计
|
|
|
List<int> no_suppliers = new List<int>()
|
|
|
{
|
|
|
@@ -12816,17 +12784,7 @@ namespace SiteCore.Handler
|
|
|
{
|
|
|
136,114,34,96
|
|
|
};
|
|
|
- //配件单
|
|
|
- Dictionary<string, List<string>> maps = new Dictionary<string, List<string>>()
|
|
|
- {
|
|
|
- {"绳子",new List<string>(){"帆布", "卡片", "吊牌", "旗帜布" } },
|
|
|
- {"棉绳",new List<string>(){ "卡片", "吊牌" } },
|
|
|
- {"别针",new List<string>(){ "卡片", "吊牌" } },
|
|
|
- {"刮刮膜",new List<string>(){ "卡片", "刮刮卡" } },
|
|
|
- {"流苏",new List<string>(){ "卡片", "吊牌" } },
|
|
|
- {"旗杆",new List<string>(){ "班旗" } },
|
|
|
- {"牙签",new List<string>(){ "不干胶" } }
|
|
|
- };
|
|
|
+
|
|
|
|
|
|
public void get_place_order_data()
|
|
|
{
|
|
|
@@ -12850,49 +12808,19 @@ namespace SiteCore.Handler
|
|
|
endtime = dateTime.ToString("yyyy-MM-dd 00:00:00");
|
|
|
end = DateTime.Parse(endtime);
|
|
|
}
|
|
|
- List<int> smSupplier = new List<int>() { 97, 121, 119, 80 };
|
|
|
+
|
|
|
string startMonthDate = commonHelper.FirstDayOfMonth(DateTime.Now).ToString("yyyy-MM-dd 00:00:00");
|
|
|
string endMonthDate = commonHelper.LastDayOfMonth(DateTime.Now).ToString("yyyy-MM-dd 23:59:59");
|
|
|
- string sql = string.Format("select SupplierId,ProductId,seller_memo,ProductCount,ProductName,payment,SupplierName,UnusualTime,FinishPlaceTime,OrderState,FinishDeliveryTime,AfterSaleState=0,AfterSaleReason = '',delivery=0,shopId from view_ErpTradeCell where ( ( FinishPlaceTime BETWEEN '{0}' AND '{1}' ) OR ( OrderState = 6 AND UnusualTag = 5 AND IsRefund <= 1 ) ) AND IsSample = 0 and SupplierId > 0 ", starttime, endtime);
|
|
|
+ string sql = string.Format("select SupplierId,ProductId,seller_memo,ProductCount,ProductName,payment,SupplierName,UnusualTime,FinishPlaceTime,OrderState,FinishDeliveryTime,AfterSaleState=0,AfterSaleReason = '',delivery=0,shopId,UnusualTag from view_ErpTradeCell where ( ( FinishPlaceTime BETWEEN '{0}' AND '{1}' ) OR ( OrderState = 6 AND UnusualTag = 5 AND IsRefund <= 1 ) ) AND IsSample = 0 and SupplierId > 0 ", starttime, endtime);
|
|
|
DataTable data = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
|
|
|
- sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState,AfterSaleReason,delivery=0,shopId FROM view_ErpTradeCell WHERE ( AfterSalePreTime BETWEEN '{0}' AND '{1}' ) AND IsSample = 0 AND SupplierId > 0 AND FinishPlaceTime IS NOT NULL", startMonthDate, endMonthDate);
|
|
|
+ sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState,AfterSaleReason,delivery=0,shopId,UnusualTag FROM view_ErpTradeCell WHERE ( HandleTime BETWEEN '{0}' AND '{1}' ) AND IsSample = 0 AND SupplierId > 0 AND FinishPlaceTime IS NOT NULL", startMonthDate, endMonthDate);
|
|
|
DataTable afterSaleData = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
data.Merge(afterSaleData);
|
|
|
|
|
|
- sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState=0,AfterSaleReason = '',delivery=1,shopId FROM view_ErpTradeCell WHERE orderstate = 6 AND IsSample = 0 AND SupplierId > 0 AND FinishPlaceTime > '2025-11-01 00:00:31.000' AND IsRefund <= 1 AND status = 'NOT_SHIPPED' AND LEN( ProductName ) > 0 AND SupplierId not in (86,10,105,86)", startMonthDate, endMonthDate);
|
|
|
+ sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState=0,AfterSaleReason = '',delivery=1,shopId,UnusualTag FROM view_ErpTradeCell WHERE orderstate = 6 AND IsSample = 0 AND SupplierId > 0 AND FinishPlaceTime > '2025-11-01 00:00:31.000' AND IsRefund <= 1 AND LEN( ProductName ) > 0 AND SupplierId not in (86,10,105,86)", startMonthDate, endMonthDate);
|
|
|
DataTable deliveryData = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
data.Merge(deliveryData);
|
|
|
- //获取商品发货时间
|
|
|
- string timer_sql = string.Format("select * from CE_ErpSupplierProductTime");
|
|
|
- DataTable timer_data = DbHelper.DbConn.ExecuteDataset(timer_sql).Tables[0];
|
|
|
-
|
|
|
- Dictionary<int, List<CeErpSupplierProductTime>> timer_map = new Dictionary<int, List<CeErpSupplierProductTime>>();
|
|
|
- foreach (DataRow datarow in timer_data.Rows)
|
|
|
- {
|
|
|
- List<CeErpSupplierProductTime> list = null;
|
|
|
- int supplierId = Convert.ToInt32(datarow["SupplierId"]);
|
|
|
- if (timer_map.ContainsKey(supplierId))
|
|
|
- {
|
|
|
- timer_map.TryGetValue(supplierId, out list);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- list = new List<CeErpSupplierProductTime>();
|
|
|
- timer_map.Add(supplierId, list);
|
|
|
- timer_map.TryGetValue(supplierId, out list);
|
|
|
- }
|
|
|
- CeErpSupplierProductTime ceErpSupplierProductTime = new CeErpSupplierProductTime();
|
|
|
-
|
|
|
- ceErpSupplierProductTime.quantity = Convert.ToInt32(datarow["quantity"]);
|
|
|
- ceErpSupplierProductTime.dayDeadLine = datarow["dayDeadLine"].ToString();
|
|
|
- ceErpSupplierProductTime.deadLine = datarow["deadLine"].ToString();
|
|
|
- ceErpSupplierProductTime.productId = datarow["productId"].ToString();
|
|
|
- ceErpSupplierProductTime.craft = datarow["craft"].ToString();
|
|
|
- ceErpSupplierProductTime.sendDay = Convert.ToInt32(datarow["sendDay"]);
|
|
|
- list.Add(ceErpSupplierProductTime);
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
//不干胶-----1,卡片-----29
|
|
|
Dictionary<string, Dictionary<string, int>> other_map = new Dictionary<string, Dictionary<string, int>>();
|
|
|
@@ -12910,27 +12838,8 @@ namespace SiteCore.Handler
|
|
|
}
|
|
|
string seller_memo = row["seller_memo"].ToString();
|
|
|
|
|
|
- bool ispj = false;//是否配件单
|
|
|
- bool isfirst = true;//第一个配
|
|
|
+ bool ispj = commonHelper.placeDataIsPeijian(seller_memo);//是否配件单
|
|
|
|
|
|
- maps.Keys.ForEach(key =>
|
|
|
- {
|
|
|
- //备注包含配件
|
|
|
- if (seller_memo.Contains(key) && isfirst)
|
|
|
- {
|
|
|
- List<string> list = maps[key];
|
|
|
- ispj = true;
|
|
|
- isfirst = false;
|
|
|
- for (int i = 0; i < list.Count; i++)
|
|
|
- {
|
|
|
- if (seller_memo.Contains(list[i]))
|
|
|
- {
|
|
|
- ispj = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
if (ispj)
|
|
|
{
|
|
|
continue;
|
|
|
@@ -12949,35 +12858,18 @@ namespace SiteCore.Handler
|
|
|
seller_memo = seller_memo.Replace("横幅", "条幅");
|
|
|
seller_memo = seller_memo.Replace("锦旗", "条幅");
|
|
|
|
|
|
- string map_key = "";
|
|
|
- string type = "";
|
|
|
+ string map_key = commonHelper.placeDataGetMapKey(seller_memo, supplierId);
|
|
|
+ string type = commonHelper.placeDataGetMapKey(seller_memo, supplierId);
|
|
|
|
|
|
- if (supplierMap.ContainsKey(supplierId))
|
|
|
- {
|
|
|
- foreach (var kvp in supplierMap[supplierId])
|
|
|
- {
|
|
|
- if (seller_memo.Contains(kvp.Key))
|
|
|
- {
|
|
|
- map_key = kvp.Value;
|
|
|
- type = kvp.Value;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
if (map_key == "")
|
|
|
{
|
|
|
-
|
|
|
type = ProductName;
|
|
|
map_key = ProductName;
|
|
|
- if (smSupplier.Contains(supplierId))
|
|
|
- {
|
|
|
- type = "数码";
|
|
|
- map_key = "数码";
|
|
|
- }
|
|
|
}
|
|
|
- if ("其他".Equals(map_key) && suppliers.ContainsKey(supplierId))
|
|
|
+
|
|
|
+ if ("其他".Equals(map_key) && commonHelper.suppliers.ContainsKey(supplierId))
|
|
|
{
|
|
|
- map_key = suppliers[supplierId];
|
|
|
+ map_key = commonHelper.suppliers[supplierId];
|
|
|
}
|
|
|
|
|
|
map_key += "_" + row["SupplierName"].ToString();
|
|
|
@@ -13010,99 +12902,9 @@ namespace SiteCore.Handler
|
|
|
DateTime palceTimeTwoEnd = DateTime.Parse(palceTime.ToString("yyyy-MM-dd 23:59:59")).AddHours(2);
|
|
|
|
|
|
DateTime FinishPlaceTime = DateTime.Parse(row["FinishPlaceTime"].ToString());
|
|
|
- //GD-CYT-----64
|
|
|
- DateTime two = palceTimeStart.AddHours(14);
|
|
|
- DateTime three = palceTimeStart.AddHours(15);
|
|
|
- DateTime four = palceTimeStart.AddHours(16);
|
|
|
- DateTime six = palceTimeStart.AddHours(18);
|
|
|
- bool istoday = false;
|
|
|
- if (supplierId == 64 && "不干胶".Equals(type) && !seller_memo.Contains("牙签"))
|
|
|
- {
|
|
|
- //下午四点前 500-1000
|
|
|
- string count = row["ProductCount"].ToString();
|
|
|
- if (count != null && count.Length > 0)
|
|
|
- {
|
|
|
- int productCount = commonHelper.getPlaceProductCount(count);
|
|
|
- if (productCount >= 500 && productCount <= 1000)
|
|
|
- {
|
|
|
-
|
|
|
- if (DateTime.Compare(FinishPlaceTime, four) < 0)
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //UV
|
|
|
- else if ("uv".Equals(type))
|
|
|
- {
|
|
|
-
|
|
|
- //ZT----70
|
|
|
- //ZHX----3
|
|
|
-
|
|
|
- if (DateTime.Compare(FinishPlaceTime, four) < 0 && (supplierId == 70 || supplierId == 3))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- //JK----97
|
|
|
- //HZX----105
|
|
|
- if (DateTime.Compare(FinishPlaceTime, two) < 0 && (supplierId == 97 || supplierId == 105))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- if (DateTime.Compare(FinishPlaceTime, six) < 0 && (supplierId == 126))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- //帆布---52|条幅---27
|
|
|
- else if ("帆布".Equals(type) || "条幅".Equals(type))
|
|
|
- {
|
|
|
- //LHCY-----98
|
|
|
- if (DateTime.Compare(FinishPlaceTime, three) < 0 && (supplierId == 98))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
- //条幅
|
|
|
- else if ("条幅".Equals(type))
|
|
|
- {
|
|
|
- //XD-----90
|
|
|
- if (DateTime.Compare(FinishPlaceTime, two) < 0 && (supplierId == 90))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
- //桌布
|
|
|
- else if ("桌布".Equals(type))
|
|
|
- {
|
|
|
- //XD-----90
|
|
|
- if (DateTime.Compare(FinishPlaceTime, three) < 0 && (supplierId == 90))
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
- //DL---10
|
|
|
- //AYTW---119
|
|
|
- //FS-CYT-DY ----80
|
|
|
- //JK----97
|
|
|
- else if (supplierId == 10 || supplierId == 119 || supplierId == 80 || supplierId == 97)
|
|
|
- {
|
|
|
- if (DateTime.Compare(FinishPlaceTime, three) < 0)
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
- // QC---121
|
|
|
- else if (supplierId == 121)
|
|
|
- {
|
|
|
- if (DateTime.Compare(FinishPlaceTime, six) < 0)
|
|
|
- {
|
|
|
- istoday = true;
|
|
|
- }
|
|
|
- }
|
|
|
+ //GD-CYT-----64
|
|
|
+ bool istoday = commonHelper.placeDataIsToday(row, type);
|
|
|
|
|
|
if (afterSaleState == 0 && delivery == 0)
|
|
|
{
|
|
|
@@ -13110,11 +12912,6 @@ namespace SiteCore.Handler
|
|
|
if (DateTime.Compare(start, palceTime) < 0 && DateTime.Compare(end, palceTime) > 0)
|
|
|
{
|
|
|
map["dayTotal"]++;
|
|
|
- if (supplierId == 97)
|
|
|
- {
|
|
|
- supplierId = 97;
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
if (Convert.ToDecimal(row["payment"]) >= 500)
|
|
|
@@ -13165,132 +12962,15 @@ namespace SiteCore.Handler
|
|
|
else
|
|
|
{
|
|
|
map["deliveryNum"]++;
|
|
|
- try
|
|
|
+ if (no_shop.Contains(shopId))
|
|
|
{
|
|
|
- if (no_shop.Contains(shopId))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (istoday)
|
|
|
- {
|
|
|
- map["unusua"]++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (supplierId == 0 || productId == 0)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- //没配置时间
|
|
|
- if (!timer_map.ContainsKey(supplierId))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<CeErpSupplierProductTime> timmerList = timer_map[supplierId];
|
|
|
- if (timmerList.Count == 0)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- string[] productIds = null;
|
|
|
- string finishPlaceTime = row["FinishPlaceTime"].ToString();
|
|
|
- string sellmer_mome = row["seller_memo"].ToString();
|
|
|
- string txtCount = row["ProductCount"].ToString();
|
|
|
- DateTime placeTime = DateTime.Now;
|
|
|
-
|
|
|
- if (string.IsNullOrEmpty(finishPlaceTime))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- placeTime = DateTime.Parse(finishPlaceTime);
|
|
|
- bool isSendTime = false;
|
|
|
- foreach (CeErpSupplierProductTime productTime in timmerList)
|
|
|
- {
|
|
|
- string txtIds = productTime.productId;
|
|
|
- string[] crafts = { };
|
|
|
- int count = productTime.quantity;
|
|
|
- if (string.IsNullOrEmpty(txtIds))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (count > 0)
|
|
|
- {
|
|
|
- int quantity = commonHelper.handleProductCount(txtCount, true);
|
|
|
- //订单数量大于写入的数量则跳过
|
|
|
- if (quantity > count)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- productIds = txtIds.Split(',');
|
|
|
- if (productIds.Contains(productId.ToString()))
|
|
|
- {
|
|
|
- string textCraft = productTime.craft;
|
|
|
- textCraft = textCraft.Replace(",", ",");//统一格式
|
|
|
- if (!string.IsNullOrEmpty(textCraft))
|
|
|
- {
|
|
|
- crafts = textCraft.Split(',');
|
|
|
- }
|
|
|
- if (crafts.Length > 0)
|
|
|
- {
|
|
|
- bool isinCraft = false;
|
|
|
- for (int i = 0; i < crafts.Length; i++)
|
|
|
- {
|
|
|
- if (sellmer_mome.IndexOf(crafts[i]) >= 0)
|
|
|
- {
|
|
|
- isinCraft = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //有写工艺并且备注中没匹配中则跳过
|
|
|
- if (!isinCraft)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- DateTime deadLine = DateTime.Parse(productTime.deadLine);
|
|
|
- DateTime dayDeadLine = DateTime.Parse(productTime.dayDeadLine);
|
|
|
-
|
|
|
- int sendDay = productTime.sendDay;
|
|
|
-
|
|
|
- //订单发货时间
|
|
|
- DateTime sendtime = placeTime;
|
|
|
-
|
|
|
- //下单时间小于当日发货时间则不用判断
|
|
|
- //当日发货必须发货
|
|
|
- if (dayDeadLine.Hour > 0 && dayDeadLine.Hour > placeTime.Hour)
|
|
|
- {
|
|
|
- sendtime = DateTime.Parse(placeTime.ToString("yyyy-MM-dd 23:59:59"));
|
|
|
- }
|
|
|
- else if (deadLine.Hour > 0 && deadLine.Hour > placeTime.Hour)
|
|
|
- {
|
|
|
- //在截稿时间之前下单的可以减去一天时间
|
|
|
- sendDay = Math.Max(1, sendDay - 1);
|
|
|
- sendtime = DateTime.Parse(placeTime.ToString("yyyy-MM-dd 00:00:00")).AddDays(sendDay);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sendDay = Math.Max(1, sendDay - 1);
|
|
|
- sendtime = DateTime.Parse(placeTime.ToString("yyyy-MM-dd 23:59:59")).AddDays(sendDay);
|
|
|
- }
|
|
|
-
|
|
|
- //判断有没有到发货日期大于0还没到发货时间
|
|
|
- if (DateTime.Compare(sendtime.Date, DateTime.Now.Date) < 0)
|
|
|
- {
|
|
|
- //匹配到就不要继续匹配了
|
|
|
- isSendTime = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (isSendTime)
|
|
|
- {
|
|
|
- map["unusua"]++;
|
|
|
- }
|
|
|
+ continue;
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ if (!Convert.IsDBNull(row["UnusualTag"]) && Convert.ToInt32(row["UnusualTag"]) == 5)
|
|
|
{
|
|
|
- XLog.SaveLog(0, row["ctid"].ToString() + "更新发货异常订单错误:" + ex);
|
|
|
+ map["unusua"]++;
|
|
|
}
|
|
|
+ continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -13344,6 +13024,8 @@ namespace SiteCore.Handler
|
|
|
writeGridDataTableJson(dtNew.Rows.Count, dtNew);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
public void get_place_all_order_data()
|
|
|
{
|
|
|
string date1 = GetPostString("date1");
|
|
|
@@ -13402,7 +13084,6 @@ namespace SiteCore.Handler
|
|
|
list.Add(ceErpSupplierProductTime);
|
|
|
|
|
|
}
|
|
|
- List<int> smSupplier = new List<int>() { 97, 121, 119, 80 };
|
|
|
foreach (DataRow row in data.Rows)
|
|
|
{
|
|
|
//存储数据
|
|
|
@@ -13416,27 +13097,8 @@ namespace SiteCore.Handler
|
|
|
}
|
|
|
string seller_memo = row["seller_memo"].ToString();
|
|
|
|
|
|
- bool ispj = false;//是否配件单
|
|
|
- bool isfirst = true;//第一个配
|
|
|
+ bool ispj = commonHelper.placeDataIsPeijian(seller_memo);//是否配件单
|
|
|
|
|
|
- maps.Keys.ForEach(key =>
|
|
|
- {
|
|
|
- //备注包含配件
|
|
|
- if (seller_memo.Contains(key) && isfirst)
|
|
|
- {
|
|
|
- List<string> list = maps[key];
|
|
|
- ispj = true;
|
|
|
- isfirst = false;
|
|
|
- for (int i = 0; i < list.Count; i++)
|
|
|
- {
|
|
|
- if (seller_memo.Contains(list[i]))
|
|
|
- {
|
|
|
- ispj = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
if (ispj)
|
|
|
{
|
|
|
continue;
|
|
|
@@ -13455,35 +13117,17 @@ namespace SiteCore.Handler
|
|
|
seller_memo = seller_memo.Replace("横幅", "条幅");
|
|
|
seller_memo = seller_memo.Replace("锦旗", "条幅");
|
|
|
|
|
|
- string map_key = "";
|
|
|
- string type = "";
|
|
|
+ string map_key = commonHelper.placeDataGetMapKey(seller_memo, supplierId);
|
|
|
+ string type = commonHelper.placeDataGetMapKey(seller_memo, supplierId);
|
|
|
|
|
|
- if (supplierMap.ContainsKey(supplierId))
|
|
|
- {
|
|
|
- foreach (var kvp in supplierMap[supplierId])
|
|
|
- {
|
|
|
- if (seller_memo.Contains(kvp.Key))
|
|
|
- {
|
|
|
- map_key = kvp.Value;
|
|
|
- type = kvp.Value;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
if (map_key == "")
|
|
|
{
|
|
|
-
|
|
|
type = ProductName;
|
|
|
map_key = ProductName;
|
|
|
- if (smSupplier.Contains(supplierId))
|
|
|
- {
|
|
|
- type = "数码";
|
|
|
- map_key = "数码";
|
|
|
- }
|
|
|
}
|
|
|
- if ("其他".Equals(map_key) && suppliers.ContainsKey(supplierId))
|
|
|
+ if ("其他".Equals(map_key) && commonHelper.suppliers.ContainsKey(supplierId))
|
|
|
{
|
|
|
- map_key = suppliers[supplierId];
|
|
|
+ map_key = commonHelper.suppliers[supplierId];
|
|
|
}
|
|
|
|
|
|
map_key += "_" + row["SupplierName"].ToString();
|
|
|
@@ -15299,6 +14943,248 @@ namespace SiteCore.Handler
|
|
|
DataTable dt = WebCache.GetData("view_ErpAssignLog", dStruct);
|
|
|
writeGridDataTableJson(dStruct.TotalCount, dt);
|
|
|
}
|
|
|
+
|
|
|
+ public void change_upfile_status()
|
|
|
+ {
|
|
|
+ int id = GetPostInt("id");
|
|
|
+
|
|
|
+ CeErpUpFileSupplier ceErpUpFileSupplier = CeErpUpFileSupplier.Get(id);
|
|
|
+ if (ceErpUpFileSupplier != null)
|
|
|
+ {
|
|
|
+ ceErpUpFileSupplier.isOpen = !ceErpUpFileSupplier.isOpen;
|
|
|
+ ceErpUpFileSupplier.Update();
|
|
|
+ }
|
|
|
+
|
|
|
+ returnSuccessMsg("保存成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void test_seller_memo_upfile()
|
|
|
+ {
|
|
|
+ string ctid = GetPostString("ctid");
|
|
|
+
|
|
|
+ CeErpTradeCell ce = CeErpTradeCell.GetByCtid(ctid);
|
|
|
+
|
|
|
+ if (ce == null)
|
|
|
+ {
|
|
|
+ returnErrorMsg("查无订单");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int supplierId = getsupplierId(ce);
|
|
|
+ if (supplierId > 0)
|
|
|
+ {
|
|
|
+ CeErpSupplier ceErpSupplier = CeErpSupplier.Get(supplierId);
|
|
|
+ if (ceErpSupplier != null)
|
|
|
+ {
|
|
|
+ returnSuccessMsg(ceErpSupplier.ComName);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ returnErrorMsg("未匹配到车间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ private int getsupplierId(CeErpTradeCell entity)
|
|
|
+ {
|
|
|
+ int supplierId = 0;
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.AppendFormat("select * from CE_ErpUpFileSupplier where isOpen = 1");
|
|
|
+ DataTable cellEx = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
|
|
|
+
|
|
|
+ int num = getProductCount(entity.seller_memo);
|
|
|
+ foreach (DataRow row in cellEx.Rows)
|
|
|
+ {
|
|
|
+ bool isIn = true;
|
|
|
+ //判断材质工艺都要符合
|
|
|
+ if (!Convert.IsDBNull(row["seller_memo"]) && !string.IsNullOrEmpty(row["seller_memo"].ToString()))
|
|
|
+ {
|
|
|
+ string memo = row["seller_memo"].ToString();
|
|
|
+
|
|
|
+ string[] memolist = memo.Split('+');
|
|
|
+ for (int i = 0; i < memolist.Length; i++)
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, memolist[i].Replace("/", "|")))
|
|
|
+ {
|
|
|
+ isIn = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isIn)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //判断金额符不符合
|
|
|
+ if (!Convert.IsDBNull(row["payment"]) && !string.IsNullOrEmpty(row["payment"].ToString()))
|
|
|
+ {
|
|
|
+ string payment = row["payment"].ToString();
|
|
|
+ string[] paymentList = payment.Split('-');
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(paymentList[0]))
|
|
|
+ {
|
|
|
+ if (entity.payment < Convert.ToDouble(paymentList[0]))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(paymentList[1]))
|
|
|
+ {
|
|
|
+ if (entity.payment > Convert.ToDouble(paymentList[1]))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Convert.IsDBNull(row["size"]) && !string.IsNullOrEmpty(row["size"].ToString()))
|
|
|
+ {
|
|
|
+ string pattern = @"\b(\d{1,5}[x\*]\d{1,5}(mm|cm))\b";
|
|
|
+ string memo = entity.seller_memo.Replace("MM", "mm").Replace("CM", "cm");
|
|
|
+ Regex reg = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline, TimeSpan.FromSeconds(2));//2秒后超时
|
|
|
+ MatchCollection matches = reg.Matches(memo);//设定要查找的字符串
|
|
|
+ double width = 0;
|
|
|
+ double height = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (matches[0].Success)
|
|
|
+ {
|
|
|
+ string sizematches = matches[0].Groups[0].Value;
|
|
|
+ sizematches = sizematches.Replace("mm", "");
|
|
|
+ sizematches = sizematches.Replace("cm", "");
|
|
|
+ string[] size_list = sizematches.Split('x');
|
|
|
+ if (size_list.Length > 1)
|
|
|
+ {
|
|
|
+ width = Convert.ToDouble(size_list[0]);
|
|
|
+ height = Convert.ToDouble(size_list[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ string size = row["size"].ToString();
|
|
|
+ string[] sizeList = size.Split('-');
|
|
|
+ if (!string.IsNullOrEmpty(sizeList[0]))
|
|
|
+ {
|
|
|
+ string[] sizeItemList = sizeList[0].Split('x');
|
|
|
+ //第一个尺寸格式不正确
|
|
|
+ if (sizeItemList.Length < 2)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ double sizeWidth = Convert.ToDouble(sizeItemList[0]);
|
|
|
+ double sizeheight = Convert.ToDouble(sizeItemList[1]);
|
|
|
+ //备注尺寸要大于第一个尺寸
|
|
|
+
|
|
|
+ if (!((width > sizeWidth && height > sizeheight) || (width > sizeheight && height > sizeWidth)))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(sizeList[1]))
|
|
|
+ {
|
|
|
+ string[] sizeItemList = sizeList[1].Split('x');
|
|
|
+ //第二个尺寸格式不正确
|
|
|
+ if (sizeItemList.Length < 2)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ double sizeWidth = Convert.ToDouble(sizeItemList[0]);
|
|
|
+ double sizeheight = Convert.ToDouble(sizeItemList[1]);
|
|
|
+ //备注尺寸要大于第二个尺寸
|
|
|
+
|
|
|
+ if (!((width < sizeWidth && height < sizeheight) || (width < sizeheight && height < sizeWidth)))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断数量是否符合
|
|
|
+ if (!Convert.IsDBNull(row["number"]) && !string.IsNullOrEmpty(row["number"].ToString()))
|
|
|
+ {
|
|
|
+ string numberText = row["number"].ToString();
|
|
|
+
|
|
|
+ string[] numberTextList = numberText.Split('-');
|
|
|
+ int number = 0;
|
|
|
+ if (!string.IsNullOrEmpty(numberTextList[0]))
|
|
|
+ {
|
|
|
+ number = Convert.ToInt32(numberTextList[0]);
|
|
|
+ if (number > num)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(numberTextList[1]))
|
|
|
+ {
|
|
|
+ number = Convert.ToInt32(numberTextList[1]);
|
|
|
+ if (number < num)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断店铺符不符合
|
|
|
+ if (!Convert.IsDBNull(row["shopIds"]) && !string.IsNullOrEmpty(row["shopIds"].ToString()))
|
|
|
+ {
|
|
|
+ List<string> shopids = row["shopIds"].ToString().Split(',').ToList();
|
|
|
+
|
|
|
+ if (!shopids.Contains(entity.ShopId.ToString()))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //地区不符合
|
|
|
+ if (!Convert.IsDBNull(row["address"]) && !string.IsNullOrEmpty(row["address"].ToString()))
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, row["address"].ToString().Replace("、", "|")))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //限制条件
|
|
|
+ if (!Convert.IsDBNull(row["filterText"]) && !string.IsNullOrEmpty(row["filterText"].ToString()))
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, row["filterText"].ToString().Replace("/", "|")))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ supplierId = Convert.ToInt32(row["supplierId"]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return supplierId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int getProductCount(string txt)
|
|
|
+ {
|
|
|
+ // 提取"个"或"张"前面的数字
|
|
|
+ int unit = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string unitPattern = @"(\d+)(?=个|张|本|套|件|卷|劵|条|箱 )";
|
|
|
+ System.Text.RegularExpressions.Match unitMatch = Regex.Match(txt, unitPattern);
|
|
|
+ string unitNum = unitMatch.Success ? unitMatch.Groups[1].Value : "1";
|
|
|
+
|
|
|
+ if (!int.TryParse(unitNum, out unit))
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ return unit;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|