Ejemplo n.º 1
0
        public JsonResult SNWholeWorkFlow()
        {
            var sn             = Request.Form["sn"];
            var snworkflowlist = DMRSNVM.RetrieveSNWorkFlow(sn);
            var ret            = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                snworkflowlist = snworkflowlist
            };
            return(ret);
        }
Ejemplo n.º 2
0
        public JsonResult SNTRACEData()
        {
            var sns     = Request.Form["sns"];
            var snlist  = sns.Replace("'", "").Replace("\r\n", " ").Split(new string[] { ";", " ", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
            var dmrdata = DMRSNVM.RetrieveDMRSNDataBySN(snlist);
            var ret     = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                dmrdata = dmrdata
            };
            return(ret);
        }
Ejemplo n.º 3
0
        public JsonResult DMRWIPData()
        {
            var prodline      = Request.Form["prodline"];
            var dmrdata       = DMRSNVM.RetrieveDMRSNData(prodline, null, null, this);
            var moduledist    = ModuleDistribution(dmrdata);
            var dmrstatuslist = DMRStatusSum(dmrdata);
            var yielddata     = DMRModuleYield(prodline, dmrdata);

            var ret = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                moduledist    = moduledist,
                dmrstatuslist = dmrstatuslist,
                dmrdata       = dmrdata,
                yielddata     = yielddata
            };
            return(ret);
        }
Ejemplo n.º 4
0
        private List <DMRSNVM> ModuleDistribution(List <DMRSNVM> srcdata)
        {
            var stepdict = new Dictionary <string, DMRSNVM>();

            foreach (var item in srcdata)
            {
                if (stepdict.ContainsKey(item.WorkFlowStep))
                {
                    stepdict[item.WorkFlowStep].ModuleCount += 1;
                    stepdict[item.WorkFlowStep].WorkFlow     = item.WorkFlow;
                }
                else
                {
                    var tempvm = new DMRSNVM();
                    tempvm.WorkFlow    = item.WorkFlow;
                    tempvm.ModuleCount = 1;
                    stepdict.Add(item.WorkFlowStep, tempvm);
                }
            }

            var ret = new List <DMRSNVM>();

            foreach (var kv in stepdict)
            {
                var tempvm = new DMRSNVM();
                tempvm.WorkFlowStep = kv.Key;
                tempvm.WorkFlow     = kv.Value.WorkFlow;
                tempvm.ModuleCount  = kv.Value.ModuleCount;
                ret.Add(tempvm);
            }

            ret.Sort(delegate(DMRSNVM obj1, DMRSNVM obj2)
            {
                return(obj2.ModuleCount.CompareTo(obj1.ModuleCount));
            });

            return(ret);
        }
Ejemplo n.º 5
0
        public JsonResult DMRTRACEData()
        {
            var prodline = Request.Form["prodline"];

            var startdate = DateTime.Now;
            var enddate   = DateTime.Now;
            var sdate     = DateTime.Parse(Request.Form["sdate"]);
            var edate     = DateTime.Parse(Request.Form["edate"]);

            if (sdate < edate)
            {
                startdate = DateTime.Parse(sdate.ToString("yyyy-MM-dd") + " 00:00:00");
                enddate   = DateTime.Parse(edate.ToString("yyyy-MM-dd") + " 00:00:00").AddDays(1).AddSeconds(-1);
            }
            else
            {
                startdate = DateTime.Parse(edate.ToString("yyyy-MM-dd") + " 00:00:00");
                enddate   = DateTime.Parse(sdate.ToString("yyyy-MM-dd") + " 00:00:00").AddDays(1).AddSeconds(-1);
            }
            var dmrdata = DMRSNVM.RetrieveDMRSNData(prodline, startdate.ToString("yyyy-MM-dd HH:mm:ss")
                                                    , enddate.ToString("yyyy-MM-dd HH:mm:ss"), this);
            var moduledist    = ModuleDistribution(dmrdata);
            var dmrstatuslist = DMRStatusSum(dmrdata);
            var yielddata     = DMRModuleYield(prodline, dmrdata);

            var ret = new JsonResult();

            ret.MaxJsonLength = Int32.MaxValue;
            ret.Data          = new
            {
                moduledist    = moduledist,
                dmrstatuslist = dmrstatuslist,
                dmrdata       = dmrdata,
                yielddata     = yielddata
            };
            return(ret);
        }
Ejemplo n.º 6
0
        private List <DMRSNVM> DMRStatusSum(List <DMRSNVM> srcdata)
        {
            var ret = new List <DMRSNVM>();

            var dmrdict = new Dictionary <string, DMRSNVM>();

            foreach (var item in srcdata)
            {
                if (dmrdict.ContainsKey(item.DMRID))
                {
                    dmrdict[item.DMRID].ModuleCount += 1;
                }
                else
                {
                    var tempvm = new DMRSNVM();
                    tempvm.DMRID       = item.DMRID;
                    tempvm.DMRDate     = item.DMRDate;
                    tempvm.DMROAStep   = item.DMROAStep;
                    tempvm.DMROAStatus = item.DMROAStatus;
                    tempvm.ModuleCount = 1;

                    dmrdict.Add(item.DMRID, tempvm);
                }
            }

            if (dmrdict.Count > 0)
            {
                ret = dmrdict.Values.ToList();
                ret.Sort(delegate(DMRSNVM obj1, DMRSNVM obj2)
                {
                    return(obj2.ModuleCount.CompareTo(obj1.ModuleCount));
                });
            }

            return(ret);
        }