Преглед изворни кода

sn轨迹变动明细记录数据添加调整,只添加一条数据,记录发送和接收方信息

DuGuYang пре 3 година
родитељ
комит
5499862d93

+ 3 - 44
AppStart/ExcelHelper.cs

@@ -329,6 +329,7 @@ namespace MySystem
                                                                         CreateDate = DateTime.Now,
                                                                         CreateMan = Operator,
                                                                         UserId = store.UserId, //创客
+                                                                        ToUserId = tostore.UserId, //收货创客
                                                                         BrandId = BrandId, //产品类型
                                                                         ChangeRecordNo = ChangeNo, //变更记录单号
                                                                         BizBatchNo = BatchNo, //业务批次号
@@ -343,33 +344,10 @@ namespace MySystem
                                                                         FromDate = DateTime.Now, //出库时间
                                                                         FromRemark = OutNote, //出库备注
                                                                         SourceStoreId = machine.SourceStoreId, //源仓库
+                                                                        ToStoreId = tostore.Id, //收货仓库
                                                                         StoreId = store.Id, //仓库
                                                                     });
 
-                                                                    db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                                                    {
-                                                                        CreateDate = DateTime.Now,
-                                                                        CreateMan = Operator,
-                                                                        UserId = tostore.UserId, //创客
-                                                                        BrandId = BrandId, //产品类型
-                                                                        ChangeRecordNo = ChangeNo, //变更记录单号
-                                                                        BizBatchNo = BatchNo, //业务批次号
-                                                                        TransType = 1, //交易类型
-                                                                        SnNo = SnNo, //SN编号
-                                                                        SnType = machine.PosSnType, //SN机具类型
-                                                                        StockOpDirect = 0, //库存操作方向
-                                                                        DeviceVendor = machine.DeviceName, //设备厂商
-                                                                        DeviceModel = machine.DeviceKind, //设备型号
-                                                                        DeviceType = machine.DeviceType, //设备类型
-                                                                        ToUserId = tostore.UserId, //收货创客
-                                                                        ToStoreId = tostore.Id, //创客退货收货仓库
-                                                                        ToDate = DateTime.Now, //入库时间
-                                                                        ToRemark = OutNote, //入库备注
-                                                                        SourceStoreId = machine.SourceStoreId, //源仓库
-                                                                        StoreId = tostore.Id, //仓库
-                                                                    });
-                                                                    db.SaveChanges();
-
                                                                     // RemoveClass.DeletePosMachineList("PosMachineTwoList:" + storefor.StoreId, machine.Id);
                                                                     // RedisDbconn.Instance.AddList("PosMachineTwoList:" + tostorefor.StoreId, machine);
 
@@ -654,6 +632,7 @@ namespace MySystem
                                                                 CreateDate = DateTime.Now,
                                                                 CreateMan = Operator,
                                                                 UserId = store.UserId, //创客
+                                                                ToUserId = touser.Id, //收货创客
                                                                 BrandId = BrandId, //产品类型
                                                                 ChangeRecordNo = ChangeNo, //变更记录单号
                                                                 BizBatchNo = BatchNo, //业务批次号
@@ -671,26 +650,6 @@ namespace MySystem
                                                                 StoreId = store.Id, //仓库
                                                             });
 
-                                                            db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                                            {
-                                                                CreateDate = DateTime.Now,
-                                                                CreateMan = Operator,
-                                                                UserId = touser.Id, //创客
-                                                                BrandId = BrandId, //产品类型
-                                                                ChangeRecordNo = ChangeNo, //变更记录单号
-                                                                BizBatchNo = BatchNo, //业务批次号
-                                                                TransType = 0, //交易类型
-                                                                SnNo = SnNo, //SN编号
-                                                                SnType = machine.PosSnType, //SN机具类型
-                                                                StockOpDirect = 0, //库存操作方向
-                                                                DeviceVendor = machine.DeviceName, //设备厂商
-                                                                DeviceModel = machine.DeviceKind, //设备型号
-                                                                DeviceType = machine.DeviceType, //设备类型
-                                                                ToUserId = touser.Id, //收货创客
-                                                                ToDate = DateTime.Now, //入库时间
-                                                                ToRemark = OutNote, //入库备注
-                                                                SourceStoreId = machine.SourceStoreId, //源仓库
-                                                            });
                                                             machine.BuyUserId = touser.Id;
                                                             machine.UserId = touser.Id;
                                                             machine.TransferTime = DateTime.Now;

+ 11 - 11
Areas/Admin/Controllers/MainServer/StoreChangeHistoryController.cs

@@ -118,6 +118,12 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["UserIdMakerCode"] = userid_Users.MakerCode;
                 dic["UserIdRealName"] = userid_Users.RealName;
                 dic.Remove("UserId");
+                //接收创客
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users tuserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["TUserIdMakerCode"] = tuserid_Users.MakerCode;
+                dic["TUserIdRealName"] = tuserid_Users.RealName;
+                dic.Remove("ToUserId");
                 //产品类型
                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
                 //交易类型
@@ -135,13 +141,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int StockOpDirect = int.Parse(dic["StockOpDirect"].ToString());
                 if (StockOpDirect == 0) dic["StockOpDirect"] = "入库";
                 if (StockOpDirect == 1) dic["StockOpDirect"] = "出库";
-                //收货创客
-                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
-                StoreHouse touserid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToUserId) ?? new StoreHouse();
-                dic["ToUserIdStoreNo"] = touserid_StoreHouse.StoreNo;
-                dic["ToUserIdStoreName"] = touserid_StoreHouse.StoreName;
-                dic.Remove("ToUserId");
-                //创客退货收货仓库
+                //创客收货仓库
                 int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));
                 StoreHouse tostoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToStoreId) ?? new StoreHouse();
                 dic["ToStoreIdStoreNo"] = tostoreid_StoreHouse.StoreNo;
@@ -442,11 +442,11 @@ namespace MySystem.Areas.Admin.Controllers
                 int StockOpDirect = int.Parse(dic["StockOpDirect"].ToString());
                 if (StockOpDirect == 0) dic["StockOpDirect"] = "入库";
                 if (StockOpDirect == 1) dic["StockOpDirect"] = "出库";
-                //收创客
+                //收创客
                 int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
-                StoreHouse touserid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToUserId) ?? new StoreHouse();
-                dic["ToUserIdStoreNo"] = touserid_StoreHouse.StoreNo;
-                dic["ToUserIdStoreName"] = touserid_StoreHouse.StoreName;
+                Users tuserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["TUserIdMakerCode"] = tuserid_Users.MakerCode;
+                dic["TUserIdRealName"] = tuserid_Users.RealName;
                 dic.Remove("ToUserId");
                 //创客退货收货仓库
                 int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));

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

@@ -772,6 +772,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 {
                                     CreateDate = DateTime.Now,
                                     UserId = user.Id, //创客
+                                    FromUserId = user.Id,//来源创客
+                                    ToUserId = toStore.UserId,//接收创客
                                     StoreId = fromStore.Id, //出货仓库
                                     ToStoreId = toStore.Id, //发货仓库
                                     BrandId = Convert.ToInt32(BrandId), //产品类型
@@ -873,6 +875,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 {
                                     CreateDate = DateTime.Now,
                                     UserId = user.Id, //创客
+                                    FromUserId = user.Id,//来源创客
+                                    ToUserId = toStore.UserId,//接收创客
                                     StoreId = fromStore.Id, //出货仓库
                                     ToStoreId = toStore.Id, //发货仓库
                                     BrandId = Convert.ToInt32(BrandId), //产品类型

+ 4 - 4
wwwroot/layuiadmin/modules_main/StoreChangeHistory_Admin.js

@@ -95,15 +95,15 @@ $('#CreateDate').val(value);
             ,{field:'StoreIdStoreName', width: 200, title:'仓库名称', sort: true}
             ,{field:'UserIdMakerCode', width: 200, title:'创客编号', sort: true}
             ,{field:'UserIdRealName', width: 200, title:'创客姓名', sort: true}
+            ,{field:'TUserIdMakerCode', width: 200, title:'收货创客编号', sort: true}
+            ,{field:'TUserIdRealName', width: 200, title:'收货创客姓名', sort: true}
             ,{field:'BrandId', width: 200, title:'产品类型', sort: true}
             ,{field:'TransType', width: 200, title:'交易类型', sort: true}
             ,{field:'SnNo', width: 200, title:'SN编号', sort: true}
             ,{field:'SnType', width: 200, title:'SN机具类型', sort: true}
             ,{field:'StockOpDirect', width: 200, title:'库存操作方向', sort: true}
-            ,{field:'ToUserIdStoreNo', width: 200, title:'收货创客仓库编号', sort: true}
-            ,{field:'ToUserIdStoreName', width: 200, title:'收货创客仓库名称', sort: true}
-            ,{field:'ToStoreIdStoreNo', width: 200, title:'创客退货收货仓库编号', sort: true}
-            ,{field:'ToStoreIdStoreName', width: 200, title:'创客退货收货仓库名称', sort: true}
+            ,{field:'ToStoreIdStoreNo', width: 200, title:'收货仓库编号', sort: true}
+            ,{field:'ToStoreIdStoreName', width: 200, title:'收货仓库名称', sort: true}
             ,{field:'SourceStoreIdStoreNo', width: 200, title:'源仓库编号', sort: true}
             ,{field:'SourceStoreIdStoreName', width: 200, title:'源仓库名称', sort: true}
             ,{field:'CreateDate', width: 200, title:'变动时间', sort: true}