Mao 3 years ago
parent
commit
79615d1111
  1. 17
      ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs
  2. 5
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs
  3. 2
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
  4. 4
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj

17
ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs

@ -5,6 +5,7 @@ using System.Configuration;
using System.Data; using System.Data;
using System.Data.Common; using System.Data.Common;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
@ -213,6 +214,22 @@ namespace ICSSoft.Common
return conn; return conn;
} }
/// <summary>
/// 读取打印模板
/// </summary>
/// <returns></returns>
public static string ReadFileStream()
{
String filePath = @"\\192.168.1.88\d\WMS基础版本文件\WMSAPI\\打印模板.txt";
string strContent = string.Empty;
FileStream fs = new FileStream(filePath, FileMode.Open);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
strContent = Encoding.UTF8.GetString(buffer);
fs.Close();
return strContent;
}
/// <summary> /// <summary>
/// 根据配置文件中所配置的数据库类型 /// 根据配置文件中所配置的数据库类型
/// 来创建相应数据库命令对象 /// 来创建相应数据库命令对象

5
ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs

@ -12,10 +12,11 @@ namespace ICSSoft.Entity
public Result() public Result()
{ {
} }
public Result(bool success, string message, object data)
public Result(bool success, string message,string printstr, object data)
{ {
Success = success; Success = success;
Message = message; Message = message;
PrintStr = printstr;
Data = data; Data = data;
} }
[DataMember] [DataMember]
@ -23,6 +24,8 @@ namespace ICSSoft.Entity
[DataMember] [DataMember]
public string Message { get; set; } public string Message { get; set; }
[DataMember] [DataMember]
public string PrintStr { get; set; }
[DataMember]
public object Data { get; set; } public object Data { get; set; }
} }
} }

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

@ -8,6 +8,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Web.Http; using System.Web.Http;
using ICSSoft.Common;
namespace ICSSoft.WebAPI.Controllers namespace ICSSoft.WebAPI.Controllers
{ {
@ -472,6 +473,7 @@ namespace ICSSoft.WebAPI.Controllers
//var resultStr = action.LOTStockDownCreate(model); //var resultStr = action.LOTStockDownCreate(model);
var resultStr = ICSSubmitService.LOTStockDownCreate(model); var resultStr = ICSSubmitService.LOTStockDownCreate(model);
res.Success = true; res.Success = true;
res.PrintStr = DBHelper.ReadFileStream();
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!"; res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]") if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
{ {

4
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj

@ -267,6 +267,10 @@
<Content Include="Scripts\jquery-3.3.1.min.map" /> <Content Include="Scripts\jquery-3.3.1.min.map" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSSoft.Common\ICSSoft.Common.csproj">
<Project>{ee45f7a5-17ee-4707-a617-8c00dd36fc01}</Project>
<Name>ICSSoft.Common</Name>
</ProjectReference>
<ProjectReference Include="..\ICSSoft.DataProject\ICSSoft.DataProject.csproj"> <ProjectReference Include="..\ICSSoft.DataProject\ICSSoft.DataProject.csproj">
<Project>{9D26A712-D243-4E25-A473-61C5C2D9ED6A}</Project> <Project>{9D26A712-D243-4E25-A473-61C5C2D9ED6A}</Project>
<Name>ICSSoft.DataProject</Name> <Name>ICSSoft.DataProject</Name>

Loading…
Cancel
Save