|
@@ -89,22 +89,35 @@ namespace SiteCore.Handler
|
|
|
CeErpTrade ceErpTrade = CeErpTrade.Get(item.Replace("'", ""));
|
|
CeErpTrade ceErpTrade = CeErpTrade.Get(item.Replace("'", ""));
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- string sql = string.Format("SELECT count(*) as number FROM [dbo].[Ce_ErpTrade] WITH(NOLOCK) WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and status = 'COMPLETE' and seller_nick = '{2}' and tid <> '{3}' AND end_time < '{4}'", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick, ceErpTrade.tid, ceErpTrade.pay_time);
|
|
|
|
|
|
|
+ string sql = string.Format("SELECT tid FROM [dbo].[CE_ErpTrade] WITH(NOLOCK) WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and status = 'COMPLETE' and seller_nick = '{2}' and tid <> '{3}' AND end_time < '{4}' and payment >= 20", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick, ceErpTrade.tid, ceErpTrade.pay_time);
|
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
|
|
+ List<string> tidList = new List<string>();
|
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
- int count = Convert.ToInt32(dataTable.Rows[0]["number"]);
|
|
|
|
|
- if (count > 0)
|
|
|
|
|
|
|
+ foreach (DataRow row in dataTable.Rows)
|
|
|
{
|
|
{
|
|
|
- Debug.WriteLine(index++);
|
|
|
|
|
- continue;
|
|
|
|
|
|
|
+ tidList.Add("'" + row["tid"].ToString() + "'");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (tidList.Count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ sql = string.Format("SELECT count(*) as number FROM [dbo].[CE_ErpTradeCell] WITH(NOLOCK) WHERE tid in ({0}) AND IsSample = 0 ", string.Join(",", tidList));
|
|
|
|
|
+ dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
|
|
+ if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ int count = Convert.ToInt32(dataTable.Rows[0]["number"]);
|
|
|
|
|
+ if (count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Debug.WriteLine(index++);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
File.AppendAllText(path1, ceErpTrade.tid + "\n");
|
|
File.AppendAllText(path1, ceErpTrade.tid + "\n");
|
|
|
}
|
|
}
|
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
|
{
|
|
{
|
|
|
- File.AppendAllText(path1, ceErpTrade.tid + "\n");
|
|
|
|
|
|
|
+ File.AppendAllText(path1, "e:" + ceErpTrade.tid + "\n");
|
|
|
}
|
|
}
|
|
|
Debug.WriteLine(index++);
|
|
Debug.WriteLine(index++);
|
|
|
}*/
|
|
}*/
|
|
@@ -1642,6 +1655,7 @@ namespace SiteCore.Handler
|
|
|
entity.AfterSaleState = 1; //1待售后2售后主管审核3主管审核4完成售后
|
|
entity.AfterSaleState = 1; //1待售后2售后主管审核3主管审核4完成售后
|
|
|
entity.UpdateTime = DateTime.Now; //entity.AfterSaleReason = reason;
|
|
entity.UpdateTime = DateTime.Now; //entity.AfterSaleReason = reason;
|
|
|
entity.AfterSaleTime = DateTime.Now;
|
|
entity.AfterSaleTime = DateTime.Now;
|
|
|
|
|
+ entity.HandleTime = null;
|
|
|
entity.Update();
|
|
entity.Update();
|
|
|
LogHelper.addLog(entity.ctid, CurrentUser.UserID, "标记售后-" + reason, entity.OrderState, 1);
|
|
LogHelper.addLog(entity.ctid, CurrentUser.UserID, "标记售后-" + reason, entity.OrderState, 1);
|
|
|
returnSuccessMsg("转售后成功!");
|
|
returnSuccessMsg("转售后成功!");
|
|
@@ -3932,7 +3946,7 @@ namespace SiteCore.Handler
|
|
|
string needtids = string.Join(",", tLst.ToArray());
|
|
string needtids = string.Join(",", tLst.ToArray());
|
|
|
StringBuilder sql = new StringBuilder();
|
|
StringBuilder sql = new StringBuilder();
|
|
|
//sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1 where SupplierId!=0 and ctid in ({0});", needtids);
|
|
//sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1 where SupplierId!=0 and ctid in ({0});", needtids);
|
|
|
- sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1,IsReturn=0,FinishPlaceTime=GETDATE(),PlaceUserId={1},IsHaveNewOrder=0 where SupplierId!=0 and ctid in ({0});", needtids, CurrentUser.UserID);
|
|
|
|
|
|
|
+ sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1,IsReturn=0,FinishPlaceTime=GETDATE(),PlaceUserId={1},IsHaveNewOrder=0 where SupplierId!=0 AND OrderState = 5 and ctid in ({0});", needtids, CurrentUser.UserID);
|
|
|
sql.AppendFormat("insert into CE_ErpTradeLog(tid,UserId,Con,OperateTime) select ctid,{1},'审核给供应商',getdate() from ce_erptradecell where ctid in({0});", needtids, CurrentUser.UserID);
|
|
sql.AppendFormat("insert into CE_ErpTradeLog(tid,UserId,Con,OperateTime) select ctid,{1},'审核给供应商',getdate() from ce_erptradecell where ctid in({0});", needtids, CurrentUser.UserID);
|
|
|
DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
|
|
DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
|
|
|
returnSuccessMsg("操作成功!");
|
|
returnSuccessMsg("操作成功!");
|