From 0831fc62745a46b056e450395b0366ec168a6e55 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 26 三月 2026 13:44:45 +0800
Subject: [PATCH] 1
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 50 ++++++++++++++++++++++++--------------------------
1 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index 20dc592..ee6b07a 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -67,7 +67,7 @@
{
try
{
- WebResponseContent content = await GetTasksByPalletCodeAsync(taskDto.PalletCode);
+ WebResponseContent content = await GetTaskByPalletCodeAsync(taskDto.PalletCode);
if (content.Status)
{
return content;
@@ -331,7 +331,7 @@
{
try
{
- WebResponseContent content = await GetTasksByPalletCodeAsync(taskDto.PalletCode);
+ WebResponseContent content = await GetTaskByPalletCodeAsync(taskDto.PalletCode);
if (content.Status)
{
return content;
@@ -381,8 +381,10 @@
};
var taskDtos = task.Adapt<WMSTaskDTO>();
- BaseDal.AddData(task);
- return WebResponseContent.Instance.OK("鏌ヨ鎴愬姛", taskDtos);
+ var addResult = await BaseDal.AddDataAsync(task);
+ if (!addResult)
+ return WebResponseContent.Instance.Error("浠诲姟鍒涘缓澶辫触");
+ return WebResponseContent.Instance.OK("浠诲姟鍒涘缓鎴愬姛", taskDtos);
}
catch (Exception ex)
{
@@ -421,15 +423,15 @@
/// </summary>
/// <param name="palletCode"></param>
/// <returns></returns>
- private async Task<WebResponseContent> GetTasksByPalletCodeAsync(string palletCode)
+ private async Task<WebResponseContent> GetTaskByPalletCodeAsync(string palletCode)
{
try
{
- var tasks = await BaseDal.QueryFirstAsync(s => s.PalletCode == palletCode);
- if (tasks == null)
+ var task = await BaseDal.QueryFirstAsync(s => s.PalletCode == palletCode);
+ if (task == null)
return WebResponseContent.Instance.Error("鏈壘鍒板搴旂殑浠诲姟");
- var taskDtos = _mapper.Map<List<WMSTaskDTO>>(tasks);
- return WebResponseContent.Instance.OK("鏌ヨ鎴愬姛", taskDtos);
+ var taskDto = _mapper.Map<WMSTaskDTO>(task);
+ return WebResponseContent.Instance.OK("鏌ヨ鎴愬姛", taskDto);
}
catch (Exception ex)
{
@@ -779,30 +781,26 @@
try
{
var stockInfo = await _stockInfoService.GetStockInfoAsync(input.PalletCode, input.LocationCode);
+
+ int locationStatus;
if (stockInfo == null)
{
var location = await _locationInfoService.GetLocationInfoAsync(input.LocationCode);
-
- OutputDto outPutDto = new OutputDto()
- {
- LocationCode = input.LocationCode,
- PalletCode = input.PalletCode,
- IsNormalProcedure = 1,
- LocationStatus = location.LocationStatus
- };
- content.OK(data: outPutDto);
+ locationStatus = location?.LocationStatus ?? 0;
}
else
{
- OutputDto outPutDto = new OutputDto()
- {
- LocationCode = input.LocationCode,
- PalletCode = input.PalletCode,
- IsNormalProcedure = 1,
- LocationStatus = stockInfo.LocationDetails.LocationStatus
- };
- content.OK(data: outPutDto);
+ locationStatus = stockInfo.LocationDetails?.LocationStatus ?? 0;
}
+
+ OutputDto outPutDto = new OutputDto()
+ {
+ LocationCode = input.LocationCode,
+ PalletCode = input.PalletCode,
+ IsNormalProcedure = 1,
+ LocationStatus = locationStatus
+ };
+ return content.OK(data: outPutDto);
}
catch (Exception ex)
{
--
Gitblit v1.9.3