From 31e6a29f45d270f78f2dc25a79563f281f496e75 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 12 六月 2025 15:53:03 +0800
Subject: [PATCH] 1
---
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 79 +++++++++++++++++++++++++++------------
1 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 3c811fb..8cfd6d0 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -32,6 +32,7 @@
private readonly IAgingInOrOutInputService _agingInOrOutInputService; //闈欑疆\闄堝寲
private readonly IDt_StationManagerRepository _stationManagerRepository;
private readonly ISys_ConfigService _configService;
+ private readonly IDt_ChangeoversRepository _dt_ChangeoversRepository;
private readonly ISimpleCacheService _simpleCacheService;
public Dt_TaskService(IDt_TaskRepository BaseDal,
@@ -51,7 +52,8 @@
IStockInfoDetailRepository stockInfoDetailRepository,
IDt_StationManagerRepository stationManagerRepository,
ISys_ConfigService configService,
- ISimpleCacheService simpleCacheService) : base(BaseDal)
+ ISimpleCacheService simpleCacheService,
+ IDt_ChangeoversRepository dt_ChangeoversRepository) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoRepository = stockInfoRepository;
@@ -69,6 +71,7 @@
_stationManagerRepository = stationManagerRepository;
_configService = configService;
_simpleCacheService = simpleCacheService;
+ _dt_ChangeoversRepository = dt_ChangeoversRepository;
}
#region 澶栭儴鎺ュ彛鏂规硶
@@ -754,12 +757,13 @@
else
{
// 澶勭悊寮傚父鐢佃姱鎯呭喌
- var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
- if (serialNosError.Count > 0)
- {
- return await HandleErrorCells(input, area, serialNosError);
- }
-
+ #region 鐢佃姱鍒嗙粨鏋滃紓甯镐笉闇�瑕佹垜浠鐞�
+ //var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
+ //if (serialNosError.Count > 0)
+ //{
+ // return await HandleErrorCells(input, area, serialNosError);
+ //}
+ #endregion
var boxing = CreateBoxingInfo(result, input.PalletCode);
if (boxing == null) return content.Error("缁勭洏澶辫触");
@@ -900,22 +904,45 @@
// 鑾峰彇缁勭洏淇℃伅
private DtBoxingInfo CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode)
- {
- return new DtBoxingInfo
+ {
+ var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode == palletCode);
+ if (boxing == null)
{
- PalletCode = palletCode,
- IsFull = true,
- ProcessCode = result.ProcessCode,
- ProductionLine = result.ProductionLine,
- BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail
+ return new DtBoxingInfo
{
- SerialNumber = serialNoObj.SerialNo,
- OrderNo = serialNoObj.PositionNo.ToString(),
- Status = serialNoObj.SerialNoStatus,
- MaterielCode = result.BindCode,
- Remark = result.TrayBarcodePropertys.ToJsonString(),
- }).ToList()
- };
+ PalletCode = palletCode,
+ IsFull = true,
+ ProcessCode = result.ProcessCode,
+ ProductionLine = result.ProductionLine,
+ BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail
+ {
+ SerialNumber = serialNoObj.SerialNo,
+ OrderNo = serialNoObj.PositionNo.ToString(),
+ Status = serialNoObj.SerialNoStatus,
+ MaterielCode = result.BindCode,
+ Remark = result.TrayBarcodePropertys.ToJsonString(),
+ }).ToList()
+ };
+ }
+ else {
+ _boxingInfoRepository.DeleteData(boxing);
+ return new DtBoxingInfo
+ {
+ PalletCode = palletCode,
+ IsFull = true,
+ ProcessCode = result.ProcessCode,
+ ProductionLine = result.ProductionLine,
+ BoxingInfoDetails = result.SerialNos.Select(seriaINoObj => new DtBoxingInfoDetail
+ {
+ SerialNumber = seriaINoObj.SerialNo,
+ OrderNo = seriaINoObj.PositionNo.ToString(),
+ Status = seriaINoObj.SerialNoStatus,
+ MaterielCode = result.BindCode,
+ Remark = result.TrayBarcodePropertys.ToJsonString(),
+ }).ToList()
+ };
+ }
+
}
// 鑾峰彇宸ヨ壓鐢宠
@@ -953,7 +980,6 @@
DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
: await QueryStockInfoForEmptyTrayAsync(areaCode, position);
-
if (stockInfo == null)
{
return content.Error("搴撳瓨淇℃伅涓嶅瓨鍦�");
@@ -1013,7 +1039,9 @@
return null;
}
- var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+ //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+ var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
+
List<string>? materielCodes = outBoundMateriel.Count != 0
? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == area.AreaCode)
.Select(x => x.MaterielCode)
@@ -1066,7 +1094,8 @@
// materielCodes = outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0]).Select(x => x.MaterielCode).ToList();
//}
- var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+ //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+ var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
List<string>? materielCodes = outBoundMateriel.Count != 0
? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0])
.Select(x => x.MaterielCode)
@@ -1283,7 +1312,7 @@
}
else
{
- task = CreateTask(stockInfo, "1049-1", taskType);
+ task = CreateTask(stockInfo, "1049-8", taskType);
}
}
--
Gitblit v1.9.3