localhost 3 years ago
parent
commit
3857523ef1
2 changed files with 11 additions and 6 deletions
  1. 7 1
      WCS.WMSWorkflow/Contracts/WMS_API.cs
  2. 4 5
      WCS.Workflow/ConvPlc04.cs

+ 7 - 1
WCS.WMSWorkflow/Contracts/WMS_API.cs

@@ -184,19 +184,25 @@ namespace WCS.WMSWorkflow
         public GetMatureContinueModeReply I_WCS_GetMatureContinueMode(GetMatureContinueParam param)
         {
             GetMatureContinueModeReply reply = null;
+            string replyTxt = "";
             try
             {
                 Log4netHelper.Logger_Info.Info(string.Format("开始:WCS调用WMS接口函数I_WCS_GetMatureContinueMode。参数:[{0}]", WebApiHelper.GetJson(param)));
                 JArray ja = new JArray();
                 ja.Add(WebApiHelper.GetJson(param));
                 JObject jobj = WebApiHelper.SendInfoToAPI(AppSettingsHelper.AppSettings.GetMatureContinueMode, "", "Post", ja);
-                reply = WebApiHelper.ParseFromJson<GetMatureContinueModeReply>(jobj.ToString());
+                replyTxt = jobj.ToString();
+                reply = WebApiHelper.ParseFromJson<GetMatureContinueModeReply>(replyTxt);
                 Log4netHelper.Logger_Info.Info(string.Format("结束:WCS调用WMS接口函数I_WCS_GetMatureContinueMode。参数:[{0}]反馈结果:[{1}]", WebApiHelper.GetJson(param), WebApiHelper.GetJson(reply)));
             }
             catch (Exception ex)
             {
                 LogMessageHelper.RecordLogMessage(ex);
             }
+            finally 
+            {
+                reply.ResType = replyTxt.Contains("true") ? true : false;
+            }
             return reply;
         }
         public GetWeightReply I_WCS_GetWeight(GetWeightParam param)

+ 4 - 5
WCS.Workflow/ConvPlc04.cs

@@ -133,10 +133,9 @@ namespace WCS.Workflow
             {
                 try
                 {
-                    //List<string> list = new List<string>() { Conv_1164, Conv_1165 };
-                    //foreach (var item in list)//1164、1165
-                    //{
-                        var item = Conv_1164;
+                    List<string> list = new List<string>() { Conv_1164, Conv_1165 };
+                    foreach (var item in list)//1164、1165
+                    {
                         var plc = Current.PlcSet.FirstOrDefault(v => v.PLC_NAME == PlcName);
                         var conveyor = plc.WCS_EquipmentInfoSet.FirstOrDefault(v => v.Equ_No == item);
                         var cs = conveyor.EquSignal_Conv;
@@ -204,7 +203,7 @@ namespace WCS.Workflow
                                 WriteTaskToBuffer(converywrite);
                             }
                         }
-                    //}
+                    }
                 }
                 catch (Exception ex)
                 {