This commit is contained in:
帅凯 贾
2023-07-18 11:18:52 +08:00
parent 53c4b66485
commit ccbca85c55
13 changed files with 504 additions and 151 deletions

View File

@ -230,6 +230,10 @@
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
<Compile Include="WebService\WebService.asmx.cs">
<DependentUpon>WebService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-theme.css" />
@ -854,6 +858,7 @@
<Content Include="Content\code\themes\sand-signika.js.map" />
<Content Include="Content\code\themes\skies.js.map" />
<Content Include="Content\code\themes\sunset.js.map" />
<Content Include="WebService\WebService.asmx" />
<None Include="Properties\PublishProfiles\Toolsweb.pubxml" />
<Content Include="Scripts\jquery\jquery-1.11.1.js" />
<Content Include="Content\js\payment.js" />
@ -954,7 +959,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52610</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:63119/</IISUrl>
<IISUrl>http://localhost:63118/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>

View File

@ -10,12 +10,10 @@
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<connectionStrings>
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=weijie_dps;user id=sa;password=123456;min pool size=4;max pool size=4;packet size=3072;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=BaBi_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=FuYuan;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<!--<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />-->
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
<add name="OraMidConnString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
<!--<add name="OraMidConnString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />-->
</connectionStrings>
@ -27,7 +25,7 @@
<add key="ControlXML" value="/App_Data/EpostController.xml" />
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
<add key="ResultsXML" value="/App_Data/Results.xml" />
<add key="WebAPIUrl" value="http://localhost:63119/api/WebAPI/ProcessingResult"/>
<add key="WebAPIUrl" value="http://localhost:63118/api/WebAPI/ProcessingResult"/>
<add key="ShowMode" value="1" />
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
<add key="CARID" value="HT01" />
@ -48,11 +46,12 @@
</customErrors>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" requestValidationMode="2.0" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
<sessionState mode="InProc" timeout="518400" />
<pages validateRequest="false" />
</system.web>
<system.webServer>
<modules>

View File

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="WebService.asmx.cs" Class="Epost.DPS.WebService.WebService" %>

View File

@ -0,0 +1,153 @@
using Epost.BLL;
using Epost.Common;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Policy;
using System.Web;
using System.Web.Services;
namespace Epost.DPS.WebService
{
/// <summary>
/// WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
OrderBLL bll = new OrderBLL();
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
[WebMethod]
public string ReceiveDataInfo_XML(string action, string messages)
{
LogHelper.WriteLogInfo("WebService请求报文");
LogHelper.WriteLogInfo("action" + action + "");
LogHelper.WriteLogInfo("messages" + messages + "");
main main = new main();
msg msg = new msg();
var resultxml = string.Empty;
try
{
DataTable queuedt = queueBLL.getQueuesbyState();
if (queuedt == null || queuedt.Rows.Count <= 0)
{
if (!string.IsNullOrEmpty(messages))
{
LogHelper.WriteLogInfo("======开始处理数据======");
DataSet set = XmlHelper.GetDataSetStrXml(messages);
if (set != null && set.Tables.Count > 0 && set.Tables[0].Rows.Count > 0)
{
var ReturnDt = set.Tables["pick"];
DataTable dtResult = ReturnDt.Clone();
foreach (DataRow item in ReturnDt.Rows)
{
DataTable dt = bll.GetDataIfRepeat(item["transderMid"].ToString(), item["transderDid"].ToString());
if (dt == null || dt.Rows.Count <= 0)
{
DataRow dataRow = dtResult.NewRow();
dataRow["transderMid"] = item["transderMid"].ToString();
dataRow["transderDid"] = item["transderDid"].ToString();
dataRow["drugCode"] = item["drugCode"].ToString();
dataRow["drugCommName"] = item["drugCommName"].ToString();
dataRow["drugName"] = item["drugName"].ToString();
dataRow["drugSpec"] = item["drugSpec"].ToString();
dataRow["manufactName"] = item["manufactName"].ToString();
dataRow["batchNo"] = item["batchNo"].ToString();
dataRow["expire"] = item["expire"].ToString();
dataRow["areaId"] = item["areaId"].ToString();
dataRow["pickQty"] = item["pickQty"].ToString();
dataRow["stock"] = item["stock"].ToString();
dataRow["drugStoreName"] = item["drugStoreName"].ToString();
dataRow["labelColor"] = item["labelColor"].ToString();
dataRow["lookListen"] = item["lookListen"].ToString();
dataRow["labelIP"] = item["labelIP"].ToString();
dataRow["labelNo"] = item["labelNo"].ToString();
dtResult.Rows.Add(dataRow);
}
}
Dictionary<string, string> diclist = new Dictionary<string, string>();
diclist.Add("transderMid", "orderid");
diclist.Add("transderDid", "transderDid");
diclist.Add("drugCode", "sku");
diclist.Add("drugCommName", "genericname");
diclist.Add("drugName", "goodsname");
diclist.Add("drugSpec", "Spec");
diclist.Add("manufactName", "manufactname");
diclist.Add("batchNo", "batchno");
diclist.Add("expire", "orderdate");
diclist.Add("areaId", "tolocation");
diclist.Add("pickQty", "quantity");
diclist.Add("stock", "stockquantity");
diclist.Add("drugStoreName", "shopname");
diclist.Add("labelColor", "labelcolor");
diclist.Add("lookListen", "looklisten");
diclist.Add("labelIP", "labelIP");
diclist.Add("labelNo", "labelno");
bool b = bll.ImportOrderinfo(dtResult, diclist);
if (b)
{
msg.Status = "ok";
msg.Message = "接收成功";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("接收成功");
}
else
{
msg.Status = "erro";
msg.Message = "数据异常:数据处理失败,请重试!";
main.msg = msg;
resultxml = XmlHelper.XmlSerialize(main);
LogHelper.WriteLogInfo("数据异常:数据处理失败,请重试!");
}
}
else
{
msg.Status = "erro";
msg.Message = "数据异常解析XML失败请检查XML格式后再进行推送";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常解析XML失败请检查XML格式后再进行推送");
}
}
else
{
msg.Status = "erro";
msg.Message = "数据异常未在XML内获取到数据请检查后再进行推送";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常未在XML内获取到数据请检查后再进行推送");
}
return resultxml;
}
else
{
msg.Status = "erro";
msg.Message = "数据异常/当前存在拣药任务";
main.msg = msg;
LogHelper.WriteLogInfo("数据异常/当前存在拣药任务");
return resultxml = XmlHelper.ModelToXml(main);
}
}
catch (Exception ex)
{
msg.Status = "erro";
msg.Message = "数据异常:" + ex.Message + "";
main.msg = msg;
LogHelper.WriteLogInfo("数据异常:" + ex.Message + "");
return resultxml = XmlHelper.ModelToXml(main);
}
}
}
}