| | |
| | | using yunneiWCS.EnumDefine; |
| | | using yunneiWCS.ExtendFunction; |
| | | using yunneiWCS.SystemInteraction.mes2.dto; |
| | | using static WZ.Useful.Commons.NativeMethods; |
| | | |
| | | namespace yunneiWCS.mes |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | |
| | | 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) |
| | | { |