Commit 4a70512e 张东亮

增加解绑rfid接口

1 个父辈 3f0dfa44
正在显示 38 个修改的文件 包含 75 行增加133 行删除
此文件类型无法预览
......@@ -9,12 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClient", "AgvClient\AgvC
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientTest", "AgvClientTest\AgvClientTest.csproj", "{E1C0827A-FA12-49A9-AC71-6D3E6518754A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LineWebService", "WebService\LineWebService.csproj", "{074D4597-8955-4EEE-840A-8FAA9B174603}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServiceHost", "WebServiceTest\WebServiceHost.csproj", "{A89F6EC4-457A-4998-ACDC-F1ADC22C8BF8}"
ProjectSection(ProjectDependencies) = postProject
{074D4597-8955-4EEE-840A-8FAA9B174603} = {074D4597-8955-4EEE-840A-8FAA9B174603}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -34,10 +29,6 @@ Global
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.Build.0 = Release|Any CPU
{074D4597-8955-4EEE-840A-8FAA9B174603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{074D4597-8955-4EEE-840A-8FAA9B174603}.Debug|Any CPU.Build.0 = Debug|Any CPU
{074D4597-8955-4EEE-840A-8FAA9B174603}.Release|Any CPU.ActiveCfg = Release|Any CPU
{074D4597-8955-4EEE-840A-8FAA9B174603}.Release|Any CPU.Build.0 = Release|Any CPU
{A89F6EC4-457A-4998-ACDC-F1ADC22C8BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A89F6EC4-457A-4998-ACDC-F1ADC22C8BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A89F6EC4-457A-4998-ACDC-F1ADC22C8BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
......
......@@ -27,12 +27,12 @@
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout>
</appender>
<logger>
<level value="ALL"/>
<logger name ="LineWebService">
<level value="Info"/>
<appender-ref ref="LineWebService"/>
</logger>
<root>
<level value="Debug"/>
<level value="Info"/>
<appender-ref ref="AgvServer"/>
</root>
</log4net>
......@@ -46,36 +46,4 @@
<add key="ChargeThreshold" value="20,70" />
</appSettings>
<system.serviceModel>
<services>
<!--添加服务-->
<service name="BLL.ClsWebService" behaviorConfiguration="CalculatorServiceBehavior">
<!--name 必须与代码中的host实例初始化的服务一样
behaviorConfiguration 行为配置 -->
<host>
<baseAddresses>
<!--添加调用服务地址-->
<add baseAddress="http://127.0.0.1/BenQMIR/Webservice/AGVService.asmx/"/>
</baseAddresses>
</host>
<!--添加契约接口 contract="WcfDemo.IService1" WcfDemo.IService1为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
<endpoint address="" binding="wsHttpBinding" contract="BLL.IWebService"></endpoint>
</service>
</services>
<!--定义CalculatorServiceBehavior的行为-->
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
\ No newline at end of file
......@@ -14,13 +14,13 @@ namespace BLL
[ServiceContract(Name = "Services")]
internal interface IWebService
{
[OperationContract]
[OperationContract]
[WebInvoke(UriTemplate = "CreateEmptyRecycleTask", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]
string CreateEmptyRecycleTask(Stream stream);//string line
//?emptyStation={line}
[OperationContract]
[WebInvoke(UriTemplate = "CreateEmptyRecycleTask?emptyStation={line}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]
string CreateEmptyRecycleTaskGET(string line);
[WebInvoke(UriTemplate = "CreateEmptyRecycleTask?emptyStation={line}&rfid={RFID}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]
string CreateEmptyRecycleTaskGET(string line,string RFID="");
}
......@@ -42,6 +42,7 @@ namespace BLL
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
internal class ClsWebService : IWebService
{
static log4net.ILog Log = log4net.LogManager.GetLogger("LineWebService");
internal ClsWebService()
{
......@@ -54,11 +55,12 @@ namespace BLL
string s = sr.ReadToEnd();
System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
string emptyStation = nvc["emptyStation"];
if(emptyStation ==null)
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "emptyStation =null "};
string rfid = nvc["rfid"];
if (emptyStation == null)
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "emptyStation =null " };
else
{
if(emptyStation.Equals("Feeder"))
if (emptyStation.Equals("Feeder"))
{
emptyStation = "FeederOut";
}
......@@ -66,43 +68,42 @@ namespace BLL
{
emptyStation = "4CFeederOut";
}
AGVControl.Common.LogInfo("WebService Request emptyStation=" + emptyStation,false);
}
if (Common.GetNodeNameByLineName(emptyStation, out string value))
{
res = new Result() { Succeed = true, ResultData = null, ErrorMessage = "" };
AGVControl.Common.log.Debug("WebService Response OK");
//加到任务
//int idx = AGVControl.Common.nodeInfo.FindIndex(s => s.Name == value);
//if (idx > -1)
// AGVControl.Common.linePlace.Add(value);
//else
// AGVControl.Common.log.Error("CreateEmptyRecycleTask " + value + "不存在");
if (!Common.AddEmptyShelfTask(value))
Common.log.Error("CreateEmptyRecycleTask 节点【" + value + "】不存在");
if (Common.GetNodeNameByLineName(emptyStation, out string value))
{
if (!Common.AddEmptyShelfTask(value))
{
Common.log.Error("CreateEmptyRecycleTask(POST) 节点[" + value + "]不存在");
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "CreateEmptyRecycleTask failed: " + emptyStation };
}
else
{
if (rfid == null)
{
res = new Result() { Succeed = true, ResultData = null, ErrorMessage = "" };
Log.Info(string.Format("WebService Request(POST) emptyStation={0},rfid=null", emptyStation));
Common.LogInfo("任务[POST]:" + value + " 出空料架 [" + emptyStation + "]");
}
else
{
res = new Result() { Succeed = true, ResultData = rfid, ErrorMessage = "" };
Log.Info(string.Format("WebService Request(POST) emptyStation={0},rfid={1}", emptyStation, rfid));
Common.LogInfo("任务[POST]:" + value + " 出空料架 [location=" + emptyStation + ",rfid=" + rfid + "]");
}
}
// AGVControl.Common.log.Debug("WebService POST Response OK");
}
else
{
Common.LogInfo("任务:" + value + " 出空料架 【" + emptyStation + "】");
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find " + emptyStation };
AGVControl.Common.log.Error("WebService POST Response false " + "Not find " + emptyStation);
}
//System.IO.File.WriteAllLines(Common.CONFIG_PATH + "LinePlace.txt", Common.linePlace);
}
else
{
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find " + emptyStation };
AGVControl.Common.LogInfo("WebService Response false "+ "Not find " + emptyStation);
}
return JsonHelper.SerializeObject(res);
}
public string CreateEmptyRecycleTaskGET(string line)
public string CreateEmptyRecycleTaskGET(string line,string RFID)
{
Result res;
// StreamReader sr = new StreamReader(stream);
//string s = sr.ReadToEnd();
//System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
//string emptyStation = nvc["emptyStation"];
if (line.Equals("Feeder"))
{
line = "FeederOut";
......@@ -111,34 +112,27 @@ namespace BLL
{
line = "4CFeederOut";
}
AGVControl.Common.LogInfo("WebService Request emptyStation=" + line,false);
//if (line == null)
// res = new Result() { Succeed = "false", ResultData = null, ErrorMessage = "line =null " };
if (Common.GetNodeNameByLineName(line, out string value))
{
res = new Result() { Succeed = true, ResultData = null, ErrorMessage = "" };
AGVControl.Common.LogInfo("WebService Response OK");
//加到任务
//int idx = AGVControl.Common.nodeInfo.FindIndex(s => s.Name == value);
//if (idx > -1)
// AGVControl.Common.linePlace.Add(value);
//else
// AGVControl.Common.log.Error("CreateEmptyRecycleTask " + value + "不存在");
if (!Common.AddEmptyShelfTask(value))
Common.log.Error("CreateEmptyRecycleTask 节点【" + value + "】不存在");
{
Common.log.Error("CreateEmptyRecycleTask 节点[" + value + "]不存在");
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "CreateEmptyRecycleTask failed: " + line };
}
else
{
Common.LogInfo("任务:" + value + " 出空料架 【" + line + "】");
res = new Result() { Succeed = true, ResultData = RFID, ErrorMessage = "" };
Log.Info(string.Format("WebService Request(GET) emptyStation={0},rfid={1}", line, RFID));
Common.LogInfo("任务[GET]:" + value + " 出空料架 [emptyStation=" + line + ",rfid="+RFID+"]");
}
//System.IO.File.WriteAllLines(Common.CONFIG_PATH + "LinePlace.txt", Common.linePlace);
}
else
{
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find " + line };
AGVControl.Common.LogInfo("WebService Response false " + "Not find " + line);
AGVControl.Common.LogInfo("WebService GET Response false " + "Not find " + line);
}
//Log.Info(string.Format("WebService GET Request emptyStation={0},rfid={1}", line, RFID));
return JsonHelper.SerializeObject(res);
}
}
......
......@@ -27,12 +27,12 @@
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout>
</appender>
<logger>
<level value="ALL"/>
<logger name ="LineWebService">
<level value="Info"/>
<appender-ref ref="LineWebService"/>
</logger>
<root>
<level value="Debug"/>
<level value="Info"/>
<appender-ref ref="AgvServer"/>
</root>
</log4net>
......@@ -46,36 +46,4 @@
<add key="ChargeThreshold" value="20,70" />
</appSettings>
<system.serviceModel>
<services>
<!--添加服务-->
<service name="BLL.ClsWebService" behaviorConfiguration="CalculatorServiceBehavior">
<!--name 必须与代码中的host实例初始化的服务一样
behaviorConfiguration 行为配置 -->
<host>
<baseAddresses>
<!--添加调用服务地址-->
<add baseAddress="http://127.0.0.1/BenQMIR/Webservice/AGVService.asmx/"/>
</baseAddresses>
</host>
<!--添加契约接口 contract="WcfDemo.IService1" WcfDemo.IService1为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
<endpoint address="" binding="wsHttpBinding" contract="BLL.IWebService"></endpoint>
</service>
</services>
<!--定义CalculatorServiceBehavior的行为-->
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
\ No newline at end of file
2020-11-03 14:08:42,D1
2020-11-03 14:10:26,D1
2020-11-03 14:12:43,D1
2020-11-03 14:20:20,D1
2020-11-03 14:22:26,D1
2020-11-03 14:22:31,D1
2020-11-03 14:22:37,D1
2020-11-03 14:22:48,D1
2020-11-03 14:22:59,D1
[MiR_R1763]
RFID=
[MiR_R1764]
RFID=
[MiR_R1767]
RFID=
[MiR_R1768]
RFID=
[MiR_R1579]
RFID=
[MiR_R1580]
RFID=
[D1]
EmptyShelfCnt=9
9684cf330348d5d70b323e6ae0e5e155759ea6d4
ce147cdc7d5f84ac5eea7abfb5866dce563042b6
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!