|
@@ -152,6 +152,7 @@ namespace ErpServer
|
|
|
string dinggaolvSync = "";
|
|
string dinggaolvSync = "";
|
|
|
string unusualSync = "";
|
|
string unusualSync = "";
|
|
|
string refundSync = "";
|
|
string refundSync = "";
|
|
|
|
|
+ List<int> shop_list = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 28, 31, 32, 56, 61, 126, 128 };
|
|
|
|
|
|
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
@@ -950,10 +951,12 @@ namespace ErpServer
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ int[] uv_productIds = new int[] { 14, 43, 2487, 2531, 2654, 2656 };
|
|
|
|
|
+
|
|
|
CeErpTrade ceErpTrade = CeErpTrade.Get(dr["tid"].ToString());
|
|
CeErpTrade ceErpTrade = CeErpTrade.Get(dr["tid"].ToString());
|
|
|
- if (ceErpTrade != null && !string.IsNullOrEmpty(ceErpTrade.buyer_nick))
|
|
|
|
|
|
|
+ if ("normal".Equals(syncType) && ceErpTrade != null && !string.IsNullOrEmpty(ceErpTrade.buyer_nick) && shop_list.Contains(Convert.ToInt32(dr["shopid"])))
|
|
|
{
|
|
{
|
|
|
- string design_order_sql = string.Format("SELECT top 1 DesignUserId,DesignUserName,OnDuty,BeOnDuty FROM [dbo].[view_ErpTradeCell] WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and seller_nick = '{2}' and DesignUserId > 0 order by pay_time desc;", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick);
|
|
|
|
|
|
|
+ string design_order_sql = string.Format("SELECT top 1 DesignUserId,DesignUserName,OnDuty,BeOnDuty,OldOrder FROM [dbo].[view_ErpTradeCell] WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and seller_nick = '{2}' and DesignUserId > 0 order by pay_time desc;", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick);
|
|
|
DataTable dataTable = SqlHelper.ExecuteDataset(design_order_sql).Tables[0];
|
|
DataTable dataTable = SqlHelper.ExecuteDataset(design_order_sql).Tables[0];
|
|
|
if (dataTable != null && dataTable.Rows != null && dataTable.Rows.Count > 0)
|
|
if (dataTable != null && dataTable.Rows != null && dataTable.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
@@ -963,13 +966,16 @@ namespace ErpServer
|
|
|
CeErpUser ceErpUser = CeErpUser.Get(designUserId);
|
|
CeErpUser ceErpUser = CeErpUser.Get(designUserId);
|
|
|
int beOnDuty = Convert.IsDBNull(dataTable.Rows[0]["BeOnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["BeOnDuty"]);
|
|
int beOnDuty = Convert.IsDBNull(dataTable.Rows[0]["BeOnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["BeOnDuty"]);
|
|
|
int onduty = Convert.IsDBNull(dataTable.Rows[0]["OnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["OnDuty"]);
|
|
int onduty = Convert.IsDBNull(dataTable.Rows[0]["OnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["OnDuty"]);
|
|
|
|
|
+ int oldOrder = Convert.IsDBNull(dataTable.Rows[0]["oldOrder"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["oldOrder"]);
|
|
|
|
|
+ int shopId = ceErpShop.ID;
|
|
|
string designUserName = Convert.IsDBNull(dataTable.Rows[0]["DesignUserName"]) ? "" : dataTable.Rows[0]["DesignUserName"].ToString();
|
|
string designUserName = Convert.IsDBNull(dataTable.Rows[0]["DesignUserName"]) ? "" : dataTable.Rows[0]["DesignUserName"].ToString();
|
|
|
List<string> desingList = ceErpUser.pemDesign.Split(',').ToList();
|
|
List<string> desingList = ceErpUser.pemDesign.Split(',').ToList();
|
|
|
|
|
+ List<string> shopList = ceErpUser.pemShop.Split(',').ToList();
|
|
|
bool isOnline = false;
|
|
bool isOnline = false;
|
|
|
if (selfTime.Hour < 12)
|
|
if (selfTime.Hour < 12)
|
|
|
{
|
|
{
|
|
|
if (beOnDuty != 2)
|
|
if (beOnDuty != 2)
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
isOnline = true;
|
|
isOnline = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -991,8 +997,13 @@ namespace ErpServer
|
|
|
{
|
|
{
|
|
|
isOnline = true;
|
|
isOnline = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ //老客户单子上个设计师不支持老客户 UV设计不用管
|
|
|
|
|
+ if ("1".Equals(IsOldCustomer) && oldOrder == 0 && !uv_productIds.Contains(ProductId))
|
|
|
|
|
+ {
|
|
|
|
|
+ isOnline = false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (onduty > 0 && designUserId > 0 && desingList.Contains(ProductId.ToString()) && isOnline)//设计师在线
|
|
|
|
|
|
|
+ if (onduty > 0 && designUserId > 0 && desingList.Contains(ProductId.ToString()) && shopList.Contains(shopId.ToString()) && isOnline)//设计师在线
|
|
|
{
|
|
{
|
|
|
string update_sql = string.Format("update CE_ErpTradeCell set OrderState=3,IsAutoDispatch=1,WaitDesignTime=getdate(),UpdateTime=getdate(),DesignUserId={1},DispatchSort=0 where ctid='{0}' and OrderState=2; update view_ErpUser set DayOrderReceive=DayOrderReceive+1,DayOrderPer=CAST((CAST(((DayOrderReceive + 1)) as decimal(8,5))/DayOrderLimit) as decimal(8,3)) where id={1}; insert into CE_ErpTradeLog(tid,OrderState,UserId,OperateTime,Con) select ctid,OrderState,0,getdate(),'2自动派单:{2}'+CONVERT(varchar,{1}) from ce_erptradecell where ctid='{0}';", dr["ctid"].ToString(), designUserId, designUserName);
|
|
string update_sql = string.Format("update CE_ErpTradeCell set OrderState=3,IsAutoDispatch=1,WaitDesignTime=getdate(),UpdateTime=getdate(),DesignUserId={1},DispatchSort=0 where ctid='{0}' and OrderState=2; update view_ErpUser set DayOrderReceive=DayOrderReceive+1,DayOrderPer=CAST((CAST(((DayOrderReceive + 1)) as decimal(8,5))/DayOrderLimit) as decimal(8,3)) where id={1}; insert into CE_ErpTradeLog(tid,OrderState,UserId,OperateTime,Con) select ctid,OrderState,0,getdate(),'2自动派单:{2}'+CONVERT(varchar,{1}) from ce_erptradecell where ctid='{0}';", dr["ctid"].ToString(), designUserId, designUserName);
|
|
|
SqlHelper.ExecuteNonQuery(update_sql);
|
|
SqlHelper.ExecuteNonQuery(update_sql);
|
|
@@ -1002,7 +1013,6 @@ namespace ErpServer
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- int[] uv_productIds = new int[] { 14, 43, 2487, 2531, 2654, 2656 };
|
|
|
|
|
//指定店铺老客户和指定店铺单价500以上分给指定部门
|
|
//指定店铺老客户和指定店铺单价500以上分给指定部门
|
|
|
if (!uv_productIds.Contains(ProductId) && ((IsOldCustomer == "1" && userId == 241)))
|
|
if (!uv_productIds.Contains(ProductId) && ((IsOldCustomer == "1" && userId == 241)))
|
|
|
{
|
|
{
|