Browse Source

纽威PDA服务

master
陆晔 2 years ago
parent
commit
f218fb2a05
  1. 112
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  2. 44
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSContainerBind.cs
  3. 24
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSContainerInfo.cs
  4. 19
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSLocationRecommend.cs
  5. 2
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSSoft.Entity.csproj
  6. 37
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

112
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -1096,6 +1096,91 @@ namespace ICSSoft.DataProject
}
#endregion
#region 获取推荐库位
/// <summary>
/// 料架验证
/// </summary>
/// <param name="JsonData"></param>
/// <returns></returns>
public static Result LocationRecommend(ICSLocationRecommend JsonData)
{
var language = LanguageHelper.GetName("WMSAPIInfo");
DataTable table = new DataTable();
string msg = "";
using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
try
{
string ContainerID = "";
Result res = new Result();
if (String.IsNullOrEmpty(JsonData.WorkPoint))
{
msg = string.Format(language.GetNameByCode("WMSAPIInfo004"));//"站点不能为空!"
}
string chksql = "";
DataTable chkdt = new DataTable();
if (JsonData.NeedMerge==false)
{
chksql = @" select TOP 1 LocationCode from ICSLocation
where ISNULL(EATTRIBUTE2,'')!='' AND ISNULL(EATTRIBUTE1,'')=''
AND WorkPoint='{0}'
Order by EATTRIBUTE2";
chksql = string.Format(chksql, JsonData.WorkPoint);
chkdt = DBHelper.SQlReturnData(chksql, cmd);
if (chkdt.Rows.Count == 0)
{
res.Success = false;
res.Message = string.Format(language.GetNameByCode("WMSAPIInfo202"));//"库位已被全部占用,暂无可以入库的库位!"
}
else
{
res.Success = true;
res.Message = chkdt.Rows[0]["LocationCode"].ToString();
}
}
else
{
chksql = @" select TOP 1 MergeLocationCode AS LocationCode from ICSLocationMerge A
INNER JOIN ICSLocation B ON B.LocationCode=A.LocationCode AND B.WorkPoint=A.WorkPoint
where ISNULL(B.EATTRIBUTE2,'')!='' AND ISNULL(B.EATTRIBUTE1,'')=''
AND ISNULL(A.IsOccupied,'0')='0' AND ISNULL(A.OccupiedPallet,'')=''
AND A.WorkPoint='{0}'
Order by B.EATTRIBUTE2";
chksql = string.Format(chksql, ContainerID, JsonData.WorkPoint);
chkdt = DBHelper.SQlReturnData(chksql, cmd);
if (chkdt.Rows.Count == 0)
{
res.Success = false;
res.Message = string.Format(language.GetNameByCode("WMSAPIInfo202"));//"库位已被全部占用,暂无可以入库的库位!"
}
else
{
res.Success = true;
res.Message = chkdt.Rows[0]["LocationCode"].ToString();
}
}
return res;
}
catch (Exception ex)
{
log.Error(ex.Message);
throw new Exception(ex.Message);
}
finally
{
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Dispose();
}
}
}
#endregion
#region 条码信息
/// <summary>
/// 条码信息
@ -6350,7 +6435,8 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
cmd.Connection = conn;
try
{
foreach (ICSContainerBind item in JsonData)
Result res = new Result();
foreach (ICSContainerBind item in JsonData)
{
string TransType = item.TransType;
if (JsonData.Count <= 0)
@ -6373,18 +6459,30 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
{
msg = string.Format(language.GetNameByCode("WMSAPIInfo199"));//"操作类型错误!"
}
if (TransType == TransTypeEnum.ContainerBind.GetDescription())
if (item.ContainerType == "窄巷道叉车(木托盘)" && item.LocationCode == "")
{
msg = string.Format(language.GetNameByCode("WMSAPIInfo203"));//"推荐库位不能为空!"
}
if (msg != "")
{
//料架条码绑定
ICSWareHouseLotInfoService.ContainerBind(item.LotNo, item.ContainerCode, item.ContainerType, item.User, item.WorkPoint, cmd, language);
res.Success = false;
res.Message = msg;// "接口调用失败!";
return res;
}
else
{
//料架条码解绑
ICSWareHouseLotInfoService.ContainerUnBind(item.ContainerCode, item.WorkPoint, cmd, language);
if (TransType == TransTypeEnum.ContainerBind.GetDescription())
{
//料架条码绑定
ICSWareHouseLotInfoService.ContainerBind(item.LotNo, item.ContainerCode, item.ContainerType, item.User, item.WorkPoint, cmd, language);
}
else
{
//料架条码解绑
ICSWareHouseLotInfoService.ContainerUnBind(item.ContainerCode, item.WorkPoint, cmd, language);
}
}
}
Result res = new Result();
res.Success = true;
res.Message = msg;// "接口调用成功!";
return res;

44
ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSContainerBind.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ICSSoft.Entity
{
public class ICSContainerBind
{
/// <summary>
///容器编码
/// </summary>
public string ContainerCode { get; set; }
/// <summary>
/// 条码
/// </summary>
public string LotNo { get; set; }
/// <summary>
/// 操作人
/// </summary>
public string User { get; set; }
/// <summary>
/// 操作时间
/// </summary>
public string MTime { get; set; }
/// <summary>
/// 站点
/// </summary>
public string WorkPoint { get; set; }
/// <summary>
/// 操作类型(绑定/解绑)
/// </summary>
public string TransType { get; set; }
/// <summary>
/// 绑定类型(货柜/窄巷道叉车(料架)/窄巷道叉车(木托盘))
/// </summary>
public string ContainerType { get; set; }
/// <summary>
/// 推荐库位(窄巷道叉车(木托盘))
/// </summary>
public string LocationCode { get; set; }
}
}

24
ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSContainerInfo.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ICSSoft.Entity
{
public class ICSContainerInfo
{
/// <summary>
///容器编码
/// </summary>
public string ContainerCode { get; set; }
/// <summary>
/// 站点
/// </summary>
public string WorkPoint { get; set; }
/// <summary>
/// 操作类型
/// </summary>
public string TransType { get; set; }
}
}

19
ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSLocationRecommend.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ICSSoft.Entity
{
public class ICSLocationRecommend
{
/// <summary>
/// 是否超托
/// </summary>
public bool NeedMerge { get; set; }
/// <summary>
/// 站点
/// </summary>
public string WorkPoint { get; set; }
}
}

2
ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSSoft.Entity.csproj

@ -60,6 +60,8 @@
<Compile Include="ERPODNRT.cs" />
<Compile Include="ERPPurchaseOrder.cs" />
<Compile Include="ICSCheck.cs" />
<Compile Include="ICSContainerInfo.cs" />
<Compile Include="ICSContainerBind.cs" />
<Compile Include="ICSUser.cs" />
<Compile Include="LanguageModel.cs" />
<Compile Include="LOTMergeCreateIModel.cs" />

37
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

@ -296,6 +296,43 @@ namespace ICSSoft.WebAPI.Controllers
return result;
}
/// <summary>
/// 获取推荐库位
/// </summary>
/// <param name="JsonData"></param>
/// <returns></returns>
[HttpPost]
[Route("api/LocationRecommend/Get")]
public HttpResponseMessage LocationRecommend([FromBody] object JsonData)
{
log.Info("获取条码信息传入值" + JsonData);
try
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
ICSLocationRecommend model = new ICSLocationRecommend();
model = JsonConvert.DeserializeObject<ICSLocationRecommend>(JsonData.ToString());
//var resultStr = ICSSubmitService.BarCodeInformationGet(model);
//res.Success = true;
//res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
//res.Data = resultStr;
res = ICSSubmitService.LocationRecommend(model);
}
}
catch (Exception ex)
{
log.Error("转换失败:" + ex.ToString());
res.Success = false;
res.Message = ex.Message;
}
finally
{
str = JsonConvert.SerializeObject(res);
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
}
log.Debug("获取条码信息返回值:" + str);
return result;
}
/// <summary>
/// 使用中
/// 获取条码信息
/// </summary>

|||||||
100:0
Loading…
Cancel
Save