Procházet zdrojové kódy

Merge branch 'DuGuYang' into feature-dgy-后台测试

DuGuYang před 2 roky
rodič
revize
c4f38318dc

+ 1 - 0
AppStart/ExcelHelper.cs

@@ -61,6 +61,7 @@ namespace MySystem
                                     string BatchNo = dr[0].ToString(); // 业务批次号
                                     string SnNo = dr[1].ToString(); // SN编号
                                     SnNo = SnNo.Replace(" ", "");
+                                    SnNo = SnNo.Replace("`", "");
                                     string DeviceName = dr[2].ToString(); // 设备厂商
                                     string DeviceKind = dr[3].ToString(); // 设备型号
                                     string DeviceType = dr[4].ToString(); // 设备类型区分(客小爽电签POS填写:KysSignPos/KssSignPos)

+ 4 - 0
Areas/Admin/Controllers/MainServer/LeadersController.cs

@@ -326,6 +326,7 @@ namespace MySystem.Areas.Admin.Controllers
                     var query = db.LeaderReserveRecord.Add(new LeaderReserveRecord()
                     {
                         CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = Note,//备注
                         Sort = 11, //类型
                         //11:盟主储蓄金增减单(兑换机具券 机具券兑换 系统增加(盟主储蓄金) 系统扣减(盟主储蓄金) 储备金购买)
                         // 示例:+/-金额
@@ -363,6 +364,7 @@ namespace MySystem.Areas.Admin.Controllers
                     var query = db.LeaderReserveRecord.Add(new LeaderReserveRecord()
                     {
                         CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = Note,//备注
                         Sort = 11, //类型
                         //11:盟主储蓄金增减单(兑换机具券 机具券兑换 系统增加(盟主储蓄金) 系统扣减(盟主储蓄金) 储备金购买)
                         // 示例:+/-金额
@@ -431,6 +433,7 @@ namespace MySystem.Areas.Admin.Controllers
                     var query = db.LeaderReserveRecord.Add(new LeaderReserveRecord()
                     {
                         CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = Note,//备注
                         Sort = 12, //类型
                         //11:盟主储蓄金增减单(兑换机具券 机具券兑换 系统增加(盟主储蓄金) 系统扣减(盟主储蓄金) 储备金购买)
                         // 示例:+/-金额
@@ -468,6 +471,7 @@ namespace MySystem.Areas.Admin.Controllers
                     var query = db.LeaderReserveRecord.Add(new LeaderReserveRecord()
                     {
                         CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = Note,//备注
                         Sort = 12, //类型
                         //11:盟主储蓄金增减单(兑换机具券 机具券兑换 系统增加(盟主储蓄金) 系统扣减(盟主储蓄金) 储备金购买)
                         // 示例:+/-金额

+ 2 - 2
Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs

@@ -332,13 +332,13 @@ namespace MySystem.Areas.Admin.Controllers
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosNo) ?? new PosMachinesTwo();
                 if (pos.UpFeeFlag == 1 && pos.DownFeeFlag == 0)
                 {
-                    if (Kind != 2 || Amount != 0.6)
+                    if (Kind != 2 || Amount != 0.6 || Amount != 0.63)
                     {
                         warning += PosNo + ",该机具调低费率数值或类型不正确或已经调整,请检查好后全部重新导入";
                     }
                     else
                     {
-                        if (Kind == 2 && Amount == 0.6)
+                        if (Kind == 2 && (Amount == 0.6 || Amount == 0.63))
                         {
                             pos.DownFeeFlag = 1;
                             pos.DownFeeDate = DateTime.Now;

+ 3 - 3
Areas/Admin/Controllers/MainServer/PosMachinesTwoChangeController.cs

@@ -59,7 +59,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("PosSn", "1"); //SN编号
             Fields.Add("BrandId", "0"); //品牌
 
-            string condition = " and Status>-1 AND BindingState = 1 AND DATE_SUB(CURDATE(), INTERVAL 120 DAY) >= date(BindingTime) and UpFeeFlag=1 and DownFeeFlag=0 and (SeoDescription!='设置成功' or SeoDescription is null or SeoDescription='')";
+            string condition = " and Status>-1 AND BindingState = 1 AND DATE_SUB(CURDATE(), INTERVAL 90 DAY) >= date(BindingTime) and UpFeeFlag=1 and DownFeeFlag=0 and BrandId!=6 and (SeoDescription!='设置成功' or SeoDescription is null or SeoDescription='')";
             //绑定状态
             if (!string.IsNullOrEmpty(BindingStateSelect))
             {
@@ -453,8 +453,8 @@ namespace MySystem.Areas.Admin.Controllers
             List<int> posIds = new List<int>();
             List<int> upposIds = new List<int>();
             string userIds = "";
-            DateTime check = DateTime.Now.AddDays(-120);
-            List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BindingState == 1 && m.UpFeeFlag == 1 && m.DownFeeFlag == 0 && m.BindingTime <= check && m.SeoDescription != "设置成功").ToList();//18503
+            DateTime check = DateTime.Now.AddDays(-90);
+            List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BindingState == 1 && m.UpFeeFlag == 1 && m.DownFeeFlag == 0 && m.BindingTime <= check && m.SeoDescription != "设置成功" && m.BrandId != 6).ToList();//非盒子
             foreach (PosMachinesTwo pos in poslist)
             {
                 Dictionary<string, object> Fields = new Dictionary<string, object>();

+ 53 - 1
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -245,6 +245,27 @@ namespace MySystem.Areas.Admin.Controllers
                 var opInfo = opdb.SysAdmin.FirstOrDefault(m => m.QueryCount > 0 && m.UserId == OpId) ?? new OpModels.SysAdmin();
                 if (OpId == 0) dic["OpIdStatus"] = "否";
                 if (OpId > 0) dic["OpIdStatus"] = opInfo.OpCode;
+
+                //顶级创客信息
+                if (!string.IsNullOrEmpty(userid_Users.ParentNav))
+                {
+                    string[] ParentNavList = userid_Users.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                    var topUserInfo = new Users();
+                    if (ParentNavList.Length > 1)
+                    {
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(ParentNavList[1])) ?? new Users();
+                    }
+                    else
+                    {
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(ParentNavList[0])) ?? new Users();
+                    }
+                    //顶级创客信息
+                    dic["TopUserInfo"] = topUserInfo.MakerCode + " " + topUserInfo.RealName;
+                }
+                else
+                {
+                    dic["TopUserInfo"] = "";
+                }
             }
             return Json(obj);
         }
@@ -1366,7 +1387,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
 
 
-            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouse", Fields, "Id desc", "0", 1, 20000, condition, "StoreNo,StoreName,UserId,BrandId,Address,ManageUserId,ManagerEmail,StoreType,TotalNum,LaveNum,OutNum,LimitTopUserId,StoreStatus,StoreKind", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouse", Fields, "Id desc", "0", 1, 20000, condition, "Id,StoreNo,StoreName,UserId,BrandId,Address,ManageUserId,ManagerEmail,StoreType,TotalNum,LaveNum,OutNum,LimitTopUserId,StoreStatus,StoreKind", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -1395,7 +1416,36 @@ namespace MySystem.Areas.Admin.Controllers
                 int StoreKind = int.Parse(dic["StoreKind"].ToString());
                 if (StoreKind == 0) dic["StoreKind"] = "分仓";
                 if (StoreKind == 1) dic["StoreKind"] = "总仓";
+                
+                //小分仓
+                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                int PreCount = db.PreSendStockDetail.Count(m => m.FromStoreId == Id && m.ApplyFlag == 0 && m.Status >= 0 && m.Status <= 1);
+                dic["PreNum"] = PreCount.ToString();
+
+                //顶级创客信息
+                if (!string.IsNullOrEmpty(userid_Users.ParentNav))
+                {
+                    string[] ParentNavList = userid_Users.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                    var topUserInfo = new Users();
+                    if (ParentNavList.Length > 1)
+                    {
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(ParentNavList[1])) ?? new Users();
+                    }
+                    else
+                    {
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(ParentNavList[0])) ?? new Users();
+                    }
+                    //顶级创客信息
+                    dic["TopUserInfo"] = topUserInfo.MakerCode + " " + topUserInfo.RealName;
+                }
+                else
+                {
+                    dic["TopUserInfo"] = "";
+                }
 
+                dic.Remove("Id");
+                dic.Remove("ManageUserId");
+                dic.Remove("UserId");
             }
 
             Dictionary<string, object> result = new Dictionary<string, object>();
@@ -1405,6 +1455,7 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
             ReturnFields.Add("StoreNo", "仓库编号");
             ReturnFields.Add("StoreName", "仓库名称");
+            ReturnFields.Add("TopUserInfo", "顶级创客信息");
             ReturnFields.Add("UserIdMakerCode", "仓库归属人创客编号");
             ReturnFields.Add("UserIdRealName", "仓库归属人真实姓名");
             ReturnFields.Add("BrandId", "产品类型");
@@ -1420,6 +1471,7 @@ namespace MySystem.Areas.Admin.Controllers
             ReturnFields.Add("LimitTopUserId", "限制创客特殊仓库");
             ReturnFields.Add("StoreStatus", "仓库状态");
             ReturnFields.Add("StoreKind", "仓库归属类型");
+            ReturnFields.Add("PreNum", "小分仓数");
 
             result.Add("Fields", ReturnFields);
             AddSysLog("0", "StoreHouse", "ExportExcel");

+ 25 - 4
Areas/Admin/Controllers/MainServer/TradeRecordController.cs

@@ -420,9 +420,29 @@ namespace MySystem.Areas.Admin.Controllers
                 string AccountName = dr["账号姓名"].ToString();
                 string SimNo = dr["SIM卡号"].ToString();
 
-                bool checkMer = db.PosMerchantInfo.Any(m => m.KqMerNo == PhoneNumber);
-                if (!checkMer)
-                {
+                // PosMerchantInfo checkMer = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == PhoneNumber && m.Field5 == ActStatus);
+                // if (checkMer == null)
+                // {
+                    string json = "{";
+                    json += "\"OrderNo\":\"" + OrderNo + "\",";
+                    json += "\"CreateDate\":\"" + CreateDate + "\",";
+                    json += "\"PhoneNumber\":\"" + PhoneNumber + "\",";
+                    json += "\"HasFirstCharge\":\"" + HasFirstCharge + "\",";
+                    json += "\"FirstChargeAmount\":\"" + FirstChargeAmount + "\",";
+                    json += "\"Province\":\"" + Province + "\",";
+                    json += "\"City\":\"" + City + "\",";
+                    json += "\"ProductName\":\"" + ProductName + "\",";
+                    json += "\"ActiveName\":\"" + ActiveName + "\",";
+                    json += "\"ProductType\":\"" + ProductType + "\",";
+                    json += "\"ActualAmount\":\"" + ActualAmount + "\",";
+                    json += "\"OrderStatus\":\"" + OrderStatus + "\",";
+                    json += "\"ActStatus\":\"" + ActStatus + "\",";
+                    json += "\"ActDate\":\"" + ActDate + "\",";
+                    json += "\"WorkNo\":\"" + WorkNo + "\",";
+                    json += "\"AccountName\":\"" + AccountName + "\",";
+                    json += "\"SimNo\":\"" + SimNo + "\"";
+                    json += "}";
+
                     spdb.BindRecord.Add(new SpModels.BindRecord()
                     {
                         CreateDate = DateTime.Parse(CreateDate),
@@ -440,6 +460,7 @@ namespace MySystem.Areas.Admin.Controllers
                         Field5 = ActStatus,
                         SeoTitle = ActualAmount,
                         SeoKeyword = ActDate,
+                        SeoDescription = json,
                         ProductType = "14",
                         Status = 1,
                     });
@@ -457,7 +478,7 @@ namespace MySystem.Areas.Admin.Controllers
                         ProductType = "14",
                         Status = 1,
                     });
-                }
+                // }
 
                 // spdb.TradeRecord.Add(new SpModels.TradeRecord()
                 // {

+ 8 - 4
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -167,13 +167,17 @@ namespace MySystem.Areas.Admin.Controllers
                 if (!string.IsNullOrEmpty(ParentNav))
                 {
                     string[] list = ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                    var topUserInfo = new Users();
                     if (list.Length > 1)
                     {
-                        int TopId = int.Parse(function.CheckInt(list[1]));
-                        Users tuser = db.Users.FirstOrDefault(m => m.Id == TopId) ?? new Users();
-                        dic["TopMakerCode"] = tuser.MakerCode;
-                        dic["TopRealName"] = tuser.RealName;
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(list[1])) ?? new Users();
+                    }
+                    else
+                    {
+                        topUserInfo = db.Users.FirstOrDefault(m => m.Id == int.Parse(list[0])) ?? new Users();
                     }
+                    dic["TopMakerCode"] = topUserInfo.MakerCode;
+                    dic["TopRealName"] = topUserInfo.RealName;
                 }
             }
             return Json(obj);

+ 16 - 1
Controllers/HomeController.cs

@@ -178,7 +178,22 @@ namespace MySystem.Controllers
     
         public string test(string p)
         {
-            return OssTestHelper.Instance.GetUrlBase64(p);
+            
+            BsModels.WebCMSEntities db = new BsModels.WebCMSEntities();
+            var sysadmins = db.SysAdmin.ToList();
+            foreach(var sysadmin in sysadmins)
+            {
+                BsModels.SysAdmin edit = db.SysAdmin.FirstOrDefault(m => m.Id == sysadmin.Id);
+                if(edit != null)
+                {
+                    string pwd = function.get_Random(8);
+                    edit.Password = function.MD5_32(pwd);
+                    db.SaveChanges();
+                    function.WriteLog(edit.AdminName + ":" + pwd, "pwd");
+                }
+            }
+            db.Dispose();
+            return "ok";
         }
 
         private SymmetricAlgorithm mCSP = new TripleDESCryptoServiceProvider();

+ 5 - 0
wwwroot/layuiadmin/modules_main/StoreHouse_Admin.js

@@ -170,6 +170,11 @@ layui.config({
                 width: 110,
                 title: '仓库名称',
                 sort: true
+            }, {
+                field: 'TopUserInfo',
+                width: 110,
+                title: '顶级创客信息',
+                sort: true
             }, {
                 field: 'ManageUserIdMakerCode',
                 width: 145,

binární
wwwroot/users/机具费率调整模版.xlsx