From 79615d11116e5ecaab0f5cc141e57d093455ee3f Mon Sep 17 00:00:00 2001
From: Mao <1205395967@qq.com>
Date: Mon, 15 Aug 2022 15:29:59 +0800
Subject: [PATCH] Mao
---
ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs | 17 +++++++++++++++++
ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs | 5 ++++-
.../Controllers/WMSBarCoreController.cs | 2 ++
.../ICSSoft.WMS.WebAPI.csproj | 4 ++++
4 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs
index 37c039d..e784c52 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.Common/DBHelper.cs
@@ -5,6 +5,7 @@ using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
+using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -213,6 +214,22 @@ namespace ICSSoft.Common
return conn;
}
+ ///
+ /// 读取打印模板
+ ///
+ ///
+ 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;
+ }
+
///
/// 根据配置文件中所配置的数据库类型
/// 来创建相应数据库命令对象
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs
index d32b211..f211a1f 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.Entity/Result.cs
@@ -12,10 +12,11 @@ namespace ICSSoft.Entity
public Result()
{
}
- public Result(bool success, string message, object data)
+ public Result(bool success, string message,string printstr, object data)
{
Success = success;
Message = message;
+ PrintStr = printstr;
Data = data;
}
[DataMember]
@@ -23,6 +24,8 @@ namespace ICSSoft.Entity
[DataMember]
public string Message { get; set; }
[DataMember]
+ public string PrintStr { get; set; }
+ [DataMember]
public object Data { get; set; }
}
}
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
index 04db366..185306a 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
@@ -8,6 +8,7 @@ using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http;
+using ICSSoft.Common;
namespace ICSSoft.WebAPI.Controllers
{
@@ -472,6 +473,7 @@ namespace ICSSoft.WebAPI.Controllers
//var resultStr = action.LOTStockDownCreate(model);
var resultStr = ICSSubmitService.LOTStockDownCreate(model);
res.Success = true;
+ res.PrintStr = DBHelper.ReadFileStream();
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
{
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj
index d37b937..056d13a 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI.csproj
@@ -267,6 +267,10 @@
+
+ {ee45f7a5-17ee-4707-a617-8c00dd36fc01}
+ ICSSoft.Common
+
{9D26A712-D243-4E25-A473-61C5C2D9ED6A}
ICSSoft.DataProject