From a4ae3bf5f1826e8e29a95da3dc2c947d713d4ebb Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期五, 06 六月 2025 15:38:14 +0800
Subject: [PATCH] 1.仓库信息储存逻辑调整 2.生产订单接口优化。
---
MES.Service/service/BasicData/MesRohInManager.cs | 48 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/MES.Service/service/BasicData/MesRohInManager.cs b/MES.Service/service/BasicData/MesRohInManager.cs
index b8853e7..fd0edbc 100644
--- a/MES.Service/service/BasicData/MesRohInManager.cs
+++ b/MES.Service/service/BasicData/MesRohInManager.cs
@@ -1,7 +1,9 @@
-锘縰sing MES.Service.DB;
+锘縰sing Masuit.Tools;
+using MES.Service.DB;
using MES.Service.Dto.webApi;
using MES.Service.Modes;
using SqlSugar;
+using System.Globalization;
namespace MES.Service.service.BasicData;
@@ -71,7 +73,7 @@
var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1)
.IgnoreColumnsNull()
.ExecuteCommand() > 0;
-
+
if (orUpdate && baOrUpdate) return true;
throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
}
@@ -117,9 +119,10 @@
mesRohIn.CancellationPerson = rohIn.FCancellerId;
if (rohIn.FCancelDate != null)
- mesRohIn.CancellationDate =
- DateTime.ParseExact(rohIn.FCancelDate,
- "yyyy-MM-dd HH:mm:ss", null);
+ if (!mesRohIn.CancellationPerson.IsNullOrEmpty())
+ mesRohIn.CancellationDate =
+ DateTime.ParseExact(rohIn.FCancelDate,
+ "yyyy-MM-dd HH:mm:ss", null);
mesRohIn.CreateBy = rohIn.FCreatorId;
@@ -149,7 +152,7 @@
mesRohIn.FixedTelephone = rohIn.FixedTelephone;
mesRohIn.Address = rohIn.Address;
mesRohIn.Acctype = rohIn.Acctype;
-
+ mesRohIn.SynchronousDate = DateTime.Now;
return mesRohIn;
}
@@ -192,16 +195,21 @@
BusinessClose = s.FMRPCloseStatus,
BusinessFreeze = s.FMRPFreezeStatus,
Freezer = s.FFreezerId,
- FreezeTime = s.FFreezeDate != null
- ? DateTime.ParseExact(s.FFreezeDate,
- "yyyy-MM-dd HH:mm:ss", null)
- : null,
+ //FreezeTime = !string.IsNullOrEmpty(s.FFreezeDate)
+ // && DateTime.TryParseExact(s.FFreezeDate,
+ // new[] { "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" }, // 鏀寔澶氱鏍煎紡
+ // CultureInfo.InvariantCulture,
+ // DateTimeStyles.None,
+ // out var parsedDate)
+ // && parsedDate > new DateTime(1900, 1, 1)
+ // ? parsedDate
+ // : (DateTime?)null,
BusinessTerminate = s.FMRPTerminateStatus,
Terminator = s.FTerminaterId,
- TerminateTime = s.FTerminateDate != null
- ? DateTime.ParseExact(s.FTerminateDate,
- "yyyy-MM-dd HH:mm:ss", null)
- : null,
+ //TerminateTime = s.FTerminateDate != null
+ // ? DateTime.ParseExact(s.FTerminateDate,
+ // "yyyy-MM-dd HH:mm:ss", null)
+ // : null,
TotalReceivedQty = Convert.ToDecimal(s.FReceiveQty), //绱鏀舵枡鏁�
RemainingReceivedQty =
Convert.ToDecimal(s.FRemainReceiveQty),
@@ -230,6 +238,18 @@
ReceivingDepartment = s.FReceiveDeptId
};
+ if (s.FFreezeDate != null)
+ if (!s.FFreezerId.IsNullOrEmpty())
+ entity.FreezeTime =
+ DateTime.ParseExact(s.FFreezeDate,
+ "yyyy-MM-dd HH:mm:ss", null);
+
+ if (s.FTerminateDate != null)
+ if (!s.FTerminaterId.IsNullOrEmpty())
+ entity.TerminateTime =
+ DateTime.ParseExact(s.FTerminateDate,
+ "yyyy-MM-dd HH:mm:ss", null);
+
var single = rohInDataManager.GetSingle(it =>
it.EbelnK3id == entity.EbelnK3id);
if (single != null) entity.Guid = single.Guid;
--
Gitblit v1.9.3