();
tuserAccountData.Add("ValidPreAmount", tuserAccount.ValidPreAmount += amount);
UserAccountService.Edit(tuserAccountData, userAccount.Id);
}
}
string text = string.Format("创客-首页-仓库管理-小分仓-撤回,UserId: '" + UserId + "',ToUserId: '" + smallStoreHouse.UserId + "',LaveNum:'" + smallStoreHouse.LaveNum + "',TotalNum:'" + smallStoreHouse.TotalNum + "',ChangeCount:'" + 1 + "',Time'" + DateTime.Now + "'");
function.WriteLog(text, "smallstorehouse");//小分仓记录日志
if (smallStoreHouse.LaveNum > 10 || smallStoreHouse.TotalNum < 0)
{
return "*库存已重置,不可撤回!";
}
BaseClass.SendPersonalMsg(query.ToUserId, 0, "预发机撤回通知", "您的预发机 SN:
" + query.SnNo + "
已被" + storeHouse.StoreName + " 撤回!
", "您的预发机: " + brandInfo.Name + " sn:" + query.SnNo + "已被 " + storeHouse.StoreName + " 撤回!");
var toUser = UsersService.Query(query.ToUserId);
BaseClass.SendPersonalMsg(query.FromUserId, 0, "预发机撤回通知", "已撤回创客:" + toUser.MakerCode + " " + toUser.RealName + " 的预发机 SN:
" + query.SnNo + "
", "已撤回创客:" + toUser.MakerCode + " " + toUser.RealName + " 的预发机 SN:" + query.SnNo + "");
}
}
RedisDbconn.Instance.SetExpire("SmallStoreCancel:" + UserId, 1);
return "success";
}
#endregion
#region 赋值预发货库存明细(创客-首页-仓库管理-小分仓-确认发货)
///
/// 赋值预发货库存明细(创客-首页-仓库管理-小分仓-确认发货)
///
public static void SetPreSendStockDetailValue(int FromUserId, int ToUserId, int SourceStoreId, int BrandId, string SnNo, int FromStoreId, int ToStoreId, int StoreId, int SnId)
{
PreSendStockDetail pd = new PreSendStockDetail();
pd.CreateDate = DateTime.Now; //创建时间
pd.FromUserId = FromUserId;//发货人Id
pd.ToUserId = ToUserId; //收货人Id
pd.SourceStoreId = SourceStoreId; //源仓库Id
pd.BrandId = BrandId; //产品类型Id
pd.SnNo = SnNo; //机具SN
pd.FromStoreId = FromStoreId; //出货仓库Id
pd.ToStoreId = ToStoreId; //收货仓库Id
pd.StoreId = ToStoreId; //仓库Id
pd.SnId = SnId;
LPD.Add(pd);
}
#endregion
#region 添加预发货库存明细(创客-首页-仓库管理-小分仓-确认发货)
///
/// 添加预发货库存明细(创客-首页-仓库管理-小分仓-确认发货)
///
public static void AddPreSendStockDetail(List pds)
{
foreach (var item in pds)
{
Dictionary query = new Dictionary();
query.Add("FromUserId", item.FromUserId);//发货人Id
query.Add("ToUserId", item.ToUserId); //收货人Id
query.Add("SourceStoreId", item.SourceStoreId); //源仓库Id
query.Add("BrandId", item.BrandId); //产品类型Id
query.Add("SnNo", item.SnNo); //机具SN
query.Add("FromStoreId", item.FromStoreId); //出货仓库Id
query.Add("ToStoreId", item.ToStoreId); //收货仓库Id
query.Add("StoreId", item.StoreId); //仓库Id
query.Add("SnId", item.SnId);
PreSendStockDetailService.Add(query);
}
}
#endregion
#region 修改预发货库存明细(创客-首页-仓库管理-小分仓-撤回)
///
/// 修改预发货库存明细(创客-首页-仓库管理-小分仓-撤回)
///
/// 记录Id
/// 状态
/// 撤回标记
public static void EditPreSendStockDetail(int Id, int Status, int CancelFlag)
{
Dictionary query = new Dictionary();
query.Add("Status", Status);
query.Add("CancelFlag", CancelFlag);
PreSendStockDetailService.Edit(query, Id);
}
#endregion
}
}