|
|
@@ -1225,6 +1225,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
return "原机具SN数量和新机具SN数量不一致";
|
|
|
}
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
+ PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == OldSn);
|
|
|
StoreForCode storeForBack = db.StoreForCode.FirstOrDefault(m => m.Code == BackStoreNo) ?? new StoreForCode();
|
|
|
StoreForCode storeForOut = db.StoreForCode.FirstOrDefault(m => m.Code == OutStoreNo) ?? new StoreForCode();
|
|
|
StoreHouse BackStore = db.StoreHouse.FirstOrDefault(m => m.Id == storeForBack.StoreId) ?? new StoreHouse();
|
|
|
@@ -1357,7 +1358,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
{
|
|
|
- UserId = OutStore.UserId, //接收创客
|
|
|
+ UserId = pos.UserId, //接收创客
|
|
|
MsgType = 2,
|
|
|
Title = "换绑成功通知", //标题
|
|
|
Summary = "您的 " + oldPosBrand.Name + " SN:" + OldSn + "已经成功为客户换绑为" + newPosBrand.Name + "SN:" + NewSn + "请告知客户进行绑定。",
|
|
|
@@ -1475,6 +1476,197 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 通过券码修改盟主标记
|
|
|
+
|
|
|
+ public IActionResult ChangeSignQuan(string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public string ChangeSignQuanDo(string CouponNos = "", int IsSend = 0)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(CouponNos))
|
|
|
+ {
|
|
|
+ return "请输入券码";
|
|
|
+ }
|
|
|
+
|
|
|
+ string[] CouponNoList = CouponNos.Split('\n');
|
|
|
+ for (int i = 0; i < CouponNoList.Length; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 通过机具SN修改盟主标记
|
|
|
+
|
|
|
+ public IActionResult ChangeSignSn(string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public string ChangeSignSnDo(string SnNos = "", int IsSend = 0)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(SnNos))
|
|
|
+ {
|
|
|
+ return "请输入机具SN";
|
|
|
+ }
|
|
|
+
|
|
|
+ string[] SnNoList = SnNos.Split('\n');
|
|
|
+ for (int i = 0; i < SnNoList.Length; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 机具循环列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据条件查询创客列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Index(string right, string SwapSnExpand, string SnNos)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+ ViewBag.SwapSnExpand = SwapSnExpand;
|
|
|
+ ViewBag.SnNos = SnNos;
|
|
|
+
|
|
|
+ List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
+ var machineApplie = db.MachineApply.Where(m => m.Status > -1).ToList();
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(SwapSnExpand))
|
|
|
+ {
|
|
|
+ machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SwapSnExpand)).ToList();
|
|
|
+ foreach (var item in machineApplie)
|
|
|
+ {
|
|
|
+ var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ data["ApplyNo"] = item.ApplyNo.ToString();
|
|
|
+ data["OrderNo"] = orders.OrderNo.ToString();
|
|
|
+ data["MakerCode"] = item.ApplyNo.ToString();
|
|
|
+ data["RealName"] = item.ApplyNo.ToString();
|
|
|
+ data["ComeSn"] = item.ApplyNo.ToString();
|
|
|
+ data["SendSn"] = item.ApplyNo.ToString();
|
|
|
+ data["CreateDate"] = item.ApplyNo.ToString();
|
|
|
+ data["Status"] = item.ApplyNo.ToString();
|
|
|
+ dataList.Add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(SnNos))
|
|
|
+ {
|
|
|
+ machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SnNos)).ToList();
|
|
|
+ foreach (var item in machineApplie)
|
|
|
+ {
|
|
|
+ var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ data["ApplyNo"] = item.ApplyNo.ToString();
|
|
|
+ data["OrderNo"] = orders.OrderNo.ToString();
|
|
|
+ data["MakerCode"] = item.ApplyNo.ToString();
|
|
|
+ data["RealName"] = item.ApplyNo.ToString();
|
|
|
+ data["ComeSn"] = item.ApplyNo.ToString();
|
|
|
+ data["SendSn"] = item.ApplyNo.ToString();
|
|
|
+ data["CreateDate"] = item.ApplyNo.ToString();
|
|
|
+ data["Status"] = item.ApplyNo.ToString();
|
|
|
+ dataList.Add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 根据条件查询机具循环列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 创客列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public JsonResult IndexData(string SwapSnExpand, string SnNos, int page = 1, int limit = 30)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+ Fields.Add("SwapSnExpand", "1"); //申请机具SN
|
|
|
+ Fields.Add("SnNos", "1"); //发货机具SN
|
|
|
+ List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
+ var machineApplie = db.MachineApply.Where(m => m.Status > -1).ToList();
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(SwapSnExpand))
|
|
|
+ {
|
|
|
+ machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SwapSnExpand)).ToList();
|
|
|
+ foreach (var item in machineApplie)
|
|
|
+ {
|
|
|
+ var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ data["ApplyNo"] = item.ApplyNo.ToString();
|
|
|
+ data["OrderNo"] = orders.OrderNo.ToString();
|
|
|
+ data["MakerCode"] = item.ApplyNo.ToString();
|
|
|
+ data["RealName"] = item.ApplyNo.ToString();
|
|
|
+ data["ComeSn"] = item.ApplyNo.ToString();
|
|
|
+ data["SendSn"] = item.ApplyNo.ToString();
|
|
|
+ data["CreateDate"] = item.ApplyNo.ToString();
|
|
|
+ data["Status"] = item.ApplyNo.ToString();
|
|
|
+ dataList.Add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (!string.IsNullOrEmpty(SnNos))
|
|
|
+ {
|
|
|
+ machineApplie = db.MachineApply.Where(m => m.Status > -1 && m.SwapSnExpand.Contains(SnNos)).ToList();
|
|
|
+ foreach (var item in machineApplie)
|
|
|
+ {
|
|
|
+ var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ data["ApplyNo"] = item.ApplyNo.ToString();
|
|
|
+ data["OrderNo"] = orders.OrderNo.ToString();
|
|
|
+ data["MakerCode"] = item.ApplyNo.ToString();
|
|
|
+ data["RealName"] = item.ApplyNo.ToString();
|
|
|
+ data["ComeSn"] = item.ApplyNo.ToString();
|
|
|
+ data["SendSn"] = item.ApplyNo.ToString();
|
|
|
+ data["CreateDate"] = item.ApplyNo.ToString();
|
|
|
+ data["Status"] = item.ApplyNo.ToString();
|
|
|
+ dataList.Add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ machineApplie = db.MachineApply.Where(m => m.Status > -1).ToList();
|
|
|
+ foreach (var item in machineApplie)
|
|
|
+ {
|
|
|
+ var orders = db.Orders.FirstOrDefault(m => m.Sort == item.Id && m.Id == item.QueryCount);
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ data["ApplyNo"] = item.ApplyNo.ToString();
|
|
|
+ data["OrderNo"] = orders.OrderNo.ToString();
|
|
|
+ data["MakerCode"] = item.ApplyNo.ToString();
|
|
|
+ data["RealName"] = item.ApplyNo.ToString();
|
|
|
+ data["ComeSn"] = item.ApplyNo.ToString();
|
|
|
+ data["SendSn"] = item.ApplyNo.ToString();
|
|
|
+ data["CreateDate"] = item.ApplyNo.ToString();
|
|
|
+ data["Status"] = item.ApplyNo.ToString();
|
|
|
+ dataList.Add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Json(dataList);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
#region 查询创客直推奖
|
|
|
|
|
|
public IActionResult Prize100(string right)
|
|
|
@@ -1587,7 +1779,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
// List<int> proids = new List<int>();
|
|
|
// proids.Add(10);
|
|
|
// proids.Add(11);
|
|
|
- while(ParentUserId > 0)
|
|
|
+ while (ParentUserId > 0)
|
|
|
{
|
|
|
Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
|
int machineCount = db.PosMachinesTwo.Count(m => m.UserId == ParentUserId && m.PosSnType == 0); //判断是否拥有3台购买机
|