示例#1
0
        public ActionResult QueryProductDatas(Page page)
        {
            ProcessDataSearch search = (ProcessDataSearch)TempData["ProcessDataSearch"];

            search.Date = DateTime.Parse(search.Date.ToShortDateString());

            page.PageSize = 10;

            var apiUrl1 = string.Format("ProductInput/QueryProductsAPI");

            var current = this.CurrentUser.AccountUId;

            search.Account_UID = current;
            HttpResponseMessage responMessage = APIHelper.APIPostAsync(search, page, apiUrl1);
            var result1 = responMessage.Content.ReadAsStringAsync().Result;

            var list     = JsonConvert.DeserializeObject <PagedListModel <ProductDataVM> >(result1).Items.ToList();
            var isRepair = list.Exists(m => m.Rework_Flag == "Repair");

            if (isRepair)
            {
                ViewBag.isRepair = true;
            }
            return(Content(result1, "application/json"));
        }
示例#2
0
        /// <summary>
        /// 根据查询条件获取制程信息
        /// </summary>
        /// <returns></returns>
        public ActionResult QueryProcessData(ProcessDataSearch search, Page page)
        {
            var apiUrl = string.Format("ProductInput/QueryProcessAPI");

            HttpResponseMessage responMessage = APIHelper.APIPostAsync(search, page, apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
示例#3
0
        public ProcessDataSearch QueryFlowChartDataByMasterUid(int flowChartMaster_uid)
        {
            var tempDataList         = flowChartMasterRepository.QueryFlowChartDataByMasterUid(flowChartMaster_uid);
            ProcessDataSearch result = new ProcessDataSearch();

            foreach (var item in tempDataList.Distinct())
            {
                result.Customer      = item.Customer;
                result.Part_Types    = item.Part_Types;
                result.Product_Phase = item.Product_Phase;
                result.Project       = item.Project;
                result.Func_Plant    = item.Func_Plant;
            }
            return(result);
        }
示例#4
0
        /// <summary>
        /// 用户warringList 和Project List那里调用,查询展现生产数据
        /// </summary>
        /// <returns></returns>
        public ActionResult QuestProductDatas()
        {
            Page page = new Page();

            page.PageSize = 10;
            if (TempData["ProcessDataSearch"] == null)
            {
                return(View("ProductData"));
            }
            //使用tempdata 获取传过来的查询条件
            ProcessDataSearch search = (ProcessDataSearch)TempData["ProcessDataSearch"];

            ViewBag.Func_Plant    = search.Func_Plant;
            ViewBag.Customer      = search.Customer;
            ViewBag.Project       = search.Project;
            ViewBag.Part_Types    = search.Part_Types;
            ViewBag.Product_Phase = search.Product_Phase;
            ViewBag.Date          = search.Date;
            ViewBag.Time          = search.Time;
            ViewBag.Flag          = search.QuertFlag;
            return(View("ProductData"));
        }
示例#5
0
        // GET: ProductInput
        public ActionResult ProductData(int flowChartMaster_Uid, string product_Date, string time_Interval)
        {
            List <OrganiztionVM> userinfo = CurrentUser.GetUserInfo.OrgInfo;
            int iswx = 0;

            if (CurrentUser.GetUserInfo.MH_Flag)
            {
                string url = string.Format("FlowChart/QueryPlantByUser?userid={0}", CurrentUser.AccountUId);
                HttpResponseMessage responseMessage2 = APIHelper.APIGetAsync(url);
                var result1 = responseMessage2.Content.ReadAsStringAsync().Result;
                var entity1 = JsonConvert.DeserializeObject <List <string> >(result1);
                foreach (string item in entity1)
                {
                    if (item == "WUXI_M")
                    {
                        iswx = 1;
                    }
                }
            }
            else
            {
                foreach (OrganiztionVM item in userinfo)
                {
                    if (item.Plant == "WUXI_M")
                    {
                        iswx = 1;
                    }
                }
            }
            ViewBag.IsWX = iswx;
            ProcessDataSearch   search          = new ProcessDataSearch();
            string              apiUrl          = string.Format("FlowChart/QueryFlowChartDataByMasterUid?flowChartMaster_uid={0}", flowChartMaster_Uid);
            HttpResponseMessage responseMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responseMessage.Content.ReadAsStringAsync().Result;
            var entity = JsonConvert.DeserializeObject <ProcessDataSearch>(result);

            //检查flowchartDetail是否有Repair和Rework---------------start
            apiUrl          = string.Format("FlowChart/GetMaxDetailInfoAPI?flowChartMaster_uid={0}", flowChartMaster_Uid);
            responseMessage = APIHelper.APIGetAsync(apiUrl);
            result          = responseMessage.Content.ReadAsStringAsync().Result;
            var detailList     = JsonConvert.DeserializeObject <List <FlowChartDetailDTO> >(result);
            var hasReworkExist = detailList.Exists(m => m.Rework_Flag == "Rework");
            var hasRepairExist = detailList.Exists(m => m.Rework_Flag == "Repair");

            if (hasRepairExist && hasRepairExist)
            {
                ViewBag.ReworkFlag = true;
            }
            else
            {
                ViewBag.ReworkFlag = false;
            }
            //检查flowchartDetail是否有Repair和Rework---------------end
            //根据专案UID获取对应的OP

            var apiUrl1          = string.Format("EventReportManager/GetOPByFlowchartMasterUIDAPI?masterUID={0}", flowChartMaster_Uid);
            var responseMessage1 = APIHelper.APIGetAsync(apiUrl1);
            var OP = JsonConvert.DeserializeObject <string>(responseMessage1.Content.ReadAsStringAsync().Result);

            ViewBag.OP      = OP;
            apiUrl          = string.Format("EventReportManager/GetIntervalInfoAPI?opType={0}", OP);
            responseMessage = APIHelper.APIGetAsync(apiUrl);
            result          = responseMessage.Content.ReadAsStringAsync().Result;
            var time = JsonConvert.DeserializeObject <IntervalEnum>(result);

            search.Date                 = DateTime.Parse(product_Date.IsNullOrWhiteSpace() ? time.NowDate : product_Date);
            search.Time                 = time_Interval.IsNullOrWhiteSpace() ? time.Time_Interval : time_Interval;
            search.Customer             = entity.Customer;
            search.Project              = entity.Project;
            search.Part_Types           = entity.Part_Types;
            search.Product_Phase        = entity.Product_Phase;
            search.QuertFlag            = "ProjectList";
            search.Func_Plant           = entity.Func_Plant;
            search.FlowChart_Master_UID = entity.FlowChart_Master_UID;
            search.FlowChart_Version    = entity.FlowChart_Version;

            TempData["ProcessDataSearch"] = search;
            ViewBag.Product_Date          = time.NowDate;
            ViewBag.Time_Interval         = time.Time_Interval;
            return(View());
        }