epickhost update, get stockgoods by multi barcodes

This commit is contained in:
bobwang 2023-06-04 12:58:50 +08:00
parent 2fcc07e050
commit b21240abda
12 changed files with 87 additions and 29 deletions

View File

@ -247,7 +247,7 @@ namespace DeiNiu.wms.Data.Model
case 605: //get stock detail by barcode case 605: //get stock detail by barcode
_strSql = " SELECT * FROM v_stockGoods where barcode =@barcode"; _strSql = " SELECT * FROM v_stockGoods a where exists(select 1 from v_erpGoodsBarcods where goodsId=a.goodsId and barcode =@barcode)";
sqlCmd.Parameters.AddWithValue("@barcode", mObj.CmdParameters[0]); sqlCmd.Parameters.AddWithValue("@barcode", mObj.CmdParameters[0]);
sqlCmd.CommandText = _strSql; sqlCmd.CommandText = _strSql;
break; break;

View File

@ -108,7 +108,8 @@ namespace DeiNiu.wms.Data.Model
case 500: // get location info by locationId case 500: // get location info by locationId
_strSql = " select * from v_location where locationId= @locId"; _strSql = " select [id],[locationId] ,[ownerCode] ,[warehouse] ,[channel] ,[shelf] ,[layer] ,[col] ,[elabId] ,[elabAddress] ,[height] ,[width] ,[length] , [weight] ,[port] ,[part] ,[bigPart] ,[goodsType] ,[whType] ,[whGoodsType] ,[whVolType] ,[volType] ,[ABC] ,[state]" +
" from v_location where locationId= @locId";
sqlCmd.CommandText = _strSql; sqlCmd.CommandText = _strSql;
sqlCmd.Parameters.AddWithValue("@locId", mObj.CmdParameters[0]); sqlCmd.Parameters.AddWithValue("@locId", mObj.CmdParameters[0]);

View File

@ -294,8 +294,8 @@ namespace DeiNiu.wms.Data.Model
public DataTable getGoodsStockLocations(string barcode) public DataTable getGoodsStockLocations(string barcode)
{ {
cmdParameters[0] = barcode; cmdParameters[0] = barcode;
return CustQuery(605).Tables[0];
return CustQuery(610).Tables[0]; // return CustQuery(610).Tables[0];
} }
/// <summary> /// <summary>

View File

@ -7,6 +7,6 @@
<PropertyGroup> <PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile /> <TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword /> <EncryptedPassword />
<History>True|2023-05-06T06:56:53.6168349Z;True|2023-05-05T13:55:40.8919105+08:00;False|2023-05-05T13:53:04.6916288+08:00;True|2023-05-05T11:03:15.9678862+08:00;True|2023-05-04T09:51:22.4612940+08:00;True|2023-05-04T09:50:52.2096412+08:00;True|2023-04-10T09:51:58.9454913+08:00;True|2023-04-10T09:48:21.4643306+08:00;True|2023-03-02T10:56:32.9641119+08:00;True|2023-03-01T13:00:21.0277044+08:00;True|2023-03-01T12:59:39.9331328+08:00;True|2023-03-01T12:51:29.9043826+08:00;True|2023-02-28T10:24:32.0453272+08:00;True|2023-02-27T14:37:14.0670495+08:00;True|2023-02-27T10:08:19.7600511+08:00;False|2023-02-27T10:02:17.2718591+08:00;True|2023-02-27T09:52:32.8960704+08:00;True|2023-02-24T14:51:59.1193489+08:00;True|2023-02-24T11:06:01.4908187+08:00;True|2023-02-23T23:29:13.2329106+08:00;True|2023-02-23T23:26:32.9514286+08:00;True|2023-02-23T23:23:34.8152904+08:00;True|2023-02-23T15:17:28.2611314+08:00;True|2023-02-21T18:20:00.6630430+08:00;True|2023-02-21T18:17:58.7619998+08:00;</History> <History>True|2023-05-25T14:09:58.9638442Z;True|2023-05-06T14:56:53.6168349+08:00;True|2023-05-05T13:55:40.8919105+08:00;False|2023-05-05T13:53:04.6916288+08:00;True|2023-05-05T11:03:15.9678862+08:00;True|2023-05-04T09:51:22.4612940+08:00;True|2023-05-04T09:50:52.2096412+08:00;True|2023-04-10T09:51:58.9454913+08:00;True|2023-04-10T09:48:21.4643306+08:00;True|2023-03-02T10:56:32.9641119+08:00;True|2023-03-01T13:00:21.0277044+08:00;True|2023-03-01T12:59:39.9331328+08:00;True|2023-03-01T12:51:29.9043826+08:00;True|2023-02-28T10:24:32.0453272+08:00;True|2023-02-27T14:37:14.0670495+08:00;True|2023-02-27T10:08:19.7600511+08:00;False|2023-02-27T10:02:17.2718591+08:00;True|2023-02-27T09:52:32.8960704+08:00;True|2023-02-24T14:51:59.1193489+08:00;True|2023-02-24T11:06:01.4908187+08:00;True|2023-02-23T23:29:13.2329106+08:00;True|2023-02-23T23:26:32.9514286+08:00;True|2023-02-23T23:23:34.8152904+08:00;True|2023-02-23T15:17:28.2611314+08:00;True|2023-02-21T18:20:00.6630430+08:00;True|2023-02-21T18:17:58.7619998+08:00;</History>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>false</UseIISExpress> <UseIISExpress>false</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />

View File

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>E:\win10e\wms\vsprojectOwen3\vsprojectOwen\WcfServiceErp\Properties\PublishProfiles\IISProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>E:\win10e\wms\vsprojectOwen3\vsprojectOwen\WcfServiceErp\Properties\PublishProfiles\IISProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />

View File

@ -448,7 +448,7 @@
this.label14.Location = new System.Drawing.Point(610, 40); this.label14.Location = new System.Drawing.Point(610, 40);
this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label14.Name = "label14"; this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(87, 36); this.label14.Size = new System.Drawing.Size(58, 24);
this.label14.TabIndex = 33; this.label14.TabIndex = 33;
this.label14.Text = "扫码"; this.label14.Text = "扫码";
// //
@ -760,7 +760,6 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4); this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormHost"; this.Name = "FormHost";
this.Text = "DN Light Service"; this.Text = "DN Light Service";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormHost_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormHost_FormClosing);

View File

@ -99,8 +99,10 @@ namespace epickHost
} }
catch (Exception e) catch (Exception e)
{ {
MessageBox.Show("启动服务失败: "+e.Message); MessageBox.Show("启动服务失败: "+e.Message);
addLog(e.StackTrace);
} }
@ -852,20 +854,29 @@ namespace epickHost
String url = svrUrl + "testPost"; String url = svrUrl + "testPost";
addLog("收到按键返回事件,开始回传..."+ getJson(lb)); addLog("收到按键返回事件,开始回传..." + getJson(lb));
// addLog(getJson(lb)); // addLog(getJson(lb));
string rowId = lb.rowId+""; string rowId = lb.rowId + "";
// if (dicRowId.ContainsKey(getRowKey(lb))) // if (dicRowId.ContainsKey(getRowKey(lb)))
// rowId = dicRowId[getRowKey(lb)]; // rowId = dicRowId[getRowKey(lb)];
// String s = getJson(lb); // String s = getJson(lb);
postUrl = System.Configuration.ConfigurationManager.AppSettings["WMSuri"]; postUrl = System.Configuration.ConfigurationManager.AppSettings["WMSuri"];
Thread threadPreProcess = new Thread(new ParameterizedThreadStart(HttpPost)); if (postUrl.StartsWith("http"))
threadPreProcess.IsBackground = true; {
threadPreProcess.Start(lb); Thread threadPreProcess = new Thread(new ParameterizedThreadStart(HttpPost));
threadPreProcess.IsBackground = true;
threadPreProcess.Start(lb);
}
else if (postUrl.StartsWith("https"))
{
Thread threadPreProcess = new Thread(new ParameterizedThreadStart(HttpsPost));
threadPreProcess.IsBackground = true;
threadPreProcess.Start(lb);
}
} }
@ -914,12 +925,13 @@ namespace epickHost
req.Method = "POST"; req.Method = "POST";
req.ContentType = "application/json"; req.ContentType = "application/json";
req.ContentLength = bs.Length; req.ContentLength = bs.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
try try
{ {
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
req.BeginGetResponse(new AsyncCallback(Compleate), req); req.BeginGetResponse(new AsyncCallback(Compleate), req);
} }
catch(Exception e) catch(Exception e)
@ -935,6 +947,43 @@ namespace epickHost
} }
private void HttpsPost(Object ticket)
{
//string Url = svrUrl + "testPost";
DataContractJsonSerializer serializer = new DataContractJsonSerializer(ticket.GetType());
MemoryStream stream = new MemoryStream();
serializer.WriteObject(stream, ticket);
byte[] dataBytes = new byte[stream.Length];
stream.Position = 0;
stream.Read(dataBytes, 0, (int)stream.Length);
string param = Encoding.UTF8.GetString(dataBytes);
byte[] bs = Encoding.ASCII.GetBytes(param);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(postUrl);
req.Method = "POST";
req.ContentType = "application/json";
req.ContentLength = bs.Length;
try
{
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
req.BeginGetResponse(new AsyncCallback(Compleate), req);
}
catch (Exception e)
{
addLog(e.Message);
}
/*
HttpWebResponse hwr = req.GetResponse() as HttpWebResponse;
System.IO.StreamReader myreader = new System.IO.StreamReader(hwr.GetResponseStream(), Encoding.UTF8);
string responseText = myreader.ReadToEnd();
Console.WriteLine( responseText);
* */
}
public void Compleate(IAsyncResult asyncResult) public void Compleate(IAsyncResult asyncResult)
{ {
try try
@ -1573,17 +1622,26 @@ namespace epickHost
//每2小时重启服务 //每2小时重启服务
private void initialTimer2() private void initialTimer2()
{ {
int intTime = 2 * 60 * 60 * 1000; //2小时 //int intTime = 1* 60 * 1000; //1分
int intTime = 8 * 60 * 60 * 1000; //8小时
timer2.Interval = intTime;//设置间隔时间,为毫秒; timer2.Interval = intTime;//设置间隔时间,为毫秒;
timer2.Elapsed += new System.Timers.ElapsedEventHandler(reset);//到达时间的时候执行事件; timer2.Elapsed += new System.Timers.ElapsedEventHandler(reset);//到达时间的时候执行事件;
timer2.AutoReset = true;//设置是执行一次false还是一直执行(true) timer2.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer2.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件 timer2.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件
timer2.Start(); timer2.Start();
} }
private void reset(object sender, ElapsedEventArgs e) private void reset(object sender, ElapsedEventArgs e)
{ {
int hour = System.DateTime.Now.Hour;
addLog("current hour is " + hour);
if (hour >7 && hour <19)
{
return;
}
addLog("Restarting....Service..... " );
restart(); restart();
} }
} }

View File

@ -30,7 +30,7 @@
<PublisherName>苏州得牛软件</PublisherName> <PublisherName>苏州得牛软件</PublisherName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage> <WebPage>index.html</WebPage>
<ApplicationRevision>22</ApplicationRevision> <ApplicationRevision>23</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>false</UseIISExpress> <UseIISExpress>false</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />