Explorar el Código

辅助工具-机具查询,增加小分仓显示信息

lichunlei hace 4 años
padre
commit
39358bc010
Se han modificado 1 ficheros con 11 adiciones y 3 borrados
  1. 11 3
      Areas/Admin/Controllers/MainServer/SysToolsController.cs

+ 11 - 3
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -952,8 +952,6 @@ namespace MySystem.Areas.Admin.Controllers
             Orders applyorder = db.Orders.FirstOrDefault(m => m.Id == apply.QueryCount) ?? new Orders();
             MachineChangeDetail change = db.MachineChangeDetail.FirstOrDefault(m => m.OutSnNo == pos.PosSn) ?? new MachineChangeDetail();
 
-            Users smallStoreUser = db.Users.FirstOrDefault(m => m.Id == pos.PreUserId) ?? new Users();
-
             string RecycFlag = pos.IsPurchase == 1 ? "已申请循环" : "未申请循环";
             string SendStatus = applyorder.SendStatus == 1 ? "已发货" : "未发货";
             string ApplyDate = apply.CreateDate == null ? "" : apply.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
@@ -972,7 +970,17 @@ namespace MySystem.Areas.Admin.Controllers
             result += "机具所属人:创客编号:" + posUser.MakerCode + ",姓名:" + posUser.RealName + ",手机号:" + posUser.Mobile + "\n";
             result += "机器持有人顶级:创客编号:" + posTopUser.MakerCode + ",姓名:" + posTopUser.RealName + ",手机号:" + posTopUser.Mobile + "\n";
             result += "机器所属仓库:仓库编号:" + store.StoreNo + ",仓库名称:" + store.StoreName + "\n";
-            result += "机具所属小分仓:创客编号:" + smallStoreUser.MakerCode + ",姓名:" + smallStoreUser.RealName + ",手机号:" + smallStoreUser.Mobile + "\n";
+            if(pos.PreUserId > 0)
+            {
+                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";
+            }
+            else
+            {
+                result += "机具所属小分仓:暂无小分仓\n";
+            }
             result += "划拨时间:" + TransferTime + "\n";
             result += "绑定状态:" + bindResult + "(绑定时间:" + bindTime + ")\n";
             result += "激活状态:" + activeResult + "(激活时间:" + activeTime + ")\n";