refactor: 物料转序按起止库位前缀查模板编号
This commit is contained in:
@@ -319,7 +319,7 @@ namespace SlMesDbIterface
|
|||||||
|
|
||||||
private void button8_Click(object sender, EventArgs e)
|
private void button8_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CALL_Inerface_DataHandle.CALL_Inerface_MaterialTransfer("ACHC01", "ACHC02", "211");
|
CALL_Inerface_DataHandle.CALL_Inerface_MaterialTransfer("ACHC01", "ACHC02");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -571,16 +571,39 @@ namespace WebApi
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="startPositionCode">起始位置编号</param>
|
/// <param name="startPositionCode">起始位置编号</param>
|
||||||
/// <param name="endPositionCode">终点位置编号</param>
|
/// <param name="endPositionCode">终点位置编号</param>
|
||||||
/// <param name="taskType">任务模板编号</param>
|
|
||||||
/// <param name="dataid">派工任务id</param>
|
/// <param name="dataid">派工任务id</param>
|
||||||
/// <param name="moveTaskType">搬运类型:1:搬运容器,2:搬运货架</param>
|
/// <param name="moveTaskType">搬运类型:1:搬运容器,2:搬运货架</param>
|
||||||
/// <param name="vehicleStatus">载具类型:0-空;1-满</param>
|
/// <param name="vehicleStatus">载具类型:0-空;1-满</param>
|
||||||
/// <returns>返回调用结果 JObject,包含 code 和 message</returns>
|
/// <returns>返回调用结果 JObject,包含 code 和 message</returns>
|
||||||
public static JObject CALL_Inerface_MaterialTransfer(string startPositionCode, string endPositionCode, string taskType = "211", string dataid = "", string moveTaskType = "2", string vehicleStatus = "1")
|
public static JObject CALL_Inerface_MaterialTransfer(string startPositionCode, string endPositionCode, string dataid = "", string moveTaskType = "2", string vehicleStatus = "1")
|
||||||
{
|
{
|
||||||
JObject response = new JObject();
|
JObject response = new JObject();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// 根据起止库位号前缀(前6位)查询任务模板编号
|
||||||
|
var paramTaskType = new SqlParameter[] {
|
||||||
|
new SqlParameter("@起始库位号", startPositionCode ?? ""),
|
||||||
|
new SqlParameter("@结束库位号", endPositionCode ?? "")
|
||||||
|
};
|
||||||
|
DataLinkMesWork2.DataAccess2.ExecuteStoredProcedure("XD_AGV任务模板_获取", ref paramTaskType, out DataTable dtTaskType, out string errTaskType);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(errTaskType) || dtTaskType == null || dtTaskType.Rows.Count == 0
|
||||||
|
|| string.IsNullOrWhiteSpace(dtTaskType.Rows[0]["任务模板编号"]?.ToString()))
|
||||||
|
{
|
||||||
|
string errorMsg = $"未找到匹配的任务模板:起点={startPositionCode}, 终点={endPositionCode}";
|
||||||
|
if (!string.IsNullOrEmpty(errTaskType))
|
||||||
|
{
|
||||||
|
errorMsg += $", 错误={errTaskType}";
|
||||||
|
}
|
||||||
|
SaveMesLog("MOM", $"物料转序失败:{errorMsg}", MesLogType.ERROR);
|
||||||
|
|
||||||
|
response["code"] = 500;
|
||||||
|
response["message"] = errorMsg;
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
string taskType = dtTaskType.Rows[0]["任务模板编号"].ToString();
|
||||||
|
|
||||||
// 构建位置列表
|
// 构建位置列表
|
||||||
List<PositionInfo> positionList = new List<PositionInfo>
|
List<PositionInfo> positionList = new List<PositionInfo>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user