From 35d6465fc502a3287c6cc1d0f307d616dbe1ccda Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周五, 10 10月 2025 13:25:33 +0800
Subject: [PATCH] 增加版本呢
---
DEmon/WebWIPAPI/Controllers/MesIntegrController.cs | 74 +++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs b/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
index 6aa50c6..b6c4ba2 100644
--- a/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
+++ b/DEmon/WebWIPAPI/Controllers/MesIntegrController.cs
@@ -3,15 +3,18 @@
using iWareCommon.Utils;
using iWareDataCore.BASE.Entity;
using iWareDataCore.BASE.Service;
+using iWareDataCore.TASK.Service;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
+using System.Web.Hosting;
using System.Web.Mvc;
using WebWIPAPI.Models;
using WebWIPAPI.Properties;
using WebWIPAPI.Utils;
+using static System.Runtime.CompilerServices.RuntimeHelpers;
using LogTextHelper = WebWIPAPI.Utils.LogTextHelper;
namespace WebWIPAPI.Controllers
@@ -108,6 +111,17 @@
};
return ApiResponseHelper.ReturnApiResponse(responseMessage, "importInOrder", "");
}
+ if (importMaterials.Select(x => x.Code).Distinct().Count() != 1)
+ {
+ responseMessage = new ApiResponse<string>()
+ {
+ Code = 500,
+ Success = false,
+ Message = "鏈璇锋眰涓墿鏂欏彿涓嶈兘閲嶅",
+ Data = null,
+ };
+ return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", "");
+ }
#endregion
#region 涓氬姟澶勭悊
@@ -179,7 +193,7 @@
///// <summary>
- ///// 瀵煎叆鍑哄簱鍗�-鐗堟湰1
+ ///// 瀵煎叆鍑哄簱鍗�-鐗堟湰1锛堜娇鐢ㄥ嚭搴撳崟鎹殑鐗堟湰锛�
///// </summary>
///// <param name="inputmaterials"></param>
///// <returns></returns>
@@ -261,7 +275,7 @@
/// <summary>
- /// 瀵煎叆鍑哄簱鍗�-鐗堟湰2
+ /// 瀵煎叆鍑哄簱鍗�-鐗堟湰2锛堥�夋嫨搴撳瓨鍑哄簱鐨勭増鏈級
/// </summary>
/// <param name="inputmaterials"></param>
/// <returns></returns>
@@ -296,12 +310,24 @@
};
return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", "");
}
+ if (inputmaterials.Select(x => x.Code).Distinct().Count() != 1)
+ {
+ responseMessage = new ApiResponse<string>()
+ {
+ Code = 500,
+ Success = false,
+ Message = "鏈璇锋眰涓墿鏂欏彿涓嶈兘閲嶅",
+ Data = null,
+ };
+ return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", "");
+ }
#endregion
#region 涓氬姟澶勭悊
string typeName = "鍑哄簱";
- handler_importOutOrder(typeName, inputmaterials, out msg);
+ handler_OutOrder(inputmaterials, out msg);
+ //handler_importOutOrder(typeName, inputmaterials, out msg);
#endregion
@@ -439,5 +465,47 @@
}
}
+
+ /// <summary>
+ /// 閫夋嫨搴撳瓨鍑哄簱鐨勭増鏈�
+ /// </summary>
+ /// <param name="inputmaterials"></param>
+ /// <param name="msg"></param>
+ private void handler_OutOrder(List<InputMaterialEntity> inputmaterials, out string msg)
+ {
+ msg = "";
+ //鏌ユ壘搴撳瓨琛ㄤ腑鐨刬d
+ var qList = inputmaterials.Select(x => x.Code).ToList();
+ List<int> ids = PlaceMaterialViewService.GetInstance().GetPlaceMaterialViewsByCodeList(qList, out msg);
+ if (!string.IsNullOrEmpty(msg))
+ {
+ return;
+ }
+ // List<int> ids = GetSelectedDataKeyIDs(PlaceGrid);
+ if (ids.Count > 0)
+ {
+ int count = MainTaskService.GetInstance().SaveOutMainTask(ids, out msg);
+ if (count > 0)
+ {
+ msg = "鍑哄簱浠诲姟鐢熸垚鎴愬姛";
+ }
+ else if (count == 0)
+ {
+ msg = "鍑哄簱浠诲姟宸插湪浠诲姟闃熷垪涓�";
+ }
+ else
+ {
+ msg = "鍑哄簱浠诲姟鐢熸垚澶辫触锛�";
+ }
+
+ }
+ else
+ {
+ msg = "璇烽�夋嫨瑕佸嚭搴撶殑鐗╂枡";
+ }
+ //Alert.Show(msg);
+ //WriteLog("搴撲綅鐗╂枡鍑哄簱" + msg, "搴撳瓨绠$悊");
+ }
+
}
}
--
Gitblit v1.9.3