222
schangxiang@126.com
2025-09-03 667c3bc186be6c460cae63c20a60a48a2323dcc2
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/PushMesHandler.cs
@@ -9,6 +9,7 @@
using yunneiWCS.EnumDefine;
using yunneiWCS.ExtendFunction;
using yunneiWCS.SystemInteraction.mes2.dto;
using static WZ.Useful.Commons.NativeMethods;
namespace yunneiWCS.mes
{
@@ -38,8 +39,22 @@
                string paprm = JsonConvert.SerializeObject(mesRequest);
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},准备参数:{paprm}");
                Guid guid = System.Guid.NewGuid();
                res = JsonConvert.DeserializeObject<ApiResponse<object>>(mes_api.postContentForString("T_WMS_Inbound_Record", paprm, guid));
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{res}");
                //模拟
                if (Form1.isvirtual)
                {//模拟环境
                    res = new ApiResponse<object>();
                    res.Success = true;
                    res.Message = "系统模拟完成";
                }
                else
                {
                    var resStr = mes_api.postContentForString("T_WMS_Inbound_Record", paprm, guid);
                    Log4NetHelper.WriteInfoLog(_logType, $"{funName},结果返回:{resStr}");
                    res = JsonConvert.DeserializeObject<ApiResponse<object>>(resStr);
                }
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{JsonConvert.SerializeObject(res)}");
            }
            catch (Exception ex)
            {
@@ -69,8 +84,21 @@
                string paprm = JsonConvert.SerializeObject(mesRequest);
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},准备参数:{paprm}");
                Guid guid = System.Guid.NewGuid();
                res = JsonConvert.DeserializeObject<ApiResponse<object>>(mes_api.postContentForString("T_WMS_Outbound_Record", paprm, guid));
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{res}");
                //模拟
                if (Form1.isvirtual)
                {//模拟环境
                    res = new ApiResponse<object>();
                    res.Success = true;
                    res.Message = "系统模拟完成";
                }
                else
                {
                    var resStr = mes_api.postContentForString("T_WMS_Outbound_Record", paprm, guid);
                    Log4NetHelper.WriteInfoLog(_logType, $"{funName},结果返回:{resStr}");
                    res = JsonConvert.DeserializeObject<ApiResponse<object>>(resStr);
                }
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{JsonConvert.SerializeObject(res)}");
            }
            catch (Exception ex)
            {
@@ -98,8 +126,23 @@
                string paprm = JsonConvert.SerializeObject(mesRequest);
                Guid guid = System.Guid.NewGuid();
                res = JsonConvert.DeserializeObject<ApiResponse<object>>(mes_api.postContentForString("T_WMS_Realtime_Data", paprm, guid));
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{res}");
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},准备参数:{paprm}");
                //模拟
                if (Form1.isvirtual)
                {//模拟环境
                    res = new ApiResponse<object>();
                    res.Success = true;
                    res.Message = "系统模拟完成";
                }
                else
                {
                    var resStr = mes_api.postContentForString("T_WMS_Realtime_Data", paprm, guid);
                    Log4NetHelper.WriteInfoLog(_logType, $"{funName},结果返回:{resStr}");
                    res = JsonConvert.DeserializeObject<ApiResponse<object>>(resStr);
                }
                Log4NetHelper.WriteInfoLog(_logType, $"{funName},参数:{paprm},返回:{JsonConvert.SerializeObject(res)}");
            }
            catch (Exception ex)
            {