ソースを参照

辅助工具删除手机号等显示
修复奖励等发放限制

DuGuYang 3 年 前
コミット
0860e2f9f3

+ 93 - 33
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1008,7 +1008,8 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     Users user = db.Users.FirstOrDefault(m => m.Id == rewards.UserId) ?? new Users();
                     DepositGets = "已领取";
-                    DepositUsers = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                    DepositUsers = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                    // DepositUsers = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
                 }
                 string ActiveTimes = rewards.CreateDate == null ? "" : rewards.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
                 var storeInfo = db.StoreHouse.FirstOrDefault(m => m.Id == pos.StoreId) ?? new StoreHouse();
@@ -1104,7 +1105,8 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == reward.UserId) ?? new Users();
                 DepositGet = "已领取";
-                DepositUser = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                DepositUser = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // DepositUser = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
                 var fAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 0);
                 if (fAmount != null)
                 {
@@ -1123,7 +1125,8 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == lisreward.UserId) ?? new Users();
                 DepositGet6 = "已领取";
-                DepositUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                DepositUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // DepositUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             string FluxGet6 = "未领取";
             string FluxUser6 = "";
@@ -1132,10 +1135,12 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == flux.UserId) ?? new Users();
                 FluxGet6 = "已领取(领取时间:" + flux.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + ")";
-                FluxUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                FluxUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // FluxUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             Users touser = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
-            DepositToUser = "创客编号:" + touser.MakerCode + ",姓名:" + touser.RealName + ",手机号:" + touser.Mobile;
+            DepositToUser = "创客编号:" + touser.MakerCode + ",姓名:" + touser.RealName;
+            // DepositToUser = "创客编号:" + touser.MakerCode + ",姓名:" + touser.RealName + ",手机号:" + touser.Mobile;
             string OpenUser10 = "未领取";
             string OpenUser20 = "未领取";
             string Leader10 = "未领取";
@@ -1145,25 +1150,29 @@ namespace MySystem.Areas.Admin.Controllers
             if (openreward.Id > 0)
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == openreward.UserId) ?? new Users();
-                OpenUser20 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                OpenUser20 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // OpenUser20 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             openreward = OpenRewardDetail.FirstOrDefault(m => m.CreditRewardAmount == 10) ?? new OpenRewardDetail();
             if (openreward.Id > 0)
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == openreward.UserId) ?? new Users();
-                OpenUser10 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                OpenUser10 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // OpenUser10 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             var leader10 = db.UserAccountRecord.FirstOrDefault(m => m.QueryCount == pos.Id && m.ChangeType == 116) ?? new UserAccountRecord();
             if (leader10.Id > 0)
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == leader10.UserId) ?? new Users();
-                Leader10 = "金额:" + leader10.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                Leader10 = "金额:" + leader10.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // Leader10 = "金额:" + leader10.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             var yyzx5 = db.UserAccountRecord.FirstOrDefault(m => m.QueryCount == pos.Id && m.ChangeType == 121) ?? new UserAccountRecord();
             if (yyzx5.Id > 0)
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == yyzx5.UserId) ?? new Users();
-                YYZX5 = "金额:" + yyzx5.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
+                YYZX5 = "金额:" + yyzx5.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName;
+                // YYZX5 = "金额:" + yyzx5.ChangeAmount + ",创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             MachineApply apply = db.MachineApply.FirstOrDefault(m => m.SwapSnExpand.Contains(pos.PosSn)) ?? new MachineApply();
             Orders applyorder = db.Orders.FirstOrDefault(m => m.Id == apply.QueryCount) ?? new Orders();
@@ -1183,12 +1192,14 @@ namespace MySystem.Areas.Admin.Controllers
             result += "\n";
             result += "机具SN:" + pos.PosSn + "\n";
             result += "商户编号:" + merInfo + ",商户姓名:" + merName + "\n";
-            result += "商户型机器/直拓机器:创客编号:" + posSubUser.MakerCode + ",姓名:" + posSubUser.RealName + ",手机号:" + posSubUser.Mobile + "\n";
+            result += "商户型机器/直拓机器:创客编号:" + posSubUser.MakerCode + ",姓名:" + posSubUser.RealName + "\n";
+            // result += "商户型机器/直拓机器:创客编号:" + posSubUser.MakerCode + ",姓名:" + posSubUser.RealName + ",手机号:" + posSubUser.Mobile + "\n";
             if (change.Id > 0)
             {
                 result += "换机来源机具SN:" + change.BackSnNo + "\n";
             }
-            result += "机具所属人:创客编号:" + posUser.MakerCode + ",姓名:" + posUser.RealName + ",手机号:" + posUser.Mobile + "\n";
+            result += "机具所属人:创客编号:" + posUser.MakerCode + ",姓名:" + posUser.RealName + "\n";
+            // result += "机具所属人:创客编号:" + posUser.MakerCode + ",姓名:" + posUser.RealName + ",手机号:" + posUser.Mobile + "\n";
             // result += "机器持有人顶级:创客编号:" + posTopUser.MakerCode + ",姓名:" + posTopUser.RealName + ",手机号:" + posTopUser.Mobile + "\n";
             result += "机器所属仓库:仓库编号:" + store.StoreNo + ",仓库名称:" + store.StoreName + "\n";
             if (pos.PreUserId > 0)
@@ -1196,7 +1207,8 @@ namespace MySystem.Areas.Admin.Controllers
                 Users smallStoreUser = db.Users.FirstOrDefault(m => m.Id == pos.PreUserId) ?? new Users();
                 PreSendStockDetail preSend = db.PreSendStockDetail.FirstOrDefault(m => m.SnId == pos.Id && m.ToUserId == pos.PreUserId && m.Status == 1) ?? new PreSendStockDetail();
                 string preSendDate = preSend.CreateDate == null ? "" : preSend.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
-                result += "机具所属小分仓:创客编号:" + smallStoreUser.MakerCode + ",姓名:" + smallStoreUser.RealName + ",手机号:" + smallStoreUser.Mobile + ",预发时间:" + preSendDate + "\n";
+                result += "机具所属小分仓:创客编号:" + smallStoreUser.MakerCode + ",姓名:" + smallStoreUser.RealName + ",预发时间:" + preSendDate + "\n";
+                // result += "机具所属小分仓:创客编号:" + smallStoreUser.MakerCode + ",姓名:" + smallStoreUser.RealName + ",手机号:" + smallStoreUser.Mobile + ",预发时间:" + preSendDate + "\n";
             }
             else
             {
@@ -1224,7 +1236,7 @@ namespace MySystem.Areas.Admin.Controllers
             result += "流量费:" + FluxGet6 + "\n";
             result += "流量费发放对象:" + FluxUser6 + "\n";
             result += "开机奖20:" + OpenUser20 + "\n";
-            result += "开机奖10:" + OpenUser10 + "\n";
+            // result += "开机奖10:" + OpenUser10 + "\n";
             result += "盟主奖" + Leader10 + "\n";
             result += "运营中心奖" + YYZX5 + "\n";
             return result;
@@ -1700,9 +1712,47 @@ namespace MySystem.Areas.Admin.Controllers
                     newpos.PreUserId = oldpos.PreUserId;
 
                     oldpos.StoreId = storeBack.Id;
+                    oldpos.QueryCount = 0;
+                    oldpos.UpdateDate = null;
+                    oldpos.ActivityList = null;
+                    oldpos.SeoKeyword = null;
+                    oldpos.SeoDescription = null;
+                    oldpos.OrderId = 0;
+                    oldpos.RecycEndDate = null;
+                    oldpos.RecycBackCount = 0;
+                    oldpos.PrizeParams = null;
+                    oldpos.ScanQrTrade = 0;
+                    oldpos.BindMerchantId = 0;
+                    oldpos.CreditTrade = 0;
+                    oldpos.DebitCardTrade = 0;
+                    oldpos.IsVip = 0;
+                    oldpos.UserNav = null;
+                    oldpos.TransferTime = null;
+                    oldpos.IsPurchase = 0;
+                    oldpos.Detail = null;
+                    oldpos.BindingTime = null;
+                    oldpos.BindingState = 0;
+                    oldpos.ActivationTime = null;
+                    oldpos.ActivationState = 0;
+                    oldpos.LeaderUserId = 0;
+                    oldpos.PreUserId = 0;
+                    oldpos.IsFirst = 0;
+                    oldpos.DownFeeMan = null;
+                    oldpos.DownFeeFlag = 0;
+                    oldpos.DownFeeDate = null;
+                    oldpos.UpFeeMan = null;
+                    oldpos.UpFeeFlag = 0;
+                    oldpos.UpFeeDate = null;
+                    oldpos.OpReserve1 = 0;
+                    oldpos.OpReserve2 = 0;
+                    oldpos.OpReserve3 = 0;
+                    oldpos.OpId = 0;
+                    oldpos.RecycStartDate = null;
+                    oldpos.SourcePosSn = null;
                     oldpos.BuyUserId = 0;
                     oldpos.UserId = 0;
                     oldpos.Status = -1;
+                    db.SaveChanges();
 
                     PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == newpos.BindMerchantId);
                     if (merchant != null)
@@ -1885,8 +1935,8 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.OpReserve2 = 0;
                     oldpos.OpReserve3 = 0;
                     oldpos.OpId = 0;
-                    // oldpos.RecycStartDate = null;
-                    // oldpos.SourcePosSn = null;
+                    oldpos.RecycStartDate = null;
+                    oldpos.SourcePosSn = null;
                     oldpos.BuyUserId = 0;
                     oldpos.UserId = 0;
                     oldpos.Status = -1;
@@ -2633,7 +2683,7 @@ namespace MySystem.Areas.Admin.Controllers
                 OpenUser10 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             result += "开机奖20:" + OpenUser20 + "\n";
-            result += "开机奖10:" + OpenUser10 + "\n";
+            // result += "开机奖10:" + OpenUser10 + "\n";
             dic.Add("id", pos.Id.ToString());
             dic.Add("code", "0");
             dic.Add("result", result);
@@ -2646,10 +2696,10 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "机具未激活";
             }
-            if (pos.BindingTime < DateTime.Now.AddDays(-30))
-            {
-                return "绑定已超过30天";
-            }
+            // if (pos.BindingTime < DateTime.Now.AddDays(-30))
+            // {
+            //     return "绑定已超过30天";
+            // }
             decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
             if (ActPrize == 0)
             {
@@ -2806,7 +2856,7 @@ namespace MySystem.Areas.Admin.Controllers
                                 RedisDbconn.Instance.AddList("UserAccountRecord:" + puser.Id + ":1:" + monthString, userAccountRecord);
                                 RedisDbconn.Instance.AddNumber("UserAccount:" + puser.Id + ":1:" + monthString, Prize);
 
-                                Prize -= 10;
+                                Prize = 0;
                                 PrizeFlag.Add(Prize.ToString("f0"));
                             }
                         }
@@ -2816,10 +2866,10 @@ namespace MySystem.Areas.Admin.Controllers
                     {
                         result += "20元奖励未发,请检查上级是否满足条件\n";
                     }
-                    if (!PrizeFlag.Contains("10"))
-                    {
-                        result += "10元奖励未发,请检查上级是否满足条件\n";
-                    }
+                    // if (!PrizeFlag.Contains("10"))
+                    // {
+                    //     result += "10元奖励未发,请检查上级是否满足条件\n";
+                    // }
                     if (string.IsNullOrEmpty(result))
                     {
                         return "发放成功";
@@ -2888,7 +2938,7 @@ namespace MySystem.Areas.Admin.Controllers
             if (flux.Id > 0)
             {
                 Users user = db.Users.FirstOrDefault(m => m.Id == flux.UserId) ?? new Users();
-                FluxGet6 = "已领取(领取时间:" + flux.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + ")";
+                FluxGet6 = "已领取(金额:" + flux.FluxFeeAmt + ",领取时间:" + flux.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") + ")";
                 FluxUser6 = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
             }
             result += "流量费:" + FluxGet6 + "\n";
@@ -2905,10 +2955,10 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "机具未激活";
             }
-            if (pos.BindingTime < DateTime.Now.AddDays(-30))
-            {
-                return "绑定已超过30天";
-            }
+            // if (pos.BindingTime < DateTime.Now.AddDays(-30))
+            // {
+            //     return "绑定已超过30天";
+            // }
             decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
             if (ActPrize == 0)
             {
@@ -3848,7 +3898,7 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
-        #region 坏机换新
+        #region 坏机回仓
 
         public IActionResult BadPosToStore(string right)
         {
@@ -3863,11 +3913,16 @@ namespace MySystem.Areas.Admin.Controllers
         {
             string[] OldSnList;
             OldSnList = OldSn.Replace("\r", "").Split('\n');
+            string error = "";
             for (int i = 0; i < OldSnList.Length; i++)
             {
                 string OldSnNum = OldSnList[i];
                 MachineForSnNo oldForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == OldSnNum) ?? new MachineForSnNo();
                 PosMachinesTwo oldpos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == oldForSnNo.SnId && m.Status == -1) ?? new PosMachinesTwo();
+                if (oldpos.Id == 0)
+                {
+                    error += "以下操作失败" + OldSnNum + ',' + "该机具不是坏机或不存在" + '\n';
+                }
                 oldpos.QueryCount = 0;
                 oldpos.UpdateDate = null;
                 oldpos.ActivityList = null;
@@ -3903,11 +3958,16 @@ namespace MySystem.Areas.Admin.Controllers
                 oldpos.OpReserve2 = 0;
                 oldpos.OpReserve3 = 0;
                 oldpos.OpId = 0;
-                // oldpos.RecycStartDate = null;
-                // oldpos.SourcePosSn = null;
+                oldpos.RecycStartDate = null;
+                oldpos.SourcePosSn = null;
                 oldpos.BuyUserId = 0;
                 oldpos.UserId = 0;
             }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
+            db.SaveChanges();
             return "success";
         }
         #endregion

+ 11 - 10
Areas/Admin/Views/MainServer/SysTools/BadPosToStore.cshtml

@@ -37,14 +37,6 @@
                                             placeholder="请输入坏机SN"></textarea>
                                     </div>
                                 </div>
-                                <div class="layui-form-item">
-                                    <label class="layui-form-label">坏机退回仓库编号</label>
-                                    <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="BackStoreNo" name="BackStoreNo"
-                                            maxlength="50" lay-verify="required|" autocomplete="off"
-                                            placeholder="请输入坏机退回仓库编号">
-                                    </div>
-                                </div>
                             </div>
 
                         </div>
@@ -78,8 +70,17 @@
                 success: function (data) {
                     layer.close(index); //关闭弹层
                     if (data == "success") {
-                        layer.msg("成功,重置为仓库机");
-                        window.location.reload();
+                        layer.close(index); //关闭弹层
+                        layer.msg('成功,重置为仓库机', {
+                            time: 1500
+                        }, function () {
+                            window.location.reload();//数据刷新
+                        });
+                    }else if (data.indexOf("Warning") == 0) {
+                        var datalist = data.split('|');
+                        layer.alert(datalist[1], { time: 20000 }, function () {
+                            window.location.reload();
+                        });
                     } else {
                         layer.msg(data);
                     }

+ 2 - 2
Areas/Admin/Views/MainServer/SysTools/FluxPrize.cshtml

@@ -60,7 +60,7 @@
             var userdata = $("#confirmFrm").serialize();
             $.ajax({
                 type: "POST",
-                url: "/Admin/SysTools/OpenPrizeDo?r=" + Math.random(1),
+                url: "/Admin/SysTools/FluxPrizeDo?r=" + Math.random(1),
                 data: userdata,
                 dataType: "json",
                 success: function (data) {
@@ -71,7 +71,7 @@
                         var index = layer.confirm(data.result.replace(/\n/g, '<br />') + '<br />是否立即补发?', { area: ['500px', '460px'] }, function (index) {
                             $.ajax({
                                 type: "POST",
-                                url: "/Admin/SysTools/AddOpenPrize?r=" + Math.random(1),
+                                url: "/Admin/SysTools/AddFluxPrize?r=" + Math.random(1),
                                 data: "Id=" + data.id,
                                 dataType: "text",
                                 success: function (data) {