|
|
@@ -57,7 +57,7 @@ namespace SiteCore.Handler
|
|
|
|
|
|
string poscode = CurrentUser.UserPost.Post.Code;
|
|
|
DataStruct dStruct = GetPostStruct();
|
|
|
- //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\CE_ErpProduct(3).xlsx");
|
|
|
+ //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\即客4月无快递单号订单.xlsx");
|
|
|
//apiHelper.Api_SyncOrderByTime("598825");
|
|
|
//apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
|
|
|
//apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
|
|
|
@@ -849,7 +849,10 @@ namespace SiteCore.Handler
|
|
|
{
|
|
|
dataHelper.api_orderBack(entity.ctid, "0", "");
|
|
|
}
|
|
|
- commonHelper.sendSpuData(entity, ceErpTradeCellExtend);
|
|
|
+ if (entity.seller_memo.Contains("改稿"))
|
|
|
+ {
|
|
|
+ commonHelper.sendSpuData(entity, ceErpTradeCellExtend);
|
|
|
+ }
|
|
|
apiDesign.API_GetPrintData_ModifyOrder(entity.ctid, memo, ismemoopt, false);
|
|
|
returnSuccessMsg("保存成功!");
|
|
|
return;
|
|
|
@@ -985,7 +988,10 @@ namespace SiteCore.Handler
|
|
|
returnSuccessMsg("保存成功!");
|
|
|
LogHelper.addLog(entity.ctid, CurrentUser.UserID, "额外:" + entity.OtherMemo, entity.OrderState);
|
|
|
CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(ctid);
|
|
|
- ceErpTradeCellExtend = commonHelper.sendSpuData(entity, ceErpTradeCellExtend);
|
|
|
+ if (entity.OtherMemo.Contains("改稿"))
|
|
|
+ {
|
|
|
+ commonHelper.sendSpuData(entity, ceErpTradeCellExtend);
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -6202,7 +6208,7 @@ namespace SiteCore.Handler
|
|
|
else if (!string.IsNullOrEmpty(isTogether) && Convert.ToInt32(isTogether) == 2)
|
|
|
{
|
|
|
string ctids = GetPostString("ctids");
|
|
|
- DataTable dt = getSameOrderList(entity, mainEn);
|
|
|
+ DataTable dt = commonHelper.getSameOrderList(entity, mainEn);
|
|
|
List<string> list = new List<string>();
|
|
|
List<string> send_list = new List<string>();
|
|
|
CeErpTradeCell ceErpTradeCell = new CeErpTradeCell();
|
|
|
@@ -13251,7 +13257,7 @@ namespace SiteCore.Handler
|
|
|
ReturnSuccess("{" + string.Format("\"data\":{0}", Utils.Serialization.JsonString.DataTable2MiniAjaxJson(new DataTable())) + "}");
|
|
|
return;
|
|
|
}
|
|
|
- DataTable dt = getSameOrderList(entity, ceErpTrade);
|
|
|
+ DataTable dt = commonHelper.getSameOrderList(entity, ceErpTrade);
|
|
|
List<string> ids = new List<string>();
|
|
|
if (dt != null && dt.Rows.Count > 1)
|
|
|
{
|
|
|
@@ -13319,140 +13325,7 @@ namespace SiteCore.Handler
|
|
|
|
|
|
returnErrorMsg("缺少必要的参数");
|
|
|
}
|
|
|
- private DataTable getSameOrderList(CeErpTradeCell entity, CeErpTrade ceErpTrade)
|
|
|
- {
|
|
|
- StringBuilder sql = new StringBuilder();
|
|
|
- sql.AppendFormat("select ctid,IsSF,seller_memo,OtherMemo,productId,FinishPlaceTime,ProductCount from view_ErpTradeCell where SupplierId={0} and orderstate=6 and IsSample = 0", entity.SupplierId);
|
|
|
- if (string.IsNullOrEmpty(ceErpTrade.receiverId))
|
|
|
- {
|
|
|
- sql.AppendFormat(" and (tid='{0}');", entity.tid);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sql.AppendFormat(" and (tid='{0}' or (receiverId = '{1}' and IsSF = '{2}'));", entity.tid, ceErpTrade.receiverId, entity.IsSF);
|
|
|
- }
|
|
|
- DataTable dt = null;
|
|
|
- try
|
|
|
- {
|
|
|
- dt = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
|
|
|
- StringBuilder timerSql = new StringBuilder();
|
|
|
- timerSql.AppendFormat("SELECT * FROM CE_ErpSupplierProductTime WHERE supplierId={0}", entity.SupplierId);
|
|
|
- DataTable timerTable = DbHelper.DbConn.ExecuteDataset(timerSql.ToString()).Tables[0];
|
|
|
- //没有设置时间则不判断
|
|
|
- if (timerTable == null || timerTable.Rows.Count == 0)
|
|
|
- {
|
|
|
- return dt;
|
|
|
- }
|
|
|
- dt.Columns.Add(new DataColumn("default", typeof(int)));
|
|
|
- foreach (DataRow dr in dt.Rows)
|
|
|
- {
|
|
|
- dr["default"] = 0;
|
|
|
- //当前订单
|
|
|
- if (entity.ctid.Equals(dr["ctid"]))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- //已经标记过发货
|
|
|
- CeErpDeliverMark ceErpDeliverMark = CeErpDeliverMark.GetByCtid(dr["ctid"].ToString());
|
|
|
- if (ceErpDeliverMark != null)
|
|
|
- {
|
|
|
- dr["default"] = 1;
|
|
|
- continue;
|
|
|
- }
|
|
|
- string[] productIds = null;
|
|
|
- string productId = dr["productId"].ToString();
|
|
|
- string finishPlaceTime = dr["FinishPlaceTime"].ToString();
|
|
|
- string sellmer_mome = dr["seller_memo"].ToString();
|
|
|
- string txtCount = dr["ProductCount"].ToString();
|
|
|
- DateTime placeTime = DateTime.Now;
|
|
|
- //没有品类
|
|
|
- if (string.IsNullOrEmpty(productId) || "0".Equals(productId))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (string.IsNullOrEmpty(finishPlaceTime))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- placeTime = DateTime.Parse(finishPlaceTime);
|
|
|
- foreach (DataRow row in timerTable.Rows)
|
|
|
- {
|
|
|
- string txtIds = row["productId"].ToString();
|
|
|
- string[] crafts = { };
|
|
|
- int count = Convert.ToUInt16(row["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))
|
|
|
- {
|
|
|
- string textCraft = row["craft"].ToString();
|
|
|
- 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(row["deadLine"].ToString());
|
|
|
- DateTime dayDeadLine = DateTime.Parse(row["dayDeadLine"].ToString());
|
|
|
-
|
|
|
- int sendDay = Convert.ToInt16(row["sendDay"]);
|
|
|
|
|
|
- //下单时间小于当日发货时间则不用判断
|
|
|
- //当日发货必须发货
|
|
|
- if (dayDeadLine.Hour > 0 && dayDeadLine.Hour > placeTime.Hour)
|
|
|
- {
|
|
|
- dr["default"] = 1;
|
|
|
- break;
|
|
|
- }
|
|
|
- //在截稿时间之前下单的可以减去一天时间
|
|
|
- /*if (deadLine.Hour > 0 && deadLine.Hour > placeTime.Hour)
|
|
|
- {
|
|
|
- sendDay = Math.Max(1, sendDay - 1);
|
|
|
- }
|
|
|
- DateTime sendtime = placeTime.AddDays(sendDay);
|
|
|
- //判断有没有到发货日期
|
|
|
- if (DateTime.Compare(sendtime.Date, DateTime.Now.Date) > 0)
|
|
|
- {
|
|
|
- break;
|
|
|
- }*/
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- return dt;
|
|
|
- }
|
|
|
public void get_mark_number()
|
|
|
{
|
|
|
string eid = GetPostString("ctid");
|
|
|
@@ -13466,7 +13339,7 @@ namespace SiteCore.Handler
|
|
|
|
|
|
if (ceErpDeliverMark == null)
|
|
|
{
|
|
|
- DataTable dt = getSameOrderList(entity, ceErpTrade);
|
|
|
+ DataTable dt = commonHelper.getSameOrderList(entity, ceErpTrade);
|
|
|
List<string> ids = new List<string>();
|
|
|
if (dt != null && dt.Rows.Count > 1)
|
|
|
{
|