Selaa lähdekoodia

调整首台机具标记为新字段FirstFlag

DuGuYang 2 vuotta sitten
vanhempi
commit
baf7949dba

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

@@ -174,7 +174,7 @@ namespace MySystem.Areas.Admin.Controllers
                 }
 
                 //是否为第一台机具
-                int IsFirst = int.Parse(dic["IsFirst"].ToString());
+                int IsFirst = int.Parse(dic["FirstFlag"].ToString());
                 if (IsFirst == 0) dic["IsFirst"] = "否";
                 if (IsFirst == 1) dic["IsFirst"] = "是";
 

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

@@ -197,7 +197,7 @@ namespace MySystem.Areas.Admin.Controllers
                 }
 
                 //是否为第一台机具
-                int IsFirst = int.Parse(dic["IsFirst"].ToString());
+                int IsFirst = int.Parse(dic["FirstFlag"].ToString());
                 if (IsFirst == 0) dic["IsFirst"] = "否";
                 if (IsFirst == 1) dic["IsFirst"] = "是";
 
@@ -901,7 +901,7 @@ namespace MySystem.Areas.Admin.Controllers
                 }
 
                 //是否为第一台机具
-                int IsFirst = int.Parse(dic["IsFirst"].ToString());
+                int IsFirst = int.Parse(dic["FirstFlag"].ToString());
                 if (IsFirst == 0) dic["IsFirst"] = "否";
                 if (IsFirst == 1) dic["IsFirst"] = "是";
 

+ 6 - 6
Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

@@ -540,7 +540,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             var amount = 0.00M;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
-            DataTable dt = OtherMySqlConn.dtable("SELECT a.BrandId,a.PosSn,a.BindMerchantId,a.SeoKeyword,b.KqMerNo,b.MerIdcardNo,b.MerchantName,b.MerchantMobile FROM PosMachinesTwo a,PosMerchantInfo b WHERE a.`Status`>-1 AND a.SeoKeyword!='' AND a.SeoKeyword!='0' AND a.SeoKeyword IS NOT NULL AND a.IsFirst=1 AND b.StandardMonths=10 AND b.StandardStatus=4 AND a.BindMerchantId=b.Id " + condition);
+            DataTable dt = OtherMySqlConn.dtable("SELECT a.BrandId,a.PosSn,a.BindMerchantId,a.SeoKeyword,b.KqMerNo,b.MerIdcardNo,b.MerchantName,b.MerchantMobile FROM PosMachinesTwo a,PosMerchantInfo b WHERE a.`Status`>-1 AND a.SeoKeyword!='' AND a.SeoKeyword!='0' AND a.SeoKeyword IS NOT NULL AND a.FirstFlag=1 AND b.StandardMonths=10 AND b.StandardStatus=4 AND a.BindMerchantId=b.Id " + condition);
             if (dt.Rows.Count > 0)
             {
                 foreach (DataRow item in dt.Rows)
@@ -631,7 +631,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             var amount = 0.00M;
             List<Dictionary<string, object>> diclist = new List<Dictionary<string, object>>();
-            DataTable dt = OtherMySqlConn.dtable("SELECT a.BrandId,a.PosSn,a.BindMerchantId,a.SeoKeyword,b.KqMerNo,b.MerIdcardNo,b.MerchantName,b.MerchantMobile FROM PosMachinesTwo a,PosMerchantInfo b WHERE a.`Status`>-1 AND a.SeoKeyword!='' AND a.SeoKeyword!='0' AND a.SeoKeyword IS NOT NULL  AND a.IsFirst=0 AND b.StandardMonths=10 AND b.StandardStatus=4 AND a.BindMerchantId=b.Id " + condition);
+            DataTable dt = OtherMySqlConn.dtable("SELECT a.BrandId,a.PosSn,a.BindMerchantId,a.SeoKeyword,b.KqMerNo,b.MerIdcardNo,b.MerchantName,b.MerchantMobile FROM PosMachinesTwo a,PosMerchantInfo b WHERE a.`Status`>-1 AND a.SeoKeyword!='' AND a.SeoKeyword!='0' AND a.SeoKeyword IS NOT NULL  AND a.FirstFlag=0 AND b.StandardMonths=10 AND b.StandardStatus=4 AND a.BindMerchantId=b.Id " + condition);
             if (dt.Rows.Count > 0)
             {
                 foreach (DataRow item in dt.Rows)
@@ -1110,7 +1110,7 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             Dictionary<string, object> curData = new Dictionary<string, object>();
                             var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == item.KqSnNo) ?? new PosMachinesTwo();
-                            int IsFirst = int.Parse(posInfo.IsFirst.ToString());
+                            int IsFirst = int.Parse(posInfo.FirstFlag.ToString());
                             var IsFirstName = "";
                             if (IsFirst == 1) IsFirstName = "首台";
                             if (IsFirst == 0) IsFirstName = "非首台";
@@ -1166,7 +1166,7 @@ namespace MySystem.Areas.Admin.Controllers
                     if (thisdate <= otherdate)
                     {
                         changeFlag = 1;
-                        posInfo.IsFirst = 0;
+                        posInfo.FirstFlag = 0;
                         flag = changeFlag;
                     }
                     else
@@ -1177,13 +1177,13 @@ namespace MySystem.Areas.Admin.Controllers
                 if (flag == 1)
                 {
                     AddSysLog(PosSn, "PosMachinesTwo", "SetFirstPos");
-                    pos.IsFirst = 1;
+                    pos.FirstFlag = 1;
                 }
             }
             else
             {
                 AddSysLog(PosSn, "PosMachinesTwo", "SetFirstPos");
-                pos.IsFirst = 1;
+                pos.FirstFlag = 1;
             }
             db.SaveChanges();
             return "success";

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

@@ -1228,6 +1228,8 @@ namespace MySystem.Areas.Admin.Controllers
                             toStore.LaveNum += 1;
                             fromStore.TotalNum -= 1;
                             fromStore.LaveNum -= 1;
+                            posInfo.FirstFlag = 0;
+                            posInfo.IsExecute = 0;
                             PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                             db.SaveChanges();
                         }
@@ -1320,6 +1322,8 @@ namespace MySystem.Areas.Admin.Controllers
                             fuserMachineData.UnBindCount -= 1;
                             toStore.LaveNum += 1;
                             toStore.TotalNum += 1;
+                            posInfo.FirstFlag = 0;
+                            posInfo.IsExecute = 0;
                             PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                             db.SaveChanges();
                         }
@@ -1416,7 +1420,7 @@ 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);

+ 19 - 1
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1837,6 +1837,8 @@ namespace MySystem.Areas.Admin.Controllers
                 newpos.PrizeParams = oldpos.PrizeParams;
                 newpos.LeaderUserId = oldpos.LeaderUserId;
                 oldpos.Status = -1;
+                newpos.FirstFlag = oldpos.FirstFlag;
+                newpos.IsExecute = oldpos.IsExecute;
 
                 //对应调整客小爽企业版数据
                 var posInfo = db.BusinessPartnerPos.FirstOrDefault(m => m.PosId == oldpos.Id);
@@ -2071,6 +2073,8 @@ namespace MySystem.Areas.Admin.Controllers
 
                     newpos.StoreId = oldpos.StoreId;
                     newpos.PreUserId = oldpos.PreUserId;
+                    newpos.FirstFlag = oldpos.FirstFlag;
+                    newpos.IsExecute = oldpos.IsExecute;
 
                     if (!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
                     {
@@ -2118,6 +2122,8 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.BuyUserId = 0;
                     oldpos.UserId = 0;
                     oldpos.Status = -1;
+                    oldpos.FirstFlag = 0;
+                    oldpos.IsExecute = 0;
                     PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                     db.SaveChanges();
                     opdb.SaveChanges();
@@ -2268,6 +2274,8 @@ namespace MySystem.Areas.Admin.Controllers
                     newpos.PreUserId = oldpos.PreUserId;
                     newpos.IsFirst = oldpos.IsFirst;
                     newpos.TransferTime = oldpos.TransferTime;
+                    newpos.FirstFlag = oldpos.FirstFlag;
+                    newpos.IsExecute = oldpos.IsExecute;
 
                     if (!opData.Contains(oldpos.BuyUserId + ":" + oldpos.BrandId))
                     {
@@ -2344,6 +2352,8 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.BuyUserId = 0;
                     oldpos.UserId = 0;
                     oldpos.Status = -1;
+                    oldpos.FirstFlag = 0;
+                    oldpos.IsExecute = 0;
                     PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                     db.SaveChanges();
                     opdb.SaveChanges();
@@ -2609,6 +2619,8 @@ namespace MySystem.Areas.Admin.Controllers
                 newpos.PrizeParams = oldpos.PrizeParams;
                 newpos.LeaderUserId = oldpos.LeaderUserId;
                 newpos.BindMerchantId = oldpos.BindMerchantId;
+                newpos.FirstFlag = oldpos.FirstFlag;
+                newpos.IsExecute = oldpos.IsExecute;
 
                 newpos.PreUserId = oldpos.PreUserId;
 
@@ -2661,6 +2673,8 @@ namespace MySystem.Areas.Admin.Controllers
                 oldpos.SourcePosSn = null;
                 oldpos.BuyUserId = 0;
                 oldpos.UserId = 0;
+                oldpos.FirstFlag = 0;
+                oldpos.IsExecute = 0;
 
                 PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                 db.SaveChanges();
@@ -4706,6 +4720,8 @@ namespace MySystem.Areas.Admin.Controllers
                 oldpos.SourcePosSn = null;
                 oldpos.BuyUserId = 0;
                 oldpos.UserId = 0;
+                oldpos.FirstFlag = 0;
+                oldpos.IsExecute = 0;
                 PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
             }
             if (!string.IsNullOrEmpty(error))
@@ -5073,6 +5089,8 @@ namespace MySystem.Areas.Admin.Controllers
                     pos.SourcePosSn = null;
                     pos.BuyUserId = 0;
                     pos.UserId = 0;
+                    pos.FirstFlag = 0;
+                    pos.IsExecute = 0;
                     PublicFunction.ClearPosHistory(db, pos.PosSn); //清除机具历史记录
                 }
                 else
@@ -5239,7 +5257,7 @@ namespace MySystem.Areas.Admin.Controllers
                     // {
                     //     IsFirst = "非首台";
                     // }
-                    if (pos.IsFirst == 1)
+                    if (pos.FirstFlag == 1)
                     {
                         IsFirst = "首台";
                     }

+ 4 - 0
Areas/Admin/Controllers/OperateServer/StoreHouseOperateController.cs

@@ -738,6 +738,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 posInfo.LeaderUserId = 0;
                                 posInfo.PreUserId = 0;
                                 posInfo.IsFirst = 0;
+                                posInfo.FirstFlag = 0;
+                                posInfo.IsExecute = 0;
                                 fuserMachineData.TotalMachineCount -= 1;
                                 fuserMachineData.UnBindCount -= 1;
                                 toStore.TotalNum += 1;
@@ -831,6 +833,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 posInfo.LeaderUserId = 0;
                                 posInfo.PreUserId = 0;
                                 posInfo.IsFirst = 0;
+                                posInfo.FirstFlag = 0;
+                                posInfo.IsExecute = 0;
                                 fuserMachineData.TotalMachineCount -= 1;
                                 fuserMachineData.UnBindCount -= 1;
                                 toStore.LaveNum += 1;