Exemple #1
0
        // GET: Board

        public ActionResult Index()
        {
            string OpType = "OP2";

            List <OrganiztionVM> userinfo = CurrentUser.GetUserInfo.OrgInfo;

            foreach (OrganiztionVM item in userinfo)
            {
                ViewBag.plant = item.Plant;
                OpType        = item.OPType;
            }
            ViewBag.Opty = OpType;
            var apiUrl                    = string.Format("EventReportManager/GetProjectByOpAPI/?Op_Type={0}", OpType);
            var responMessage             = APIHelper.APIGetAsync(apiUrl);
            var result                    = responMessage.Content.ReadAsStringAsync().Result;
            JavaScriptSerializer js       = new JavaScriptSerializer();
            List <string>        Projects = js.Deserialize <List <string> >(result);

            ViewBag.Projects = Projects;

            apiUrl        = string.Format("Equipmentmaintenance/GetEBoardLocationAPI/?optype={0}", OpType);
            responMessage = APIHelper.APIGetAsync(apiUrl);
            result        = responMessage.Content.ReadAsStringAsync().Result;
            List <string> loctions = js.Deserialize <List <string> >(result);

            ViewBag.loctions = loctions;

            return(View());
        }
Exemple #2
0
        public ActionResult ExportDemissionRateInfoByID(string uids)
        {
            //get Export datas
            var apiUrl        = string.Format("ProductionResourcePlan/ExportDemissionRateInfoByIDAPI?uids={0}", uids);
            var responMessage = APIHelper.APIGetAsync(apiUrl);
            var result        = responMessage.Content.ReadAsStringAsync().Result;
            var list          = JsonConvert.DeserializeObject <List <DemissionRateAndWorkScheduleDTO> >(result);

            var stream      = new MemoryStream();
            var fileName    = PathHelper.SetGridExportExcelName("DemissionRateAndWorkSchedule");
            var filePath    = Path.Combine(PathHelper.GetGridExportExcelDirectory, fileName);
            var stringHeads = new string[] {
                "序号",
                "厂区",
                "OP类型",
                "生产阶段",
                "生产日期",
                "NPI离职率",
                "NPI预计招募人力",
                "MP离职率",
                "MP预计招募人力",
                "排班机制",
            };

            using (var excelPackage = new ExcelPackage(stream))
            {
                //set sheet name
                var worksheet = excelPackage.Workbook.Worksheets.Add("DemissionRateAndWorkSchedule");

                //set Title
                for (int colIndex = 0; colIndex < stringHeads.Length; colIndex++)
                {
                    worksheet.Cells[1, colIndex + 1].Value = stringHeads[colIndex];
                }

                //set cell value
                for (int index = 0; index < list.Count; index++)
                {
                    var currentRecord = list[index];
                    //seq
                    worksheet.Cells[index + 2, 1].Value  = index + 1;
                    worksheet.Cells[index + 2, 2].Value  = currentRecord.Organization_Name;
                    worksheet.Cells[index + 2, 3].Value  = currentRecord.OPType;
                    worksheet.Cells[index + 2, 4].Value  = currentRecord.Product_Phase;
                    worksheet.Cells[index + 2, 5].Value  = currentRecord.Product_Date.ToString("yyyy-MM-dd hh:ss");
                    worksheet.Cells[index + 2, 6].Value  = (currentRecord.DemissionRate_NPI / 100).ToString("p");
                    worksheet.Cells[index + 2, 7].Value  = currentRecord.NPI_RecruitStaff_Qty;
                    worksheet.Cells[index + 2, 8].Value  = (currentRecord.DemissionRate_MP / 100).ToString("p");;
                    worksheet.Cells[index + 2, 9].Value  = currentRecord.MP_RecruitStaff_Qty;
                    worksheet.Cells[index + 2, 10].Value = currentRecord.WorkSchedule;
                }
                worksheet.Cells.AutoFitColumns();
                excelPackage.Save();
            }

            return(new FileContentResult(stream.ToArray(), "application/octet-stream")
            {
                FileDownloadName = Server.UrlEncode(fileName)
            });
        }
        public ActionResult OQCMaster(string Flowchart_Master_UID, string Process_seq, string color, string MaterialType, string FlowChart_Detail_UID, string Process, string ProjectName, string IsQAProcess)
        {
            if (!string.IsNullOrEmpty(ProjectName) && !string.IsNullOrEmpty(MaterialType))
            {
                CheckPointInputConditionModel condition = new CheckPointInputConditionModel();
                condition.Color = color;
                condition.Flowchart_Master_UID = int.Parse(Flowchart_Master_UID);
                condition.Flowchart_Detail_UID = int.Parse(FlowChart_Detail_UID);
                condition.Process_seq          = int.Parse(Process_seq);
                condition.MaterialType         = MaterialType;
                condition.Process      = Process;
                condition.Project_Name = ProjectName;

                var apiUrl          = string.Format("EventReportManager/GetIntervalInfoAPI?opType={0}", "OP1");
                var responseMessage = APIHelper.APIGetAsync(apiUrl);
                var result          = responseMessage.Content.ReadAsStringAsync().Result;
                var time            = JsonConvert.DeserializeObject <IntervalEnum>(result);
                condition.Time_interval = time.Time_Interval;
                condition.ProductDate   = DateTime.Parse(time.NowDate);

                ViewBag.Flowchart_Master_UID = condition.Flowchart_Master_UID;
                ViewBag.MaterialType         = condition.MaterialType;
                ViewBag.Color                = condition.Color;
                ViewBag.Process_seq          = condition.Process_seq;
                ViewBag.Process              = condition.Process;
                ViewBag.Flowchart_Detail_UID = condition.Flowchart_Detail_UID;
                ViewBag.Project              = condition.Project_Name;
                ViewBag.ProductDate          = condition.ProductDate.ToString(FormatConstants.DateTimeFormatStringByDate);
                ViewBag.Time_interval        = condition.Time_interval;
                ViewBag.IsAssembleProcess    = IsQAProcess == "Inspect_Assemble" ? "" : "hidden";
            }
            return(View());
        }
Exemple #4
0
        public ActionResult EBoardShow(string opType, string selectProjects, string selectFunplants, string location)
        {
            var cooike = System.Web.HttpContext.Current.Request.Cookies.Get(SessionConstants.UserSelect);

            if (cooike != null)
            {
                cooike["opType"]          = opType;
                cooike["selectProjects"]  = selectProjects;
                cooike["selectFunplants"] = selectFunplants;
                cooike["location"]        = location;
                cooike["userName"]        = CurrentUser.UserName;
            }
            else
            {
                var userCookie = new HttpCookie("UserSelect");
                userCookie["opType"]          = opType;
                userCookie["selectProjects"]  = selectProjects;
                userCookie["selectFunplants"] = selectFunplants;
                userCookie["location"]        = location;
                userCookie["userName"]        = CurrentUser.UserName;
                userCookie[SessionConstants.CurrentAccountUID] = CurrentUser.AccountUId.ToString();
                userCookie[SessionConstants.CurrentLanguageId] = CurrentUser.Language_UID.ToString();
                userCookie.Expires.AddDays(365);
                HttpContext.Response.SetCookie(userCookie);
            }

            var apiUrl              = "Chart/GetPageSizeAPI";
            var responMessage       = APIHelper.APIGetAsync(apiUrl);
            var result              = responMessage.Content.ReadAsStringAsync().Result.ToString();
            JavaScriptSerializer js = new JavaScriptSerializer();
            string Size             = js.Deserialize <string>(result);

            if (string.IsNullOrWhiteSpace(Size))
            {
                ViewBag.PageSize = 13;
            }
            else
            {
                ViewBag.PageSize = int.Parse(Size);
            }
            ViewBag.Projects = selectProjects;
            ViewBag.Parts    = selectFunplants;
            ViewBag.opType   = opType;
            //if(location=="/")
            //{
            //    apiUrl = string.Format("Equipmentmaintenance/GetEBoardLocationAPI/?optype={0}", opType);
            //    responMessage = APIHelper.APIGetAsync(apiUrl);
            //    result = responMessage.Content.ReadAsStringAsync().Result;
            //    List<string> loctions = js.Deserialize<List<string>>(result);
            //    string s = string.Empty;
            //    foreach (var item in loctions)
            //    {
            //        s += item+',';
            //    }
            //    ViewBag.location = s;
            //}
            //else
            ViewBag.location = location;
            return(View());
        }
Exemple #5
0
        public ActionResult MachineDetail()
        {
            MachineDetailVM currentVM     = new MachineDetailVM();
            var             apiUrl        = string.Format("FixturePart/QueryOpTypesByUserAPI?plantorguid={0}", GetPlantOrgUid());
            var             responMessage = APIHelper.APIGetAsync(apiUrl);
            var             result        = responMessage.Content.ReadAsStringAsync().Result;
            var             optypes       = JsonConvert.DeserializeObject <List <SystemOrgDTO> >(result);

            currentVM.Orgs = optypes;
            int optypeID   = 0;
            int funPlantID = 0;

            if (CurrentUser.GetUserInfo.OrgInfo != null && CurrentUser.GetUserInfo.OrgInfo.Count > 0 && CurrentUser.GetUserInfo.OrgInfo[0].Plant != null && CurrentUser.GetUserInfo.OrgInfo[0].Plant_OrganizationUID != null)
            {
                if (CurrentUser.GetUserInfo.OrgInfo[0].OPType_OrganizationUID != null)
                {
                    optypeID = CurrentUser.GetUserInfo.OrgInfo[0].OPType_OrganizationUID.Value;
                }

                if (CurrentUser.GetUserInfo.OrgInfo[0].Funplant_OrganizationUID != null)
                {
                    funPlantID = CurrentUser.GetUserInfo.OrgInfo[0].Funplant_OrganizationUID.Value;
                }
                currentVM.Plants = new List <PlantVM>()
                {
                    new PlantVM()
                    {
                        Plant = CurrentUser.GetUserInfo.OrgInfo[0].Plant, Plant_OrganizationUID = CurrentUser.GetUserInfo.OrgInfo[0].Plant_OrganizationUID.Value
                    }
                };
            }
            else
            {
                //获取
                var Plants = new List <PlantVM>();
                apiUrl        = string.Format("Settings/GetPlantsAPI?PlantOrgUid={0}", 0);
                responMessage = APIHelper.APIGetAsync(apiUrl);
                result        = responMessage.Content.ReadAsStringAsync().Result;
                var systemOrgDTOs = JsonConvert.DeserializeObject <List <SystemOrgDTO> >(result);
                foreach (var item in systemOrgDTOs)
                {
                    PlantVM plantvm = new PlantVM()
                    {
                        Plant = item.Organization_Name, Plant_OrganizationUID = item.Organization_UID
                    };
                    Plants.Add(plantvm);
                }
                currentVM.Plants = Plants;
            }
            currentVM.OptypeID   = optypeID;
            currentVM.FunPlantID = funPlantID;

            var apiUrlMachine        = string.Format("Enumeration/GetMachineDataSourceAPI?enum_Type={0}", "MachineDataSource");
            var responMessageMachine = APIHelper.APIGetAsync(apiUrlMachine);
            var resultMachine        = responMessageMachine.Content.ReadAsStringAsync().Result;
            var MachineDataSources   = JsonConvert.DeserializeObject <List <string> >(resultMachine);

            currentVM.MachineDataSources = MachineDataSources;
            return(View("MachineDetail", currentVM));
        }
Exemple #6
0
        public ActionResult GetTotalCapacity()
        {
            var apiUrl = string.Format("ElectricalBoard/GetTotalCapacityAPI");
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #7
0
        public ActionResult QueryCapacity()
        {
            var apiUrl = string.Format("Fixture/QueryFixtureStatusMoniterAPI");
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #8
0
        /// <summary>
        /// 获取当前或所有时段
        /// </summary>
        /// <param name="nowOrAllInterval">可传入两个参数:当前时段=PPCheckData,所有时段=DataReport </param>
        /// <returns></returns>
        public ActionResult GetIntervalTime(string nowOrAllInterval)
        {
            var apiUrl = string.Format("EventReportManager/GetIntervalTimeAPI?PageName={0}", nowOrAllInterval);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetDemissionRateByBG(int op, string begin)
        {
            var apiUrl = string.Format("ProductionPlanningForIE/GetDemissionRateByBGAPI?bgOrgID={0}&begindate={1}", op, DateTime.Parse(begin));
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        /// <summary>
        /// 人力需求报表按功能厂查询
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public ActionResult GetHumanResourcesByFunplant(int project)
        {
            var apiUrl = string.Format("ProductionPlanningForIE/GetHumanResourcesByFunplantAPI?project={0}", project);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetOpTypesByPlantName(string PlantName)
        {
            var apiUrl = string.Format("ProductionPlanning/GetOpTypesByPlantNameAPI?PlantName={0}", PlantName);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #12
0
        public ActionResult getPartTypes(string project)
        {
            var apiUrl = string.Format("Chart/getPartTypesAPI?project={0}", project);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #13
0
        /// <summary>
        /// 根据专案获取站点
        /// </summary>
        /// <param name="Machine_Customer_UID"></param>
        /// <returns></returns>
        public ActionResult GetStationList(int Machine_Customer_UID)
        {
            var apiUrl = string.Format("MachineYieldReport/GetStationListAPI?Machine_Customer_UID={0}", Machine_Customer_UID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #14
0
        /// <summary>
        /// 获取产线
        /// </summary>
        /// <param name="Plant_Organization_UID"></param>
        /// <param name="BG_Organization_UID"></param>
        /// <param name="FunPlant_Organization_UID"></param>
        /// <returns></returns>
        public ActionResult GetCustomerList(int Plant_Organization_UID, int BG_Organization_UID, int FunPlant_Organization_UID)
        {
            var apiUrl = string.Format("MachineYieldReport/GetCustomerListAPI?Plant_Organization_UID={0}&BG_Organization_UID={1}&FunPlant_Organization_UID={2}", Plant_Organization_UID, BG_Organization_UID, FunPlant_Organization_UID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #15
0
        /// <summary>
        /// GetProductPhaseSource
        /// </summary>
        /// <param name="CustomerName"></param>
        /// <param name="ProjectName"></param>
        /// <returns></returns>
        public ActionResult GetProductPhaseSource(string CustomerName, string ProjectName)
        {
            var apiUrl = string.Format("EventReportManager/GetProductPhaseSourceAPI?customer={0}&&project={1}", CustomerName, ProjectName);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #16
0
        //public ActionResult EBoard_Project()
        //{
        //    var project = new GetProjectModel
        //    {

        //        OpTypes = this.CurrentUser.DataPermissions.Op_Types,
        //        Project_UID = this.CurrentUser.DataPermissions.Project_UID
        //    };
        //    var apiUrl = string.Format("EventReportManager/GetProjectSourceQAAPI");
        //    HttpResponseMessage responMessage = APIHelper.APIPostAsync(project, apiUrl);
        //    ViewBag.Projects = responMessage.Content.ReadAsStringAsync().Result;
        //    if (CurrentUser.DataPermissions.Op_Types.Count!=0)
        //    {
        //        ViewBag.Opty = CurrentUser.DataPermissions.Op_Types[0];
        //    }
        //    else ViewBag.Opty = null;
        //    return View();
        //}
        #endregion
        #region Common Function-------Sidney 2015/12/20
        /// <summary>
        /// GetCustomerSource
        /// </summary>
        /// <returns></returns>
        public ActionResult GetCustomerSource()
        {
            var apiUrl = "EventReportManager/GetCustomerSourceAPI";
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #17
0
        public ActionResult QueryModelLineHRs()//Fixture_PartModelSearch search, Page page)
        {
            var apiUrl = "ElectricalBoard/QueryModelLineHRsAPI";
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #18
0
        public ActionResult getNoticeContent(string optype)
        {
            var apiUrl = string.Format("Chart/getNoticeContentAPI?optype={0}", optype);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result.ToString();

            return(Content(result, "application/json"));
        }
Exemple #19
0
        public ActionResult DeleteModelLineHR(int uid)
        {
            var apiUrl = string.Format("ElectricalBoard/DeleteModelLineHRAPI?uid={0}", uid);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #20
0
        public ActionResult getMovieUrl(string optype, int CurrentLocation)
        {
            var apiUrl = string.Format("Chart/getMovieUrl?optype={0}&CurrentLocation={1}", optype, CurrentLocation);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result.ToString();

            return(Content(result, "application/json"));
        }
        public ActionResult GetPlanDataByProject(int site, int op, int project, int PartTypeUID, string begin)
        {
            var apiUrl = string.Format("ProductionPlanningForIE/GetPlanDataByProjectAPI?site={0}&op={1}&project={2}&PartTypeUID={3}&begin={4}", site, op, project, PartTypeUID, begin);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetFunPlantByOpType(int OpTypeUID)
        {
            var apiUrl = string.Format("ProductionPlanning/GetFunPlantByOpTypeAPI?OpTypeUID={0}", OpTypeUID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetInputDataByProject(int op, int project, string begin)
        {
            var apiUrl = string.Format("ProductionPlanningForIE/GetInputDataByProjectAPI?op={0}&project={1}&begin={2}", op, project, begin);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #24
0
        /// <summary>
        /// 获取返工的制程
        /// </summary>
        /// <param name="CustomerName"></param>
        /// <returns></returns>
        public ActionResult GetRepairToReworkProcess(int Detail_UID, int Product_UID, string selectDate, string selectTime)
        {
            var apiUrl = string.Format("ProductInput/GetRepairToReworkProcessAPI?Detail_UID={0}&Product_UID={1}&selectDate={2}&selectTime={3}", Detail_UID, Product_UID, selectDate, selectTime);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetPartTypesByProject(int ProjectUID)
        {
            var apiUrl = string.Format("ProductionPlanning/GetPartTypesByProjectAPI?ProjectUID={0}", ProjectUID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        /// <summary>
        ///根据UID获取数据
        /// </summary>
        /// <param name="searchParm"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult GetProcessDataByUID(string ProcessTransformConfig_UID)
        {
            var apiUrl = string.Format("ProcessIDTRSConfig/GetProcessDataByUIDAPI?Process_UID={0}", ProcessTransformConfig_UID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
        public ActionResult GetRPTColumnName(ProductionPlanningReportVM vm)
        {
            var apiUrl = string.Format("ProductionPlanning/GetRPTColumnNameAPI?PlantUID={0}&OpTypeUID={1}", vm.PlantUID, vm.OpTypeUID);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #28
0
        public ActionResult GetFinnalYield(string Projects)
        {
            var apiUrl = string.Format("Chart/GetFinnalYieldAPI?Projects={0}", Projects);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result.ToString();

            return(Content(result, "application/json"));
        }
Exemple #29
0
        public ActionResult GetErrorInfo(int productUid, string ErrorType)
        {
            var apiUrl = string.Format("ProductInput/GetErrorInfoAPI?productUid={0}&&ErrorType={1}", productUid, ErrorType);
            HttpResponseMessage responMessage = APIHelper.APIGetAsync(apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
Exemple #30
0
        public ActionResult GetPageSize()
        {
            var apiUrl        = "Chart/GetPageSizeAPI";
            var responMessage = APIHelper.APIGetAsync(apiUrl);
            var result        = responMessage.Content.ReadAsStringAsync().Result.ToString();

            return(Content(result, "application/json"));
        }