Example #1
0
        public ActionResult A6()
        {
            string    WE_Status       = "0";
            string    query_list      = "distinct E.WE_Ser, E.WE_Id, R.username";
            string    query_condition = "E.W_Name='A6dot2dot1" + "' and E.WE_Status='" + WE_Status + "' and R.username is not null";
            string    record_filter   = "username is not null";
            DataTable dt = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter);

            ViewBag.CompleteCount = 18 - dt.Rows.Count;
            return(View());
        }
Example #2
0
        public JsonResult GetGraphicData(string graphicName, string ser)
        {
            List <double> result = new List <double>();
            List <string> r_time = new List <string>();

            DateTime time_now = DateTime.Now.AddYears(-1);

            DataTable dt = CWFEngine.QueryAllInformation("E.WE_Ser, E.W_Name, M.Event_Name, R.time, P.Th_ItemRecord",
                                                         "E.W_Name = 'A7dot1dot1' and M.Event_Name = 'ZzSubmit'", "time >= '" + time_now.ToString() + "'");

            DataRow[] NNullRows = dt.Select("Th_ItemRecord is not Null");

            foreach (DataRow r in NNullRows)
            {
                if (r["WE_Ser"].ToString() == ser)
                {
                    string val  = r["Th_ItemRecord"].ToString();
                    JArray item = (JArray)JsonConvert.DeserializeObject(val);
                    if (item != null)
                    {
                        foreach (var i in item)
                        {
                            if (i["name"].ToString() == graphicName)
                            {
                                string val1 = i["exact_value"].ToString();
                                r_time.Add(r["time"].ToString());
                                try
                                {
                                    double e_val = Convert.ToDouble(val1);
                                    result.Add(e_val);
                                }
                                catch
                                {
                                    result.Add(0.0);
                                }
                                break;
                            }
                        }
                    }
                }
            }
            return(Json(new { val = result.ToArray(), valtime = r_time.ToArray() }));
        }
Example #3
0
        public string A14HistoryList(string WorkFlow_Name, string yearandmonth)
        {
            string username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;


            string WE_Status       = "3";
            string query_list      = "distinct E.WE_Ser, E.WE_Id, R.username,R.time";
            string query_condition = "E.W_Name='" + WorkFlow_Name + "' and E.WE_Status='" + WE_Status + "' and R.username is not null";
            string record_filter;
            string nexttimepoint;

            string[] month = yearandmonth.Split('/');
            nexttimepoint = month[0] + "/" + (Convert.ToInt16(month[1]) + 1).ToString();
            record_filter = "time >= '" + yearandmonth + "/" + "1" + " 00:00:00'" + "and  time <= '" + nexttimepoint + "/" + "1" + " 00:00:00'";
            DataTable dt  = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter);
            DataTable dt2 = DeleteSameRow(dt, "WE_Ser");
            string    str = "";//存返回结果

            List <Gxqmodel> Gmlist = new List <Gxqmodel>();

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                Gxqmodel Gm = new Gxqmodel();
                Gm.WE_Id  = Convert.ToInt16(dt.Rows[i]["WE_Id"]);
                Gm.WE_Ser = dt.Rows[i]["WE_Ser"].ToString();
                Gmlist.Add(Gm);
            }
            List <HistroyModel> Hm = new List <HistroyModel>();

            foreach (var item in Gmlist)
            {
                HistroyModel h = new HistroyModel();
                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Equip_GyCode"] = null;
                UI_WFEntity_Info  wfei           = CWFEngine.GetWorkFlowEntityWithParams(item.WE_Id, paras);
                List <UI_MISSION> AllHistoryMiss = CWFEngine.GetHistoryMissions(item.WE_Id);
                int Miss_Id = AllHistoryMiss[0].Miss_Id;
                h.miss_LastStatusdesc = AllHistoryMiss[AllHistoryMiss.Count - 1].WE_Event_Desc;
                IDictionary <string, string> r = CWFEngine.GetMissionRecordInfo(Miss_Id);
                if (r.Count > 0)
                {
                    h.missStartName = r["username"];
                    h.missStartTime = r["time"];
                }
                else
                {
                    h.missStartName = "";
                    h.missStartTime = "";
                }

                h.wfe_serial = item.WE_Ser;
                // h.miss_wfe_Id = wfei.EntityID;
                h.miss_wfe_Id  = item.WE_Id;
                h.workFlowName = wfei.description;
                h.sbGycode     = paras["Equip_GyCode"].ToString();
                Hm.Add(h);
            }
            List <object> or = new List <object>();

            for (int i = 0; i < Hm.Count; i++)
            {
                object o = new
                {
                    wfe_serial          = Hm[i].wfe_serial,
                    equip_gycode        = Hm[i].sbGycode,
                    workflow_name       = Hm[i].workFlowName,
                    missStartName       = Hm[i].missStartName,
                    missStartTime       = Hm[i].missStartTime,
                    miss_LastStatusdesc = Hm[i].miss_LastStatusdesc,
                    miss_wfe_Id         = Hm[i].miss_wfe_Id
                };
                or.Add(o);
            }
            str = JsonConvert.SerializeObject(or);

            return("{" + "\"data\": " + str + "}");
        }
Example #4
0
        public ActionResult Home()
        {
            homemodel hm = new homemodel();

            hm.userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString();
            hm.userId   = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm = new PersonManagment();
            //string cj = pm.Get_Person_Cj(hm.userId).First().EA_Name;
            string cj = "联合一车间";

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(hm.userId);
            QEntranceManagment    qem = new QEntranceManagment();
            List <Quick_Entrance> qe  = qem.GetQ_EbyP_Id(hm.userId);

            hm.q_cunzai = new int[8] {
                0, 0, 0, 0, 0, 0, 0, 0
            };
            if (qe != null)
            {
                foreach (var q in qe)
                {
                    hm.q_cunzai[q.xuhao - 1] = 1;
                }
            }
            //if (pv.Role_Names == "现场工程师")
            if (pv.Role_Names.Contains("现场工程师"))
            {
                DateTime now          = DateTime.Now;
                DateTime LastThursday = now;
                DateTime Day20        = now;
                string   a            = now.DayOfWeek.ToString("d");
                if (a == "1")
                {
                    LastThursday = now.AddDays(-4).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "2")
                {
                    LastThursday = now.AddDays(-5).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "3")
                {
                    LastThursday = now.AddDays(-6).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "4")
                {
                    LastThursday = now.AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "5")
                {
                    LastThursday = now.AddDays(-1).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "6")
                {
                    LastThursday = now.AddDays(-2).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (a == "0")
                {
                    LastThursday = now.AddDays(-3).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                }
                if (now.Day >= 20)
                {
                    Day20 = now.AddDays(20 - now.Day).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                    string    query_list1      = "E.WE_Ser,R.time";
                    string    query_condition1 = " P.Cj_Name ='" + cj + "' and E.W_Name='A6dot2' and M.Miss_Name ='Xc_Sample' ";
                    string    record_filter1   = "Convert(datetime,time)>'" + Day20.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'";
                    DataTable dt1 = CWFEngine.QueryAllInformation(query_list1, query_condition1, record_filter1);
                    if (dt1.Rows.Count != 0)
                    {
                        hm.A6dot2Isdone = "false";
                    }
                    else
                    {
                        hm.A6dot2Isdone = "true";
                    }
                }
                else
                {
                    hm.A6dot2Isdone = "false";
                }
                string    query_list      = "E.WE_Ser,R.time";
                string    query_condition = " P.Cj_Name ='" + cj + "' and E.W_Name='A7dot1dot1'";
                string    record_filter   = "Convert(datetime,time)>'" + LastThursday.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'";
                DataTable dt = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter);
                if (dt != null)
                {
                    if (dt.Rows.Count != 0)
                    {
                        hm.A7dot1Isdone = "true";
                    }
                    else
                    {
                        hm.A7dot1Isdone = "false";
                    }
                }
            }
            else
            {
                hm.A7dot1Isdone = "true";
            }
            //注:这里判断的是部门为设监中心的
            if (pv.Department_Name.Contains("设监中心"))
            {
                DateTime now   = DateTime.Now;
                DateTime Day27 = now;
                if (now.Day >= 27)
                {
                    Day27 = now.AddDays(27 - now.Day).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second);
                    string    query_list1      = "E.WE_Ser,R.time";
                    string    query_condition1 = "E.W_Name='A6dot2' and M.Miss_Name ='Sj_Result' ";
                    string    record_filter1   = "Convert(datetime,time)>'" + Day27.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'";
                    DataTable dt1 = CWFEngine.QueryAllInformation(query_list1, query_condition1, record_filter1);
                    if (dt1.Rows.Count != 0)
                    {
                        hm.A6dot2SjFile = "false";
                    }
                    else
                    {
                        hm.A6dot2SjFile = "true";
                    }
                }
                else
                {
                    hm.A6dot2SjFile = "false";
                }
            }
            else
            {
                hm.A6dot2SjFile = "false";
            }



            return(View(hm));
        }
Example #5
0
        public string A8ActiveList(string WorkFlow_Name)
        {
            string username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;


            string          WE_Status       = "0";
            string          query_list      = "distinct E.WE_Ser, E.WE_Id, R.username";
            string          query_condition = "E.W_Name='" + WorkFlow_Name + "' and E.WE_Status='" + WE_Status + "' and R.username is not null";
            string          record_filter   = "username is not null";
            DataTable       dt     = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter);
            List <Gxqmodel> Gmlist = new List <Gxqmodel>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Gxqmodel Gm = new Gxqmodel();
                Gm.WE_Id  = Convert.ToInt16(dt.Rows[i]["WE_Id"]);
                Gm.WE_Ser = dt.Rows[i]["WE_Ser"].ToString();
                Gmlist.Add(Gm);
            }
            List <A8Model>    Hm  = new List <A8Model>();
            ERPInfoManagement erp = new ERPInfoManagement();

            foreach (var item in Gmlist)
            {
                A8Model h = new A8Model();

                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Equip_GyCode"] = null;
                paras["Job_Order"]    = null; //通过工单找通知单号
                paras["Zz_Name"]      = null;
                paras["Job_Name"]     = null; //计划名称

                UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(item.WE_Id, paras);
                h.zz_name   = paras["Zz_Name"].ToString();
                h.sb_gycode = paras["Equip_GyCode"].ToString();
                h.job_order = paras["Job_Order"].ToString();
                h.plan_name = paras["Job_Name"].ToString();
                GD_InfoModal res = erp.getGD_Modal_GDId(paras["Job_Order"].ToString());
                if (res != null)
                {
                    h.notice_order = res.GD_Notice_Id;
                }
                h.gd_state = "检修中";
                WorkFlows wfsd          = new WorkFlows();
                Mission   db_missA8dot2 = wfsd.GetWFEntityMissions(item.WE_Id).Last();
                //写if而不写else if是因为13.1和8.2是断开的,跳转8.2仍满足db_miss.Miss_Desc == "专业团队审核"
                if (db_missA8dot2.Miss_Desc == "检修单位按计划建立工单,完善工序、组件")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "检修计划提报")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "现场工程师审核工单")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "专业团队审1")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "可靠性工程师审1")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "机动处计划科审2")
                {
                    if (res != null)
                    {
                        h.gd_state = res.GD_State;
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "物资处采购,填写到货时间")
                {
                    h.gd_state = "物资采购中";
                }
                else if (db_missA8dot2.Miss_Desc == "物资处确认到货并通知检修单位")
                {
                    h.gd_state = "物资已到货";
                }
                else if (db_missA8dot2.Miss_Desc == "检修单位上传检修方案" || db_missA8dot2.Miss_Desc == "专业团队审批" || db_missA8dot2.Miss_Desc == "检修单位填写检修内容及关键工序,关联作业指导书" || db_missA8dot2.Miss_Desc == "可靠性工程师审批")
                {
                    h.gd_state = "检修方案制定与审判";
                }
                else if (db_missA8dot2.Miss_Desc == "现场工程师确认是否可实施计划")
                {
                    UI_MISSION           ui       = new UI_MISSION();
                    List <Mission_Param> mis_pars = wfsd.GetMissParams(db_missA8dot2.Miss_Id);//获取当前任务参数
                    foreach (var par in mis_pars)
                    {
                        CParam cp = new CParam();
                        ui.Miss_Params[cp.name] = cp.value;
                    }
                    if (ui.Miss_Params["ZzConfirmPlan_Result"].ToString() == "是")
                    {
                        h.gd_state = "检修计划实施中";
                    }
                    else if (ui.Miss_Params["ZzConfirmPlan_Result"].ToString() == "否")
                    {
                        h.gd_state = "检修计划延期";
                    }
                }
                else if (db_missA8dot2.Miss_Desc == "检修单位确认施工完毕,上传交工资料")
                {
                    h.gd_state = "处理完成";
                }
                h.Data_Src = "待定";
                h.detail   = "待定";
                Hm.Add(h);
            }
            List <object> or = new List <object>();

            for (int i = 0; i < Hm.Count; i++)
            {
                object o = new
                {
                    index        = i + 1,
                    equip_gycode = Hm[i].sb_gycode,
                    job_order    = Hm[i].job_order,
                    notice_order = Hm[i].notice_order,
                    gd_state     = Hm[i].gd_state,
                    datasrc      = Hm[i].Data_Src,
                    detail       = Hm[i].detail,
                    zzname       = Hm[i].zz_name,
                    planname     = Hm[i].plan_name
                };
                or.Add(o);
            }
            string str = JsonConvert.SerializeObject(or);

            return("{" + "\"data\": " + str + "}");
        }
Example #6
0
        public string Query_HistoryFlow(string time, string flow_id, string equip_gycode)//string json1)//,)
        {
            // JObject item = (JObject)JsonConvert.DeserializeObject(json1);
            List <object> r = new List <object>();

            if (time != "" || flow_id != "" || equip_gycode != "")
            {
                string Equip_GyCode = equip_gycode;
                string record_filter;

                if (time == "")
                {
                    record_filter = "1<>1";
                }
                else
                {
                    string[] strtime = time.Split(new char[] { '-' });
                    record_filter = "time >= '" + strtime[0] + "00:00:00'" + "and  time <= '" + strtime[1] + " 00:00:00'";
                }
                string Query_list = "distinct E.WE_Ser ,E.WE_Id,R.time  ";
                string Query_condition;
                if ((flow_id == "" && Equip_GyCode == ""))
                {
                    Query_condition = "";
                }
                else
                {
                    if (flow_id != "")
                    {
                        Query_condition = "E.W_Name like '%" + flow_id + "%'";
                        if (equip_gycode != "")
                        {
                            Query_condition = Query_condition + "  and P.Equip_Code like '%" + Equip_GyCode + "%'";
                        }
                    }
                    else
                    {
                        Query_condition = "P.Equip_Code like'%" + Equip_GyCode + "%'";
                    }
                }

                System.Data.DataTable dt = CWFEngine.QueryAllInformation(Query_list, Query_condition, record_filter);



                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    UI_MISSION lastMi  = CWFEngine.GetHistoryMissions(Convert.ToInt32(dt.Rows[i].ItemArray[1])).Last();
                    int        Miss_Id = lastMi.Miss_Id;
                    IDictionary <string, string> rr = CWFEngine.GetMissionRecordInfo(Miss_Id);
                    string userName = "";
                    string missTime = "";
                    if (r.Count > 0)
                    {
                        userName = rr["username"];
                        missTime = rr["time"];
                    }

                    object o = new
                    {
                        index        = i,
                        Flow_Name    = "<a  onclick=\"DispalsySide('" + dt.Rows[i].ItemArray[0].ToString() + "')\"> " + dt.Rows[i].ItemArray[0].ToString() + "</a>",
                        Mission_Name = CWFEngine.GetWorkFlowEntiy(Convert.ToInt32(dt.Rows[i].ItemArray[1]), true).description,
                        Mission_Time = userName,
                        Mission_User = missTime
                    };
                    r.Add(o);
                }
            }
            string str = JsonConvert.SerializeObject(r);

            return("{" + "\"data\": " + str + "}");
        }