|
|
@@ -232,7 +232,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
mer.ActiveStatus = 1;
|
|
|
mer.MerStandardDate = DateTime.Now;
|
|
|
- RedisDbconn.Instance.Clear("PosMerchantInfo:" + mer.Id);
|
|
|
}
|
|
|
}
|
|
|
else if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 1)
|
|
|
@@ -243,7 +242,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
{
|
|
|
- UserId = user.Id, //接收创客
|
|
|
+ UserId = pos.Id, //接收创客
|
|
|
MsgType = 2,
|
|
|
Title = "补录成功通知", //标题
|
|
|
Summary = "您的 " + kqProducts.Name + " SN:" + pos.PosSn + "已经成功补录,请查收。",
|
|
|
@@ -259,7 +258,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
- RedisDbconn.Instance.Clear("PosMachinesTwo:" + pos.Id);
|
|
|
return "success";
|
|
|
}
|
|
|
pos.UserId = user.Id;
|
|
|
@@ -1225,6 +1223,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 +1356,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 + "请告知客户进行绑定。",
|
|
|
@@ -1463,7 +1462,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
{
|
|
|
- UserId = forMakerCode.UserId, //接收创客
|
|
|
+ UserId = pos.UserId, //接收创客
|
|
|
MsgType = 2,
|
|
|
Title = "解绑成功通知", //标题
|
|
|
Summary = "" + PosSn + "机具已成功解绑,当前机具如需绑定同一客户请再2个工作日后再进行绑定,直接绑定会导致数控异常,相关损失由您本人承担。",
|
|
|
@@ -1475,6 +1474,196 @@ 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(dataList);
|
|
|
+ }
|
|
|
+
|
|
|
+ #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 = machineApplie.Where(m => 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 = machineApplie.Where(m => 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
|
|
|
+ {
|
|
|
+ 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 +1776,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台购买机
|