示例#1
0
        /// <summary>
        /// 监控erp计划完成状态
        /// </summary>
        private void TaskHandleThread()
        {
            try
            {
                string restr = "";
                List <ERP_Plan_ReportModel> reportList = bllErpPlanReport.GetUnReportModelList();
                if (reportList == null || reportList.Count == 0)
                {
                    return;
                }
                for (int i = 0; i < reportList.Count; i++)
                {
                    ERP_Plan_ReportModel      erpPlan  = reportList[i];
                    List <View_PlanListModel> viewPlan = bllViewPlanList.GetCompleteModelByPlanCode(erpPlan.ERP_Plan_Code);
                    if (viewPlan == null || viewPlan.Count == 0)
                    {
                        continue;
                    }
                    JBS_Service_Manager jbsService = JBS_Service_Manager.GetServiceManager();
                    string jsonStr = "";
                    if (viewPlan[0].Plan_Type_InOut == "1")//入库
                    {
                        bool jsonGetStatus = jbsService.erpSvrPresenter.InHouseResponse(viewPlan, ref jsonStr, ref restr);
                        SendToErp(erpERL, "PuApi", jsonStr);
                        if (jsonGetStatus == true)
                        {
                            ERP_Plan_ReportModel erpPlanUpdate = bllErpPlanReport.GetModelByPlanCode(viewPlan[0].Plan_Code);
                            erpPlanUpdate.ERP_Plan_IsReported = true;
                            bllErpPlanReport.Update(erpPlanUpdate);
                        }

                        //调用erp接口
                        //object reObj = WCFHelper.WebHttpPost("http://localhost/WMS_To_ERP_Svc/MaterialPlanOrder", jsonStr, out restr);
                    }
                    else
                    {
                        bool jsonGetStatus = jbsService.erpSvrPresenter.OutHouseResponse(viewPlan, ref jsonStr, ref restr);
                        //调用erp接口
                        if (jsonGetStatus == true)
                        {
                            ERP_Plan_ReportModel erpPlanUpdate = bllErpPlanReport.GetModelByPlanCode(viewPlan[0].Plan_Code);
                            erpPlanUpdate.ERP_Plan_IsReported = true;
                            bllErpPlanReport.Update(erpPlanUpdate);
                        }
                        //出库不需要上报了erp定的
                        //  SendToErp(erpERL, "produceApi", jsonStr);
                        //调用erp接口
                        //object reObj = WCFHelper.WebHttpPost("http://localhost/WMS_To_ERP_Svc/MaterialPlanOrder", jsonStr, out restr);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("系统发送异常:" + ex.Message);
            }
        }
示例#2
0
 public void Init(IWMSFrame wmsFrame)
 {
     this.wmsFrame = wmsFrame;
     jsbService    = JBS_Service_Manager.GetServiceManager();
     statusManager.Init(wmsFrame);
 }