From 733e63cb362f17aea4a1020654fa348a0d0c1f06 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 24 二月 2025 00:08:59 +0800
Subject: [PATCH] 优化入库逻辑,优化直接出库逻辑,优化移库任务逻辑
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs | 88 +++++++++++--------------------------------
1 files changed, 23 insertions(+), 65 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
index 9623a53..cc108bf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
@@ -8,6 +8,7 @@
using WIDESEA_Core;
using WIDESEA_Model.Models;
using WIDESEAWCS_DTO.WCSInfo;
+using WIDESEA_DTO.WCSInfo;
namespace WIDESEA_TaskInfoService
{
@@ -25,15 +26,22 @@
{
string ConveyorLineID = AppSettings.Configuration[nameof(ConveyorLineID)];
if (!ConveyorLineID.Split(",").Contains(lineDTO.stationCode)) throw new Exception($"鏈壘鍒拌緭閫佺嚎缂栧彿[{lineDTO.stationCode}]鐨勪俊鎭�");
- switch (lineDTO.stationCode)
- {
- case "102":
- content = TransmissionlineRequest(lineDTO);
- break;
- case "1001":
- content = ProductionlineRequest(lineDTO);
- break;
- }
+ content = TransmissionlineRequest(lineDTO);
+ //switch (lineDTO.stationCode)
+ //{
+ // case "102":
+ // content = TransmissionlineRequest(lineDTO);
+ // break;
+ // case "Z1":
+ // case "Z2":
+ // case "Z3":
+ // case "X1":
+ // case "X2":
+ // case "X3":
+ // content = ProductionlineRequest(lineDTO);
+ // break;
+ // default: throw new Exception("鏈畾涔夌珯鍙帮細" + lineDTO.stationCode);
+ //}
}
catch (Exception ex)
{
@@ -114,18 +122,19 @@
Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault();
- if (lineDTO.Spec != 1 || lineDTO.Weight != 500)//妫�娴嬫潯浠堕渶鏇存敼锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
+ if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//妫�娴嬫潯浠堕渶鏇存敼锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
{
- task.NextAddress = "101";
+ //task.NextAddress = "101";
task.TaskState = (int)InTaskStatusEnum.InException;
- task.Remark = $"鎵樼洏[{lineDTO.Barcode}]淇℃伅涓嶅悎鏍�";
+ task.Remark = $"鎵樼洏[{lineDTO.Barcode}]瓒呴噸";
+ //task.Remark = $"鎵樼洏[{lineDTO.Barcode}]淇℃伅涓嶅悎鏍�";
//stockInfo.StockStatus = StockStatusEmun.鍏ュ簱鎾ら攢.ObjToInt();
}
else
{
- task.NextAddress = "104";
+ task.NextAddress = "1004";
task.CurrentAddress = lineDTO.stationCode;
- task.Remark=string.Empty;
+ task.Remark = string.Empty;
task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
stockInfoDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
@@ -140,57 +149,6 @@
Db.Ado.CommitTran();
#endregion
if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark);
- }
- catch (Exception ex)
- {
- Db.Ado.RollbackTran();
- content.Error(ex.Message);
- }
- return content;
- }
-
- /// <summary>
- /// 浜х嚎鐢宠
- /// </summary>
- /// <param name="lineDTO"></param>
- /// <returns></returns>
- public WebResponseContent ProductionlineRequest(ConveyorLineDTO lineDTO)
- {
- WebResponseContent content = new WebResponseContent();
- try
- {
- var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode);
- if (task != null && task.TaskType == TaskTypeEnum.Inbound.ObjToInt())
- return content.OK(data: task);
- if (task != null) throw new Exception($"鎵樼洏鍙穂{lineDTO.Barcode}]宸插瓨鍦ㄤ换鍔�");
- Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode);
- (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo);
- if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
- var StockInfoDetails = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).ToList();
- #region 鐢熸垚鍏ュ簱浠诲姟
- Dt_Task dt_Task = new Dt_Task()
- {
- CurrentAddress = lineDTO.stationCode,
- NextAddress = "SC01",
- SourceAddress = lineDTO.stationCode,
- TargetAddress = "SC01",
- CreateDate = DateTime.Now,
- Creater = "System",
- PalletCode = lineDTO.Barcode,
- OrderNo = StockInfoDetails.Count() == 1 ? StockInfoDetails.First().OrderNo : null,
- Roadway = "SC01",
- TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")),
- TaskState = InTaskStatusEnum.InNew.ObjToInt(),
- TaskType = TaskTypeEnum.Inbound.ObjToInt(),
- };
- dt_Task.Dispatchertime = dt_Task.CreateDate;
- Db.Ado.BeginTran();
- BaseDal.AddData(dt_Task);
- task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt());
- //content.Data = dt_Task;
- Db.Ado.CommitTran();
- if (task != null) return content.OK(data: task);
- #endregion
}
catch (Exception ex)
{
--
Gitblit v1.9.3