From b698a2085fd090e90abedb1e91266ec496574b29 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 16 四月 2026 23:31:35 +0800
Subject: [PATCH] 1
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs
index 28b3d83..a46a6b4 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs
@@ -1,4 +1,5 @@
-锘縰sing WIDESEA_Core.BaseRepository;
+using WIDESEA_Common.LocationEnum;
+using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_IRecordService;
using WIDESEA_Model.Models;
@@ -13,7 +14,6 @@
/// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
- /// <param name="baseDal">鍩虹鏁版嵁璁块棶瀵硅薄</param>
public LocationStatusChangeRecordService(IRepository<Dt_LocationStatusChangeRecord> baseDal) : base(baseDal)
{
}
@@ -22,5 +22,39 @@
/// 鑾峰彇璐т綅鐘舵�佸彉鏇磋褰曚粨鍌ㄦ帴鍙�
/// </summary>
public IRepository<Dt_LocationStatusChangeRecord> Repository => BaseDal;
+
+ /// <summary>
+ /// 璁板綍璐т綅鐘舵�佸彉鏇淬��
+ /// </summary>
+ public async Task<bool> AddChangeRecordAsync(
+ Dt_LocationInfo beforeLocation,
+ Dt_LocationInfo afterLocation,
+ LocationChangeType changeType,
+ int? taskNum = null,
+ string? orderNo = null,
+ int? orderId = null,
+ string? remark = null)
+ {
+ if (beforeLocation == null || afterLocation == null)
+ return false;
+
+ if (beforeLocation.LocationStatus == afterLocation.LocationStatus)
+ return true;
+
+ Dt_LocationStatusChangeRecord record = new Dt_LocationStatusChangeRecord
+ {
+ LocationId = afterLocation.Id,
+ LocationCode = afterLocation.LocationCode,
+ BeforeStatus = beforeLocation.LocationStatus,
+ AfterStatus = afterLocation.LocationStatus,
+ ChangeType = (int)changeType,
+ OrderId = orderId,
+ OrderNo = orderNo,
+ TaskNum = taskNum,
+ Remark = remark
+ };
+
+ return await BaseDal.AddDataAsync(record) > 0;
+ }
}
}
--
Gitblit v1.9.3