|
|
@@ -118,9 +118,9 @@ namespace SiteCore.Handler
|
|
|
if (tid.Length > 0)
|
|
|
{
|
|
|
|
|
|
- string select_tid = getTidByCtid(tid);
|
|
|
+ List<string> select_tid = getTidByCtidMore(tid);
|
|
|
|
|
|
- lw.Add(string.Format("tid='{0}'", select_tid));
|
|
|
+ lw.Add(string.Format("tid in ({0})", string.Join(",", select_tid)));
|
|
|
}
|
|
|
if (buyernick.Length > 0)
|
|
|
{
|
|
|
@@ -2490,9 +2490,24 @@ namespace SiteCore.Handler
|
|
|
return tid;
|
|
|
}
|
|
|
|
|
|
+ public List<string> getTidByCtidMore(string ctid)
|
|
|
+ {
|
|
|
+ string sql = string.Format("select tid from CE_ErpTradeCell where (ctid = '{0}' or tid = '{0}' or orderSn = '{0}' or ParentSplitNo = '{0}' or ptid = '{0}')", ctid);
|
|
|
+ DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (DataRow item in dataTable.Rows)
|
|
|
+ {
|
|
|
+ list.Add("'" + item["tid"].ToString() + "'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
public List<string> getTidByCtidLike(string ctid)
|
|
|
{
|
|
|
- string sql = string.Format("select tid from CE_ErpTradeCell where (ctid='{0}' or tid='{0}' or orderSn='{0}')", ctid);
|
|
|
+ string sql = string.Format("select tid from CE_ErpTradeCell where (ctid = '{0}' or orderSn = '{0}')", ctid);
|
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
List<string> list = new List<string>();
|
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
@@ -6970,7 +6985,7 @@ namespace SiteCore.Handler
|
|
|
{
|
|
|
string select_tid = getTidByCtid(tid);
|
|
|
|
|
|
- lw.Add(string.Format("tid='{0}'", select_tid));
|
|
|
+ lw.Add(string.Format("otid='{0}'", select_tid));
|
|
|
}
|
|
|
string shopname = GetPostString("shopname");
|
|
|
if (shopname.Length > 0) lw.Add(string.Format("seller_nick = '{0}'", shopname));
|
|
|
@@ -7114,7 +7129,7 @@ namespace SiteCore.Handler
|
|
|
{
|
|
|
string select_tid = getTidByCtid(tid);
|
|
|
|
|
|
- lw.Add(string.Format("tid='{0}'", select_tid));
|
|
|
+ lw.Add(string.Format("otid='{0}'", select_tid));
|
|
|
}
|
|
|
string shopname = GetPostString("shopname");
|
|
|
if (shopname.Length > 0) lw.Add(string.Format("seller_nick = '{0}'", shopname));
|
|
|
@@ -12858,12 +12873,12 @@ namespace SiteCore.Handler
|
|
|
string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, ceErpTradeCell.ShopId);
|
|
|
ceErpTradeCellExtend.ToType = result;
|
|
|
List<int> products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2634, 2636, 2637, 2638, 2645, 2646 };
|
|
|
-
|
|
|
+ List<int> shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18, 21, 23, 24, 27, 28, 31, 32, 56, 61, 63, 64, 66, 124, 126, 127, 128 };
|
|
|
if (products.Contains(ceErpTradeCell.ProductId) || ceErpTradeCell.seller_memo.IndexOf("手绘") > -1 || ceErpTradeCell.seller_memo.IndexOf("电子稿") > -1 || ceErpTradeCell.isDianziOrder > 0)
|
|
|
{
|
|
|
ceErpTradeCellExtend.ToType = "外协";
|
|
|
}
|
|
|
- if (ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿"))
|
|
|
+ if ((ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿")) && shopIds.Contains(ceErpTradeCell.ShopId))
|
|
|
{
|
|
|
ceErpTradeCellExtend.ToType = "内部";
|
|
|
}
|
|
|
@@ -13280,7 +13295,7 @@ namespace SiteCore.Handler
|
|
|
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", entity.SupplierId);
|
|
|
+ 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);
|
|
|
@@ -13293,6 +13308,7 @@ namespace SiteCore.Handler
|
|
|
try
|
|
|
{
|
|
|
dt = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
|
|
|
+ return dt;
|
|
|
StringBuilder timerSql = new StringBuilder();
|
|
|
timerSql.AppendFormat("SELECT * FROM CE_ErpSupplierProductTime WHERE supplierId={0}", entity.SupplierId);
|
|
|
DataTable timerTable = DbHelper.DbConn.ExecuteDataset(timerSql.ToString()).Tables[0];
|